|
|
@ -41,16 +41,11 @@ import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.modules.act.dao.ActOperationRecordDao; |
|
|
|
import com.epmet.modules.act.dao.ActReadRecordDao; |
|
|
|
import com.epmet.modules.act.dao.GroupActContentDao; |
|
|
|
import com.epmet.modules.act.dao.GroupActInfoDao; |
|
|
|
import com.epmet.modules.act.entity.ActOperationRecordEntity; |
|
|
|
import com.epmet.modules.act.entity.ActReadRecordEntity; |
|
|
|
import com.epmet.modules.act.entity.GroupActContentEntity; |
|
|
|
import com.epmet.modules.act.entity.GroupActInfoEntity; |
|
|
|
import com.epmet.modules.act.dao.*; |
|
|
|
import com.epmet.modules.act.entity.*; |
|
|
|
import com.epmet.modules.act.service.ActCategoryDictService; |
|
|
|
import com.epmet.modules.act.service.ActSignInRecordService; |
|
|
|
import com.epmet.modules.act.service.ActSummaryService; |
|
|
|
import com.epmet.modules.act.service.GroupActInfoService; |
|
|
|
import com.epmet.modules.constant.GroupActConstant; |
|
|
|
import com.epmet.modules.constant.UserMessageConstant; |
|
|
@ -118,7 +113,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr |
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private InvitationRecordService invitationRecordService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ActSummaryService actSummaryService; |
|
|
|
/** |
|
|
|
* 003、发布(编辑)组织活动 |
|
|
|
* |
|
|
@ -706,4 +702,46 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr |
|
|
|
resultDTO.setInvitationRecordId(formDTO.getInvitationRecordId()); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 017、关闭活动 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public void closeAct(CloseGroupActFormDTO formDTO) { |
|
|
|
GroupActInfoEntity actInfoEntity=baseDao.selectById(formDTO.getGroupActId()); |
|
|
|
//1、只有组长才可以关闭活动
|
|
|
|
ResiGroupMemberDTO groupMemberDTO = resiGroupMemberService.getLeaderMember(actInfoEntity.getGroupId()); |
|
|
|
if (!formDTO.getUserId().equals(groupMemberDTO.getCustomerUserId())) { |
|
|
|
throw new RenException(EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getCode(), EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getMsg()); |
|
|
|
} |
|
|
|
//2、活动已关闭,已取消,不能关闭
|
|
|
|
if (GroupActConstant.CLOSED.equals(actInfoEntity.getStatus())) { |
|
|
|
throw new RenException(EpmetErrorCode.GROUP_ACT_CAN_NOT_CANCEL.getCode(), EpmetErrorCode.GROUP_ACT_CAN_NOT_CANCEL.getMsg()); |
|
|
|
} else if (GroupActConstant.CANCELED.equals(actInfoEntity.getStatus())) { |
|
|
|
throw new RenException(EpmetErrorCode.GROUP_ACT_CAN_NOT_CANCEL.getCode(), EpmetErrorCode.GROUP_ACT_CAN_NOT_CANCEL.getMsg()); |
|
|
|
} |
|
|
|
ActSummaryEntity actSummaryEntity = actSummaryService.queryUserSummary(formDTO.getGroupActId(),formDTO.getUserId()); |
|
|
|
//3、没有填写总结,自动提交默认总结
|
|
|
|
if (actInfoEntity.getSummaryFlag() == NumConstant.ZERO && null == actSummaryEntity) { |
|
|
|
ActSummaryFormDTO actSummaryFormDTO=new ActSummaryFormDTO(); |
|
|
|
actSummaryFormDTO.setUserId(formDTO.getUserId()); |
|
|
|
actSummaryFormDTO.setGroupActId(formDTO.getGroupActId()); |
|
|
|
actSummaryService.submitActSummary(actSummaryFormDTO); |
|
|
|
} |
|
|
|
//4、插入操作日志
|
|
|
|
ActOperationRecordEntity actOperationRecordEntity = new ActOperationRecordEntity(); |
|
|
|
actOperationRecordEntity.setCustomerId(actInfoEntity.getCustomerId()); |
|
|
|
actOperationRecordEntity.setOperateUserId(formDTO.getUserId()); |
|
|
|
actOperationRecordEntity.setGroupActId(formDTO.getGroupActId()); |
|
|
|
actOperationRecordEntity.setOperationType(GroupActConstant.CLOSE); |
|
|
|
actOperationRecordDao.insert(actOperationRecordEntity); |
|
|
|
//5、更新关闭时间
|
|
|
|
actInfoEntity.setStatus(GroupActConstant.CLOSED); |
|
|
|
actInfoEntity.setClosedTime(actOperationRecordEntity.getCreatedTime()); |
|
|
|
baseDao.updateById(actInfoEntity); |
|
|
|
} |
|
|
|
} |