Browse Source

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

dev
zxc 4 years ago
parent
commit
bdb7e50fa1
  1. 62
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentMiniFormDTO.java
  2. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
  3. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
  4. 57
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

62
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentMiniFormDTO.java

@ -0,0 +1,62 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/11/22 2:00 下午
* @DESC
*/
@Data
public class AppointmentMiniFormDTO implements Serializable {
private static final long serialVersionUID = -7113952715343314153L;
public interface AppointmentMiniForm{}
/**
* 事项ID
*/
@NotBlank(message = "matterId不能为空",groups = AppointmentMiniForm.class)
private String matterId;
/**
* 预约日期
*/
@NotBlank(message = "appointmentDate不能为空",groups = AppointmentMiniForm.class)
private String appointmentDate;
/**
* 预约编号
*/
@NotBlank(message = "timeId不能为空",groups = AppointmentMiniForm.class)
private String timeId;
/**
* 预约人
*/
private String appointmentName;
/**
* 预约电话
*/
private String appointmentPhone;
/**
* 备注
*/
private String remark;
/**
* 组织ID
*/
private String orgId;
/**
* 组织类型grid网格agency组织
*/
private String orgType;
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java

@ -155,6 +155,13 @@ public class IcPartyServiceCenterController {
return new Result();
}
@PostMapping("appointmentmini")
public Result appointmentMini(@RequestBody AppointmentMiniFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, AppointmentMiniFormDTO.AppointmentMiniForm.class);
icPartyServiceCenterService.appointmentMini(formDTO,tokenDto);
return new Result();
}
/**
* @Description 党群服务中心列表
* @param formDTO

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java

@ -133,6 +133,7 @@ public interface IcPartyServiceCenterService extends BaseService<IcPartyServiceC
* @date 2021/11/22 2:06 下午
*/
void appointment(AppointmentFormDTO formDTO,TokenDto tokenDto);
void appointmentMini(AppointmentMiniFormDTO formDTO,TokenDto tokenDto);
/**
* @Description 党群服务中心列表

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

@ -35,6 +35,7 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.PartyServiceCenterConstant;
import com.epmet.dao.IcMatterAppointmentRecordDao;
import com.epmet.dao.IcPartyServiceCenterDao;
@ -45,6 +46,7 @@ import com.epmet.dto.result.*;
import com.epmet.entity.IcMatterAppointmentRecordEntity;
import com.epmet.entity.IcPartyServiceCenterEntity;
import com.epmet.entity.IcPartyServiceCenterMatterEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.IcPartyServiceCenterMatterService;
import com.epmet.service.IcPartyServiceCenterService;
import org.apache.commons.collections4.CollectionUtils;
@ -75,6 +77,8 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
private IcPartyServiceCenterMatterService matterService;
@Autowired
private IcMatterAppointmentRecordDao matterAppointmentRecordDao;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
@Override
public PageData<IcPartyServiceCenterDTO> page(Map<String, Object> params) {
@ -313,6 +317,59 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
matterAppointmentRecordDao.insert(e);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void appointmentMini(AppointmentMiniFormDTO formDTO, TokenDto tokenDto) {
String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
.eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getAppointmentDate())
.eq(IcMatterAppointmentRecordEntity::getStatus,PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING)
.eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO);
List<IcMatterAppointmentRecordEntity> records = matterAppointmentRecordDao.selectList(l);
Result<ResiUserBaseInfoResultDTO> userInfoResult = userOpenFeignClient.selectUserBaseInfo(tokenDto);
if (!userInfoResult.success()){
throw new EpmetException("查询用户信息失败...");
}
formDTO.setAppointmentName(userInfoResult.getData().getRealName());
formDTO.setAppointmentPhone(userInfoResult.getData().getMobile());
if (CollectionUtils.isNotEmpty(records)){
List<String> timeIds = new ArrayList<>();
records.forEach(r -> {
timeIds.addAll(Arrays.asList(r.getTimeId().split(",")));
});
List<String> formTimeId = Arrays.asList(formDTO.getTimeId().split(","));
int before = timeIds.size() + formTimeId.size();
List<String> endTimeId = new ArrayList<>();
endTimeId.addAll(timeIds);endTimeId.addAll(formTimeId);
List<String> collect = endTimeId.stream().distinct().collect(Collectors.toList());
if (collect.size() < before){
throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode());
}
}
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
if (null == staffInfo){
throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId()));
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
if (null == agencyInfo){
throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId()));
}
IcMatterAppointmentRecordEntity e = ConvertUtils.sourceToTarget(formDTO, IcMatterAppointmentRecordEntity.class);
e.setCustomerId(customerId);
if (StringUtils.isNotBlank(formDTO.getOrgId())){
e.setOrgId(formDTO.getOrgId());
e.setOrgType(formDTO.getOrgType());
}else {
e.setOrgId(staffInfo.getAgencyId());
e.setOrgType(PartyServiceCenterConstant.ORG_TYPE_AGENCY);
}
e.setPid(agencyInfo.getPid());
e.setPids(agencyInfo.getPids());
e.setStatus(PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING);
matterAppointmentRecordDao.insert(e);
}
/**
* @Description 党群服务中心列表
* @param formDTO

Loading…
Cancel
Save