Browse Source

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

dev_shibei_match
yinzuomei 4 years ago
parent
commit
6440da7568
  1. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
  2. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java
  3. 31
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java
  4. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  5. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml
  6. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  7. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java

@ -14,7 +14,7 @@ public class DemandRecResultDTO implements Serializable {
private static final long serialVersionUID = 1140730681599839420L;
private String demandRecId;
@JsonIgnore
//@JsonIgnore
private String gridId;
private String gridName;
private String agencyId;
@ -31,6 +31,7 @@ public class DemandRecResultDTO implements Serializable {
private String content;
private String reportUserName;
private String reportUserMobile;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date reportTime;
private String demandUserId;

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java

@ -35,6 +35,7 @@ import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.ExportCommunitySelfOrganizationExcel;
import com.epmet.excel.IcCommunitySelfOrganizationExcel;
import com.epmet.service.IcCommunitySelfOrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
@ -100,6 +101,12 @@ public class IcCommunitySelfOrganizationController {
ExcelUtils.exportExcelToTarget(response, null, list, IcCommunitySelfOrganizationExcel.class);
}
@PostMapping("exportcommunityselforganization")
public void exportCommunitySelfOrganization(HttpServletResponse response,@LoginUser TokenDto tokenDto,@RequestBody CommunitySelfOrganizationListFormDTO formDTO) throws Exception {
CommunitySelfOrganizationListResultDTO resultDTO = icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO);
ExcelUtils.exportExcelToTarget(response, null, resultDTO.getList(), ExportCommunitySelfOrganizationExcel.class);
}
/**
* @Description 添加社区自组织
* @param tokenDto

31
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java

@ -0,0 +1,31 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.CellStyler;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
@Data
public class ExportCommunitySelfOrganizationExcel {
@Excel(name = "排序")
private Integer sort;
@Excel(name = "组织名称", width = 40)
private String organizationName;
@Excel(name = "组织人数", width = 20)
private Integer organizationPersonCount;
@Excel(name = "负责人姓名", width = 20)
private String principalName;
@Excel(name = "负责人电话", width = 20)
private String principalPhone;
@Excel(name = "服务事项", width = 60)
private String serviceItem;
@Excel(name = "社区自组织创建时间", width = 20)
private String organizationCreatedTime;
}

15
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -43,6 +43,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN;
@ -213,7 +214,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
formDTO.setCustomerId(tokenDto.getCustomerId());
final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE};
CommunitySelfOrganizationListResultDTO result = new CommunitySelfOrganizationListResultDTO();
PageInfo<CommunitySelfOrganizationListDTO> objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO));
if (formDTO.getIsPage()){
PageInfo<CommunitySelfOrganizationListDTO> objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO));
result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal())));
if (CollectionUtils.isNotEmpty(objectPageInfo.getList())){
objectPageInfo.getList().forEach(l -> {
@ -224,6 +226,17 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
}
return result;
}
List<CommunitySelfOrganizationListDTO> resultDTOs = baseDao.selectCommunitySelfOrganizationList(formDTO);
if (CollectionUtils.isNotEmpty(resultDTOs)){
result.setTotal(resultDTOs.size());
AtomicReference<Integer> sort = new AtomicReference<>(NumConstant.ONE);
resultDTOs.forEach(r -> {
r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE));
});
result.setList(resultDTOs);
}
return result;
}
/**
* @Description 社区自组织删除

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

@ -54,7 +54,6 @@
so.LATITUDE AS latitude,
so.ID as orgId
FROM ic_community_self_organization so
# LEFT JOIN ic_community_self_organization_personnel op ON (op.ORG_ID = so.ID AND op.DEL_FLAG = 0)
WHERE so.DEL_FLAG = 0
AND so.ORG_ID = #{agencyId}
AND so.CUSTOMER_ID = #{customerId}
@ -62,10 +61,10 @@
AND so.ORGANIZATION_NAME LIKE CONCAT('%',#{organizationName},'%')
</if>
<if test=" null != startTime and startTime != '' ">
AND DATE_FORMAT(so.ORGANIZATION_CREATED_TIME,'%Y%m%d') <![CDATA[ >= ]]> #{startTime}
AND so.ORGANIZATION_CREATED_TIME <![CDATA[ >= ]]> #{startTime}
</if>
<if test="null != endTime and endTime != '' ">
AND DATE_FORMAT(so.ORGANIZATION_CREATED_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endTime}
AND so.ORGANIZATION_CREATED_TIME <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY so.ORGANIZATION_CREATED_TIME DESC
</select>

1
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -45,6 +45,7 @@
r.REPORT_TYPE as reportType,
r.REPORT_TIME as reportTime,
r.REPORT_USER_NAME as reportUserName,
r.REPORT_USER_MOBILE as reportUserMobile,
r.`STATUS` as status,
r.DEMAND_USER_ID as demandUserId,
r.DEMAND_USER_NAME as demandUserName,

18
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java

@ -48,7 +48,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -74,6 +76,14 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
@Override
@Transactional(rollbackFor = Exception.class)
public void add(AddPlacePatrolTeamFormDTO formDTO) {
//检验分队下添加的人员手机号唯一
Map<String, String> map = new HashMap<>();
formDTO.getMemberList().forEach(m -> {
if(map.containsKey(m.getMobile())){
throw new RenException(String.format("新增巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile()));
}
map.put(m.getMobile(),m.getName());
});
//1.分队主表新增数据
IcPlacePatrolTeamEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class);
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
@ -101,6 +111,14 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(EditPlacePatrolTeamFormDTO formDTO) {
//检验分队下添加的人员手机号唯一
Map<String, String> map = new HashMap<>();
formDTO.getMemberList().forEach(m -> {
if(map.containsKey(m.getMobile())){
throw new RenException(String.format("修改巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile()));
}
map.put(m.getMobile(),m.getName());
});
//1.修改分队主表信息
IcPlacePatrolTeamEntity entity = baseDao.selectById(formDTO.getTeamId());
if (null == entity) {

Loading…
Cancel
Save