Browse Source

Merge remote-tracking branch 'origin/develop' into develop

dev
jianjun 4 years ago
parent
commit
02b3a4e6c0
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java
  3. 123
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  4. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/GridMemberDataAnalysisExcelExportBean.java
  5. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  6. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  7. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  8. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java
  9. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  10. 4
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml
  11. 4
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  12. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java
  13. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java
  14. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  15. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml
  16. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java
  17. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java
  18. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java
  19. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java
  20. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java
  21. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java
  22. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  23. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java
  24. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  25. 206
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  26. 41
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  27. 8
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  28. 13
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml
  29. 12
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  30. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml
  31. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java
  32. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  33. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -157,6 +157,7 @@ public enum EpmetErrorCode {
COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"),
MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"),
ERROR_DATE(8533, "不合理日期"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java

@ -59,7 +59,8 @@ public class CustomerOrgRedis {
throw new RenException("查询网格信息失败...");
}
if (null == gridInfoResult.getData()){
throw new RenException("没有此网格信息...");
//throw new RenException("没有此网格信息...");
return null;
}
Map<String, Object> map = BeanUtil.beanToMap(gridInfoResult.getData(), false, true);
customerOrgRedis.redisUtils.hMSet(key, map);

123
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -945,4 +945,127 @@ public class DateUtils {
return result;
}
/**
* @Description 获取工作日时间没有排除节假日
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:51 上午
*/
public static Date getWorkDay(Date startDate, int num) {
Date tomorrow = null;
int delay = 1;
while (delay <= num) {
tomorrow = getTomorrow(startDate);
if (!isWeekend(tomorrow)) {
delay++;
}
startDate = tomorrow;
}
return startDate;
}
/**
* @Description 根据开始时间计算出 当前日期后n个工作日没有排除节假日包括今天
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:20 上午
*/
public static List<String> getWorkDayList(Date startDate, int num) {
List<String> result = new ArrayList<>();
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(startDate);
rightNow.add(Calendar.DATE,-1);
startDate = rightNow.getTime();
Date tomorrow;
Integer tag = 1;
while (tag <= num){
tomorrow = getTomorrow(startDate);
// 返回工作日
if (!isWeekend(tomorrow)) {
result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow));
tag++;
}
startDate = tomorrow;
}
return result;
}
/**
* @Description 根据开始时间计算出 当前日期后n个周末没有排除节假日包括今天
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:20 上午
*/
public static List<String> getWeekendDayList(Date startDate, int num) {
List<String> result = new ArrayList<>();
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(startDate);
rightNow.add(Calendar.DATE,-1);
startDate = rightNow.getTime();
Date tomorrow;
Integer tag = 1;
while (tag <= num){
tomorrow = getTomorrow(startDate);
// 返回周末
if (isWeekend(tomorrow)) {
result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow));
tag++;
}
startDate = tomorrow;
}
return result;
}
/**
* @Description 根据开始时间计算出 当前日期后n天没有排除节假日包括今天
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:20 上午
*/
public static List<String> getEveryDayList(Date startDate, int num) {
List<String> result = new ArrayList<>();
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(startDate);
rightNow.add(Calendar.DATE,-1);
startDate = rightNow.getTime();
Date tomorrow;
Integer tag = 1;
while (tag <= num){
tomorrow = getTomorrow(startDate);
result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow));
tag++;
startDate = tomorrow;
}
return result;
}
/**
* @Description 判断日期字符串是否为周末
* @param date eg:yyyy-MM-dd
* @author zxc
* @date 2022/1/7 10:50 上午
*/
private static boolean isWeekend(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY;
}
/**
* @Description 获取tomorrow的日期
* @param startDate
* @author zxc
* @date 2022/1/7 10:50 上午
*/
private static Date getTomorrow(Date startDate) {
Calendar cal = Calendar.getInstance();
cal.setTime(startDate);
cal.add(Calendar.DAY_OF_MONTH, +1);
return cal.getTime();
}
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/GridMemberDataAnalysisExcelExportBean.java

@ -47,8 +47,8 @@ public class GridMemberDataAnalysisExcelExportBean {
@ExcelProperty(value = {"巡查次数"})
private int patrolTimes;
@ExcelProperty(value = {"巡查时长(小时)"})
private double totalTime;
@ExcelProperty(value = {"巡查时长"})
private String totalTime;
@ExcelProperty(value = {"例行工作次数"})
private int patrolRoutineWorkTimes;

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -5,6 +5,7 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
@ -15,7 +16,6 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.beans.GridMemberDataAnalysisExcelExportBean;
@ -30,7 +30,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@ -41,7 +40,6 @@ import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
@ -302,11 +300,11 @@ public class GovOrgController {
PageData<GridMemberDataAnalysisResultDTO> page;
int pageNo = 0;
int pageSize = 1000;
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_THOUSAND;
do {
page = aggreGridService.getGridMemberDataAnalysis4PcWork(orgId, orgType, pageNo, pageSize, startTime, endTime, false);
page = aggreGridService.getGridMemberDataAnalysis4PcWork(orgId, orgType, pageNo++, pageSize, startTime, endTime, false);
List<GridMemberDataAnalysisResultDTO> pageList = page.getList();
List<GridMemberDataAnalysisExcelExportBean> exportBeans = ConvertUtils.sourceToTarget(pageList, GridMemberDataAnalysisExcelExportBean.class);

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -2172,6 +2172,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "【pcwork查询网格员数据统计列表】传入时间条件有误");
//}
PageHelper.startPage(pageNo, pageSize, needCount);
return factGridMemberStatisticsDailyDao.listGridMemberDataStatsIncr(pids, gridId, startDateID, endDateID);
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -342,7 +342,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
re.setTotalTime(totalTime == "" ? "0分钟" : totalTime);
//re.setTotalTime(re.getTimeNum() < 1 ? BigDecimal.ZERO + "h" : new BigDecimal(numberFormat.format((float) re.getTimeNum() / (float) 3600)) + "h");
//re.setTotalTime(re.getTimeNum() / 60 + "分钟");
list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName()));
//list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName()));
});
return resultList;

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java

@ -19,11 +19,14 @@ import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.rmi.runtime.Log;
import java.util.*;
@Slf4j
@Service
public class AggreGridServiceImpl implements AggreGridService {
@ -101,6 +104,10 @@ public class AggreGridServiceImpl implements AggreGridService {
for (GridMemberDataAnalysisResultDTO data : datas) {
// 填充gridName
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(data.getGridId());
if (gridInfo == null) {
log.warn("未找到网格信息:{}", data.getGridId());
continue;
}
Optional.ofNullable(gridInfo).ifPresent((d) -> data.setOrgName(d.getGridName()));
// 生成结构化map

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -42,6 +42,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import sun.jvm.hotspot.memory.ContiguousSpace;
import java.math.BigDecimal;
import java.util.ArrayList;
@ -397,6 +398,10 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
l.setGridName(agencyInfo.getOrganizationName());
}else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getOrgId());
if (gridInfo == null) {
log.warn("未找到网格信息:{}", l.getOrgId());
return;
}
l.setGridName(gridInfo.getGridNamePath());
}
});

4
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml

@ -9,10 +9,10 @@ services:
volumes:
- "/opt/epmet-cloud-logs/prod:/logs"
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx1524m -jar ./data-stats.jar"
RUN_INSTRUCT: "java -Xms256m -Xmx3000m -jar ./data-stats.jar"
restart: "unless-stopped"
deploy:
resources:
limits:
cpus: '0.1'
memory: 1600M
memory: 3200M

4
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

@ -25,6 +25,8 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -616,7 +618,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
//地区编码 同一级不允许重名
List<AreaCodeChildDTO> list = childDao.selectByPCodeAndName(formDTO.getParentAreaCode().trim(), formDTO.getName().trim());
if (CollUtil.isNotEmpty(list)) {
throw new RenException("name已存在");
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "name已存在", "组织名称已存在");
}
AreaCodeChildDTO areaCodeChildDTO = new AreaCodeChildDTO();
areaCodeChildDTO.setName(formDTO.getName().trim());

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java

@ -17,11 +17,13 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
@ -73,11 +75,13 @@ public class AddSocietyOrgFormDTO implements Serializable {
/**
* 起始服务时间
*/
@NotNull(message = "起始服务时间不能为空", groups = { AddSocietyOrgFormDTO.Add.class })
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceStartTime;
/**
* 终止服务时间
*/
@NotNull(message = "终止服务时间不能为空", groups = { AddSocietyOrgFormDTO.Add.class })
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceEndTime;
/**
@ -100,6 +104,6 @@ public class AddSocietyOrgFormDTO implements Serializable {
//token中userId
private String staffId;
public interface Add {}
public interface Add extends CustomerClientShowGroup {}
}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java

@ -54,5 +54,7 @@ public class GetListSocietyOrgFormDTO implements Serializable {
private String staffId;
//token中userId所属组织的pid
private String pids;
//token中userId所属组织Id
private String agencyId;
}

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java

@ -117,7 +117,9 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) {
GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO();
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setPids(staffInfoCache.getAgencyPIds());
//2022.1.7 应产品要求 当前组织只能看到自己组织添加的社会组织数据,不允许看其他下级的
//formDTO.setPids(staffInfoCache.getAgencyPIds());
formDTO.setAgencyId(staffInfoCache.getAgencyId());
//1.根据查询条件分页查询社会组织数据
PageInfo<SocietyOrgListResultDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO));

5
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml

@ -24,8 +24,11 @@
<if test="customerId != null and customerId.trim() != ''">
AND customer_id = #{customerId}
</if>
<if test="pids != null and pids.trim() != ''">
<!-- <if test="pids != null and pids.trim() != ''">
AND pids LIKE CONCAT('%', #{pids}, '%')
</if>-->
<if test="agencyId != null and agencyId.trim() != ''">
AND agency_id = #{agencyId}
</if>
<if test="societyName != null and societyName.trim() != ''">
AND society_name LIKE CONCAT('%', #{societyName}, '%')

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java

@ -58,5 +58,6 @@ public class AgencyListResultDTO implements Serializable {
* 联系电话
*/
private String mobile = "";
private String areaCode;
private String parentAreaCode;
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java

@ -47,6 +47,11 @@ public class AllMattersResultDTO implements Serializable {
@JsonIgnore
private String endTime;
/**
* 预约类型每天everyDay工作日workDay周末weekend
*/
private String appointmentType;
public AllMattersResultDTO() {
this.matterName = "";
this.allowTime = "";
@ -55,5 +60,6 @@ public class AllMattersResultDTO implements Serializable {
this.address = "";
this.workPhone = "";
this.centerName = "";
this.appointmentType="";
}
}

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java

@ -27,8 +27,11 @@ public class AppointmentTimeResultDTO implements Serializable {
*/
private List<TimeDTO> timeDetail;
private List<String> dateList;
public AppointmentTimeResultDTO() {
this.appointmentType = "";
this.timeDetail = new ArrayList<>();
this.dateList = new ArrayList<>();
}
}

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java

@ -58,4 +58,5 @@ public class DepartmentListResultDTO implements Serializable {
* 联系电话
*/
private String mobile = "";
private String areaCode;
}

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java

@ -49,4 +49,5 @@ public class GridBaseInfoResultDTO implements Serializable {
* 联系电话
*/
private String mobile = "";
private String areaCode;
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java

@ -13,4 +13,8 @@ public interface PartyServiceCenterConstant {
String APPOINTMENT_STATUS_APPOINTING = "appointing";
String APPOINTMENT_STATUS_CANCEL = "cancel";
String APPOINTMENT_TYPE_EVERY_DAY = "everyDay";
String APPOINTMENT_TYPE_WORK_DAY = "workDay";
String APPOINTMENT_TYPE_WEEKEND = "weekend";
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -305,6 +305,6 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
**/
OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId);
int updateSubAgencyAreaCode(@Param("customerId") String customerId, @Param("originalParentAreaCode")String originalParentAreaCode,@Param("operateUserId") String operateUserId);
int updateSubAgencyAreaCodeById(@Param("customerId")String customerId, @Param("agencyId")String agencyId, @Param("operateUserId") String operateUserId);
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java

@ -101,4 +101,8 @@ public interface CustomerDepartmentDao extends BaseDao<CustomerDepartmentEntity>
* @Date 2020/12/15 10:05
**/
int delDeptById(@Param("deptId")String deptId,@Param("operateUserId") String operateUserId);
int updateSubDeptAreaCode(@Param("customerId") String customerId,
@Param("areaCode")String areaCode,
@Param("operateUserId") String operateUserId);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -351,4 +351,9 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @Description 网格组织信息
**/
CustomerGridDTO gridAgencyByGrid(@Param("gridId") String gridId);
int updateSubGridAreaCode(@Param("customerId") String customerId,
@Param("agencyId")String agencyId,
@Param("operateUserId") String operateUserId);
}

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

@ -19,10 +19,12 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -33,6 +35,7 @@ import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.constant.RoleKeyConstants;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerDepartmentDao;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.CustomerAgencyDTO;
@ -40,6 +43,7 @@ import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerDepartmentEntity;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
@ -60,6 +64,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
@ -93,7 +98,8 @@ public class AgencyServiceImpl implements AgencyService {
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private IcBuildingDao icBuildingDao;
@Autowired
private CustomerDepartmentDao customerDepartmentDao;
/**
* @param formDTO
@ -152,31 +158,26 @@ public class AgencyServiceImpl implements AgencyService {
originalEntity.setCode(formDTO.getCode());
originalEntity.setContacts(formDTO.getContacts());
originalEntity.setMobile(formDTO.getMobile());
if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalEntity.getAreaCode())) {
//如果修改了areaCode。
customerAgencyDao.updateSubAgencyAreaCode(originalEntity.getCustomerId(), originalEntity.getAreaCode(), formDTO.getUserId());
//判断areaCodeSwitch:open: 选择地区编码必填;closed: 无需选择地区编码
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) {
//校验areaCode是否被使用过
if (!"other".equals(formDTO.getAreaCode())) {
List<String> agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(formDTO.getAreaCode(),formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(agencyIds)) {
//已经被占用,提示
throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg());
}
originalEntity.setAreaCode(formDTO.getAreaCode());
}else{
//如果选择的是other,需要自定义一个编码
AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO();
addAreaCodeFormDTO.setCurrentAreaLevel(formDTO.getLevel());
addAreaCodeFormDTO.setParentAreaCode(formDTO.getAreaCode());
addAreaCodeFormDTO.setName(formDTO.getAgencyName());
Result<String> addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO);
if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) {
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg());
}
originalEntity.setAreaCode(addAreaCodeResult.getData());
//当前客户开启了area_code_switch参数:open: 选择地区编码必填;closed: 无需选择地区编码
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) {
CustomerAgencyEntity parent = customerAgencyDao.selectById(originalEntity.getPid());
if (null != parent) {
//开关开启后,areaCode必填
String originalAreaCode = originalEntity.getAreaCode();
checkEditAgencyFormDTO(formDTO, originalEntity);
// 1、之前当前组织没有编码,本次修改设置了编码
// 2、之前已经有编码,本次修改为了其他编码
if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalAreaCode)) {
String newAreaCode = getAgencyNewAreaCode(formDTO, parent);
originalEntity.setAreaCode(newAreaCode);
originalEntity.setParentAreaCode(parent.getAreaCode());
formDTO.setAreaCode(newAreaCode);
}
//什么时候要全部置为空呢?原来没有现在有 || 原来与现在不一致
if ((StringUtils.isBlank(originalAreaCode) && StringUtils.isNotBlank(formDTO.getAreaCode()))
|| (!formDTO.getAreaCode().equals(originalAreaCode))) {
updateSubOrg(originalEntity.getCustomerId(), formDTO, originalAreaCode);
}
}
}
@ -225,6 +226,107 @@ public class AgencyServiceImpl implements AgencyService {
return result;
}
/**
* 所有下家组织网格部门的area_codeparent_area_code置为空
* 直属组织parent_area_code直属网格+直属部门的area_code更新为最新值
* @param customerId
* @param formDTO
* @param originalAreaCode
*/
private void updateSubOrg(String customerId, EditAgencyFormDTO formDTO,String originalAreaCode) {
//如果原来这个组织有area_code再去更新,没有其实应该按照pids去更新。
customerAgencyDao.updateSubAgencyAreaCodeById(customerId, formDTO.getAgencyId(), formDTO.getUserId());
//网格的
customerGridDao.updateSubGridAreaCode(customerId, formDTO.getAgencyId(), formDTO.getUserId());
//部门的
customerDepartmentDao.updateSubDeptAreaCode(customerId, originalAreaCode, formDTO.getUserId());
//1、更新直属网格的areaCode
LambdaUpdateWrapper<CustomerGridEntity> updateGridWrapper = new LambdaUpdateWrapper<>();
updateGridWrapper.eq(CustomerGridEntity::getPid,formDTO.getAgencyId())
.set(CustomerGridEntity::getAreaCode, formDTO.getAreaCode())
.set(CustomerGridEntity::getUpdatedBy,formDTO.getUserId())
.set(CustomerGridEntity::getUpdatedTime,new Date());
int subGridRows=customerGridDao.update(null,updateGridWrapper);
log.info(String.format("更新了%s个直属网格的area_code",subGridRows));
// 2、更新直属部门的area_code
LambdaUpdateWrapper<CustomerDepartmentEntity> updateDeptWrapper = new LambdaUpdateWrapper<>();
updateDeptWrapper.eq(CustomerDepartmentEntity::getAgencyId,formDTO.getAgencyId())
.set(CustomerDepartmentEntity::getAreaCode, formDTO.getAreaCode())
.set(CustomerDepartmentEntity::getUpdatedBy,formDTO.getUserId())
.set(CustomerDepartmentEntity::getUpdatedTime,new Date());
int gridRows=customerDepartmentDao.update(null,updateDeptWrapper);
log.info(String.format("更新了%s个直属部门的area_code",gridRows));
// 3、更新下级组织的parent_area_code
LambdaUpdateWrapper<CustomerAgencyEntity> updateAgencyWrapper = new LambdaUpdateWrapper<>();
updateAgencyWrapper.eq(CustomerAgencyEntity::getPid,formDTO.getAgencyId())
.set(CustomerAgencyEntity::getParentAreaCode, formDTO.getAreaCode())
.set(CustomerAgencyEntity::getUpdatedBy,formDTO.getUserId())
.set(CustomerAgencyEntity::getUpdatedTime,new Date());
Integer rows = customerAgencyDao.update(null, updateAgencyWrapper);
log.info(String.format("更新了%s个下级组织的parent_area_code",rows));
}
/**
*
* @param formDTO 编辑组织入参
* @param parent 当前编辑组织的上级组织
* @return 返回组织区划编码
*/
private String getAgencyNewAreaCode(EditAgencyFormDTO formDTO, CustomerAgencyEntity parent) {
String newAreaCode="";
if (!"other".equals(formDTO.getAreaCode())) {
//校验除了当前组织外,areaCode是否被使用过
List<String> agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(formDTO.getAreaCode(), formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(agencyIds)) {
//已经被占用,提示
throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg());
}
newAreaCode=formDTO.getAreaCode();
} else {
//如果选择的是other,需要自定义一个编码
AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO();
addAreaCodeFormDTO.setCurrentAreaLevel(formDTO.getLevel());
addAreaCodeFormDTO.setParentAreaCode(parent.getAreaCode());
addAreaCodeFormDTO.setName(formDTO.getAgencyName());
Result<String> addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO);
if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) {
if (addAreaCodeResult.getCode() > 8000) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义area_code异常" + addAreaCodeResult.getInternalMsg(), addAreaCodeResult.getMsg());
} else {
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg());
}
}
newAreaCode=addAreaCodeResult.getData();
}
return newAreaCode;
}
/**
* 如果当前客户开启了areaCode校验参数逼单
* @param formDTO
*/
private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO,CustomerAgencyEntity originalEntity) {
//根组织不允许修改
if (StringUtils.isNotBlank(originalEntity.getPid()) && !NumConstant.ZERO_STR.equals(originalEntity.getPid())) {
if (StringUtils.isBlank(formDTO.getAreaCode())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open areaCode不能为空", "组织区划不能为空");
}
if (StringUtils.isBlank(formDTO.getParentAreaCode())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open parentAreaCode不能为空", "请先设置上级组织的组织区划");
}
//如果当前组织已经使用了自定义编码,不允许在选择其他。
if (StringUtils.isNotBlank(originalEntity.getAreaCode())
&& originalEntity.getAreaCode().contains("UD")
&& StringUtils.isNotBlank(formDTO.getAreaCode())
&& "other".equals(formDTO.getAreaCode())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义编码不允许修改", "自定义组织区划代码不允许修改");
}
}
}
/**
* @param formDTO
* @return
@ -287,27 +389,6 @@ public class AgencyServiceImpl implements AgencyService {
agencysResultDTO.setCode(entity.getCode());
agencysResultDTO.setContacts(entity.getContacts());
agencysResultDTO.setMobile(entity.getMobile());
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 start
if (null != entity) {
if (null == entity.getPids() || "".equals(entity.getPids())) {
agencysResultDTO.setRootlevel(entity.getLevel());
} else {
String id = Arrays.asList(entity.getPids().split(":")).get(0);
CustomerAgencyEntity rootEntity = customerAgencyDao.selectById(id);
if (null != rootEntity) {
agencysResultDTO.setRootlevel(rootEntity.getLevel());
}
}
}
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end
//2:查询本机关的所有上级机关,按自上而下层级顺序
if (null == entity.getPids()) {
agencysResultDTO.setParentList(parentList);
return new Result<AgencysResultDTO>().ok(agencysResultDTO);
}
List<String> listStr = Arrays.asList(entity.getPids().split(":"));
parentList = customerAgencyDao.selectPAgencyById(listStr);
agencysResultDTO.setParentList(parentList);
agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId()));
agencysResultDTO.setAreaName(StrConstant.EPMETY_STR);
agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode())?entity.getAreaCode():StrConstant.EPMETY_STR);
@ -333,13 +414,30 @@ public class AgencyServiceImpl implements AgencyService {
agencysResultDTO.setAreaName(StrConstant.EPMETY_STR);
}
}
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 start
if (null != entity) {
if (null == entity.getPids() || "".equals(entity.getPids())) {
agencysResultDTO.setRootlevel(entity.getLevel());
} else {
String id = Arrays.asList(entity.getPids().split(":")).get(0);
CustomerAgencyEntity rootEntity = customerAgencyDao.selectById(id);
if (null != rootEntity) {
agencysResultDTO.setRootlevel(rootEntity.getLevel());
}
}
}
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end
//2:查询本机关的所有上级机关,按自上而下层级顺序
if (StringUtils.isBlank(entity.getPids())) {
agencysResultDTO.setParentList(parentList);
return new Result<AgencysResultDTO>().ok(agencysResultDTO);
}
List<String> listStr = Arrays.asList(entity.getPids().split(":"));
parentList = customerAgencyDao.selectPAgencyById(listStr);
agencysResultDTO.setParentList(parentList);
return new Result<AgencysResultDTO>().ok(agencysResultDTO);
}
public static void main(String[] args) {
String m="1234";
System.out.println(m.equals("1234") ? "yes" : "no");
}
/**
* @param formDTO
* @return
@ -519,7 +617,11 @@ public class AgencyServiceImpl implements AgencyService {
addAreaCodeFormDTO.setName(formDTO.getAgencyName());
Result<String> addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO);
if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) {
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg());
if (addAreaCodeResult.getCode() > 8000) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义area_code异常" + addAreaCodeResult.getInternalMsg(), addAreaCodeResult.getMsg());
} else {
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg());
}
}
insertEntity.setAreaCode(addAreaCodeResult.getData());
}

41
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -275,6 +275,20 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
@Override
@Transactional(rollbackFor = Exception.class)
public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) {
IcPartyServiceCenterMatterEntity entity = matterService.selectById(formDTO.getMatterId());
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
Boolean s = false;
for (String d : dateList) {
if (d.equals(formDTO.getAppointmentDate())){
s = true;
}
}
if (!s){
throw new EpmetException(EpmetErrorCode.ERROR_DATE.getCode());
}
String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
@ -322,6 +336,20 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
@Override
@Transactional(rollbackFor = Exception.class)
public void appointmentMini(AppointmentMiniFormDTO formDTO, TokenDto tokenDto) {
IcPartyServiceCenterMatterEntity entity = matterService.selectById(formDTO.getMatterId());
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
Boolean s = false;
for (String d : dateList) {
if (d.equals(formDTO.getAppointmentDate())){
s = true;
}
}
if (!s){
throw new EpmetException(EpmetErrorCode.ERROR_DATE.getCode());
}
String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
@ -423,6 +451,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
throw new RenException("事项不存在...");
}
result.setAppointmentType(matter.getAppointmentType());
result.setDateList(getDateList(result.getAppointmentType()));
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
.eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate())
@ -487,6 +516,18 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
return result;
}
public List<String> getDateList(String type) {
List<String> result = new ArrayList<>();
if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_EVERY_DAY)){
result = DateUtils.getEveryDayList(new Date(),NumConstant.SEVEN);
}else if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_WORK_DAY)){
result = DateUtils.getWorkDayList(new Date(),NumConstant.SEVEN);
}else {
result = DateUtils.getWeekendDayList(new Date(),NumConstant.SEVEN);
}
return result;
}
/**
* @Description 党群服务中心预约记录
* @param formDTO

8
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -131,7 +131,9 @@
total_user AS 'totalUser',
IFNULL(code,'')AS 'code',
IFNULL(contacts,'')AS 'contacts',
IFNULL(mobile,'')AS 'mobile'
IFNULL(mobile,'')AS 'mobile',
IFNULL(AREA_CODE,'') AS areaCode,
IFNULL(PARENT_AREA_CODE,'') parentAreaCode
FROM customer_agency
WHERE del_flag = '0'
AND pid = #{pId}
@ -731,7 +733,7 @@
AND PID = #{orgId}
</select>
<update id="updateSubAgencyAreaCode" parameterType="map">
<update id="updateSubAgencyAreaCodeById" parameterType="map">
UPDATE customer_agency
SET AREA_CODE = '',
PARENT_AREA_CODE = '',
@ -740,6 +742,6 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND PARENT_AREA_CODE LIKE concat( #{originalParentAreaCode}, '%' )
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
</mapper>

13
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml

@ -26,7 +26,8 @@
total_user AS 'totalUser',
IFNULL(code,'')AS 'code',
IFNULL(contacts,'')AS 'contacts',
IFNULL(mobile,'')AS 'mobile'
IFNULL(mobile,'')AS 'mobile',
IFNULL(AREA_CODE,'')AS areaCode
FROM customer_department
WHERE del_flag = '0'
AND agency_id = #{agencyId}
@ -87,4 +88,14 @@
UPDATED_TIME=NOW()
where id=#{deptId}
</update>
<update id="updateSubDeptAreaCode" parameterType="map">
update customer_department
SET AREA_CODE = '',
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
where customer_id=#{customerId}
AND AREA_CODE LIKE concat(#{areaCode}, '%' )
</update>
</mapper>

12
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -291,7 +291,8 @@
IFNULL(code,'')AS 'code',
IFNULL(grid_type,'')AS 'gridType',
IFNULL(contacts,'')AS 'contacts',
IFNULL(mobile,'')AS 'mobile'
IFNULL(mobile,'')AS 'mobile',
IFNULL(AREA_CODE,'') as areaCode
FROM
CUSTOMER_GRID
<where>
@ -755,4 +756,13 @@
AND cg.id = #{gridId}
</select>
<update id="updateSubGridAreaCode" parameterType="map">
update customer_grid
SET AREA_CODE = '',
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
where customer_id=#{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
</mapper>

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

@ -64,7 +64,8 @@
IFNULL(cm.MATTER_IMG,'') AS matterImg,
c.ADDRESS,
c.WORK_PHONE,
c.CENTER_NAME
c.CENTER_NAME,
cm.APPOINTMENT_TYPE as appointmentType
FROM ic_party_service_center c
INNER JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = c.ID AND cm.DEL_FLAG = 0)
AND c.DEL_FLAG = 0

8
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

@ -100,6 +100,10 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
dtoList.forEach(item -> {
if (StringUtils.isNotBlank(item.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId());
if(gridInfo == null) {
log.warn("未找到网格信息:{}", item.getGridId());
return;
}
item.setGridName(gridInfo.getGridName());
}
});
@ -191,6 +195,10 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
dtoList.forEach(item -> {
if (StringUtils.isNotBlank(item.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId());
if (gridInfo == null) {
log.warn("未找到网格信息:{}", item.getGridId());
return;
}
item.setGridName(gridInfo.getGridName());
}
});

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

@ -218,12 +218,14 @@ public class CustomerStaffController {
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);
if (result.success()) {
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;
@ -240,12 +242,14 @@ public class CustomerStaffController {
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);
if (result.success()) {
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;

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

@ -491,6 +491,11 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
//2.查询网格信息并赋值
Map<String, CustomerGridDTO> map = new HashMap<>();
for (PcworkRecordListResultDTO.StaffPatrol r : result.getList()) {
//秒变小时分钟
Integer minutes = r.getTotalTimeNum() / 60;
String patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟");
r.setTotalTime(patrolDuration);
if (map.containsKey(r.getGridId())) {
r.setGridName(map.get(r.getGridId()).getGridName());
continue;
@ -512,12 +517,6 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
r.setGridName(resultGrid.getData().getGridName());
map.put(r.getGridId(), resultGrid.getData());
}
//秒变小时分钟
Integer minutes = r.getTotalTimeNum() / 60;
String patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟");
r.setTotalTime(patrolDuration);
}
//3.封装数据并返回
resultDTO.setTotal((int)result.getTotal());

Loading…
Cancel
Save