Browse Source

tiyixia

master
yinzuomei 3 years ago
parent
commit
022ab84ed1
  1. 18
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/IcPartyActPageFormDTO.java
  2. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java
  3. 30
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java

18
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/IcPartyActPageFormDTO.java

@ -3,6 +3,7 @@ package com.epmet.resi.partymember.dto.icpartyact.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -13,7 +14,24 @@ import java.io.Serializable;
@Data
public class IcPartyActPageFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -8171649039313981541L;
// tokenDto取值
@NotBlank(message = "cusotomerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
@NotBlank(message = "publishStaffId不能为空",groups = AddUserInternalGroup.class)
private String publishStaffId;
/**
* 接口内部查询
* 当前登录用户所属的行政组织id
*/
private String staffAgencyId;
// 界面传参数
private String publishPartyOrgId;
private String startDate;
private String endDate;
private String address;
private String topic;
private String isPublish;
private String actType;
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java

@ -1,6 +1,7 @@
package com.epmet.modules.partyOrg.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -67,6 +68,7 @@ public class IcPartyActController {
public Result<PageData<IcPartyActPageResultDTO>> pageList(@LoginUser TokenDto tokenDto, @RequestBody IcPartyActPageFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setPublishStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
return new Result<PageData<IcPartyActPageResultDTO>>().ok(icPartyActService.pageList(formDTO));
}

30
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java

@ -85,10 +85,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
*/
@Override
public List<HomeMonthTotalResultDTO> getHomeMonthTotal(HomeMonthTotalFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
throw new EpmetException("查询工作人员失败:"+formDTO.getStaffId());
}
CustomerStaffInfoCacheResult staffInfo = queryStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setAgencyId(staffInfo.getAgencyId());
IcPartyOrgDTO icPartyOrgDTO = partyOrgService.get(formDTO.getOrgId());
if (null == icPartyOrgDTO){
@ -138,11 +135,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String, String> addOrUpdate(IcPartyActAddOrUpdateFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getPublishStaffId());
if (null == staffInfo) {
String msg = "查询工作人员信息异常";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);
}
CustomerStaffInfoCacheResult staffInfo=queryStaffInfo(formDTO.getCustomerId(),formDTO.getPublishStaffId());
IcPartyActEntity icPartyActEntity= ConvertUtils.sourceToTarget(formDTO,IcPartyActEntity.class);
icPartyActEntity.setAutoPublicTime(DateUtils.calDateBaseDay(formDTO.getHoldTime(),formDTO.getAutoPublicType()));
icPartyActEntity.setPublishStaffName(staffInfo.getRealName());
@ -181,6 +174,15 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
return map;
}
private CustomerStaffInfoCacheResult queryStaffInfo(String customerId, String staffId) {
CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(customerId,staffId);
if (null == staffInfo) {
String msg = "查询工作人员信息异常";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);
}
return staffInfo;
}
/**
* 活动列表-分页查询
@ -190,7 +192,10 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
*/
@Override
public PageData<IcPartyActPageResultDTO> pageList(IcPartyActPageFormDTO formDTO) {
//todo
CustomerStaffInfoCacheResult staffInfo = queryStaffInfo(formDTO.getCustomerId(),formDTO.getPublishStaffId());
formDTO.setStaffAgencyId(staffInfo.getAgencyId());
// todo
return null;
}
@ -216,10 +221,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
*/
@Override
public ActAndScheduleListResultDTO getActAndScheduleList(ActAndScheduleListFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
throw new EpmetException("查询工作人员失败:"+formDTO.getStaffId());
}
CustomerStaffInfoCacheResult staffInfo = queryStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId());
formDTO.setAgencyId(staffInfo.getAgencyId());
IcPartyOrgDTO icPartyOrgDTO = partyOrgService.get(formDTO.getOrgId());
if (null == icPartyOrgDTO){

Loading…
Cancel
Save