27 changed files with 948 additions and 77 deletions
@ -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; |
|||
} |
@ -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; |
|||
} |
@ -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; |
|||
} |
@ -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(); |
|||
} |
|||
} |
@ -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); |
|||
} |
@ -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; |
|||
|
|||
} |
@ -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); |
|||
} |
@ -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); |
|||
} |
|||
|
|||
|
|||
} |
@ -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' |
|||
); |
|||
|
|||
|
|||
|
@ -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> |
@ -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; |
|||
} |
@ -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; |
|||
} |
@ -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; |
|||
} |
@ -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; |
|||
} |
Loading…
Reference in new issue