From d1b2889537565dc213e275f269fd25dde231c7f3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Jan 2022 09:12:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E8=B4=A6=E6=88=B7=E5=AF=86=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=88=90root?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-cloud-generator/src/main/resources/application.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index cc5174da7b..0bd4a76f77 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -10,8 +10,8 @@ spring: #MySQL配置 driverClassName: com.mysql.jdbc.Driver url: jdbc:mysql://192.168.1.140:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false - username: epmet_dba - password: EpmEt-dbA-UsEr + username: root + password: root #oracle配置 # driverClassName: oracle.jdbc.OracleDriver # url: jdbc:oracle:thin:@192.168.10.10:1521:helowin From ebbb4539bc6386c91cc39e24235acbe2f53d30b3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Jan 2022 09:31:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=B0=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=20=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=A1=B6=E9=83=A8renren=E4=BB=8B=E7=BB=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/template/Controller.java.vm | 17 ---- .../src/main/resources/template/DTO.java.vm | 17 ---- .../src/main/resources/template/Dao.java.vm | 17 ---- .../main/resources/template/Entity.java.vm | 17 ---- .../src/main/resources/template/Excel.java.vm | 17 ---- .../src/main/resources/template/Redis.java.vm | 17 ---- .../main/resources/template/Service.java.vm | 17 ---- .../resources/template/ServiceImpl.java.vm | 17 ---- .../com/epmet/dto/IcOftenUseFunctionDTO.java | 91 +++++++++++++++++++ .../IcOftenUseFunctionController.java | 42 +++++++++ .../com/epmet/dao/IcOftenUseFunctionDao.java | 33 +++++++ .../entity/IcOftenUseFunctionEntity.java | 61 +++++++++++++ .../service/IcOftenUseFunctionService.java | 51 +++++++++++ .../impl/IcOftenUseFunctionServiceImpl.java | 52 +++++++++++ .../mapper/IcOftenUseFunctionDao.xml | 7 ++ .../dto/IcIndividualCategoryManageDTO.java | 74 +++++++++++++++ .../IcIndividualCategoryManageController.java | 42 +++++++++ .../dao/IcIndividualCategoryManageDao.java | 16 ++++ .../IcIndividualCategoryManageEntity.java | 44 +++++++++ .../IcIndividualCategoryManageService.java | 38 ++++++++ ...IcIndividualCategoryManageServiceImpl.java | 45 +++++++++ .../mapper/IcIndividualCategoryManageDao.xml | 7 ++ 22 files changed, 603 insertions(+), 136 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/IcOftenUseFunctionDTO.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/IcOftenUseFunctionEntity.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcIndividualCategoryManageDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcIndividualCategoryManageEntity.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml diff --git a/epmet-cloud-generator/src/main/resources/template/Controller.java.vm b/epmet-cloud-generator/src/main/resources/template/Controller.java.vm index 387cdc6961..e7d642a3ca 100644 --- a/epmet-cloud-generator/src/main/resources/template/Controller.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/Controller.java.vm @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package ${package}.controller; import ${main}.commons.tools.page.PageData; diff --git a/epmet-cloud-generator/src/main/resources/template/DTO.java.vm b/epmet-cloud-generator/src/main/resources/template/DTO.java.vm index 83d0e1db5a..f444c74181 100644 --- a/epmet-cloud-generator/src/main/resources/template/DTO.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/DTO.java.vm @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package ${package}.dto; import java.io.Serializable; diff --git a/epmet-cloud-generator/src/main/resources/template/Dao.java.vm b/epmet-cloud-generator/src/main/resources/template/Dao.java.vm index 43af398afa..a894ab59a7 100644 --- a/epmet-cloud-generator/src/main/resources/template/Dao.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/Dao.java.vm @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package ${package}.dao; import ${main}.commons.mybatis.dao.BaseDao; diff --git a/epmet-cloud-generator/src/main/resources/template/Entity.java.vm b/epmet-cloud-generator/src/main/resources/template/Entity.java.vm index 8822676ab2..5a8de66500 100644 --- a/epmet-cloud-generator/src/main/resources/template/Entity.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/Entity.java.vm @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package ${package}.entity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-cloud-generator/src/main/resources/template/Excel.java.vm b/epmet-cloud-generator/src/main/resources/template/Excel.java.vm index eee8847471..3590e88559 100644 --- a/epmet-cloud-generator/src/main/resources/template/Excel.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/Excel.java.vm @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package ${package}.excel; import cn.afterturn.easypoi.excel.annotation.Excel; diff --git a/epmet-cloud-generator/src/main/resources/template/Redis.java.vm b/epmet-cloud-generator/src/main/resources/template/Redis.java.vm index 22ab9f82f4..abe1ff0c2e 100644 --- a/epmet-cloud-generator/src/main/resources/template/Redis.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/Redis.java.vm @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package ${package}.redis; import ${main}.commons.tools.redis.RedisUtils; diff --git a/epmet-cloud-generator/src/main/resources/template/Service.java.vm b/epmet-cloud-generator/src/main/resources/template/Service.java.vm index 388dba62cf..59e490572d 100644 --- a/epmet-cloud-generator/src/main/resources/template/Service.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/Service.java.vm @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package ${package}.service; import ${main}.commons.mybatis.service.BaseService; diff --git a/epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm b/epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm index e0e34c5a3a..f0bcfe2a7e 100644 --- a/epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package ${package}.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/IcOftenUseFunctionDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/IcOftenUseFunctionDTO.java new file mode 100644 index 0000000000..83e458ceb6 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/IcOftenUseFunctionDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 常用功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +public class IcOftenUseFunctionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 菜单ID + */ + private String menuId; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标记 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java new file mode 100644 index 0000000000..b852a732f2 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java @@ -0,0 +1,42 @@ +package com.epmet.controller; + +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.service.IcOftenUseFunctionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 常用功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@RestController +@RequestMapping("icoftenusefunction") +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(); + } + + @PutMapping + public Result update(@RequestBody IcOftenUseFunctionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icOftenUseFunctionService.update(dto); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java new file mode 100644 index 0000000000..9c1a1e4a21 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcOftenUseFunctionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 常用功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Mapper +public interface IcOftenUseFunctionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/IcOftenUseFunctionEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/IcOftenUseFunctionEntity.java new file mode 100644 index 0000000000..9c0e1cf9f0 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/IcOftenUseFunctionEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 常用功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_often_use_function") +public class IcOftenUseFunctionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 菜单ID + */ + private String menuId; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java new file mode 100644 index 0000000000..440e229478 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.IcOftenUseFunctionDTO; +import com.epmet.entity.IcOftenUseFunctionEntity; + +/** + * 常用功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +public interface IcOftenUseFunctionService extends BaseService { + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-01-17 + */ + void save(IcOftenUseFunctionDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-01-17 + */ + void update(IcOftenUseFunctionDTO dto); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java new file mode 100644 index 0000000000..b695a925ff --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcOftenUseFunctionDao; +import com.epmet.dto.IcOftenUseFunctionDTO; +import com.epmet.entity.IcOftenUseFunctionEntity; +import com.epmet.service.IcOftenUseFunctionService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 常用功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Service +public class IcOftenUseFunctionServiceImpl extends BaseServiceImpl implements IcOftenUseFunctionService { + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcOftenUseFunctionDTO dto) { + IcOftenUseFunctionEntity entity = ConvertUtils.sourceToTarget(dto, IcOftenUseFunctionEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcOftenUseFunctionDTO dto) { + IcOftenUseFunctionEntity entity = ConvertUtils.sourceToTarget(dto, IcOftenUseFunctionEntity.class); + updateById(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml new file mode 100644 index 0000000000..78574bd371 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcIndividualCategoryManageDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcIndividualCategoryManageDTO.java new file mode 100644 index 0000000000..372864b7f0 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcIndividualCategoryManageDTO.java @@ -0,0 +1,74 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 个人分类管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +public class IcIndividualCategoryManageDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * + */ + private String columnId; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标记 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java new file mode 100644 index 0000000000..44fe329111 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java @@ -0,0 +1,42 @@ +package com.epmet.controller; + +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.service.IcIndividualCategoryManageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 个人分类管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@RestController +@RequestMapping("icindividualcategorymanage") +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(); + } + + @PutMapping + public Result update(@RequestBody IcIndividualCategoryManageDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icIndividualCategoryManageService.update(dto); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java new file mode 100644 index 0000000000..cdc466058b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcIndividualCategoryManageEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 个人分类管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Mapper +public interface IcIndividualCategoryManageDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcIndividualCategoryManageEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcIndividualCategoryManageEntity.java new file mode 100644 index 0000000000..008cc40fd1 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcIndividualCategoryManageEntity.java @@ -0,0 +1,44 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 个人分类管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_individual_category_manage") +public class IcIndividualCategoryManageEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * + */ + private String columnId; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java new file mode 100644 index 0000000000..e21285817c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java @@ -0,0 +1,38 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcIndividualCategoryManageDTO; +import com.epmet.entity.IcIndividualCategoryManageEntity; + +import java.util.List; +import java.util.Map; + +/** + * 个人分类管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +public interface IcIndividualCategoryManageService extends BaseService { + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-01-17 + */ + void save(IcIndividualCategoryManageDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-01-17 + */ + void update(IcIndividualCategoryManageDTO dto); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java new file mode 100644 index 0000000000..073cbc82b4 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java @@ -0,0 +1,45 @@ +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.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcIndividualCategoryManageDao; +import com.epmet.dto.IcIndividualCategoryManageDTO; +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.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 个人分类管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Service +public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl implements IcIndividualCategoryManageService { + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcIndividualCategoryManageDTO dto) { + IcIndividualCategoryManageEntity entity = ConvertUtils.sourceToTarget(dto, IcIndividualCategoryManageEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcIndividualCategoryManageDTO dto) { + IcIndividualCategoryManageEntity entity = ConvertUtils.sourceToTarget(dto, IcIndividualCategoryManageEntity.class); + updateById(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml new file mode 100644 index 0000000000..abb3d01e4a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From e24d9db24de54dbb1740b7c83e28b6b0df2b7c7b Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 17 Jan 2022 12:50:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=201.=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E6=9F=A5=E8=AF=A2-=E6=90=9C=E7=B4=A2=E9=9C=80?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复: 2.社区查询-搜索房屋 --- .../form/demand/PageListAnalysisFormDTO.java | 5 + .../form/demand/UserDemandPageFormDTO.java | 5 + .../controller/IcUserDemandRecController.java | 43 ++++- .../epmet/service/IcUserDemandRecService.java | 10 ++ .../impl/IcUserDemandRecServiceImpl.java | 151 +++++++++++------- .../resources/mapper/IcUserDemandRecDao.xml | 7 + .../com/epmet/controller/HouseController.java | 27 +++- .../main/java/com/epmet/dao/IcHouseDao.java | 1 + .../java/com/epmet/service/HouseService.java | 3 +- .../epmet/service/impl/HouseServiceImpl.java | 32 +++- .../src/main/resources/mapper/IcHouseDao.xml | 4 +- 11 files changed, 222 insertions(+), 66 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java index 2eb55979b1..dea90b14ad 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java @@ -53,4 +53,9 @@ public class PageListAnalysisFormDTO implements Serializable { * 数据分析-服务措施分析排除,已取消 */ private String excludeStatus; + + /** + * 搜索关键词 + */ + private String keyword; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java index a574bb3100..bfeb9203e2 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java @@ -74,4 +74,9 @@ public class UserDemandPageFormDTO extends PageFormDTO implements Serializable { * 希望截止 */ private String wantServiceEndTime; + + /** + * 搜索关键词 + */ + private String keyword; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 0eb686a401..019771d846 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -21,8 +21,12 @@ import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -30,12 +34,16 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserDemandConstant; +import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.demand.*; import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.*; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.PostMapping; @@ -57,7 +65,7 @@ import java.util.List; @Slf4j @RestController @RequestMapping("userdemand") -public class IcUserDemandRecController { +public class IcUserDemandRecController implements ResultDataResolver { @Autowired private IcUserDemandRecService icUserDemandRecService; @@ -71,6 +79,8 @@ public class IcUserDemandRecController { private IcPartyUnitService icPartyUnitService; @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; /** * 根据服务方类型查询 下拉框 @@ -321,5 +331,36 @@ public class IcUserDemandRecController { return new Result().ok(icUserDemandRecService.categoryAnalysis(formDTO)); } + /** + * 搜索需求。根据需求人精确搜索;需求方、需求内容模糊搜索 + * @return + */ + @PostMapping("search") + public Result search(@RequestBody UserDemandPageFormDTO input, @LoginUser TokenDto loginUser) { + ValidatorUtils.validateEntity(input); + String keyword = input.getKeyword(); + Integer pageNo = input.getPageNo(); + Integer pageSize = input.getPageSize(); + + if (StringUtils.isBlank(keyword)) { + return new Result(); + } + + LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO(); + form.setApp(loginUser.getApp()); + form.setClient(loginUser.getClient()); + form.setUserId(loginUser.getUserId()); + + LoginUserDetailsResultDTO loginUserDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(form), + ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【社区查询】查找当前人所属组织失败", + null); + + PageData page = icUserDemandRecService.search(loginUser.getCustomerId(), loginUserDetail.getAgencyId(), keyword, pageNo, pageSize); + + return new Result().ok(page); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index da3fd68cdf..336cd21999 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -214,4 +214,14 @@ public interface IcUserDemandRecService extends BaseService search(String customerId, String agencyId, String keyword, Integer pageNo, Integer pageSize); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 34f7f2070f..f7034a63ee 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -22,12 +22,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -77,7 +79,7 @@ import java.util.stream.Collectors; */ @Slf4j @Service -public class IcUserDemandRecServiceImpl extends BaseServiceImpl implements IcUserDemandRecService { +public class IcUserDemandRecServiceImpl extends BaseServiceImpl implements IcUserDemandRecService, ResultDataResolver { @Autowired private IcUserDemandOperateLogDao operateLogDao; @Autowired @@ -792,67 +794,76 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList()); - Result> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds); - List gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); - Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); - - //2、查询分类名称 - List categoryCodes=list.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); - List dictList=demandDictService.listByCodes(formDTO.getCustomerId(),categoryCodes); - Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + fillDemandsInfo(list, formDTO.getCustomerId()); + } + return new PageData<>(list, total); + } - //3、查询志愿者 - // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; - Map userInfoMap=new HashMap<>(); - Set userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); - if(CollectionUtils.isNotEmpty(userIdList)){ - Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); - if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常"); - } - userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); + /** + * 填充需求信息 + * @param demandList 需求列表 + * @param customerId 客户id + */ + public void fillDemandsInfo(List demandList, String customerId) { + //1、查询网格信息 + List gridIds=demandList.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList()); + Result> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); + + //2、查询分类名称 + List categoryCodes=demandList.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); + List dictList=demandDictService.listByCodes(customerId,categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + + //3、查询志愿者 + // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + Map userInfoMap=new HashMap<>(); + Set userIdList=demandList.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); + if(CollectionUtils.isNotEmpty(userIdList)){ + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); + if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常"); } + userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); + } - for(DemandRecResultDTO res:list){ - if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { - res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); - } + for(DemandRecResultDTO res:demandList){ + if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { + res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); + } - if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { - res.setCategoryName(dictMap.get(res.getCategoryCode())); - } - res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getFirstCategoryCode())); - if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { - res.setServiceName(userInfoMap.get(res.getServerId())); - } - //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help - //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished - //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; - switch (res.getServiceType()) - { - case UserDemandConstant.PARTY_UNIT: - res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)")); - break; - case UserDemandConstant.SOCIAL_ORG: - res.setServiceShowName(res.getServiceName().concat("(社会组织)")); - break; - case UserDemandConstant.COMMUNITY_ORG: - res.setServiceShowName(res.getServiceName().concat("(社区自组织)")); - break; - case UserDemandConstant.VOLUNTEER: - res.setServiceShowName(res.getServiceName().concat("(志愿者)")); - break; - default: - res.setServiceShowName(res.getServiceName()); - log.warn("serviceType 错误"); - break; - } - res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId())); + if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { + res.setCategoryName(dictMap.get(res.getCategoryCode())); + } + res.setFirstCategoryName(demandDictService.getCategoryName(customerId, res.getFirstCategoryCode())); + if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { + res.setServiceName(userInfoMap.get(res.getServerId())); } + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + switch (res.getServiceType()) + { + case UserDemandConstant.PARTY_UNIT: + res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)")); + break; + case UserDemandConstant.SOCIAL_ORG: + res.setServiceShowName(res.getServiceName().concat("(社会组织)")); + break; + case UserDemandConstant.COMMUNITY_ORG: + res.setServiceShowName(res.getServiceName().concat("(社区自组织)")); + break; + case UserDemandConstant.VOLUNTEER: + res.setServiceShowName(res.getServiceName().concat("(志愿者)")); + break; + default: + res.setServiceShowName(res.getServiceName()); + log.warn("serviceType 错误"); + break; + } + res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId())); } - return new PageData<>(list, total); } /** @@ -1603,7 +1614,35 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl search(String customerId, String agencyId, String keyword, Integer pageNo, Integer pageSize) { + CustomerAgencyDTO agency = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(agencyId), ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败", null); + + if (agency == null) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败"); + } + + String gridPids; + if(NumConstant.ZERO_STR.equals(agency.getPid())){ + gridPids = agencyId; + }else{ + gridPids = agency.getPids().concat(StrConstant.COLON).concat(agencyId); + } + PageListAnalysisFormDTO queryForm = new PageListAnalysisFormDTO(); + queryForm.setCustomerId(customerId); + queryForm.setGridPids(gridPids); + queryForm.setKeyword(keyword); + + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.pageListAnalysis(queryForm); + + // 填充信息 + fillDemandsInfo(list, customerId); + + return new PageData<>(list, new PageInfo<>(list).getTotal()); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 4bb193f075..b59fa44be5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -325,6 +325,13 @@ and r.STATUS !=#{excludeStatus} + + AND ( + r.DEMAND_USER_NAME = #{keyword} + OR match(r.CONTENT) against (#{keyword} in boolean mode ) + OR s.SERVER_NAME like CONCAT('%',#{keyword},'%') + ) + order by r.WANT_SERVICE_TIME desc,r.REPORT_TIME asc diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 1edcfe206d..44593788a9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -22,15 +22,22 @@ import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.feign.ResultDataResolver; 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.IcHouseFormDTO; import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.excel.IcHouseExcel; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.HouseService; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; @@ -55,11 +62,14 @@ import java.util.stream.Collectors; @Slf4j @RestController @RequestMapping("house") -public class HouseController { +public class HouseController implements ResultDataResolver { @Autowired private HouseService houseService; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + @PostMapping("houselist") public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ @@ -68,7 +78,7 @@ public class HouseController { String queryScene = "house_manage"; - IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(formDTO.getBuildingId(), formDTO.getOwnerName(), + IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, formDTO.getBuildingId(), formDTO.getOwnerName(), formDTO.getOwnerPhone(), null, null, queryScene, formDTO.getPageNo(), formDTO.getPageSize()); @@ -84,7 +94,7 @@ public class HouseController { *@return */ @PostMapping("search") - public Result searchHouse(@RequestBody ListIcNeighborHoodFormDTO formDTO) { + public Result searchHouse(@RequestBody ListIcNeighborHoodFormDTO formDTO, @LoginUser TokenDto loginUser) { String keyword = formDTO.getKeyword(); if (StringUtils.isBlank(keyword)) { IcNeighborHoodResultDTO r = new IcNeighborHoodResultDTO(); @@ -108,7 +118,16 @@ public class HouseController { // 使用场景:社区查询 String scene = "community_search"; - IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, null, null, + LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO(); + form.setUserId(loginUser.getUserId()); + form.setClient(loginUser.getClient()); + form.setApp(loginUser.getApp()); + LoginUserDetailsResultDTO loginUserDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(form), ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【社区查询-查询房屋】查询当前staff所在组织信息失败", + null); + + IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(loginUserDetail.getAgencyId(),null, null, null, neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize()); return new Result().ok(icNeighborHoodResultDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index a974510a38..93c5af18e5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -47,6 +47,7 @@ public interface IcHouseDao extends BaseDao { // @Param("building") IcBuildingEntity building, // @Param("house") IcHouseEntity house); IPage> searchHouseByPage(IPage page, + @Param("pids") String pids, @Param("buildingId") String buildingId, @Param("ownerName") String ownerName, @Param("ownerPhone") String ownerPhone, diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index e92fbd0e57..ac7f28dbbc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -49,7 +49,8 @@ public interface HouseService { List importExcel(String customerId, List list, String staffId, List numList); - IcNeighborHoodResultDTO listNeighborhood(String buildingId, + IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId, + String buildingId, String ownerName, String ownerPhone, String neighborHoodName, diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 6f072441f9..90a46acfc0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -3,15 +3,21 @@ package com.epmet.service.impl; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dao.IcHouseDao; import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.IcBuildingUnitDTO; import com.epmet.dto.IcHouseDTO; @@ -24,6 +30,7 @@ import com.epmet.enums.HousePurposeEnums; import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; import com.epmet.excel.IcHouseExcel; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.HouseService; import com.epmet.service.IcBuildingService; import com.epmet.service.IcBuildingUnitService; @@ -42,7 +49,7 @@ import java.util.stream.Collectors; @Slf4j @Service -public class HouseServiceImpl implements HouseService { +public class HouseServiceImpl implements HouseService, ResultDataResolver { @@ -60,6 +67,8 @@ public class HouseServiceImpl implements HouseService { private IcBuildingUnitDao icBuildingUnitDao; @Resource private IcHouseDao icHouseDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; @Override @Transactional(rollbackFor = Exception.class) @@ -207,7 +216,8 @@ public class HouseServiceImpl implements HouseService { } @Override - public IcNeighborHoodResultDTO listNeighborhood(String buildingId, + public IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId, + String buildingId, String ownerName, String ownerPhone, String neighborHoodName, @@ -219,9 +229,25 @@ public class HouseServiceImpl implements HouseService { //如果类型是house 查房屋 //IPage> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize); + // 查询pids + CustomerAgencyDTO agency = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(ancestorAgencyId), ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败", null); + + if (agency == null) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败"); + } + + String pids; + + if(NumConstant.ZERO_STR.equals(agency.getPid())){ + pids = ancestorAgencyId; + }else{ + pids = agency.getPids().concat(StrConstant.COLON).concat(ancestorAgencyId); + } + IPage page = new Page(pageNo,pageSize); - IPage> mapIPage = icHouseDao.searchHouseByPage(page, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene); + IPage> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene); List> records = mapIPage.getRecords(); records.forEach(item->{ item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index ab84f43e0f..b5a8b72a25 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -129,7 +129,9 @@ LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0' - + + AND c.AGENCY_PIDS like CONCAT(#{pids},'%') + AND a.BUILDING_ID = #{buildingId}