Browse Source

Merge branch 'dev'

master
zhaoqifeng 4 years ago
parent
commit
ea04a91079
  1. 98
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java
  2. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  3. 53
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  4. 33
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  6. 49
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  7. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  8. 136
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridInfoDTO.java
  9. 191
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridUserDTO.java
  10. 21
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExDeptDTO.java
  11. 33
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.java
  12. 4
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExDeptFormDTO.java
  13. 2
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/StaffBaseInfoFormDTO.java
  14. 22
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExDeptController.java
  15. 15
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExUserController.java
  16. 41
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridInfoDao.java
  17. 41
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridUserDao.java
  18. 1
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExDeptDao.java
  19. 11
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.java
  20. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java
  21. 106
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridInfoEntity.java
  22. 161
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridUserEntity.java
  23. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.java
  24. 7
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java
  25. 10
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java
  26. 6
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java
  27. 44
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridInfoService.java
  28. 38
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridUserService.java
  29. 68
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExDeptService.java
  30. 8
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java
  31. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java
  32. 155
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java
  33. 74
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.java
  34. 138
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExDeptServiceImpl.java
  35. 49
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java
  36. 50
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridInfoDao.xml
  37. 58
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml
  38. 63
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml
  39. 41
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExUserDao.xml
  40. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  41. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

98
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java

@ -79,104 +79,6 @@ public class GridUserInfoDTO implements Serializable {
*/
private String sex;
/**
* 民族[字典表主键]
*/
private String nation;
/**
* 政治面貌[字典表主键]
*/
private String paerty;
/**
* 出生日期[YYYY-MM-DD]
*/
private Date birthday;
/**
* 学历[字典表主键]
*/
private String education;
/**
* 入职时间
*/
private Date entryDate;
/**
* 是否离职
*/
private String isLeave;
/**
* 离职时间
*/
private Date leaveDate;
/**
* 网格员年收入
*/
private String income;
/**
* 是否社区两委委员[YN]
*/
private String isCommittee;
/**
* 是否社区工作者[YN]
*/
private String isCommunityWorkers;
/**
* 是否社会工作者[YN]
*/
private String isSocialWorker;
/**
* 是否村民小组长[YN
*/
private String isVillageLeader;
/**
* 是否警务助理[YN]
*/
private String isPoliceAssistant;
/**
* 是否人民调解员[YN]
*/
private String isMediator;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java

@ -114,25 +114,6 @@ public class DataReportingServiceImpl implements DataReportingService {
st.setUserType(dto.getWorkType().equals("fulltime") ? "01" : "02");
st.setPhonenumber(dto.getMobile());
st.setSex(0 == dto.getGender() ? "9" : dto.getGender().toString());
st.setNation("01");
st.setPaerty("13");
st.setBirthday(new Date());
st.setEducation("20");
st.setEntryDate(new Date());
st.setIsLeave("N");
//st.setLeaveDate();
st.setIncome("05");
st.setIsCommittee("Y");
st.setIsCommunityWorkers("Y");
st.setIsSocialWorker("Y");
st.setIsVillageLeader("Y");
st.setIsPoliceAssistant("N");
st.setIsMediator("Y");
st.setDelFlag(dto.getDelFlag());
st.setCreatedBy(dto.getCreatedBy());
st.setCreatedTime(dto.getCreatedTime());
st.setUpdatedBy(dto.getUpdatedBy());
st.setUpdatedTime(dto.getUpdatedTime());
}
});
@ -239,11 +220,11 @@ public class DataReportingServiceImpl implements DataReportingService {
if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId())) {
switch (project.getFinishOrgLevel()) {
case OrgTypeConstant.DISTRICT:
dto.setCompleteLevel("04");
dto.setCompleteLevel("3");
break;
case OrgTypeConstant.STREET:
case OrgTypeConstant.COMMUNITY:
dto.setCompleteLevel("06");
dto.setCompleteLevel("4");
break;
default:
break;
@ -259,7 +240,7 @@ public class DataReportingServiceImpl implements DataReportingService {
dto.setCompleteLevel(getCompleteLevel(agency.getLevel()));
} else {
//办结组织是网格时,办结层级为网格
dto.setCompleteLevel("07");
dto.setCompleteLevel("5");
}
}
dto.setStatus(getProjectStatus(project.getProjectStatusCode()));
@ -272,15 +253,15 @@ public class DataReportingServiceImpl implements DataReportingService {
private String getCompleteLevel(String level) {
switch (level) {
case OrgTypeConstant.PROVINCE:
return "01";
return "0";
case OrgTypeConstant.CITY:
return "02";
return "1";
case OrgTypeConstant.DISTRICT:
return "03";
return "2";
case OrgTypeConstant.STREET:
return "04";
return "3";
case OrgTypeConstant.COMMUNITY:
return "06";
return "4";
default:
return null;
}

53
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -17,6 +17,7 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
@ -32,6 +33,8 @@ import com.epmet.dto.result.AgencyListResultDTO;
import com.epmet.dto.result.AgencysResultDTO;
import com.epmet.dto.result.SubAgencyResultDTO;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.AgencyService;
import com.epmet.service.CustomerAgencyService;
import org.apache.commons.lang3.StringUtils;
@ -57,6 +60,8 @@ public class AgencyController {
private AgencyService agencyService;
@Autowired
private CustomerAgencyService customerAgencyService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* @param formDTO
@ -100,7 +105,18 @@ public class AgencyController {
}
//当前客户下,同级组织中,组织名称不允许重复
customerAgencyService.checkAgencyName(formDTO.getAgencyName(),tokenDTO.getCustomerId(),null,formDTO.getParentAgencyId());
return new Result<AddAgencyResultDTO>().ok(agencyService.addAgencyV2(formDTO));
AddAgencyResultDTO resultDTO = agencyService.addAgencyV2(formDTO);
//2021-11-30 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(tokenDTO.getCustomerId());
mq.setOrgId(resultDTO.getAgencyId());
mq.setOrgType("agency");
mq.setType("agency_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-11-30 end
return new Result<AddAgencyResultDTO>().ok(resultDTO);
}
/**
@ -114,6 +130,16 @@ public class AgencyController {
String agencyId = agencyService.addRootAgency(form);
HashMap<String, String> resultMap = new HashMap<>();
resultMap.put("agencyId", agencyId);
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(form.getCustomerId());
mq.setOrgId(agencyId);
mq.setOrgType("agency");
mq.setType("agency_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return new Result<Map<String, String>>().ok(resultMap);
}
@ -128,7 +154,18 @@ public class AgencyController {
public Result editAgency(@LoginUser TokenDto tokenDTO, @RequestBody EditAgencyFormDTO formDTO) {
formDTO.setUserId(tokenDTO.getUserId());
ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.DefaultUserShowGroup.class, EditAgencyFormDTO.AddUserInternalGroup.class);
return agencyService.editAgency(formDTO);
Result result = agencyService.editAgency(formDTO);
//2021-10-18 推送mq,数据同步到中介库 start【中介库只放了组织的名称、级别,所以涉及批量修改pname的操作不涉及同步中间库】
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(tokenDTO.getCustomerId());
mq.setOrgId(formDTO.getAgencyId());
mq.setOrgType("agency");
mq.setType("agency_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return result;
}
/**
@ -251,7 +288,17 @@ public class AgencyController {
**/
@PostMapping("saverootagency")
public Result saveRootAgency(@RequestBody AddAgencyAndStaffFormDTO agencyAndStaff) {
agencyService.saveRootAgency(agencyAndStaff);
String agencyId = agencyService.saveRootAgency(agencyAndStaff);
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(agencyAndStaff.getAgencyDTO().getCustomerId());
mq.setOrgId(agencyId);
mq.setOrgType("agency");
mq.setType("agency_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return new Result();
}

33
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java

@ -1,5 +1,6 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
@ -9,6 +10,8 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerGridService;
import com.epmet.service.CustomerStaffAgencyService;
import org.springframework.beans.factory.annotation.Autowired;
@ -28,6 +31,8 @@ public class GridController {
private CustomerGridService customerGridService;
@Autowired
private CustomerStaffAgencyService customerStaffAgencyService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* 获取网格详情
@ -47,8 +52,18 @@ public class GridController {
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_CREATE)
public Result<AddGridResultDTO> addGrid(@LoginUser TokenDto tokenDto, @RequestBody AddGridFormDTO addGridFormDTO){
ValidatorUtils.validateEntity(addGridFormDTO, AddGridFormDTO.AddGrid.class);
return customerGridService.addGrid(tokenDto,addGridFormDTO);
Result<AddGridResultDTO> resultDTOResult = customerGridService.addGrid(tokenDto,addGridFormDTO);
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(tokenDto.getCustomerId());
mq.setOrgId(resultDTOResult.getData().getGridId());
mq.setOrgType("grid");
mq.setType("grid_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return resultDTOResult;
}
/**
@ -59,8 +74,18 @@ public class GridController {
public Result editGrid(@LoginUser TokenDto tokenDto, @RequestBody EditGridFormDTO editGridFormDTO){
ValidatorUtils.validateEntity(editGridFormDTO, EditGridFormDTO.EditGrid.class);
editGridFormDTO.setCustomerId(tokenDto.getCustomerId());
return customerGridService.editGrid(tokenDto,editGridFormDTO);
Result result = customerGridService.editGrid(tokenDto,editGridFormDTO);
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(tokenDto.getCustomerId());
mq.setOrgId(editGridFormDTO.getGridId());
mq.setOrgType("grid");
mq.setType("grid_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return result;
}
/**

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -107,7 +107,7 @@ public interface AgencyService {
* @Description 单客户-添加根组织及客户管理员信息
* @Date 2020/7/16 17:13
**/
void saveRootAgency(AddAgencyAndStaffFormDTO agencyAndStaff);
String saveRootAgency(AddAgencyAndStaffFormDTO agencyAndStaff);
/**
* 添加组织V2

49
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -182,15 +182,6 @@ public class AgencyServiceImpl implements AgencyService {
//5.redis缓存
customerAgencyRedis.delete(formDTO.getAgencyId());
//2021-10-18 推送mq,数据同步到中介库 start【中介库只放了组织的名称、级别,所以涉及批量修改pname的操作不涉及同步中间库】
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(originalEntity.getCustomerId());
mq.setOrgId(formDTO.getAgencyId());
mq.setOrgType("agency");
mq.setType("agency_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return result;
}
@ -231,15 +222,6 @@ public class AgencyServiceImpl implements AgencyService {
throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION);
}
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(formDTO.getCustomerId());
mq.setOrgId(formDTO.getAgencyId());
mq.setOrgType("agency");
mq.setType("agency_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return result;
}
@ -396,15 +378,6 @@ public class AgencyServiceImpl implements AgencyService {
entity.setCustomerId(form.getCustomerId());
customerAgencyDao.insert(entity);
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(form.getCustomerId());
mq.setOrgId(entity.getId());
mq.setOrgType("agency");
mq.setType("agency_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return entity.getId();
}
@ -417,7 +390,8 @@ public class AgencyServiceImpl implements AgencyService {
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void saveRootAgency(AddAgencyAndStaffFormDTO agencyAndStaff) {
public String saveRootAgency(AddAgencyAndStaffFormDTO agencyAndStaff) {
String agencyId = "";
CustomerAgencyDTO agencyDTO = agencyAndStaff.getAgencyDTO();
AdminStaffFromDTO staffDTO = agencyAndStaff.getStaffDTO();
@ -465,15 +439,8 @@ public class AgencyServiceImpl implements AgencyService {
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_MANAGER_ERROR.getCode(), staffResult.getMsg());
}
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(agencyDTO.getCustomerId());
mq.setOrgId(entity.getId());
mq.setOrgType("agency");
mq.setType("agency_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
agencyId = entity.getId();
return agencyId;
}
/**
@ -519,14 +486,6 @@ public class AgencyServiceImpl implements AgencyService {
resultDTO.setAgencyId(insertEntity.getId());
resultDTO.setAreaCode(insertEntity.getAreaCode());
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(parent.getCustomerId());
mq.setOrgId(insertEntity.getId());
mq.setOrgType("agency");
mq.setType("agency_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return resultDTO;
}

26
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -275,15 +275,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
AddGridResultDTO resultDTO = new AddGridResultDTO();
resultDTO.setGridId(customerGridEntity.getId());
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(customerAgencyDTO.getCustomerId());
mq.setOrgId(customerGridEntity.getId());
mq.setOrgType("grid");
mq.setType("grid_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return new Result<AddGridResultDTO>().ok(resultDTO);
}
@ -306,15 +297,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
customerGridDTO.setId(editGridFormDTO.getGridId());
baseDao.editGrid(customerGridDTO);
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(editGridFormDTO.getCustomerId());
mq.setOrgId(editGridFormDTO.getGridId());
mq.setOrgType("grid");
mq.setType("grid_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return new Result();
}
@ -334,14 +316,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return new Result().error(EpmetErrorCode.NOT_DEL_GRID.getCode());
}
}
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(deleteGridFormDTO.getCustomerId());
mq.setOrgId(deleteGridFormDTO.getGridId());
mq.setOrgType("grid");
mq.setType("grid_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return new Result();
}

136
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridInfoDTO.java

@ -1,136 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 网格基础信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Data
public class BaseGridInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 组织/网格Id
*/
private String orgId;
/**
* 网格编码
*/
private String code;
/**
* 网格名称
*/
private String gridName;
/**
* 网格层级[07:网格]
*/
private String gridLevel;
/**
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区;
*/
private String gridType;
/**
* 网格内人口规模[01:500人以下含500人; 02:500-1000人含1000人; 03:1000-1500人含1500人; 04:1500人以上]
*/
private String populationSize;
/**
* 是否成立网格党支部或网格党小组[YN]
*/
private String isPartyBranch;
/**
* 网格党组织类型[01:网格党支部; 02:网格党小组]
*/
private String partyBranchType;
/**
* 中心点质心经度
*/
private String lng;
/**
* 中心点质心纬度
*/
private String lat;
/**
* 网格颜色
*/
private String gridColor;
/**
* 空间范围
*/
private String shape;
/**
* 删除标识 0.未删除 1.已删除
*/
private Long delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

191
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridUserDTO.java

@ -1,191 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 网格员基础信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Data
public class BaseGridUserDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 网格Id
*/
private String gridId;
/**
* 人员Id
*/
private String staffId;
/**
* 网格编码
*/
private String code;
/**
* 网格名称
*/
private String gridName;
/**
* 网格员姓名
*/
private String nickName;
/**
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区;
*/
private String cardNum;
/**
* 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员]
*/
private String userType;
/**
* 手机号码
*/
private String phonenumber;
/**
* 性别[1:男性; 2:女性; 9:未说明的性别]
*/
private String sex;
/**
* 民族[字典表主键]
*/
private String nation;
/**
* 政治面貌[字典表主键]
*/
private String paerty;
/**
* 出生日期[YYYY-MM-DD]
*/
private Date birthday;
/**
* 学历[字典表主键]
*/
private String education;
/**
* 入职时间
*/
private Date entryDate;
/**
* 是否离职
*/
private String isLeave;
/**
* 离职时间
*/
private Date leaveDate;
/**
* 网格员年收入
*/
private String income;
/**
* 是否社区两委委员[YN]
*/
private String isCommittee;
/**
* 是否社区工作者[YN]
*/
private String isCommunityWorkers;
/**
* 是否社会工作者[YN]
*/
private String isSocialWorker;
/**
* 是否村民小组长[YN
*/
private String isVillageLeader;
/**
* 是否警务助理[YN]
*/
private String isPoliceAssistant;
/**
* 是否人民调解员[YN]
*/
private String isMediator;
/**
* 删除标识 0.未删除 1.已删除
*/
private Long delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

21
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExDeptDTO.java

@ -36,37 +36,37 @@ public class ExDeptDTO implements Serializable {
/**
* 市平台部门id
*/
private Integer deptId;
private Integer deptId;
/**
* 市平台父部门id
*/
private Integer parentId;
private Integer parentId;
/**
* 祖级列表
*/
private String ancestors;
private String ancestors;
/**
* 市平台部门/网格名称
*/
private String fullName;
private String fullName;
/**
* 市平台部门/网格简称
*/
private String deptName;
private String deptName;
/**
* 市平台部门/网格编码
*/
private String deptCode;
private String deptCode;
/**
*
* 省标准区划编码/网格编码
*/
private String gridCode;
private String gridCode;
/**
* 组织类型
@ -88,4 +88,9 @@ public class ExDeptDTO implements Serializable {
*/
private String qxDeptName;
/**
* 区县平台客户Id
*/
private String qxCustomerId;
}

33
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.java

@ -36,41 +36,46 @@ public class ExUserDTO implements Serializable {
/**
* 市平台 用户ID
*/
private String userId;
private Integer userId;
/**
* 市平台 用户名
*/
private String userName;
private String userName;
/**
* 市平台 用户身份证
* 市平台 登录账
*/
private String idCard;
private String loginName;
/**
* 市平台 用户手机号
* 市平台所属区县街道村居或网格id
*/
private String mobile;
private String gridId;
/**
* 区县平台 用户ID
* 市平台所属部门id
*/
private String userIdQx;
private String deptId;
/**
* 区县平台 用户名
* 区县平台用户id
*/
private String userNameQx;
private String qxUserId;
/**
* 区县平台 用户账号
* 区县平台姓名/用户名称
*/
private String userAccount;
private String qxUserName;
/**
* 删除标识
* 区县平台手机号码
*/
private String delFlag;
private String qxMobile;
/**
* 区县平台客户Id
*/
private String qxCustomerId;
}

4
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridBaseInfoFormDTO.java → epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExDeptFormDTO.java

@ -12,13 +12,13 @@ import java.util.List;
* @author sun
*/
@Data
public class GridBaseInfoFormDTO implements Serializable {
public class ExDeptFormDTO implements Serializable {
private static final long serialVersionUID = -3634745091993094743L;
/**
* 客户Id
*/
@NotBlank(message = "事件标识不能为空", groups = {Grid.class})
@NotBlank(message = "客户Id不能为空", groups = {Grid.class})
private String customerId = "";
/**
* 网格Id

2
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/StaffBaseInfoFormDTO.java

@ -18,7 +18,7 @@ public class StaffBaseInfoFormDTO implements Serializable {
/**
* 客户Id
*/
@NotBlank(message = "事件标识不能为空", groups = {Staff.class})
@NotBlank(message = "客户Id不能为空", groups = {Staff.class})
private String customerId = "";
/**
* 人员Id

22
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java → epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExDeptController.java

@ -19,8 +19,8 @@ package com.epmet.opendata.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.opendata.dto.form.GridBaseInfoFormDTO;
import com.epmet.opendata.service.BaseGridInfoService;
import com.epmet.opendata.dto.form.ExDeptFormDTO;
import com.epmet.opendata.service.ExDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -35,11 +35,11 @@ import org.springframework.web.bind.annotation.RestController;
* @since v1.0.0 2021-10-15
*/
@RestController
@RequestMapping("basegridinfo")
public class BaseGridInfoController {
@RequestMapping("exdept")
public class ExDeptController {
@Autowired
private BaseGridInfoService baseGridInfoService;
private ExDeptService exDeptService;
/**
@ -47,9 +47,9 @@ public class BaseGridInfoController {
* @Description 组织基础信息中间库同步
**/
@PostMapping("agencybaseinfo")
public Result getAgencyBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class);
baseGridInfoService.getAgencyBaseInfo(formDTO);
public Result getAgencyBaseInfo(@RequestBody(required = false) ExDeptFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ExDeptFormDTO.Grid.class);
exDeptService.getAgencyBaseInfo(formDTO);
return new Result();
}
@ -58,9 +58,9 @@ public class BaseGridInfoController {
* @Description 网格基础信息中间库同步
**/
@PostMapping("gridbaseinfo")
public Result getGridBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class);
baseGridInfoService.getGridBaseInfo(formDTO);
public Result getGridBaseInfo(@RequestBody(required = false) ExDeptFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ExDeptFormDTO.Grid.class);
exDeptService.getGridBaseInfo(formDTO);
return new Result();
}

15
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridUserController.java → epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExUserController.java

@ -19,17 +19,14 @@ package com.epmet.opendata.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.user.result.GridUserInfoDTO;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import com.epmet.opendata.service.BaseGridUserService;
import com.epmet.opendata.service.ExUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 网格员基础信息表
@ -38,11 +35,11 @@ import java.util.List;
* @since v1.0.0 2021-10-15
*/
@RestController
@RequestMapping("basegriduser")
public class BaseGridUserController {
@RequestMapping("exuser")
public class ExUserController {
@Autowired
private BaseGridUserService baseGridUserService;
private ExUserService exUserService;
/**
* @Author sun
@ -51,7 +48,7 @@ public class BaseGridUserController {
@PostMapping("staffbaseinfo")
public Result getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class);
baseGridUserService.getStaffBaseInfo(formDTO);
exUserService.getStaffBaseInfo(formDTO);
return new Result();
}

41
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridInfoDao.java

@ -1,41 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.entity.BaseGridInfoEntity;
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-10-15
*/
@Mapper
public interface BaseGridInfoDao extends BaseDao<BaseGridInfoEntity> {
/**
* @Author sun
* @Description 网格基础信息批量更新部分字段
**/
void updateBatch(@Param("list") List<BaseGridInfoEntity> entityList);
}

41
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridUserDao.java

@ -1,41 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.entity.BaseGridUserEntity;
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-10-15
*/
@Mapper
public interface BaseGridUserDao extends BaseDao<BaseGridUserEntity> {
/**
* @Author sun
* @Description 网格员基础信息批量更新部分字段
**/
void updateBatch(@Param("list") List<BaseGridUserEntity> entityList);
}

1
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExDeptDao.java

@ -18,7 +18,6 @@
package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.entity.BaseGridInfoEntity;
import com.epmet.opendata.entity.ExDeptEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

11
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.java

@ -20,6 +20,9 @@ package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.entity.ExUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 系统用户中间表
@ -29,5 +32,11 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ExUserDao extends BaseDao<ExUserEntity> {
/**
* @Author sun
* @Description 网格员基础信息批量更新部分字段
**/
void updateBatch(@Param("list") List<ExUserEntity> entityList);
}

2
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java

@ -40,7 +40,7 @@ public class BaseConflictsResolveEntity{
* 事件ID
*/
private String id;
private String customerId;
/**
* 事件所属网格ID
*/

106
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridInfoEntity.java

@ -1,106 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.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-10-15
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("base_grid_info")
public class BaseGridInfoEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织/网格Id
*/
private String orgId;
/**
* 网格编码
*/
private String code;
/**
* 网格名称
*/
private String gridName;
/**
* 网格层级[07:网格]
*/
private String gridLevel;
/**
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区;
*/
private String gridType;
/**
* 网格内人口规模[01:500人以下含500人; 02:500-1000人含1000人; 03:1000-1500人含1500人; 04:1500人以上]
*/
private String populationSize;
/**
* 是否成立网格党支部或网格党小组[YN]
*/
private String isPartyBranch;
/**
* 网格党组织类型[01:网格党支部; 02:网格党小组]
*/
private String partyBranchType;
/**
* 中心点质心经度
*/
private String lng;
/**
* 中心点质心纬度
*/
private String lat;
/**
* 网格颜色
*/
private String gridColor;
/**
* 空间范围
*/
private String shape;
}

161
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridUserEntity.java

@ -1,161 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.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-10-15
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("base_grid_user")
public class BaseGridUserEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格Id
*/
private String gridId;
/**
* 人员Id
*/
private String staffId;
/**
* 网格编码
*/
private String code;
/**
* 网格名称
*/
private String gridName;
/**
* 网格员姓名
*/
private String nickName;
/**
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区;
*/
private String cardNum;
/**
* 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员]
*/
private String userType;
/**
* 手机号码
*/
private String phonenumber;
/**
* 性别[1:男性; 2:女性; 9:未说明的性别]
*/
private String sex;
/**
* 民族[字典表主键]
*/
private String nation;
/**
* 政治面貌[字典表主键]
*/
private String paerty;
/**
* 出生日期[YYYY-MM-DD]
*/
private Date birthday;
/**
* 学历[字典表主键]
*/
private String education;
/**
* 入职时间
*/
private Date entryDate;
/**
* 是否离职
*/
private String isLeave;
/**
* 离职时间
*/
private Date leaveDate;
/**
* 网格员年收入
*/
private String income;
/**
* 是否社区两委委员[YN]
*/
private String isCommittee;
/**
* 是否社区工作者[YN]
*/
private String isCommunityWorkers;
/**
* 是否社会工作者[YN]
*/
private String isSocialWorker;
/**
* 是否村民小组长[YN
*/
private String isVillageLeader;
/**
* 是否警务助理[YN]
*/
private String isPoliceAssistant;
/**
* 是否人民调解员[YN]
*/
private String isMediator;
}

5
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.java

@ -89,4 +89,9 @@ public class ExDeptEntity {
*/
private String qxDeptName;
/**
* 区县平台客户Id
*/
private String qxCustomerId;
}

7
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java

@ -73,4 +73,11 @@ public class ExUserEntity {
* 区县平台手机号码
*/
private String qxMobile;
/**
* 区县平台客户Id
*/
private String qxCustomerId;
}

10
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java

@ -9,8 +9,8 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.opendata.dto.form.GridBaseInfoFormDTO;
import com.epmet.opendata.service.BaseGridInfoService;
import com.epmet.opendata.dto.form.ExDeptFormDTO;
import com.epmet.opendata.service.ExDeptService;
import org.apache.commons.lang.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
@ -74,15 +74,15 @@ public class OpenDataOrgChangeEventListener implements MessageListenerConcurrent
lock = distributedLock.getLock(String.format("lock:open_data_org:%s", obj.getOrgId()),
30L, 30L, TimeUnit.SECONDS);
GridBaseInfoFormDTO dto = new GridBaseInfoFormDTO();
ExDeptFormDTO dto = new ExDeptFormDTO();
dto.setCustomerId(obj.getCustomerId());
dto.setType(obj.getType());
List<String> orgIdList = new ArrayList<>();
orgIdList.add(obj.getOrgId());
if ("agency".equals(obj.getOrgType())) {
SpringContextUtils.getBean(BaseGridInfoService.class).getAgencyBaseInfo(dto);
SpringContextUtils.getBean(ExDeptService.class).getAgencyBaseInfo(dto);
} else {
SpringContextUtils.getBean(BaseGridInfoService.class).getGridBaseInfo(dto);
SpringContextUtils.getBean(ExDeptService.class).getGridBaseInfo(dto);
}
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试

6
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java

@ -1,7 +1,7 @@
package com.epmet.opendata.mq.listener;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
@ -11,7 +11,7 @@ import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import com.epmet.opendata.service.BaseGridUserService;
import com.epmet.opendata.service.ExUserService;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
@ -83,7 +83,7 @@ public class OpenDataStaffChangeEventListener implements MessageListenerConcurre
dto.setType(obj.getType());
List<String> staffIdList = new ArrayList<>();
staffIdList.add(obj.getOrgId());
SpringContextUtils.getBean(BaseGridUserService.class).getStaffBaseInfo(dto);
SpringContextUtils.getBean(ExUserService.class).getStaffBaseInfo(dto);
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【开放数据事件监听器】-工作人员信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e)));

44
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridInfoService.java

@ -1,44 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.opendata.dto.form.GridBaseInfoFormDTO;
import com.epmet.opendata.entity.BaseGridInfoEntity;
/**
* 网格基础信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
public interface BaseGridInfoService extends BaseService<BaseGridInfoEntity> {
/**
* @Author sun
* @Description 组织基础信息中介库同步
**/
void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO);
/**
* @Author sun
* @Description 网格基础信息中介库同步
**/
void getGridBaseInfo(GridBaseInfoFormDTO formDTO);
}

38
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridUserService.java

@ -1,38 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import com.epmet.opendata.entity.BaseGridUserEntity;
/**
* 网格员基础信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
public interface BaseGridUserService extends BaseService<BaseGridUserEntity> {
/**
* @Author sun
* @Description 网格员信息中间库同步
**/
void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO);
}

68
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExDeptService.java

@ -18,11 +18,9 @@
package com.epmet.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.opendata.dto.ExDeptDTO;
import com.epmet.opendata.dto.form.ExDeptFormDTO;
import com.epmet.opendata.entity.ExDeptEntity;
import java.util.List;
import java.util.Map;
/**
@ -33,65 +31,19 @@ import java.util.Map;
*/
public interface ExDeptService extends BaseService<ExDeptEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ExDeptDTO>
* @author generator
* @date 2021-10-19
*/
PageData<ExDeptDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ExDeptDTO>
* @author generator
* @date 2021-10-19
*/
List<ExDeptDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ExDeptDTO
* @author generator
* @date 2021-10-19
*/
ExDeptDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-10-19
*/
void save(ExDeptDTO dto);
Map<String, Integer> getDeptMap();
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-10-19
*/
void update(ExDeptDTO dto);
* @Author sun
* @Description 组织基础信息中介库同步
**/
void getAgencyBaseInfo(ExDeptFormDTO formDTO);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-10-19
*/
void delete(String[] ids);
* @Author sun
* @Description 网格基础信息中介库同步
**/
void getGridBaseInfo(ExDeptFormDTO formDTO);
Map<String, Integer> getDeptMap();
}

8
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java

@ -18,6 +18,7 @@
package com.epmet.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import com.epmet.opendata.entity.ExUserEntity;
import java.util.Map;
@ -29,6 +30,13 @@ import java.util.Map;
* @since v1.0.0 2021-10-22
*/
public interface ExUserService extends BaseService<ExUserEntity> {
Map<String, Integer> getUserMap();
/**
* @Author sun
* @Description 网格员信息中间库同步
**/
void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO);
}

4
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java

@ -94,6 +94,7 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
List<BaseConflictsResolveEntity> resolveList = list.stream().map(item -> {
BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity();
entity.setId(item.getId().concat("_PY"));
entity.setCustomerId(item.getCustomerId());
entity.setGridId(deptMap.get(item.getOrgId()));
entity.setGridName(item.getOrgName());
entity.setEventName(item.getEventName());
@ -106,6 +107,9 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
entity.setCreateDate(item.getReportTime());
entity.setUpdateDate(new Date());
entity.setStatus(item.getStatus());
//业务不确定
entity.setSuccessfulOrNot(null);
entity.setEventNo(("py_").concat(item.getId()));
entity.setFirstEventCategory(item.getParentEventCategory());
entity.setSource("01");
entity.setSecondEventCategory(item.getEventCategory());

155
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java

@ -1,155 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.service.impl;
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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.org.result.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.opendata.dao.BaseGridInfoDao;
import com.epmet.opendata.dao.ExDeptDao;
import com.epmet.opendata.dto.form.GridBaseInfoFormDTO;
import com.epmet.opendata.entity.BaseGridInfoEntity;
import com.epmet.opendata.entity.ExDeptEntity;
import com.epmet.opendata.service.BaseGridInfoService;
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.List;
/**
* 网格基础信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Service
public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, BaseGridInfoEntity> implements BaseGridInfoService {
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
@Autowired
private ExDeptDao exDeptDao;
/**
* @Author sun
* @Description 组织基础信息中介库同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) {
//1.查询组织基础信息
com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class);
Result<List<CustomerAgencyDTO>> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO1);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
if (null == result.getData() || result.getData().size() < NumConstant.ONE) {
return;
}
//2.中间库新增/修改数据
/*List<BaseGridInfoEntity> entityList = new ArrayList<>();
result.getData().forEach(ag->{
BaseGridInfoEntity entity = new BaseGridInfoEntity();
entity.setCustomerId(ag.getCustomerId());
entity.setOrgId(ag.getId());
entity.setCode("");
entity.setGridName(ag.getOrganizationName());
String level = "06";
if("province".equals(ag.getLevel())){ level = "01"; }
else if("city".equals(ag.getLevel())){ level = "02"; }
else if("district".equals(ag.getLevel())){ level = "03"; }
else if("street".equals(ag.getLevel())){ level = "04"; }
entity.setGridLevel(level);
entity.setGridType("01");
entity.setDelFlag(ag.getDelFlag().toString());
entity.setUpdatedBy(ag.getUpdatedBy());
entity.setUpdatedTime(ag.getUpdatedTime());
entityList.add(entity);
});*/
List<ExDeptEntity> ExList = new ArrayList<>();
result.getData().forEach(ag->{
ExDeptEntity entity = new ExDeptEntity();
entity.setQxDeptId(ag.getId());
entity.setQxDeptName(ag.getOrganizationName());
entity.setGridCode(ag.getCode());
ExList.add(entity);
});
if(null!=formDTO.getType()&& "all".equals(formDTO.getType())){
exDeptDao.updateBatch(ExList);
}else {
exDeptDao.insertBatch(ExList);
}
}
/**
* @Author sun
* @Description 网格基础信息中介库同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void getGridBaseInfo(GridBaseInfoFormDTO formDTO) {
//1.查询网格基础信息
com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class);
Result<List<CustomerGridDTO>> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO1);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
if (null == result.getData() || result.getData().size() < NumConstant.ONE) {
return;
}
//2.中间库新增/修改数据
/*List<BaseGridInfoEntity> entityList = new ArrayList<>();
result.getData().forEach(ag->{
BaseGridInfoEntity entity = new BaseGridInfoEntity();
entity.setCustomerId(ag.getCustomerId());
entity.setOrgId(ag.getId());
entity.setCode("");
entity.setGridName(ag.getGridName());
entity.setGridLevel("07");
entity.setGridType("01");
entity.setDelFlag(ag.getDelFlag().toString());
entity.setUpdatedBy(ag.getUpdatedBy());
entity.setUpdatedTime(ag.getUpdatedTime());
entityList.add(entity);
});*/
List<ExDeptEntity> ExList = new ArrayList<>();
result.getData().forEach(ag -> {
ExDeptEntity entity = new ExDeptEntity();
entity.setQxDeptId(ag.getId());
entity.setQxDeptName(ag.getGridName());
entity.setGridCode(ag.getCode());
ExList.add(entity);
});
if (null != formDTO.getType() && "all".equals(formDTO.getType())) {
exDeptDao.updateBatch(ExList);
//exDeptDao.updateBatchGrid(ExList);
} else {
exDeptDao.insertBatch(ExList);
}
}
}

74
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.java

@ -1,74 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.org.result.CustomerAgencyDTO;
import com.epmet.dto.user.result.CustomerStaffDTO;
import com.epmet.dto.user.result.GridUserInfoDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.opendata.dao.BaseGridUserDao;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import com.epmet.opendata.entity.BaseGridInfoEntity;
import com.epmet.opendata.entity.BaseGridUserEntity;
import com.epmet.opendata.service.BaseGridUserService;
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.List;
/**
* 网格员基础信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Service
public class BaseGridUserServiceImpl extends BaseServiceImpl<BaseGridUserDao, BaseGridUserEntity> implements BaseGridUserService {
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
/**
* @Author sun
* @Description 网格员信息中间库同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) {
//1.查询网格基础信息
com.epmet.dto.user.form.StaffBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.user.form.StaffBaseInfoFormDTO.class);
Result<List<GridUserInfoDTO>> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO1);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
//2.中间库新增/修改数据
List<BaseGridUserEntity> entityList = ConvertUtils.sourceToTarget(result.getData(), BaseGridUserEntity.class);
if("add".equals(formDTO.getType())){
insertBatch(entityList);
}else {
baseDao.updateBatch(entityList);
}
}
}

138
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExDeptServiceImpl.java

@ -18,22 +18,24 @@
package com.epmet.opendata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.org.result.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.opendata.dao.ExDeptDao;
import com.epmet.opendata.dto.ExDeptDTO;
import com.epmet.opendata.dto.form.ExDeptFormDTO;
import com.epmet.opendata.entity.ExDeptEntity;
import com.epmet.opendata.service.ExDeptService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@ -47,69 +49,91 @@ import java.util.stream.Collectors;
*/
@Service
public class ExDeptServiceImpl extends BaseServiceImpl<ExDeptDao, ExDeptEntity> implements ExDeptService {
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
@Override
public PageData<ExDeptDTO> page(Map<String, Object> params) {
IPage<ExDeptEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ExDeptDTO.class);
}
@Override
public List<ExDeptDTO> list(Map<String, Object> params) {
List<ExDeptEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ExDeptDTO.class);
}
private QueryWrapper<ExDeptEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ExDeptEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ExDeptDTO get(String id) {
ExDeptEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ExDeptDTO.class);
public Map<String, Integer> getDeptMap() {
LambdaQueryWrapper<ExDeptEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.isNotNull(ExDeptEntity::getGridCode);
List<ExDeptEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(entityList)) {
return Collections.emptyMap();
}
return entityList.stream().collect(Collectors.toMap(ExDeptEntity::getQxDeptId, ExDeptEntity::getDeptId, (key1, key2) -> key2));
}
/**
* @Author sun
* @Description 组织基础信息中介库同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ExDeptDTO dto) {
ExDeptEntity entity = ConvertUtils.sourceToTarget(dto, ExDeptEntity.class);
insert(entity);
}
public void getAgencyBaseInfo(ExDeptFormDTO formDTO) {
//1.查询组织基础信息
com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class);
Result<List<CustomerAgencyDTO>> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO1);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
if (null == result.getData() || result.getData().size() < NumConstant.ONE) {
return;
}
//2.封装数据
List<ExDeptEntity> ExList = new ArrayList<>();
result.getData().forEach(ag -> {
ExDeptEntity entity = new ExDeptEntity();
entity.setQxDeptId(ag.getId());
entity.setQxDeptName(ag.getOrganizationName());
entity.setQxDeptCode(ag.getCode());
entity.setQxCustomerId(formDTO.getCustomerId());
ExList.add(entity);
});
//3.全量数据则按组织名称更新数据,新增修改则是按组织Id(qx_dept_id)新增或修改
if (null != formDTO.getType() && "all".equals(formDTO.getType())) {
baseDao.updateBatch(ExList);
} else {
baseDao.insertBatch(ExList);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ExDeptDTO dto) {
ExDeptEntity entity = ConvertUtils.sourceToTarget(dto, ExDeptEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Author sun
* @Description 网格基础信息中介库同步
**/
@Override
public Map<String, Integer> getDeptMap() {
LambdaQueryWrapper<ExDeptEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.isNotNull(ExDeptEntity::getGridCode);
List<ExDeptEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(entityList)) {
return Collections.emptyMap();
@Transactional(rollbackFor = Exception.class)
public void getGridBaseInfo(ExDeptFormDTO formDTO) {
//1.查询网格基础信息
com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class);
Result<List<CustomerGridDTO>> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO1);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
return entityList.stream().collect(Collectors.toMap(ExDeptEntity::getQxDeptId, ExDeptEntity::getDeptId, (key1, key2) -> key2));
if (null == result.getData() || result.getData().size() < NumConstant.ONE) {
return;
}
//2.封装数据
List<ExDeptEntity> ExList = new ArrayList<>();
result.getData().forEach(ag -> {
ExDeptEntity entity = new ExDeptEntity();
entity.setQxDeptId(ag.getId());
entity.setQxDeptName(ag.getGridName());
entity.setQxDeptCode(ag.getCode());
entity.setQxCustomerId(formDTO.getCustomerId());
ExList.add(entity);
});
//3.全量数据则按组织名称更新数据,新增修改则是按组织Id(qx_dept_id)新增或修改
if (null != formDTO.getType() && "all".equals(formDTO.getType())) {
baseDao.updateBatch(ExList);
//exDeptDao.updateBatchGrid(ExList);
} else {
baseDao.insertBatch(ExList);
}
}
}

49
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java

@ -19,12 +19,21 @@ package com.epmet.opendata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.user.result.GridUserInfoDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.opendata.dao.ExUserDao;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import com.epmet.opendata.entity.ExUserEntity;
import com.epmet.opendata.service.ExUserService;
import org.apache.commons.collections4.CollectionUtils;
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.Collections;
import java.util.List;
import java.util.Map;
@ -38,7 +47,8 @@ import java.util.stream.Collectors;
*/
@Service
public class ExUserServiceImpl extends BaseServiceImpl<ExUserDao, ExUserEntity> implements ExUserService {
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
@Override
public Map<String, Integer> getUserMap() {
@ -49,4 +59,41 @@ public class ExUserServiceImpl extends BaseServiceImpl<ExUserDao, ExUserEntity>
}
return list.stream().collect(Collectors.toMap(ExUserEntity::getQxUserId, ExUserEntity::getUserId, (key1, key2) -> key2));
}
/**
* @Author sun
* @Description 网格员信息中间库同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) {
//1.查询网格基础信息
com.epmet.dto.user.form.StaffBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.user.form.StaffBaseInfoFormDTO.class);
Result<List<GridUserInfoDTO>> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO1);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
//2.中间库新增/修改数据
List<ExUserEntity> entityList = new ArrayList<>();
result.getData().forEach(r -> {
ExUserEntity entity = new ExUserEntity();
entity.setQxUserId(r.getStaffId());
entity.setQxUserName(r.getNickName());
entity.setQxMobile(r.getPhonenumber());
entity.setQxCustomerId(formDTO.getCustomerId());
});
//3.更新数据,不能新增,市平台信息表中必填的
if (!"staff_create".equals(formDTO.getType())) {
baseDao.updateBatch(entityList);
}
/*if ("staff_create".equals(formDTO.getType())) {
insertBatch(entityList);
} else {
baseDao.updateBatch(entityList);
}*/
}
}

50
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridInfoDao.xml

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.opendata.dao.BaseGridInfoDao">
<update id="updateBatch" >
UPDATE base_grid_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="grid_name =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.gridName'>
when org_id = #{item.orgId} then #{item.gridName}
</if>
</foreach>
</trim>
<trim prefix="del_flag =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.delFlag'>
when org_id = #{item.orgId} then #{item.delFlag}
</if>
</foreach>
</trim>
<trim prefix="updated_by =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.updatedBy'>
when org_id = #{item.orgId} then #{item.updatedBy}
</if>
</foreach>
</trim>
<trim prefix="updated_time =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.updatedTime'>
when org_id = #{item.orgId} then #{item.updatedTime}
</if>
</foreach>
</trim>
</trim>
WHERE
1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
org_id = #{item.orgId}
</foreach>
</update>
</mapper>

58
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.opendata.dao.BaseGridUserDao">
<update id="updateBatch">
UPDATE base_grid_user
<trim prefix="set" suffixOverrides=",">
<trim prefix="grid_name =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.gridName'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.gridName}
</if>
</foreach>
</trim>
<trim prefix="nick_name =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.nickName'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.nickName}
</if>
</foreach>
</trim>
<trim prefix="del_flag =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.delFlag'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.delFlag}
</if>
</foreach>
</trim>
<trim prefix="updated_by =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.updatedBy'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedBy}
</if>
</foreach>
</trim>
<trim prefix="updated_time =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.updatedTime'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedTime}
</if>
</foreach>
</trim>
</trim>
WHERE
1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
(grid_id = #{item.gridId} AND staff_id = #{item.staffId} )
</foreach>
</update>
</mapper>

63
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml

@ -3,35 +3,38 @@
<mapper namespace="com.epmet.opendata.dao.ExDeptDao">
<resultMap type="com.epmet.opendata.entity.ExDeptEntity" id="exDeptMap">
<result property="deptId" column="dept_id"/>
<result property="parentId" column="parent_id"/>
<result property="ancestors" column="ancestors"/>
<result property="fullName" column="full_name"/>
<result property="deptName" column="dept_name"/>
<result property="deptCode" column="dept_code"/>
<result property="gridCode" column="grid_code"/>
<result property="deptIdQx" column="dept_id_qx"/>
<result property="deptNameQx" column="dept_name_qx"/>
</resultMap>
<update id="updateBatch">
UPDATE ex_dept
<trim prefix="set" suffixOverrides=",">
<trim prefix="dept_id_qx =(case" suffix="end),">
<trim prefix="qx_dept_id =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.deptIdQx'>
<!-- when grid_code = #{item.gridCode} then #{item.deptIdQx} -->
when dept_name_qx = #{item.deptNameQx} then #{item.deptIdQx}
<if test='null != item.qxDeptId'>
when qx_dept_name = #{item.qxDeptName} then #{item.qxDeptId}
</if>
</foreach>
</trim>
<trim prefix="dept_name_qx =(case" suffix="end),">
<trim prefix="qx_dept_name =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.deptNameQx'>
when dept_name_qx = #{item.deptNameQx} then #{item.deptIdQx}
<!-- when grid_code = #{item.gridCode} then #{item.deptNameQx} -->
<if test='null != item.qxDeptName'>
when qx_dept_name = #{item.qxDeptName} then #{item.qxDeptId}
</if>
</foreach>
</trim>
<trim prefix="qx_dept_code =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.qxDeptCode'>
when qx_dept_name = #{item.qxDeptName} then #{item.qxDeptCode}
</if>
</foreach>
</trim>
<trim prefix="qx_customer_id =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.qxCustomerId'>
when qx_dept_name = #{item.qxDeptName} then #{item.qxCustomerId}
</if>
</foreach>
</trim>
@ -40,30 +43,32 @@
WHERE
1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
<!-- grid_code = #{item.gridCode} -->
dept_name_qx = #{item.deptNameQx}
qx_dept_name = #{item.qxDeptName}
</foreach>
</update>
<insert id="insertBatch">
INSERT INTO ex_dept
(
dept_id_qx,
dept_name_qx,
grid_code
qx_dept_id,
qx_dept_name,
qx_dept_code,
qx_customer_id
)
VALUES
<foreach collection="list" item="i" separator=",">
(
#{i.deptIdQx},
#{i.deptNameQx},
#{i.gridCode}
#{i.qxDeptId},
#{i.qxDeptName},
#{i.qxDeptCode},
#{i.qxCustomerId}
)
</foreach>
ON DUPLICATE KEY
UPDATE
dept_id_qx = values(dept_id_qx),
dept_name_qx = values(dept_name_qx)
qx_dept_name = values(qx_dept_name),
qx_dept_code = values(qx_dept_code),
qx_customer_id = values(qx_customer_id)
</insert>
<update id="updateBatchGrid">

41
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExUserDao.xml

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.opendata.dao.ExUserDao">
<update id="updateBatch">
UPDATE ex_user
<trim prefix="set" suffixOverrides=",">
<trim prefix="qx_user_name =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.qxUserName'>
when (qx_user_id = #{item.qxUserId} ) then #{item.qxUserName}
</if>
</foreach>
</trim>
<trim prefix="qx_mobile =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.qxMobile'>
when (qx_user_id = #{item.qxUserId} ) then #{item.qxMobile}
</if>
</foreach>
</trim>
<trim prefix="qx_customer_id =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.qxCustomerId'>
when (qx_user_id = #{item.qxUserId} ) then #{item.qxCustomerId}
</if>
</foreach>
</trim>
</trim>
WHERE 1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
(qx_user_id = #{item.qxUserId} )
</foreach>
</update>
</mapper>

32
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -17,6 +17,7 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
@ -36,6 +37,8 @@ import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.excel.CustomerStaffExcel;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerStaffService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -59,9 +62,10 @@ public class CustomerStaffController {
@Autowired
private CustomerStaffService customerStaffService;
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@GetMapping("page")
public Result<PageData<CustomerStaffDTO>> page(@RequestParam Map<String, Object> params) {
@ -214,7 +218,18 @@ public class CustomerStaffController {
*/
@PostMapping("addstaff")
public Result<CustomerStaffDTO> addStaff(@RequestBody StaffSubmitFromDTO fromDTO){
return customerStaffService.addStaff(fromDTO);
Result<CustomerStaffDTO> result = customerStaffService.addStaff(fromDTO);
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgId(result.getData().getUserId());
mq.setOrgType("staff");
mq.setType("staff_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return result;
}
/**
@ -225,7 +240,18 @@ public class CustomerStaffController {
*/
@PostMapping("editstaff")
public Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO){
return customerStaffService.editStaff(fromDTO);
Result result = customerStaffService.editStaff(fromDTO);
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgId(fromDTO.getStaffId());
mq.setOrgType("staff");
mq.setType("staff_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return result;
}
/**

18
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -348,15 +348,6 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
dto.setRoles(m);
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgId(userEntity.getId());
mq.setOrgType("staff");
mq.setType("staff_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class));
}
@ -431,15 +422,6 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
dto.setRoles(m);
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgId(fromDTO.getStaffId());
mq.setOrgType("staff");
mq.setType("staff_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return new Result();
}

Loading…
Cancel
Save