From 0919eb7a454b85c830c362b5f06faf451184b3d7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Apr 2020 23:16:33 +0800 Subject: [PATCH] =?UTF-8?q?/loginwxmp/getmyorg=E6=8E=A5=E5=8F=A3=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/GovOrgFeignClient.java | 12 ------ .../fallback/GovOrgFeignClientFallback.java | 6 --- .../service/impl/GovLoginServiceImpl.java | 20 +--------- .../dto/form/StaffLatestLoginGridFormDTO.java | 33 ---------------- .../result/StaffLatestLoginGridResultDTO.java | 39 ------------------- .../controller/CustomerGridController.java | 14 ------- .../java/com/epmet/dao/CustomerGridDao.java | 10 ----- .../epmet/service/CustomerGridService.java | 10 ----- .../service/impl/CustomerGridServiceImpl.java | 11 ------ .../main/resources/mapper/CustomerGridDao.xml | 19 --------- .../form/StaffLoginAgencyRecordFormDTO.java | 4 -- 11 files changed, 2 insertions(+), 176 deletions(-) delete mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java delete mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java diff --git a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java index f284da98ab..527db417ef 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -2,9 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.form.StaffOrgFormDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -20,16 +18,6 @@ import java.util.List; */ @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallback.class) public interface GovOrgFeignClient { - /** - * @return com.epmet.commons.tools.utils.Result> - * @param staffGridInfoFormDTO - * @Author yinzuomei - * @Description - * @Date 2020/4/20 21:36 - **/ - @PostMapping(value = "gov/org/customergrid/getStaffGridInfo",consumes = MediaType.APPLICATION_JSON_VALUE) - Result getStaffLatestLoginGrid(StaffLatestLoginGridFormDTO staffGridInfoFormDTO); - /** * @return com.epmet.commons.tools.utils.Result> * @param staffOrgFormDTO diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java index 6121363dfd..a1ccd0bdf0 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallback.java @@ -3,9 +3,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.form.StaffOrgFormDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -19,10 +17,6 @@ import java.util.List; */ @Component public class GovOrgFeignClientFallback implements GovOrgFeignClient { - @Override - public Result getStaffLatestLoginGrid(StaffLatestLoginGridFormDTO staffLatestLoginGridFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffLatestLoginGrid", staffLatestLoginGridFormDTO); - } @Override public Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO) { diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index d8ebf53c1e..6ceb130e79 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -190,10 +190,8 @@ public class GovLoginServiceImpl implements GovLoginService { WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode()); //3、记录staff_wechat this.savestaffwechat(customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); - //4、查询用户绑定的网格 - StaffLatestLoginGridResultDTO latestGridInfo = this.getLatestGridInfo(formDTO, customerStaff.getUserId()); //5、记录登录日志 - this.saveStaffLoginRecord(formDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid(), latestGridInfo.getGridId()); + this.saveStaffLoginRecord(formDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); //1、获取用户token String token = this.generateGovWxmpToken(customerStaff.getUserId()); //2、保存到redis @@ -203,28 +201,14 @@ public class GovLoginServiceImpl implements GovLoginService { return new Result().ok(userTokenResultDTO); } - //查询用户绑定的网格 - private StaffLatestLoginGridResultDTO getLatestGridInfo(GovWxmpEnteOrgFormDTO formDTO, String userId) { - StaffLatestLoginGridFormDTO staffGridInfoFormDTO = new StaffLatestLoginGridFormDTO(); - staffGridInfoFormDTO.setCustomerId(formDTO.getCustomerId()); - staffGridInfoFormDTO.setOrgId(formDTO.getOrgId()); - staffGridInfoFormDTO.setStaffId(userId); - Result staffGridInfoListResult = govOrgFeignClient.getStaffLatestLoginGrid(staffGridInfoFormDTO); - if (staffGridInfoListResult.success() && null != staffGridInfoListResult.getData()) { - return staffGridInfoListResult.getData(); - } - return new StaffLatestLoginGridResultDTO(); - } - //保存登录日志 - private Result saveStaffLoginRecord(GovWxmpEnteOrgFormDTO formDTO, String staffId, String openId, String grid) { + private Result saveStaffLoginRecord(GovWxmpEnteOrgFormDTO formDTO, String staffId, String openId) { StaffLoginAgencyRecordFormDTO staffLoginAgencyRecordFormDTO = new StaffLoginAgencyRecordFormDTO(); staffLoginAgencyRecordFormDTO.setCustomerId(formDTO.getCustomerId()); staffLoginAgencyRecordFormDTO.setStaffId(staffId); staffLoginAgencyRecordFormDTO.setWxOpenId(openId); staffLoginAgencyRecordFormDTO.setMobile(formDTO.getMobile()); staffLoginAgencyRecordFormDTO.setOrgId(formDTO.getOrgId()); - staffLoginAgencyRecordFormDTO.setGridId(grid); Result staffLoginRecordResult = epmetUserFeignClient.saveStaffLoginRecord(staffLoginAgencyRecordFormDTO); return staffLoginRecordResult; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java deleted file mode 100644 index f07e657f73..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffLatestLoginGridFormDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.epmet.dto.form; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @Description 根据用户选择的组织,查询用户与网格的关系列表 - * @Author yinzuomei - * @Date 2020/4/20 15:29 - */ -@Data -public class StaffLatestLoginGridFormDTO implements Serializable { - /** - * 用户选择的组织所属的id - */ - @NotBlank(message = "客户id不能为空") - private String customerId; - - /** - * 用户选择的要进入的组织(根组织id) - */ - @NotBlank(message = "组织id不能为空") - private String orgId; - - /** - * 工作人员id - */ - @NotBlank(message = "staffId不能为空") - private String staffId; -} - diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java deleted file mode 100644 index 4c067bdbe2..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffLatestLoginGridResultDTO.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description 根据用户选择的组织,查询用户与网格的关系列表 - * @Author yinzuomei - * @Date 2020/4/20 15:22 - */ -@Data -public class StaffLatestLoginGridResultDTO implements Serializable { - /** - * ID 唯一标识 - */ - private String gridId; - - /** - * 客户ID - */ - private String customerId; - - /** - * 网格名称 - */ - private String gridName; - - /** - * 所属组织机构ID(customer_organization.id) - */ - private String pid; - - /** - * 所有上级组织ID - */ - private String pids; -} - diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index b9c8f8672f..2599fa67e3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -28,9 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -127,16 +125,4 @@ public class CustomerGridController { return new Result().ok(data); } - /** - * @param staffGridInfoFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 根据用户选择的组织,查询用户与网格的关系列表 - * @Date 2020/4/20 15:34 - **/ - @PostMapping(value = "getStaffGridInfo") - public Result getStaffGridInfo(@RequestBody StaffLatestLoginGridFormDTO staffGridInfoFormDTO) { - ValidatorUtils.validateEntity(staffGridInfoFormDTO); - return customerGridService.listStaffGridInfo(staffGridInfoFormDTO); - } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index d8c308ec90..a8113682c4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -21,9 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -63,12 +61,4 @@ public interface CustomerGridDao extends BaseDao { CustomerGridDTO getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); - /** - * @param staffGridInfoFormDTO - * @return java.util.List - * @Author yinzuomei - * @Description 查询工作人员绑定的网格列表 - * @Date 2020/4/20 15:36 - **/ - List selectListStaffGridInfo(StaffLatestLoginGridFormDTO staffGridInfoFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 7b48c8724d..cf24460d88 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -23,9 +23,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -116,12 +114,4 @@ public interface CustomerGridService extends BaseService { */ Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); - /** - * @param staffGridInfoFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 根据用户选择的组织,查询用户与网格的关系列表 - * @Date 2020/4/20 15:35 - **/ - Result listStaffGridInfo(StaffLatestLoginGridFormDTO staffGridInfoFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index b27f57019f..86cb83f0c2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -28,9 +28,7 @@ import com.epmet.dao.CustomerGridDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.StaffLatestLoginGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.StaffLatestLoginGridResultDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.redis.CustomerGridRedis; import com.epmet.service.CustomerGridService; @@ -151,15 +149,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) { return new Result().ok(baseDao.getCustomerGridByGridId(customerGridFormDTO)); -} - - @Override - public Result listStaffGridInfo(StaffLatestLoginGridFormDTO staffGridInfoFormDTO) { - List list = baseDao.selectListStaffGridInfo(staffGridInfoFormDTO); - if(null!=list&&list.size()>0){ - return new Result().ok(list.get(0)); - } - return new Result<>(); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 5fa9468faa..a2421ac708 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -93,23 +93,4 @@ - - \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java index c4fe580a11..ad67aba726 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffLoginAgencyRecordFormDTO.java @@ -36,9 +36,5 @@ public class StaffLoginAgencyRecordFormDTO implements Serializable { */ private String orgId; - /** - * 网格表Id (CUSTOMER_GRID.id) - */ - private String gridId; }