Browse Source

Merge branch 'develop' into release_temp

dev
zhaoqifeng 4 years ago
parent
commit
2248e362d3
  1. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
  2. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BasicInfoResultDTO.java
  3. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java
  4. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
  5. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  6. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
  7. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java
  8. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java
  9. 17
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

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

@ -176,6 +176,8 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
if (CollectionUtils.isEmpty(data)){
return new ArrayList<>();
}
/*gridStaff.stream().forEach(g -> data.stream().filter(d -> g.getStaffId().equals(d.getStaffId()) && g.getGridId().equals(d.getGridId())).forEach(d -> g.setMobile(d.getMobile())));
return gridStaff.stream().filter(g -> StringUtils.isNotBlank(g.getMobile())).collect(Collectors.toList());*/
return data;
}

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BasicInfoResultDTO.java

@ -1,7 +1,6 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java

@ -16,7 +16,7 @@ public class StaffBasicInfoResultDTO implements Serializable {
* 客户Id
*/
private String customerId;
private String customerName;
/**
* 用户Id
*/

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

@ -138,6 +138,8 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
*/
List<GridStaffResultDTO> staffGridRole(@Param("forms") List<GridStaffResultDTO> forms);
List<GridStaffResultDTO> staffGridRoleByIds(@Param("ids") List<String> ids);
/**
* @Description 查询角色
* @Param userIds

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

@ -742,6 +742,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
resultDTO.setLongitude(staffInfo.getLongitude());
resultDTO.setLatitude(staffInfo.getLatitude());
}
//获取工作人员所属客户名
CustomerDTO dto = new CustomerDTO();
dto.setId(customerId);
Result<CustomerDTO> customerResult = operCrmOpenFeignClient.getCustomerInfo(dto);
if (!customerResult.success()) {
throw new RenException(customerResult.getCode(), customerResult.getMsg());
}
if (null != customerResult.getData()) {
resultDTO.setCustomerName(customerResult.getData().getCustomerName());
}
}
return new Result<StaffBasicInfoResultDTO>().ok(resultDTO);
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java

@ -112,7 +112,7 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW
public void add(PatrolRoutineWorkFormDTO formDTO) {
PatrolRoutineWorkEntity entity = null;
try {
if (formDTO.getWorkTypeList().toString().contains("02")
if (formDTO.getWorkTypeList().toString().startsWith("02")
&& (formDTO.getIsKeyPeopleLocate() == null || StringUtils.isBlank(formDTO.getKeyPeopleStatus()))) {
log.warn("add patrolRoutineWork fail,param is error,param:{}", JSON.toJSONString(formDTO));
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode());

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

@ -119,8 +119,8 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
result.setStaffPatrolRecId(entity.getId());
result.setStatus(entity.getStatus());
result.setLatestSerialNum(PatrolConstant.END.equals(entity.getStatus()) ? NumConstant.ONE_NEG : detail.getSerialNum());
//最小间隔设置 3*60s
result.setCarmDown(NumConstant.THREE * NumConstant.SIXTY);
//最小间隔设置 20s
result.setCarmDown(NumConstant.TWENTY);
result.setPatrolStartTime(DateUtils.format(entity.getPatrolStartTime(), DateUtils.DATE_TIME_PATTERN));
//状态为巡查中时返回所在网格ID和名称
if (PatrolConstant.PATROLLING.equals(entity.getStatus())) {

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -32,6 +32,7 @@ import com.epmet.entity.StaffRoleEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.StaffRoleService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -136,6 +137,8 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
if (CollectionUtils.isEmpty(forms)){
return new ArrayList<>();
}
List<String> userIds = forms.stream().map(m -> m.getStaffId()).distinct().collect(Collectors.toList());
// List<GridStaffResultDTO> result = baseDao.staffGridRoleByIds(userIds);
List<GridStaffResultDTO> result = baseDao.staffGridRole(forms);
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();

17
epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

@ -210,6 +210,23 @@
</foreach>
</select>
<select id="staffGridRoleByIds" resultType="com.epmet.dto.result.GridStaffResultDTO">
SELECT
sr.org_id as gridId,
sr.STAFF_ID,
cs.MOBILE
FROM staff_role sr
LEFT JOIN gov_staff_role gsr ON gsr.ID = sr.ROLE_ID AND gsr.DEL_FLAG = 0
LEFT JOIN customer_staff cs ON cs.USER_ID = sr.STAFF_ID AND cs.customer_id = sr.customer_id AND cs.DEL_FLAG = 0
WHERE sr.DEL_FLAG = 0
AND gsr.ROLE_KEY = 'grid_member'
AND sr.STAFF_ID in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</select>
<!-- 查询角色 -->
<select id="getRolesByDB" resultType="com.epmet.dto.result.RoleKeyValueResultDTO">
SELECT

Loading…
Cancel
Save