From 60979307ec9c69e59336e8cdf1cc81c0790f8e77 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 21 Jun 2021 14:51:04 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=A1=B5=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=8E=A5=E5=8F=A3=E9=A6=96=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/CustomerStartPageDTO.java | 96 ++++++++ .../epmet/dto/form/HomeStartPageFromDTO.java | 25 ++ .../epmet/dto/form/SaveStartPageFromDTO.java | 49 ++++ .../com/epmet/dto/form/StartPageFromDTO.java | 26 ++ .../dto/result/HomeStartPageResultDTO.java | 31 +++ .../epmet/dto/result/StartPageResultDTO.java | 47 ++++ .../oper-customize-server/pom.xml | 6 + .../CustomerStartPageController.java | 140 +++++++++++ .../com/epmet/dao/CustomerStartPageDao.java | 48 ++++ .../epmet/entity/CustomerStartPageEntity.java | 66 +++++ .../epmet/excel/CustomerStartPageExcel.java | 71 ++++++ .../epmet/redis/CustomerStartPageRedis.java | 47 ++++ .../service/CustomerStartPageService.java | 121 +++++++++ .../impl/CustomerStartPageServiceImpl.java | 233 ++++++++++++++++++ .../resources/mapper/CustomerStartPageDao.xml | 27 ++ 15 files changed, 1033 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerStartPageDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeStartPageFromDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveStartPageFromDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/StartPageFromDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/StartPageResultDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerStartPageController.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerStartPageDao.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerStartPageEntity.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerStartPageExcel.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerStartPageRedis.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerStartPageService.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerStartPageDao.xml diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerStartPageDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerStartPageDTO.java new file mode 100644 index 0000000000..35bb386820 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerStartPageDTO.java @@ -0,0 +1,96 @@ +/** + * 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 2021-06-21 + */ +@Data +public class CustomerStartPageDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 小程序所属端类型【居民端: resi 工作端: work】 + */ + private String clientType; + + /** + * 启动页文件url路径 + */ + private String url; + + /** + * 启动页展示时间,单位秒 + */ + private Integer time; + + /** + * 启动页文件类型(图片 - image、 视频 - video) + */ + private String type; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer 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-client/src/main/java/com/epmet/dto/form/HomeStartPageFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeStartPageFromDTO.java new file mode 100644 index 0000000000..d544c9825b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeStartPageFromDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 小程序-启动页查询-接口入参 + * @Author sun + */ +@Data +public class HomeStartPageFromDTO implements Serializable { + + private static final long serialVersionUID = -6163303184086480522L; + /** + * extAppId + */ + @NotBlank(message = "小程序Id不能为空", groups = {Start.class}) + private String appId; + + public interface Start extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveStartPageFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveStartPageFromDTO.java new file mode 100644 index 0000000000..b2cd013634 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveStartPageFromDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 运营端-启动页查询-接口入参 + * @Author sun + */ +@Data +public class SaveStartPageFromDTO implements Serializable { + + private static final long serialVersionUID = -6163303184086480522L; + /** + * 客户ID + */ + @NotBlank(message = "客户Id不能为空", groups = {Save.class}) + private String customerId; + /** + * 启动页文件url路径 + */ + @NotBlank(message = "url路径不能为空", groups = {Save.class}) + private String url; + /** + * 小程序所属端类型【居民端: resi 工作端: work】 + */ + @NotBlank(message = "所属端类型不能为空", groups = {Save.class}) + private String clientType; + /** + * 启动页展示时间,单位秒 + */ + @NotNull(message = "展示时长不能为空", groups = {Save.class}) + @Min(value = 3, groups = {Save.class}) + @Max(value = 10, groups = {Save.class}) + private Integer time; + /** + * 启动页文件类型(图片 - image、 视频 - video) + */ + @NotBlank(message = "文件类型不能为空", groups = {Save.class}) + private String type; + public interface Save extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/StartPageFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/StartPageFromDTO.java new file mode 100644 index 0000000000..819d03b563 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/StartPageFromDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 运营端-启动页查询-接口入参 + * @Author sun + */ +@Data +public class StartPageFromDTO implements Serializable { + + private static final long serialVersionUID = -6163303184086480522L; + /** + * 客户ID + */ + @NotBlank(message = "客户Id不能为空", groups = {Start.class}) + private String customerId; + + public interface Start extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java new file mode 100644 index 0000000000..5b3769b325 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 小程序-启动页查询-接口入参 + * @Author sun + */ +@Data +public class HomeStartPageResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 居民端启动页文件url路径 + */ + private String reisUrl; + /** + * 居民端启动页展示时间,单位秒 + */ + private Integer resiTime; + /** + * 工作端启动页文件url路径 + */ + private String workUrl; + /** + * 工作端启动页展示时间,单位秒 + */ + private Integer workTime; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/StartPageResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/StartPageResultDTO.java new file mode 100644 index 0000000000..faa5171bd9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/StartPageResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 运营端-启动页查询-接口入参 + * @Author sun + */ +@Data +public class StartPageResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 启动页文件url路径 + */ + private String url; + /** + * 小程序所属端类型【居民端: resi 工作端: work】 + */ + private String clientType; + /** + * 启动页展示时间,单位秒 + */ + private Integer time; + /** + * 【暂时没用】启动页文件类型(图片 - image、 视频 - video) + */ + private String type; + /** + * 默认值 + */ + private String defUrl; + /** + * 默认值 + */ + private String defClientType; + /** + * 默认值 + */ + private Integer defTime; + /** + * 默认值 + */ + private String defType; +} diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index e3eb48b48f..ae5cc37dbb 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -77,6 +77,12 @@ epmet-commons-rocketmq 2.0.0 + + com.epmet + epmet-third-client + 2.0.0 + compile + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerStartPageController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerStartPageController.java new file mode 100644 index 0000000000..816524cc89 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerStartPageController.java @@ -0,0 +1,140 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.CustomerStartPageDTO; +import com.epmet.dto.form.HomeStartPageFromDTO; +import com.epmet.dto.form.SaveStartPageFromDTO; +import com.epmet.dto.form.StartPageFromDTO; +import com.epmet.dto.result.HomeStartPageResultDTO; +import com.epmet.dto.result.StartPageResultDTO; +import com.epmet.excel.CustomerStartPageExcel; +import com.epmet.service.CustomerStartPageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 客户小程序启动页配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-21 + */ +@RestController +@RequestMapping("customerstartpage") +public class CustomerStartPageController { + + @Autowired + private CustomerStartPageService customerStartPageService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = customerStartPageService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + CustomerStartPageDTO data = customerStartPageService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerStartPageDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerStartPageService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerStartPageDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerStartPageService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerStartPageService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerStartPageService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerStartPageExcel.class); + } + + /** + * @param fromDTO + * @Author sun + * @Description 运营端-启动页查询 + **/ + @PostMapping("startpage") + public Result> startPage(@RequestBody StartPageFromDTO fromDTO) { + ValidatorUtils.validateEntity(fromDTO, StartPageFromDTO.Start.class); + return new Result>().ok(customerStartPageService.startPage(fromDTO)); + } + + /** + * @param listDTO + * @Author sun + * @Description 运营端-启动页保存 + **/ + @PostMapping("savestartpage") + public Result saveStartPage(@RequestBody List listDTO) { + if (null == listDTO || listDTO.size() < NumConstant.ONE) { + throw new RenException("参数错误,集合元素不能为空"); + } + for (SaveStartPageFromDTO formDTO : listDTO) { + ValidatorUtils.validateEntity(formDTO, SaveStartPageFromDTO.Save.class); + } + customerStartPageService.saveStartPage(listDTO); + return new Result(); + } + + /** + * @param fromDTO + * @Author sun + * @Description 小程序-启动页查询 + **/ + @PostMapping("homestartpage") + public Result homeStartPage(@RequestBody HomeStartPageFromDTO fromDTO) { + ValidatorUtils.validateEntity(fromDTO, HomeStartPageFromDTO.Start.class); + return new Result().ok(customerStartPageService.homeStartPage(fromDTO)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerStartPageDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerStartPageDao.java new file mode 100644 index 0000000000..42ec6d77a3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerStartPageDao.java @@ -0,0 +1,48 @@ +/** + * 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.dto.result.StartPageResultDTO; +import com.epmet.entity.CustomerStartPageEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 客户小程序启动页配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-21 + */ +@Mapper +public interface CustomerStartPageDao extends BaseDao { + + /** + * @Author sun + * @Description 查询客户启动页配置数据 + **/ + List selectByCustomerId(@Param("customerId") String customerId); + + /** + * @Author sun + * @Description 根据客户Id删除可能存在的配置数据 + **/ + int delByCustomerId(@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerStartPageEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerStartPageEntity.java new file mode 100644 index 0000000000..54912ab392 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerStartPageEntity.java @@ -0,0 +1,66 @@ +/** + * 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 2021-06-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_start_page") +public class CustomerStartPageEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 小程序所属端类型【居民端: resi 工作端: work】 + */ + private String clientType; + + /** + * 启动页文件url路径 + */ + private String url; + + /** + * 启动页展示时间,单位秒 + */ + private Integer time; + + /** + * 启动页文件类型(图片 - image、 视频 - video) + */ + private String type; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerStartPageExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerStartPageExcel.java new file mode 100644 index 0000000000..c3501d206f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerStartPageExcel.java @@ -0,0 +1,71 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户小程序启动页配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-21 + */ +@Data +public class CustomerStartPageExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "小程序所属端类型【居民端: resi 工作端: work】") + private String clientType; + + @Excel(name = "启动页文件url路径") + private String url; + + @Excel(name = "启动页展示时间,单位秒") + private Integer time; + + @Excel(name = "启动页文件类型(图片 - image、 视频 - video)") + private String type; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerStartPageRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerStartPageRedis.java new file mode 100644 index 0000000000..4ad0f1927b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerStartPageRedis.java @@ -0,0 +1,47 @@ +/** + * 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.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户小程序启动页配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-21 + */ +@Component +public class CustomerStartPageRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerStartPageService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerStartPageService.java new file mode 100644 index 0000000000..429fcf72cb --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerStartPageService.java @@ -0,0 +1,121 @@ +/** + * 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.commons.tools.page.PageData; +import com.epmet.dto.CustomerStartPageDTO; +import com.epmet.dto.form.HomeStartPageFromDTO; +import com.epmet.dto.form.SaveStartPageFromDTO; +import com.epmet.dto.form.StartPageFromDTO; +import com.epmet.dto.result.HomeStartPageResultDTO; +import com.epmet.dto.result.StartPageResultDTO; +import com.epmet.entity.CustomerStartPageEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户小程序启动页配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-21 + */ +public interface CustomerStartPageService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-06-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-06-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerStartPageDTO + * @author generator + * @date 2021-06-21 + */ + CustomerStartPageDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-06-21 + */ + void save(CustomerStartPageDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-06-21 + */ + void update(CustomerStartPageDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-06-21 + */ + void delete(String[] ids); + + /** + * @param fromDTO + * @Author sun + * @Description 运营端-启动页查询 + **/ + List startPage(StartPageFromDTO fromDTO); + + /** + * @param listDTO + * @Author sun + * @Description 运营端-启动页保存 + **/ + void saveStartPage(List listDTO); + + /** + * @param fromDTO + * @Author sun + * @Description 小程序-启动页查询 + **/ + HomeStartPageResultDTO homeStartPage(HomeStartPageFromDTO fromDTO); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java new file mode 100644 index 0000000000..3aad1b9454 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java @@ -0,0 +1,233 @@ +/** + * 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.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +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.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerStartPageDao; +import com.epmet.dto.CustomerStartPageDTO; +import com.epmet.dto.PaCustomerDTO; +import com.epmet.dto.form.HomeStartPageFromDTO; +import com.epmet.dto.form.SaveStartPageFromDTO; +import com.epmet.dto.form.StartPageFromDTO; +import com.epmet.dto.result.HomeStartPageResultDTO; +import com.epmet.dto.result.StartPageResultDTO; +import com.epmet.entity.CustomerStartPageEntity; +import com.epmet.redis.CustomerStartPageRedis; +import com.epmet.service.CustomerStartPageService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户小程序启动页配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-21 + */ +@Service +public class CustomerStartPageServiceImpl extends BaseServiceImpl implements CustomerStartPageService { + private static final Logger logger = LoggerFactory.getLogger(CustomerStartPageServiceImpl.class); + @Autowired + private CustomerStartPageRedis customerStartPageRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerStartPageDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerStartPageDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CustomerStartPageDTO get(String id) { + CustomerStartPageEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerStartPageDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerStartPageDTO dto) { + CustomerStartPageEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStartPageEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerStartPageDTO dto) { + CustomerStartPageEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStartPageEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param fromDTO + * @Author sun + * @Description 运营端-启动页查询 + **/ + @Override + public List startPage(StartPageFromDTO fromDTO) { + List resultList = new ArrayList<>(); + //1.按客户id查询客户数据 + resultList = baseDao.selectByCustomerId(fromDTO.getCustomerId()); + if (null == resultList || resultList.size() < NumConstant.ONE) { + StartPageResultDTO resi = new StartPageResultDTO(); + resi.setClientType("resi"); + resultList.add(resi); + StartPageResultDTO work = new StartPageResultDTO(); + work.setClientType("work"); + resultList.add(work); + } + + //2.查询默认客户数据 + List defList = baseDao.selectByCustomerId("default"); + + //3.封装数据并返回 + resultList.forEach(re -> { + defList.forEach(d -> { + if (re.getClientType().equals(d.getClientType())) { + re.setDefUrl(d.getUrl()); + re.setDefClientType(d.getClientType()); + re.setDefTime(d.getTime()); + re.setDefType(d.getType()); + } + }); + }); + + return resultList; + } + + /** + * @param listDTO + * @Author sun + * @Description 运营端-启动页保存 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveStartPage(List listDTO) { + //1.按客户Id删除可能存在的历史数据 + baseDao.delByCustomerId(listDTO.get(0).getCustomerId()); + + //2.新增客户设置数据 + List list = new ArrayList<>(); + listDTO.forEach(l -> { + CustomerStartPageEntity entity = ConvertUtils.sourceToTarget(l, CustomerStartPageEntity.class); + list.add(entity); + }); + + insertBatch(list); + } + + /** + * @param fromDTO + * @Author sun + * @Description 小程序-启动页查询 + **/ + @Override + public HomeStartPageResultDTO homeStartPage(HomeStartPageFromDTO fromDTO) { + HomeStartPageResultDTO resultDTO = new HomeStartPageResultDTO(); + //1.调用third服务,根据appId查询客户Id + PaCustomerDTO dto = getCustomerInfo(fromDTO.getAppId()); + + //2.根据客户Id查询客户启动页数据 + List defList = baseDao.selectByCustomerId(dto.getId()); + + //3.封装数据并返回 + defList.forEach(d -> { + if ("resi".equals(d.getClientType())) { + resultDTO.setReisUrl(d.getUrl()); + resultDTO.setResiTime(d.getTime()); + } + if ("work".equals(d.getClientType())) { + resultDTO.setWorkUrl(d.getUrl()); + resultDTO.setWorkTime(d.getTime()); + } + }); + + return resultDTO; + } + + /** + * @param appId + * @Description 获取客户信息 + * @author sun + */ + public PaCustomerDTO getCustomerInfo(String appId) { + String url = "https://epmet-cloud.elinkservice.cn/api/third/customermp/getcustomermsg/"; + JSONObject jsonObject = new JSONObject(); + String data = HttpClientManager.getInstance().sendPostByJSON(url + appId, JSON.toJSONString(jsonObject)).getData(); + logger.info("CustomerStartPageServiceImpl.getCustomerInfo:httpclient->url:" + url + ",结果->" + data); + JSONObject toResult = JSON.parseObject(data); + Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class); + if (null != toResult.get("code")) { + mapToResult.setCode(((Integer) toResult.get("code")).intValue()); + } + if (!mapToResult.success()) { + logger.error(String.format("根据appId查询客户Id失败,对应appId->" + appId)); + throw new RenException(mapToResult.getMsg()); + } + Object PublicCustomerResultDTO = mapToResult.getData(); + JSONObject json = JSON.parseObject(PublicCustomerResultDTO.toString()); + Map map = (Map) json.get("customer"); + PaCustomerDTO customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class); + logger.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->" + customer); + return customer; + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerStartPageDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerStartPageDao.xml new file mode 100644 index 0000000000..0f6edfab62 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerStartPageDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + DELETE + FROM + customer_start_page + WHERE + customer_id = #{customerId} + + + \ No newline at end of file From 514bf41ceee8f4a87f0b74f9ac985137cfa0fcda Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 21 Jun 2021 15:07:26 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=A1=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=B8=8D=E9=9C=80=E8=A6=81token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index d797bc08bd..4259540d53 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -471,6 +471,7 @@ epmet: internalAuthUrlsWhiteList: - /epmetuser/customerstaff/customerlist - /gov/project/project/platformcallback + - /oper/customize/customerstartpage/homestartpage # 外部应用认证,使用AccessToken等头进行认证 externalOpenUrls: From 7f41a1c36dcdf1da9e57bee7d694cfec15d5e77e Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 21 Jun 2021 15:54:24 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=90=AB=E4=B9=89=20=E4=BA=8C=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/datareport/constant/IndexConstant.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java index e6a4b3bfac..dd34c3c42d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java @@ -30,7 +30,7 @@ public class IndexConstant { public static final String THRESHOLD_TEXT = "给定阈值%d%%,超过阈值不加分"; public static final String TABLE_DESC = "详见下表:"; public static final String INDEX_SCORE_TITLE = "当月指数"; - public static final String INDEX_SCORE_DESC = "含义:自然月周期内,当月指数得分=党建指数得分*相关权重+治理指数得分*相关权重+服务指数得分*相关权重"; + public static final String INDEX_SCORE_DESC = "自然月周期内,当月指数得分=党建指数得分*相关权重+治理指数得分*相关权重+服务指数得分*相关权重"; public static final String INDEX_DISTRINCT_TABLE1_INDEX_CODE = "suoyoujiedaozlnlpjz"; public static final String ZHI_LI_NENG_LI = "zhilinengli"; public static final String PATTERN_D = "d"; From 9c6e95c3657477f875fbe36a5867d48600f64b54 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 21 Jun 2021 16:21:58 +0800 Subject: [PATCH 04/17] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AE=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E9=A1=B5=E8=B5=8B=E5=80=BC=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/CustomerStartPageServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java index 3aad1b9454..de93223bbf 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java @@ -187,7 +187,9 @@ public class CustomerStartPageServiceImpl extends BaseServiceImpl defList = baseDao.selectByCustomerId(dto.getId()); - + if(null==defList||defList.size() { if ("resi".equals(d.getClientType())) { From bedb2105600565da280c85aa1adf82852f44f93f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 21 Jun 2021 17:10:58 +0800 Subject: [PATCH 05/17] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=A1=B5sql=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V0.0.11__customer_start_page.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.11__customer_start_page.sql diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.11__customer_start_page.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.11__customer_start_page.sql new file mode 100644 index 0000000000..70557e8e9d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.11__customer_start_page.sql @@ -0,0 +1,18 @@ +CREATE TABLE `customer_start_page` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `CLIENT_TYPE` varchar(32) NOT NULL COMMENT '小程序所属端类型【居民端: resi 工作端: work】', + `URL` varchar(256) NOT NULL COMMENT '启动页文件url路径', + `TIME` int(11) NOT NULL DEFAULT '0' COMMENT '启动页展示时间,单位秒', + `TYPE` varchar(32) NOT NULL COMMENT '启动页文件类型(图片 - image、 视频 - video)', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' 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 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='客户小程序启动页配置'; + +INSERT INTO `customer_start_page` VALUES ('3c3a2860d22d11ebbc490050568f8cf7', 'default', 'resi', 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20210621/a6e19dd7a39646b58ba29700d7d7dd64.jpg', '5', 'image', '0', '0', 'APP_USER', '2021-06-21 09:07:31', 'APP_USER', '2021-06-21 09:07:31'); +INSERT INTO `customer_start_page` VALUES ('45fb43a2d22d11ebbc490050568f8cf7', 'default', 'work', 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20210621/a6e19dd7a39646b58ba29700d7d7dd64.jpg', '5', 'image', '0', '0', 'APP_USER', '2021-06-21 09:07:31', 'APP_USER', '2021-06-21 09:07:31'); From 211018e5dd3e91680422e62aab3ca54e3de44f35 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 21 Jun 2021 17:20:08 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=94=B9=E5=8D=95=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerStartPageController.java | 14 ++++++-------- .../java/com/epmet/dao/CustomerStartPageDao.java | 2 +- .../epmet/service/CustomerStartPageService.java | 4 ++-- .../impl/CustomerStartPageServiceImpl.java | 15 +++++---------- .../resources/mapper/CustomerStartPageDao.xml | 1 + 5 files changed, 15 insertions(+), 21 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerStartPageController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerStartPageController.java index 816524cc89..c90599c1ae 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerStartPageController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerStartPageController.java @@ -110,19 +110,17 @@ public class CustomerStartPageController { } /** - * @param listDTO + * @param formDTO * @Author sun * @Description 运营端-启动页保存 **/ @PostMapping("savestartpage") - public Result saveStartPage(@RequestBody List listDTO) { - if (null == listDTO || listDTO.size() < NumConstant.ONE) { - throw new RenException("参数错误,集合元素不能为空"); + public Result saveStartPage(@RequestBody SaveStartPageFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SaveStartPageFromDTO.Save.class); + if (!"resi".equals(formDTO.getClientType()) && !"work".equals(formDTO.getClientType())) { + throw new RenException("参数错误,所属端类型值错误"); } - for (SaveStartPageFromDTO formDTO : listDTO) { - ValidatorUtils.validateEntity(formDTO, SaveStartPageFromDTO.Save.class); - } - customerStartPageService.saveStartPage(listDTO); + customerStartPageService.saveStartPage(formDTO); return new Result(); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerStartPageDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerStartPageDao.java index 42ec6d77a3..75f1c674aa 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerStartPageDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerStartPageDao.java @@ -44,5 +44,5 @@ public interface CustomerStartPageDao extends BaseDao { * @Author sun * @Description 根据客户Id删除可能存在的配置数据 **/ - int delByCustomerId(@Param("customerId") String customerId); + int delByCustomerId(@Param("customerId") String customerId, @Param("clientType") String clientType); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerStartPageService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerStartPageService.java index 429fcf72cb..ba4937cb0c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerStartPageService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerStartPageService.java @@ -106,11 +106,11 @@ public interface CustomerStartPageService extends BaseService startPage(StartPageFromDTO fromDTO); /** - * @param listDTO + * @param formDTO * @Author sun * @Description 运营端-启动页保存 **/ - void saveStartPage(List listDTO); + void saveStartPage(SaveStartPageFromDTO formDTO); /** * @param fromDTO diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java index de93223bbf..0f4b64605e 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java @@ -154,24 +154,19 @@ public class CustomerStartPageServiceImpl extends BaseServiceImpl listDTO) { + public void saveStartPage(SaveStartPageFromDTO formDTO) { //1.按客户Id删除可能存在的历史数据 - baseDao.delByCustomerId(listDTO.get(0).getCustomerId()); + baseDao.delByCustomerId(formDTO.getCustomerId(), formDTO.getClientType()); //2.新增客户设置数据 - List list = new ArrayList<>(); - listDTO.forEach(l -> { - CustomerStartPageEntity entity = ConvertUtils.sourceToTarget(l, CustomerStartPageEntity.class); - list.add(entity); - }); - - insertBatch(list); + CustomerStartPageEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerStartPageEntity.class); + insert(entity); } /** diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerStartPageDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerStartPageDao.xml index 0f6edfab62..0ea8c2ab16 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerStartPageDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerStartPageDao.xml @@ -22,6 +22,7 @@ customer_start_page WHERE customer_id = #{customerId} + AND client_type = #{clientType} \ No newline at end of file From ae2e9762cef53f0fbcc4287f2914ca2dda599cca Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 21 Jun 2021 17:49:27 +0800 Subject: [PATCH 07/17] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/HomeStartPageResultDTO.java | 2 +- .../impl/CustomerStartPageServiceImpl.java | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java index 5b3769b325..7d7fe5d990 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java @@ -15,7 +15,7 @@ public class HomeStartPageResultDTO implements Serializable { /** * 居民端启动页文件url路径 */ - private String reisUrl; + private String resiUrl; /** * 居民端启动页展示时间,单位秒 */ diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java index 0f4b64605e..1ab9f564c6 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java @@ -47,10 +47,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 客户小程序启动页配置 @@ -133,6 +131,20 @@ public class CustomerStartPageServiceImpl extends BaseServiceImpl map = resultList.stream().collect(Collectors.toMap(StartPageResultDTO::getClientType,StartPageResultDTO::getClientType,(value1,value2)->{ + return value2; + })); + if(!map.containsKey("resi")){ + StartPageResultDTO resi = new StartPageResultDTO(); + resi.setClientType("resi"); + resultList.add(resi); + } + if(!map.containsKey("work")){ + StartPageResultDTO work = new StartPageResultDTO(); + work.setClientType("work"); + resultList.add(work); + } } //2.查询默认客户数据 @@ -188,7 +200,7 @@ public class CustomerStartPageServiceImpl extends BaseServiceImpl { if ("resi".equals(d.getClientType())) { - resultDTO.setReisUrl(d.getUrl()); + resultDTO.setResiUrl(d.getUrl()); resultDTO.setResiTime(d.getTime()); } if ("work".equals(d.getClientType())) { From 2783dab1487f1f66427a955abf628fc404f2eeaf Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 21 Jun 2021 21:50:15 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=B9=B3?= =?UTF-8?q?=E5=9D=87=E5=80=BC=E8=AE=A1=E7=AE=97=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E7=94=9F=E6=88=90sample=5Fcount=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/IndexCalculateDistrictServiceImpl.java | 6 +++--- .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 1 + .../mapper/evaluationindex/indexcal/GridScoreDao.xml | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index bceed3de9d..468c974c74 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -230,7 +230,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); subGridPartyAvgScore.forEach(s -> { - gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount()); + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount()); }); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); @@ -319,7 +319,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); districtGovernAvgList.forEach(s -> { - gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount()); + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount()); }); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -412,7 +412,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); log.info("subStreetAvgList:::"+subStreetAvgList.toString()); subStreetAvgList.forEach(s -> { - gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount()); + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount()); }); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 115103bb6a..c940e8b71d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -230,6 +230,7 @@ #{quarterId} AS quarterId, #{yearId} AS yearId, IFNULL(ROUND(AVG( fics.score ),6),0) AS score, + COUNT(1) AS sample_count, sca.customer_id, sca.pid AS parentId FROM screen_customer_agency sca diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml index 1a67d13f8d..d37bfbd30b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -211,6 +211,7 @@ #{quarterId} as quarterId, #{yearId} as yearId, IFNULL(ROUND(AVG( figc.score ),6),0) AS score, + COUNT(1) AS sample_count, sca.customer_id as customerId, sca.pid AS parentId FROM screen_customer_agency sca From 5af2524824a83a8ce5accef2953573718b69eb78 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 22 Jun 2021 09:11:54 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectLogDailyDao.xml | 34 ++++++------- .../extract/FactOriginProjectMainDailyDao.xml | 48 +++++++++---------- 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index bd57a4df1e..b5a2fe362f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -330,20 +330,20 @@ IFNULL( b.count, 0 ) AS "count" FROM - (SELECT f.AGENCY_ID, + (SELECT da.ID AS AGENCY_ID, COUNT( f.ID ) AS "count" FROM fact_origin_project_log_daily f - INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID + INNER JOIN dim_agency da ON f.PIDS LIKE CONCAT( '%', da.ID, '%' ) AND da.`LEVEL` = #{level} WHERE f.IS_ACTIVE = 0 AND f.CUSTOMER_ID = #{customerId} AND f.MONTH_ID = #{monthId} - GROUP BY f.AGENCY_ID ) a + GROUP BY da.ID ) a LEFT JOIN - (SELECT f.AGENCY_ID, + (SELECT da.ID AS AGENCY_ID, COUNT( f.ID ) AS "count" FROM fact_origin_project_log_daily f - INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID + INNER JOIN dim_agency da ON f.PIDS LIKE CONCAT( '%', da.ID, '%' ) AND da.`LEVEL` = #{level} WHERE ( ACTION_CODE = 'close' @@ -354,7 +354,7 @@ AND f.IS_ACTIVE = 1 AND f.CUSTOMER_ID = #{customerId} AND f.MONTH_ID = #{monthId} - GROUP BY f.AGENCY_ID ) b + GROUP BY da.ID ) b ON a.AGENCY_ID = b.AGENCY_ID From d9a013697ac5271e3c0bfed18e564a52f5cbdaa1 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 22 Jun 2021 11:01:19 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E4=B8=BA=E5=A4=9A=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E7=9A=84=E8=AE=A1=E7=AE=97=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B9=B3=E5=9D=87=E5=80=BC=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E5=8F=82=E4=B8=8E=E8=AE=A1=E7=AE=97=E6=95=B0=E9=87=8F=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateCommunityServiceImpl.java | 21 +++++++++++-- .../IndexCalculateDistrictServiceImpl.java | 27 +++++++++++++++++ .../impl/IndexCalculateStreetServiceImpl.java | 30 +++++++++++++++++++ .../indexcal/AgencyScoreDao.xml | 1 + .../indexcal/CommunityScoreDao.xml | 1 + .../evaluationindex/indexcal/GridScoreDao.xml | 1 + 6 files changed, 78 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 8a12ec8c1e..d9b9677a41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -646,9 +646,13 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCodeNew(form.getMonthId(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); + subGridPartyAvgScore.stream().forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL); } else { @@ -702,7 +706,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); deleteOldRecord(form.getCustomerId(),form.getMonthId()); result.getFiveLevel().forEach(s->{ - s.setSampleCount(0); + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? 0 : sampleCount); }); deleteAndInsert(result); return true; @@ -724,10 +729,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni String yearId = DateUtils.getYearId(form.getMonthId()); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { // 社区下属所有网格治理能力汇总(平均值) if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCodeNew(form.getMonthId(),IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); + subGridGovernAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("社区下级治理能力平均分集合为空"); }else{ @@ -779,7 +788,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); result.getFiveLevel().forEach(s->{ - s.setSampleCount(0); + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? 0 : sampleCount); }); deleteAndInsert(result); return true; @@ -802,10 +812,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni String yearId = DateUtils.getYearId(form.getMonthId()); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCodeNew(form.getMonthId(),IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); + subGridServiceAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridServiceAvg)) { log.warn("查询社区下级所有网格服务能力得分平均值集合为空"); } else { @@ -857,7 +871,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); result.getFiveLevel().forEach(s->{ - s.setSampleCount(0); + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? 0 : sampleCount); }); deleteAndInsert(result); return true; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 468c974c74..9c8e1579d9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -645,10 +645,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map pid = new HashMap<>(); Map agencyMap = agencyMap(customerId); //党建能力平均值 + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); + subGridPartyAvgScore.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { @@ -709,6 +714,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.info("districtPartyAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); deleteOldRecord(customerId,monthId,IndexCalConstant.DISTRICT_LEVEL); + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -732,11 +741,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); Map agencyMap = agencyMap(customerId); + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { // 治理能力平均值 List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); + districtGovernAvgList.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount()); + }); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ districtGovernAvgList.remove(districtGovernAvgList.get(i)); @@ -800,6 +813,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.info("districtGovernAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("districtGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -823,11 +841,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); Map agencyMap = agencyMap(customerId); + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); log.info("subStreetAvgList:::"+subStreetAvgList.toString()); + subStreetAvgList.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount()); + }); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ subStreetAvgList.remove(subStreetAvgList.get(i)); @@ -867,6 +889,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.info("districtServiceAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("districtServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); } return true; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index f148e3d83e..bdcd026d07 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -659,12 +659,17 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { // 下属所有社区的党建能力平均值 List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); // 数据处理 List subCommPartyAvgScore = disposeSubAvg(dispose, form); + dispose.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { @@ -718,6 +723,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.info("streetPartyAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); deleteOldRecord(customerId, monthId, IndexCalConstant.STREET_LEVEL); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -739,6 +749,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ String quarterId = DateUtils.getQuarterId(monthId); String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { @@ -746,6 +758,9 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); // 孔村数据处理 List subGridGovernAvg = disposeSubAvg(dispose,form); + subGridGovernAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("查询街道下属所有社区治理能力汇总为空"); }else if (subGridGovernAvg.size() > NumConstant.ZERO) { @@ -797,6 +812,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.info("streetGovernAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("streetGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -819,6 +839,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { @@ -826,6 +848,9 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); // 孔村数据处理 List subCommServiceAvg = disposeSubAvg(dispose,form); + subCommServiceAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subCommServiceAvg)) { log.warn("查询街道下属社区服务能力得分平均值为空"); } else if (subCommServiceAvg.size() > NumConstant.ZERO) { @@ -877,6 +902,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.info("streetServiceAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("streetServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index c940e8b71d..9cceffc4df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -255,6 +255,7 @@ #{quarterId} AS quarterId, #{yearId} AS yearId, IFNULL(ROUND(AVG( fics.score ),6),0) AS score, + COUNT(1) AS sample_count, sca.customer_id AS customerId, (SELECT AGENCY_ID FROM screen_customer_agency WHERE AREA_CODE = #{areaCode} AND DEL_FLAG = 0) AS parentId FROM screen_customer_agency sca diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index 214ca9f017..22e0ba9ca4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -156,6 +156,7 @@ #{quarterId} AS quarterId, #{yearId} AS yearId, IFNULL(ROUND(AVG( fics.score ),6),0) AS score, + COUNT(1) AS sampleCount, sca.customer_id, sca.pid AS parentId FROM screen_customer_agency sca diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml index d37bfbd30b..e1622ebd23 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -235,6 +235,7 @@ #{quarterId} as quarterId, #{yearId} as yearId, IFNULL(ROUND(AVG( figc.score ),6),0) AS score, + COUNT(1) AS sample_count, sca.customer_id as customerId, sca.pid AS parentId FROM screen_customer_agency sca From c6656f8a3ef6bcbe25872db0c490312b9a5bc650 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 22 Jun 2021 17:47:30 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E4=B8=AD=E5=92=8C?= =?UTF-8?q?=E6=9C=AA=E5=B7=A1=E6=9F=A5=E4=B8=AD=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/constant/PatrolConstant.java | 5 +++ .../user/StaffPatrolDetailController.java | 14 ++++++++ .../user/StaffPatrolDetailService.java | 10 ++++++ .../impl/StaffPatrolDetailServiceImpl.java | 34 ++++++++++++++++--- .../epmet/dto/form/PatrolCountFormDTO.java | 30 ++++++++++++++++ .../dto/result/PatrolCountResultDTO.java | 32 +++++++++++++++++ 6 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolCountFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolCountResultDTO.java diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java index eff0bdd451..e4956db0fb 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java @@ -17,4 +17,9 @@ public interface PatrolConstant { */ String LATITUDE = "latitude"; + /** + * 巡查中 + */ + String PATROLLING = "patrolling"; + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java index 72329ea1a1..68d57fa810 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java @@ -3,6 +3,8 @@ package com.epmet.datareport.controller.user; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.user.StaffPatrolDetailService; +import com.epmet.dto.form.PatrolCountFormDTO; +import com.epmet.dto.result.PatrolCountResultDTO; import com.epmet.user.form.GridManagerListFormDTO; import com.epmet.dto.form.PatrolTrackFormDTO; import com.epmet.dto.form.RecordListFormDTO; @@ -63,4 +65,16 @@ public class StaffPatrolDetailController { return new Result>().ok(staffPatrolService.patrolTrack(formDTO)); } + /** + * @Description 004、网格员巡查中和未巡查中的人数 + * @Param formDTO + * @author zxc + * @date 2021/6/22 2:01 下午 + */ + @PostMapping("patrolcount") + public Result patrolCount(@RequestBody PatrolCountFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PatrolCountFormDTO.PatrolCountForm.class); + return new Result().ok(staffPatrolService.patrolCount(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java index 98260990a3..d2e94ce385 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java @@ -1,5 +1,7 @@ package com.epmet.datareport.service.user; +import com.epmet.dto.form.PatrolCountFormDTO; +import com.epmet.dto.result.PatrolCountResultDTO; import com.epmet.user.form.GridManagerListFormDTO; import com.epmet.dto.form.PatrolTrackFormDTO; import com.epmet.dto.form.RecordListFormDTO; @@ -41,4 +43,12 @@ public interface StaffPatrolDetailService{ */ List patrolTrack(PatrolTrackFormDTO formDTO); + /** + * @Description 004、网格员巡查中和未巡查中的人数 + * @Param formDTO + * @author zxc + * @date 2021/6/22 2:01 下午 + */ + PatrolCountResultDTO patrolCount(PatrolCountFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java index 8daf720ea1..5590d127b8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java @@ -9,16 +9,14 @@ import com.epmet.datareport.dao.user.StaffPatrolDetailDao; import com.epmet.datareport.dao.user.StaffPatrolRecordDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenOrgService; import com.epmet.datareport.service.user.StaffPatrolDetailService; -import com.epmet.dto.result.GridStaffResultDTO; -import com.epmet.dto.result.UserNameAndLLResultDTO; +import com.epmet.dto.form.PatrolCountFormDTO; +import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.user.form.GridManagerListFormDTO; import com.epmet.dto.form.PatrolTrackFormDTO; import com.epmet.dto.form.RecordListFormDTO; import com.epmet.user.result.GridManagerListResultDTO; -import com.epmet.dto.result.PatrolTrackResultDTO; -import com.epmet.dto.result.RecordListResultDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -27,6 +25,7 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -192,5 +191,32 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService { return new ArrayList<>(); } + /** + * @Description 004、网格员巡查中和未巡查中的人数 + * @Param formDTO + * @author zxc + * @date 2021/6/22 2:01 下午 + */ + @Override + public PatrolCountResultDTO patrolCount(PatrolCountFormDTO formDTO) { + PatrolCountResultDTO result = new PatrolCountResultDTO(); + GridManagerListFormDTO gridManagerListFormDTO = ConvertUtils.sourceToTarget(formDTO, GridManagerListFormDTO.class); + List resultDTOS = gridManagerList(gridManagerListFormDTO); + // 结果为空就是没网格员 + if (CollectionUtils.isEmpty(resultDTOS)){ + return result; + } + // 根据状态分组,只取巡查中的网格员;巡查中的为0,剩下的都是未巡查,巡查中不为0,总数 - 巡查中 = 未巡查 + Map> groupByStatus = resultDTOS.stream().collect(Collectors.groupingBy(GridManagerListResultDTO::getStatus)); + List patrolling = groupByStatus.get(PatrolConstant.PATROLLING); + if (CollectionUtils.isEmpty(patrolling)){ + result.setElseCount(resultDTOS.size()); + return result; + } + result.setPatrollingCount(patrolling.size()); + result.setElseCount(resultDTOS.size() - patrolling.size()); + return result; + } + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolCountFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolCountFormDTO.java new file mode 100644 index 0000000000..86505b98e2 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolCountFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/22 1:54 下午 + * @DESC + */ +@Data +public class PatrolCountFormDTO implements Serializable { + + private static final long serialVersionUID = -4365871122000986115L; + + public interface PatrolCountForm{} + + /** + * 组织ID + */ + @NotBlank(message = "组织ID不能为空",groups = PatrolCountForm.class) + private String agencyId; + + /** + * 行政地区编码 + */ + private String areaCode; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolCountResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolCountResultDTO.java new file mode 100644 index 0000000000..aeb9032734 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolCountResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/22 1:50 下午 + * @DESC + */ +@Data +public class PatrolCountResultDTO implements Serializable { + + private static final long serialVersionUID = -5686401629775910576L; + + /** + * 当前巡查中人数 + */ + private Integer patrollingCount; + + /** + * 当前未巡查中人数 + */ + private Integer elseCount; + + public PatrolCountResultDTO() { + this.patrollingCount = NumConstant.ZERO; + this.elseCount = NumConstant.ZERO; + } +} From 0738a81aee67a562d1a8140e3f34365c2fe3155f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 23 Jun 2021 09:33:00 +0800 Subject: [PATCH 12/17] =?UTF-8?q?dto=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/user}/form/PatrolCountFormDTO.java | 2 +- .../java/com/epmet/user}/result/PatrolCountResultDTO.java | 2 +- .../controller/user/StaffPatrolDetailController.java | 4 ++-- .../datareport/service/user/StaffPatrolDetailService.java | 4 ++-- .../service/user/impl/StaffPatrolDetailServiceImpl.java | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) rename {epmet-user/epmet-user-client/src/main/java/com/epmet/dto => epmet-module/data-report/data-report-client/src/main/java/com/epmet/user}/form/PatrolCountFormDTO.java (95%) rename {epmet-user/epmet-user-client/src/main/java/com/epmet/dto => epmet-module/data-report/data-report-client/src/main/java/com/epmet/user}/result/PatrolCountResultDTO.java (95%) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolCountFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolCountFormDTO.java similarity index 95% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolCountFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolCountFormDTO.java index 86505b98e2..6f48bc75f3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolCountFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolCountFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.dto.form; +package com.epmet.user.form; import lombok.Data; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolCountResultDTO.java similarity index 95% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolCountResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolCountResultDTO.java index aeb9032734..4c11895d3d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolCountResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolCountResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.dto.result; +package com.epmet.user.result; import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java index 68d57fa810..3778182520 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java @@ -3,14 +3,14 @@ package com.epmet.datareport.controller.user; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.user.StaffPatrolDetailService; -import com.epmet.dto.form.PatrolCountFormDTO; -import com.epmet.dto.result.PatrolCountResultDTO; import com.epmet.user.form.GridManagerListFormDTO; import com.epmet.dto.form.PatrolTrackFormDTO; import com.epmet.dto.form.RecordListFormDTO; +import com.epmet.user.form.PatrolCountFormDTO; import com.epmet.user.result.GridManagerListResultDTO; import com.epmet.dto.result.PatrolTrackResultDTO; import com.epmet.dto.result.RecordListResultDTO; +import com.epmet.user.result.PatrolCountResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java index d2e94ce385..20573e51a7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java @@ -1,13 +1,13 @@ package com.epmet.datareport.service.user; -import com.epmet.dto.form.PatrolCountFormDTO; -import com.epmet.dto.result.PatrolCountResultDTO; import com.epmet.user.form.GridManagerListFormDTO; import com.epmet.dto.form.PatrolTrackFormDTO; import com.epmet.dto.form.RecordListFormDTO; +import com.epmet.user.form.PatrolCountFormDTO; import com.epmet.user.result.GridManagerListResultDTO; import com.epmet.dto.result.PatrolTrackResultDTO; import com.epmet.dto.result.RecordListResultDTO; +import com.epmet.user.result.PatrolCountResultDTO; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java index 5590d127b8..4f36820709 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java @@ -9,14 +9,15 @@ import com.epmet.datareport.dao.user.StaffPatrolDetailDao; import com.epmet.datareport.dao.user.StaffPatrolRecordDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenOrgService; import com.epmet.datareport.service.user.StaffPatrolDetailService; -import com.epmet.dto.form.PatrolCountFormDTO; import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.user.form.GridManagerListFormDTO; import com.epmet.dto.form.PatrolTrackFormDTO; import com.epmet.dto.form.RecordListFormDTO; +import com.epmet.user.form.PatrolCountFormDTO; import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolCountResultDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; From 392b75c355cf3b80cc762be15a341a726bcd7471 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 23 Jun 2021 10:51:11 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E6=9B=B4=E5=A4=9A-=E5=B7=A1=E6=9F=A5?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=E5=8F=AF=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=BB=84=E7=BB=87=E5=8F=8A=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E6=89=80=E6=9C=89=E7=BD=91=E6=A0=BC=E5=88=97=E8=A1=A8=E4=B8=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmetuser/impl/EpmetUserServiceImpl.java | 2 +- .../mapper/govorg/CustomerGridDao.xml | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index ad2c35ec1c..2ebc6b4613 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -84,7 +84,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { public List staffList(StaffListFormDTO formDTO) { List resultList = new ArrayList<>(); List result = new ArrayList<>(); - //1.查询当前人员所属组织下网格列表数据,供后续封装数据使用 + //1.查询当前人员所属组织及下级所有网格列表数据,供后续封装数据使用 List list = govOrgService.gridListByStaffId(formDTO.getUserId()); if (list.size() < NumConstant.ONE) { return resultList; diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml index 3d00ea3cd4..92cffd9271 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml @@ -78,11 +78,24 @@ WHERE cg.del_flag = '0' AND ca.del_flag = '0' - AND cg.pid = ( - select agency_id - from customer_staff_agency - where del_flag = '0' - AND user_id = #{staffId} + AND ( + cg.pid = ( + select agency_id + from customer_staff_agency + where del_flag = '0' + AND user_id = #{staffId} + ) + OR + cg.pids LIKE CONCAT( + '%', + ( + select agency_id + from customer_staff_agency + where del_flag = '0' + AND user_id = #{staffId} + ), + '%' + ) ) From f74080fb3bb45b07a7a38c3a2f14f6b918aee3f6 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 23 Jun 2021 14:18:02 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=91=98=E5=B7=A1?= =?UTF-8?q?=E6=9F=A5=E5=8A=9F=E8=83=BD=E6=8E=A5=E5=8F=A3bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/exception/EpmetErrorCode.java | 1 + .../epmet/service/impl/StaffPatrolRecordServiceImpl.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 25e0a4d4d9..86edad6f0b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -109,6 +109,7 @@ public enum EpmetErrorCode { ONLINE_BADGE_COUNT(8517, "最多上线5个徽章"), PATROL_REPEATED_SUBMIT_ERROR(8521, "巡查已结束,请勿重复提交"), PATROL_END_TIME_ERROR(8522, "巡查结束时间不能小于巡查开始时间"), + TIME_FORMAT_ERROR(8523, "时间格式错误"), // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java index bdc2d9d86b..fd9e5891cd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java @@ -191,7 +191,11 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl 0) { + Date endTime = DateUtils.parse(formDTO.getPatrolEndTime(), DateUtils.DATE_TIME_PATTERN); + if (null == endTime) { + throw new RenException(EpmetErrorCode.TIME_FORMAT_ERROR.getCode()); + } + if (record.getPatrolStartTime().compareTo(endTime) > 0) { throw new RenException(EpmetErrorCode.PATROL_END_TIME_ERROR.getCode()); } record.setActrualEndTime(new Date()); From dfa7c8011119ff91c3050f3f2b9a03fd856df8d6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 23 Jun 2021 15:14:40 +0800 Subject: [PATCH 15/17] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E5=91=98=E5=88=97=E8=A1=A8=E8=BF=94=E5=9B=9E=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=EF=BC=88org=EF=BC=8Cuser=EF=BC=8Creport=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/user/result/GridManagerListResultDTO.java | 5 +++++ .../main/java/com/epmet/dto/result/GridStaffResultDTO.java | 2 ++ .../src/main/resources/mapper/StaffRoleDao.xml | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java index 986350e424..4b825e3da4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java @@ -20,6 +20,11 @@ public class GridManagerListResultDTO implements Serializable { */ private String staffId; + /** + * 工作人员手机号 + */ + private String mobile; + /** * 经度 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java index d74af6d7f6..8cda9d5f32 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java @@ -18,4 +18,6 @@ public class GridStaffResultDTO implements Serializable { private String staffId; + private String mobile; + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 1054b26a5e..98328339b5 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -199,9 +199,11 @@ SELECT #{s.gridId} as gridId, - sr.STAFF_ID + sr.STAFF_ID, + cs.MOBILE FROM staff_role sr LEFT JOIN gov_staff_role gsr ON gsr.ID = sr.ROLE_ID AND gsr.DEL_FLAG = 0 + LEFT JOIN customer_staff cs ON cs.USER_ID = sr.STAFF_ID AND cs.customer_id = sr.customer_id AND cs.DEL_FLAG = 0 WHERE sr.DEL_FLAG = 0 AND gsr.ROLE_KEY = 'grid_member' AND sr.STAFF_ID = #{s.staffId} From d203cfea9e34ac43e885d244cbf93895bb9ba6a0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 23 Jun 2021 16:24:48 +0800 Subject: [PATCH 16/17] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E5=91=98=E5=88=97=E8=A1=A8=E8=BF=94=E5=9B=9E=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=EF=BC=88org=EF=BC=8Cuser=EF=BC=8Creport=EF=BC=89?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/user/StaffPatrolDetailController.java | 6 +++--- .../resources/mapper/screen/ScreenCustomerAgencyDao.xml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java index 3778182520..8f06a5850f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java @@ -25,12 +25,12 @@ import java.util.List; @RestController @RequestMapping("staffpatrol") public class StaffPatrolDetailController { - + @Autowired private StaffPatrolDetailService staffPatrolService; /** - * @Description 001、网格员分布 + * @Description 001、网格员分布 优先选择areaCode查询 * @Param formDTO * @author zxc * @date 2021/6/7 3:06 下午 @@ -77,4 +77,4 @@ public class StaffPatrolDetailController { return new Result().ok(staffPatrolService.patrolCount(formDTO)); } -} \ No newline at end of file +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 4397b99fd6..03dcd38d40 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -333,11 +333,11 @@ LEFT JOIN epmet_evaluation_index.screen_customer_agency ca ON ca.AGENCY_ID = cg.PARENT_AGENCY_ID AND ca.DEL_FLAG = 0 LEFT JOIN epmet_evaluation_index.screen_customer_agency ca2 ON ca2.AGENCY_ID = ca.PID AND ca2.DEL_FLAG = 0 WHERE cg.DEL_FLAG = 0 - + AND cg.AREA_CODE LIKE CONCAT(#{areaCode},'%') - - AND cg.PARENT_AGENCY_ID = #{agencyId} + + AND cg.ALL_PARENT_IDS LIKE CONCAT(#{agencyId}, '%') From 0679a24421dd11061eafdfc005f479149fa9c414 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 23 Jun 2021 18:18:30 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=20?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=9C=AA=E7=99=BB=E5=BD=95=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resolver/LoginUserHandlerMethodArgumentResolver.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java index 57a537d027..5c725c2ec4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java @@ -71,6 +71,7 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu //app-client-userId String redisKey = request.getHeader(Constant.APP_USER_KEY); if (StringUtils.isEmpty(redisKey)) { + logger.info("用户未登陆"); throw new RenException(ErrorCode.UNAUTHORIZED); } // String[] keyArray=redisKey.split("-");