Browse Source

Merge remote-tracking branch 'origin/dev_ic_diaodong' into dev_ic_diaodong

dev
wangxianzhang 4 years ago
parent
commit
83deccbc55
  1. 33
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemAddFormDTO.java
  2. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemPageFormDTO.java
  3. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java
  4. 19
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java
  5. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  6. 71
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java
  7. 37
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java
  8. 83
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceItemDictEntity.java
  9. 55
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java
  10. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  11. 126
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java
  12. 117
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.8__service_item_dict.sql
  13. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml
  14. 26
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java
  15. 41
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java
  16. 36
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java
  17. 21
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java
  18. 30
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java
  19. 43
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java
  20. 20
      epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml
  21. 26
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java
  22. 36
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java
  23. 36
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java
  24. 21
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java
  25. 29
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java
  26. 51
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java
  27. 16
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml

33
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemAddFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 新增或者修改服务事项分类
*/
@Data
public class ServiceItemAddFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
@NotBlank(message = "分类名称不能为空", groups = AddUserShowGroup.class)
@Length(max = 100, message = "分类名称至多输入100字", groups = AddUserShowGroup.class)
private String categoryName;
@NotNull(message = "", groups = AddUserShowGroup.class)
private Integer awardPoint;
private String categoryId;
}

20
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemPageFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 服务事项分类列表查询入参
* 目前不分页
*/
@Data
public class ServiceItemPageFormDTO extends PageFormDTO implements Serializable {
public interface AddUserInternalGroup {}
@NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java

@ -17,4 +17,7 @@ public class StatusFormDTO implements Serializable {
@NotNull(message = "usableFlag不能为空", groups = AddUserInternalGroup.class)
private Boolean usableFlag;
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
}

19
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.result.demand;
import lombok.Data;
import java.io.Serializable;
/**
* 服务事项分类列表查询返参
* 目前不分页
*/
@Data
public class ServiceItemResultDTO implements Serializable {
private static final long serialVersionUID = -590440160577071133L;
private String categoryId;
private String categoryName;
private Integer awardPoint;
private Boolean usableFlag;
}

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java

@ -114,7 +114,8 @@ public class IcResiDemandDictController {
* @return
*/
@PostMapping("updatestatus")
public Result updateStatus(@RequestBody StatusFormDTO formDTO){
public Result updateStatus(@LoginUser TokenDto tokenDto,@RequestBody StatusFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,StatusFormDTO.AddUserInternalGroup.class);
icResiDemandDictService.updateStatus(formDTO);
return new Result();

71
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java

@ -0,0 +1,71 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.demand.ServiceItemAddFormDTO;
import com.epmet.dto.form.demand.ServiceItemPageFormDTO;
import com.epmet.dto.form.demand.StatusFormDTO;
import com.epmet.dto.result.demand.ServiceItemResultDTO;
import com.epmet.service.IcServiceItemDictService;
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;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@RestController
@RequestMapping("serviceitem")
public class IcServiceItemDictController {
@Autowired
private IcServiceItemDictService icServiceItemDictService;
/**
* 01分页列表查询
*
* @param formDTO
* @return
*/
@PostMapping("list")
public Result<PageData<ServiceItemResultDTO>> page(@RequestBody ServiceItemPageFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ServiceItemPageFormDTO.AddUserInternalGroup.class);
PageData<ServiceItemResultDTO> page = icServiceItemDictService.page(formDTO);
return new Result<PageData<ServiceItemResultDTO>>().ok(page);
}
/**
* 02新增分类
* @param formDTO
* @return
*/
@PostMapping("saveorupdate")
public Result addOrUpdate(@RequestBody ServiceItemAddFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ServiceItemAddFormDTO.AddUserShowGroup.class,ServiceItemAddFormDTO.AddUserInternalGroup.class);
icServiceItemDictService.addOrUpdate(formDTO);
return new Result();
}
/**
* 03启用或者禁用分类
* @param formDTO
* @return
*/
@PostMapping("updatestatus")
public Result updateStatus(@LoginUser TokenDto tokenDto, @RequestBody StatusFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,StatusFormDTO.AddUserInternalGroup.class);
icServiceItemDictService.updateStatus(formDTO);
return new Result();
}
}

37
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java

@ -0,0 +1,37 @@
/**
* 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.demand.ServiceItemResultDTO;
import com.epmet.entity.IcServiceItemDictEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-14
*/
@Mapper
public interface IcServiceItemDictDao extends BaseDao<IcServiceItemDictEntity> {
List<ServiceItemResultDTO> pageList(String customerId);
}

83
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceItemDictEntity.java

@ -0,0 +1,83 @@
/**
* 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;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_service_item_dict")
public class IcServiceItemDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 父级,一级默认为0
*/
private String parentCode;
/**
* 分类编码
*/
private String categoryCode;
/**
* 分类名称
*/
private String categoryName;
/**
* 级别
*/
private Integer level;
/**
* 备注
*/
private String remark;
/**
* 排序
*/
private Integer sort;
/**
* 1可用0不可用
*/
private Boolean usableFlag;
/**
* 奖励积分
*/
private Integer awardPoint;
}

55
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java

@ -0,0 +1,55 @@
/**
* 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.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.demand.ServiceItemAddFormDTO;
import com.epmet.dto.form.demand.ServiceItemPageFormDTO;
import com.epmet.dto.form.demand.StatusFormDTO;
import com.epmet.dto.result.demand.ServiceItemResultDTO;
import com.epmet.entity.IcServiceItemDictEntity;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-14
*/
public interface IcServiceItemDictService extends BaseService<IcServiceItemDictEntity> {
/**
* 01列表查询
* @param formDTO
* @return
*/
PageData<ServiceItemResultDTO> page(ServiceItemPageFormDTO formDTO);
/**
* 02添加或者修改分类
* @param formDTO
*/
void addOrUpdate(ServiceItemAddFormDTO formDTO);
/**
* 03启用或者禁用分类
* @param formDTO
* @return
*/
void updateStatus(StatusFormDTO formDTO);
}

1
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java

@ -217,6 +217,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
return list;
}
@Transactional(rollbackFor = Exception.class)
@Override
public void updateStatus(StatusFormDTO formDTO) {
IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId());

126
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java

@ -0,0 +1,126 @@
/**
* 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.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dao.IcServiceItemDictDao;
import com.epmet.dto.form.demand.ServiceItemAddFormDTO;
import com.epmet.dto.form.demand.ServiceItemPageFormDTO;
import com.epmet.dto.form.demand.StatusFormDTO;
import com.epmet.dto.result.demand.ServiceItemResultDTO;
import com.epmet.entity.IcServiceItemDictEntity;
import com.epmet.service.IcServiceItemDictService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-14
*/
@Slf4j
@Service
public class IcServiceItemDictServiceImpl extends BaseServiceImpl<IcServiceItemDictDao, IcServiceItemDictEntity> implements IcServiceItemDictService {
/**
* 列表查询
*
* @param formDTO
* @return
*/
@Override
public PageData<ServiceItemResultDTO> page(ServiceItemPageFormDTO formDTO) {
//目前不分页,只是接口支持分页
List<ServiceItemResultDTO> list = baseDao.pageList(formDTO.getCustomerId());
return new PageData<>(list, CollectionUtils.isNotEmpty(list) ? list.size() : NumConstant.ZERO);
}
/**
* 02添加或者修改分类
*
* @param formDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void addOrUpdate(ServiceItemAddFormDTO formDTO) {
//分类名称是否唯一
LambdaQueryWrapper<IcServiceItemDictEntity> nameQuery = new LambdaQueryWrapper<>();
nameQuery.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId())
.eq(IcServiceItemDictEntity::getCategoryName, formDTO.getCategoryName())
.ne(StringUtils.isNotBlank(formDTO.getCategoryId()), IcServiceItemDictEntity::getId, formDTO.getCategoryId());
if (baseDao.selectCount(nameQuery) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前客户下,分类名称已存在", "分类名称已存在");
}
if (StringUtils.isNotBlank(formDTO.getCategoryId())) {
LambdaUpdateWrapper<IcServiceItemDictEntity> update = new LambdaUpdateWrapper<>();
update.eq(IcServiceItemDictEntity::getId, formDTO.getCategoryId());
update.set(IcServiceItemDictEntity::getCategoryName, formDTO.getCategoryName())
.set(IcServiceItemDictEntity::getAwardPoint, formDTO.getAwardPoint());
baseDao.update(null, update);
return;
}
LambdaQueryWrapper<IcServiceItemDictEntity> maxQuery = new LambdaQueryWrapper<>();
maxQuery.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId())
.orderByDesc(IcServiceItemDictEntity::getCategoryCode).last("limit 1");
IcServiceItemDictEntity max = baseDao.selectOne(maxQuery);
// 获取编码
IcServiceItemDictEntity insert = new IcServiceItemDictEntity();
insert.setCustomerId(formDTO.getCustomerId());
insert.setAwardPoint(formDTO.getAwardPoint());
insert.setCategoryName(formDTO.getCategoryName());
insert.setUsableFlag(true);
insert.setParentCode(NumConstant.ZERO_STR);
insert.setLevel(NumConstant.ONE);
insert.setSort(null != max ? max.getSort() + 1 : NumConstant.ONE);
insert.setCategoryCode(null != max ? String.valueOf(Integer.valueOf(max.getCategoryCode()) + 1) : "1001");
baseDao.insert(insert);
}
/**
* 03启用或者禁用分类
*
* @param formDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void updateStatus(StatusFormDTO formDTO) {
LambdaUpdateWrapper<IcServiceItemDictEntity> update = new LambdaUpdateWrapper<>();
update.eq(IcServiceItemDictEntity::getId, formDTO.getCategoryId())
.set(IcServiceItemDictEntity::getUsableFlag, formDTO.getUsableFlag())
.set(IcServiceItemDictEntity::getUpdatedTime, new Date())
.set(IcServiceItemDictEntity::getUpdatedBy, formDTO.getUserId());
baseDao.update(null, update);
}
}

117
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.8__service_item_dict.sql

@ -0,0 +1,117 @@
CREATE TABLE `ic_service_item_dict` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id',
`PARENT_CODE` varchar(32) NOT NULL COMMENT '父级,一级默认为0',
`CATEGORY_CODE` varchar(32) NOT NULL COMMENT '分类编码',
`CATEGORY_NAME` varchar(255) NOT NULL COMMENT '分类名称',
`LEVEL` int(11) NOT NULL COMMENT '级别',
`REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
`SORT` int(10) unsigned NOT NULL COMMENT '排序',
`USABLE_FLAG` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1可用,0不可用',
`AWARD_POINT` int(11) NOT NULL COMMENT '奖励积分',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE,
UNIQUE KEY `uk_dict_value` (`CATEGORY_CODE`,`CUSTOMER_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='服务事项分类字典表';
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', 'default', '0', '1001', '积极配合社区安全巡查员进行场所消防、安全等方面的检查,并具备必须的安全意识及设备设施', 1, NULL, 1, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', 'default', '0', '1002', '积极参与社区举办的各类生产生活安全培训讲座等', 1, NULL, 2, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3', 'default', '0', '1003', '定期开展内部自检自查,安全培训及演练,紧绷安全生产生活弦', 1, NULL, 3, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('4', 'default', '0', '1004', '社区困难群体生活帮扶', 1, NULL, 4, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', 'default', '0', '1005', '社区低保、伤残等困难家庭子女学习辅导', 1, NULL, 5, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', 'default', '0', '1006', '未成年人兴趣培养', 1, NULL, 6, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7', 'default', '0', '1007', '楼道基础设施维护', 1, NULL, 7, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('8', 'default', '0', '1008', '健康知识专业讲座', 1, NULL, 8, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('9', 'default', '0', '1009', '老年人现代智能设备培训', 1, NULL, 9, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10', 'default', '0', '1010', '空巢老人志愿帮扶', 1, NULL, 10, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('11', 'default', '0', '1011', '法律专业问题咨询', 1, NULL, 11, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('12', 'default', '0', '1012', '矛盾调解专业法律顾问', 1, NULL, 12, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('13', 'default', '0', '1013', '居民紧急自救、他救技能', 1, NULL, 13, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('14', 'default', '0', '1014', '少儿安全意识培养', 1, NULL, 14, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('15', 'default', '0', '1015', '文化队伍的培育和提升', 1, NULL, 15, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('16', 'default', '0', '1016', '老年群体的心理辅导', 1, NULL, 16, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('17', 'default', '0', '1017', '丰富多样的文体活动', 1, NULL, 17, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('18', 'default', '0', '1018', '失业人员技能培训', 1, NULL, 18, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('19', 'default', '0', '1019', '青年人文化活动的开展', 1, NULL, 19, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('20', 'default', '0', '1020', '亲子教育课堂', 1, NULL, 20, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('21', 'default', '0', '1021', '未成年人“家风”培育', 1, NULL, 21, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('22', 'default', '0', '1022', '和谐邻里活动开展', 1, NULL, 22, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
-- 共建单位及九小场所共建 统一删除
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于服务事项分类"
where CATEGORY_CODE='1010' or PARENT_CODE='1010';
-- 居民积分统一从需求分类中移除
-- 1、民生服务
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1002' or PARENT_CODE='1002';
-- 2、便民服务
-- 2.1便民服务-参与日常矛盾调解并取得一定成效
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='10030001' or PARENT_CODE='10030001';
-- 2.2便民服务-爱心敲门,自愿与社区高龄、独居、孤寡、残障等人员结对子,参与日常探望、帮扶
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='10030004' or PARENT_CODE='10030004';
-- 2.3便民服务-收集反馈社区特殊群体(高龄、残障、独居等)生活需求,并协助社区共同落实解决。
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='10030005' or PARENT_CODE='10030005';
-- 3、城市建设
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1004' or PARENT_CODE='1004';
-- 4、社区建设
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1005' or PARENT_CODE='1005';
-- 5、社区自治
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1006' or PARENT_CODE='1006';
-- 6、思想建设
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1008' or PARENT_CODE='1008';
-- 7、文化娱乐
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1009' or PARENT_CODE='1009';
-- 8、社会治安
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1013' or PARENT_CODE='1013';
-- 9、消防安全
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1014' or PARENT_CODE='1014';
-- 10、文化体育
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1015' or PARENT_CODE='1015';
-- 11、慈善募捐
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1020' or PARENT_CODE='1020';
-- 12、其他
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1022' or PARENT_CODE='1022';
-- 删除需求记录、服务记录、评价记录
update ic_user_demand_rec
set DEL_FLAG='1',UPDATED_TIME=NOW(),UPDATED_BY='删除分类'
where CATEGORY_CODE in (
select distinct m.CATEGORY_CODE
from ic_resi_demand_dict m where m.DEL_FLAG='1'
and m.CUSTOMER_ID!='default'
);
update ic_user_demand_service set DEL_FLAG='1',UPDATED_TIME=NOW()
where DEMAND_REC_ID in(
select m.id from ic_user_demand_rec m where m.DEL_FLAG='1'
);
update ic_user_demand_satisfaction set DEL_FLAG='1',UPDATED_TIME=NOW()
WHERE DEMAND_REC_ID IN(
select m.id from ic_user_demand_rec m where m.DEL_FLAG='1'
);

21
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml

@ -0,0 +1,21 @@
<?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.IcServiceItemDictDao">
<select id="pageList" parameterType="java.lang.String" resultType="com.epmet.dto.result.demand.ServiceItemResultDTO">
SELECT
d.id AS categoryId,
d.CATEGORY_NAME AS categoryName,
d.AWARD_POINT AS awardPoint,
d.USABLE_FLAG AS usableFlag
FROM
ic_service_item_dict d
WHERE
d.DEL_FLAG = '0'
AND d.CUSTOMER_ID = #{customerId}
ORDER BY
d.SORT DESC
</select>
</mapper>

26
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/17 10:09 上午
* @DESC
*/
@Data
public class AddOftenUseFunctionFormDTO implements Serializable {
private static final long serialVersionUID = -8044386389656626183L;
public interface AddOftenUseFunctionForm{}
@NotBlank(message = "menuId不能为空", groups = AddOftenUseFunctionForm.class)
private String menuId;
@NotNull(message = "sort不能为空", groups = AddOftenUseFunctionForm.class)
private Integer sort;
}

41
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/17 9:41 上午
* @DESC
*/
@Data
public class OftenUseFunctionListResultDTO implements Serializable {
private static final long serialVersionUID = 8561818114575776804L;
/**
* 跳转url
*/
private String url;
/**
* 菜单ID
*/
private String menuId;
/**
* 菜单名字
*/
private String menuName;
/**
* 图标
*/
private String icon;
/**
* 排序
*/
private String sort;
}

36
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java

@ -1,15 +1,21 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcOftenUseFunctionDTO;
import com.epmet.dto.form.AddOftenUseFunctionFormDTO;
import com.epmet.dto.result.OftenUseFunctionListResultDTO;
import com.epmet.service.IcOftenUseFunctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 常用功能
*
@ -23,19 +29,27 @@ public class IcOftenUseFunctionController {
@Autowired
private IcOftenUseFunctionService icOftenUseFunctionService;
@PostMapping
public Result save(@RequestBody IcOftenUseFunctionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icOftenUseFunctionService.save(dto);
return new Result();
/**
* @Description 社区查询常用功能查询
* @param tokenDto
* @author zxc
* @date 2022/1/17 9:47 上午
*/
@PostMapping("oftenusefunctionlist")
public Result<List<OftenUseFunctionListResultDTO>> oftenUseFunctionList(@LoginUser TokenDto tokenDto){
return new Result<List<OftenUseFunctionListResultDTO>>().ok(icOftenUseFunctionService.oftenUseFunctionList(tokenDto));
}
@PutMapping
public Result update(@RequestBody IcOftenUseFunctionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icOftenUseFunctionService.update(dto);
/**
* @Description 社区查询常用功能添加(就是修改)
* @param formDTOS
* @param tokenDto
* @author zxc
* @date 2022/1/17 10:13 上午
*/
@PostMapping("addoftenusefunction")
public Result addOftenUseFunction(@RequestBody List<AddOftenUseFunctionFormDTO> formDTOS, @LoginUser TokenDto tokenDto){
icOftenUseFunctionService.addOftenUseFunction(formDTOS, tokenDto);
return new Result();
}

21
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.OftenUseFunctionListResultDTO;
import com.epmet.entity.IcOftenUseFunctionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 常用功能
@ -30,4 +34,21 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IcOftenUseFunctionDao extends BaseDao<IcOftenUseFunctionEntity> {
/**
* @Description 社区查询常用功能查询
* @param userId
* @author zxc
* @date 2022/1/17 10:06 上午
*/
List<OftenUseFunctionListResultDTO> oftenUseFunctionList(@Param("userId")String userId);
/**
* @Description 删除旧数据
* @param userId
* @param customerId
* @author zxc
* @date 2022/1/17 10:25 上午
*/
void deleteOldData(@Param("userId")String userId,@Param("customerId")String customerId);
}

30
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java

@ -18,9 +18,14 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcOftenUseFunctionDTO;
import com.epmet.dto.form.AddOftenUseFunctionFormDTO;
import com.epmet.dto.result.OftenUseFunctionListResultDTO;
import com.epmet.entity.IcOftenUseFunctionEntity;
import java.util.List;
/**
* 常用功能
*
@ -30,22 +35,19 @@ import com.epmet.entity.IcOftenUseFunctionEntity;
public interface IcOftenUseFunctionService extends BaseService<IcOftenUseFunctionEntity> {
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-01-17
* @Description 社区查询常用功能查询
* @param tokenDto
* @author zxc
* @date 2022/1/17 9:47 上午
*/
void save(IcOftenUseFunctionDTO dto);
List<OftenUseFunctionListResultDTO> oftenUseFunctionList(TokenDto tokenDto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-01-17
* @Description 社区查询常用功能添加(就是修改)
* @param formDTOS
* @param tokenDto
* @author zxc
* @date 2022/1/17 10:13 上午
*/
void update(IcOftenUseFunctionDTO dto);
void addOftenUseFunction(List<AddOftenUseFunctionFormDTO> formDTOS, TokenDto tokenDto);
}

43
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java

@ -18,14 +18,21 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcOftenUseFunctionDao;
import com.epmet.dto.IcOftenUseFunctionDTO;
import com.epmet.dto.form.AddOftenUseFunctionFormDTO;
import com.epmet.dto.result.OftenUseFunctionListResultDTO;
import com.epmet.entity.IcOftenUseFunctionEntity;
import com.epmet.service.IcOftenUseFunctionService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* 常用功能
*
@ -35,18 +42,40 @@ import org.springframework.transaction.annotation.Transactional;
@Service
public class IcOftenUseFunctionServiceImpl extends BaseServiceImpl<IcOftenUseFunctionDao, IcOftenUseFunctionEntity> implements IcOftenUseFunctionService {
/**
* @Description 社区查询常用功能查询
* @param tokenDto
* @author zxc
* @date 2022/1/17 9:47 上午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcOftenUseFunctionDTO dto) {
IcOftenUseFunctionEntity entity = ConvertUtils.sourceToTarget(dto, IcOftenUseFunctionEntity.class);
insert(entity);
public List<OftenUseFunctionListResultDTO> oftenUseFunctionList(TokenDto tokenDto) {
List<OftenUseFunctionListResultDTO> result = baseDao.oftenUseFunctionList(tokenDto.getUserId());
if (CollectionUtils.isNotEmpty(result)){
return result;
}
return new ArrayList<>();
}
/**
* @Description 社区查询常用功能添加(就是修改)
* @param formDTOS
* @param tokenDto
* @author zxc
* @date 2022/1/17 10:13 上午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcOftenUseFunctionDTO dto) {
IcOftenUseFunctionEntity entity = ConvertUtils.sourceToTarget(dto, IcOftenUseFunctionEntity.class);
updateById(entity);
public void addOftenUseFunction(List<AddOftenUseFunctionFormDTO> formDTOS, TokenDto tokenDto) {
if (CollectionUtils.isNotEmpty(formDTOS)){
baseDao.deleteOldData(tokenDto.getUserId(),tokenDto.getCustomerId());
List<IcOftenUseFunctionEntity> entities = ConvertUtils.sourceToTarget(formDTOS, IcOftenUseFunctionEntity.class);
entities.forEach(e -> {
e.setCustomerId(tokenDto.getCustomerId());
e.setUserId(tokenDto.getUserId());
});
insertBatch(entities);
}
}
}

20
epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml

@ -3,5 +3,25 @@
<mapper namespace="com.epmet.dao.IcOftenUseFunctionDao">
<!-- 删除旧数据 -->
<delete id="deleteOldData">
DELETE FROM ic_often_use_function WHERE USER_ID = #{userId} AND CUSTOMER_ID = #{customerId}
</delete>
<!-- 【社区查询】常用功能查询 -->
<select id="oftenUseFunctionList" resultType="com.epmet.dto.result.OftenUseFunctionListResultDTO">
SELECT
ic.SORT,
ic.MENU_ID,
gm.url,
gm.icon,
gl.field_value AS menuName
FROM ic_often_use_function ic
INNER JOIN gov_customer_menu gc ON (gc.TABLE_ID = ic.MENU_ID AND gc.DEL_FLAG = '0' AND ic.CUSTOMER_ID = gc.CUSTOMER_ID)
INNER JOIN gov_menu gm ON (gc.TABLE_ID = gm.id AND gm.DEL_FLAG = 0 AND gm.SHOW_FLAG = 1)
INNER JOIN gov_language gl ON (gl.table_id = gc.TABLE_ID)
WHERE ic.DEL_FLAG = 0
AND ic.USER_ID = #{userId}
ORDER BY ic.SORT
</select>
</mapper>

26
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/17 10:59 上午
* @DESC
*/
@Data
public class EditIndividualCategoryFormDTO implements Serializable {
private static final long serialVersionUID = -3492393795553841513L;
public interface EditIndividualCategoryForm{}
@NotBlank(message = "columnId不能为空",groups = EditIndividualCategoryForm.class)
private String columnId;
@NotNull(message = "sort不能为空",groups = EditIndividualCategoryForm.class)
private Integer sort;
}

36
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/1/17 10:52 上午
* @DESC
*/
@Data
public class IndividualCategoryListResultDTO implements Serializable {
private static final long serialVersionUID = -3294223041971531203L;
/**
* 标签
*/
private String label;
/**
* 图片
*/
private String managementIcon;
/**
* 字段名
*/
private String columnName;
/**
* 排序
*/
private Integer sort;
}

36
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java

@ -1,15 +1,21 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcIndividualCategoryManageDTO;
import com.epmet.dto.form.EditIndividualCategoryFormDTO;
import com.epmet.dto.result.IndividualCategoryListResultDTO;
import com.epmet.service.IcIndividualCategoryManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 个人分类管理
*
@ -23,19 +29,27 @@ public class IcIndividualCategoryManageController {
@Autowired
private IcIndividualCategoryManageService icIndividualCategoryManageService;
@PostMapping
public Result save(@RequestBody IcIndividualCategoryManageDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icIndividualCategoryManageService.save(dto);
return new Result();
/**
* @Description 人员分类管理查询个人分类列表
* @param tokenDto
* @author zxc
* @date 2022/1/17 10:55 上午
*/
@PostMapping("individualcategorylist")
public Result<List<IndividualCategoryListResultDTO>> individualCategoryList(@LoginUser TokenDto tokenDto){
return new Result<List<IndividualCategoryListResultDTO>>().ok(icIndividualCategoryManageService.individualCategoryList(tokenDto));
}
@PutMapping
public Result update(@RequestBody IcIndividualCategoryManageDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icIndividualCategoryManageService.update(dto);
/**
* @Description 人员分类管理个人分类修改(添加修改一个接口)
* @param formDTOS
* @param tokenDto
* @author zxc
* @date 2022/1/17 11:04 上午
*/
@PostMapping("editindividualcategory")
public Result editIndividualCategory(@RequestBody List<EditIndividualCategoryFormDTO> formDTOS,@LoginUser TokenDto tokenDto){
icIndividualCategoryManageService.editIndividualCategory(formDTOS,tokenDto);
return new Result();
}

21
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java

@ -1,8 +1,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.IndividualCategoryListResultDTO;
import com.epmet.entity.IcIndividualCategoryManageEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 个人分类管理
@ -13,4 +17,21 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IcIndividualCategoryManageDao extends BaseDao<IcIndividualCategoryManageEntity> {
/**
* @Description 删除旧数据
* @param userId
* @param customerId
* @author zxc
* @date 2022/1/17 11:10 上午
*/
void deleteOldData(@Param("userId")String userId,@Param("customerId")String customerId);
/**
* @Description 人员分类管理查询个人分类列表
* @param userId
* @author zxc
* @date 2022/1/17 1:25 下午
*/
List<IndividualCategoryListResultDTO> individualCategoryList(@Param("userId")String userId);
}

29
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java

@ -2,7 +2,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcIndividualCategoryManageDTO;
import com.epmet.dto.form.EditIndividualCategoryFormDTO;
import com.epmet.dto.result.IndividualCategoryListResultDTO;
import com.epmet.entity.IcIndividualCategoryManageEntity;
import java.util.List;
@ -17,22 +20,20 @@ import java.util.Map;
public interface IcIndividualCategoryManageService extends BaseService<IcIndividualCategoryManageEntity> {
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-01-17
* @Description 人员分类管理查询个人分类列表
* @param tokenDto
* @author zxc
* @date 2022/1/17 10:55 上午
*/
void save(IcIndividualCategoryManageDTO dto);
List<IndividualCategoryListResultDTO> individualCategoryList(TokenDto tokenDto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-01-17
* @Description 人员分类管理个人分类修改(添加修改一个接口)
* @param formDTOS
* @param tokenDto
* @author zxc
* @date 2022/1/17 11:04 上午
*/
void update(IcIndividualCategoryManageDTO dto);
void editIndividualCategory(List<EditIndividualCategoryFormDTO> formDTOS, TokenDto tokenDto);
}

51
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java

@ -1,23 +1,19 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.IcIndividualCategoryManageDao;
import com.epmet.dto.IcIndividualCategoryManageDTO;
import com.epmet.dto.form.EditIndividualCategoryFormDTO;
import com.epmet.dto.result.IndividualCategoryListResultDTO;
import com.epmet.entity.IcIndividualCategoryManageEntity;
import com.epmet.service.IcIndividualCategoryManageService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 个人分类管理
@ -28,18 +24,39 @@ import java.util.Map;
@Service
public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl<IcIndividualCategoryManageDao, IcIndividualCategoryManageEntity> implements IcIndividualCategoryManageService {
/**
* @Description 人员分类管理查询个人分类列表
* @param tokenDto
* @author zxc
* @date 2022/1/17 10:55 上午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcIndividualCategoryManageDTO dto) {
IcIndividualCategoryManageEntity entity = ConvertUtils.sourceToTarget(dto, IcIndividualCategoryManageEntity.class);
insert(entity);
public List<IndividualCategoryListResultDTO> individualCategoryList(TokenDto tokenDto) {
List<IndividualCategoryListResultDTO> result = baseDao.individualCategoryList(tokenDto.getUserId());
if (CollectionUtils.isNotEmpty(result)){
return result;
}
return new ArrayList<>();
}
/**
* @Description 人员分类管理个人分类修改(添加修改一个接口)
* @param formDTOS
* @param tokenDto
* @author zxc
* @date 2022/1/17 11:04 上午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcIndividualCategoryManageDTO dto) {
IcIndividualCategoryManageEntity entity = ConvertUtils.sourceToTarget(dto, IcIndividualCategoryManageEntity.class);
updateById(entity);
public void editIndividualCategory(List<EditIndividualCategoryFormDTO> formDTOS, TokenDto tokenDto) {
if (CollectionUtils.isNotEmpty(formDTOS)){
baseDao.deleteOldData(tokenDto.getUserId(),tokenDto.getCustomerId());
List<IcIndividualCategoryManageEntity> entities = ConvertUtils.sourceToTarget(formDTOS, IcIndividualCategoryManageEntity.class);
entities.forEach(e -> {
e.setCustomerId(tokenDto.getCustomerId());
e.setUserId(tokenDto.getUserId());
});
insertBatch(entities);
}
}
}

16
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml

@ -3,5 +3,21 @@
<mapper namespace="com.epmet.dao.IcIndividualCategoryManageDao">
<!-- 删除旧数据 -->
<delete id="deleteOldData">
DELETE FROM ic_individual_category_manage WHERE USER_ID = #{userId} AND CUSTOMER_ID = #{customerId}
</delete>
<!-- 【人员分类管理】查询个人分类列表 -->
<select id="individualCategoryList" resultType="com.epmet.dto.result.IndividualCategoryListResultDTO">
SELECT
cm.SORT,
sc.LABEL,
sc.MANAGEMENT_ICON,
sc.COLUMN_NAME
FROM ic_individual_category_manage cm
INNER JOIN ic_resi_category_stats_config sc ON (sc.ID = cm.COLUMN_ID AND sc.DEL_FLAG = '0' AND `STATUS` = 'show')
WHERE cm.DEL_FLAG = 0
AND cm.USER_ID = #{userId}
</select>
</mapper>
Loading…
Cancel
Save