Browse Source

删除、发布活动

master
yinzuomei 3 years ago
parent
commit
c02382f0a4
  1. 35
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java
  2. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java
  3. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActOrgDao.java
  4. 16
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java
  5. 51
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  6. 9
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml
  7. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActOrgDao.xml

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

@ -16,6 +16,7 @@ import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -38,7 +39,7 @@ public class IcPartyActController {
private IcPartyActService icPartyActService;
/**
* 添加修改活动
* 添加修改活动各端通用
* @param tokenDto
* @param formDTO
* @return
@ -141,5 +142,35 @@ public class IcPartyActController {
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<ActAndScheduleListResultDTO>>().ok(icPartyActService.homeSearch(formDTO));
}
/**
* pc活动列表-发布活动
* pc党建日历左下角列表点击发布
* 工作端小程序点击发布
* @param tokenDto
* @param icPartyActId
* @return
*/
@PostMapping("publish/{icPartyActId}")
public Result publicshIcPartyAct(@LoginUser TokenDto tokenDto,@PathVariable("icPartyActId")String icPartyActId){
icPartyActService.publicshIcPartyAct(tokenDto.getUserId(),icPartyActId);
return new Result();
}
/**
* pc活动列表-发布活动
* pc党建日历左下角列表点击删除
* pc生成年度记录删除活动
* 工作端小程序-详情页面删除
* @param tokenDto
* @param icPartyActIds
* @return
*/
@PostMapping("del")
public Result deleteIcPartyAct(@LoginUser TokenDto tokenDto,@RequestBody List<String> icPartyActIds){
if(CollectionUtils.isNotEmpty(icPartyActIds)){
icPartyActService.deleteIcPartyAct(tokenDto.getCustomerId(),tokenDto.getUserId(),icPartyActIds);
}
return new Result();
}
}

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java

@ -8,6 +8,7 @@ import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -37,4 +38,6 @@ public interface IcPartyActDao extends BaseDao<IcPartyActEntity> {
List<IcPartyActPageResultDTO> selectPageList(IcPartyActPageFormDTO formDTO);
String selectActTypeName(String actType);
int deleteIcPartyAct(@Param("customerId") String customerId, @Param("userId")String userId, @Param("icPartyActId")String icPartyActId);
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActOrgDao.java

@ -31,4 +31,6 @@ public interface IcPartyActOrgDao extends BaseDao<IcPartyActOrgEntity> {
* @return
*/
List<JoinOrgDTO> selectJoinOrgList(String icPartyActId);
int updateToDel(@Param("userId") String userId, @Param("icPartyActId") String icPartyActId);
}

16
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java

@ -80,4 +80,20 @@ public interface IcPartyActService extends BaseService<IcPartyActEntity> {
* @date 2022/8/19 14:01
*/
List<ActAndScheduleListResultDTO> homeSearch(ActAndScheduleListFormDTO formDTO);
/**
* * pc活动列表-发布活动
* pc党建日历左下角列表点击发布
* 工作端小程序点击发布
* @param userId
* @param icPartyActId
*/
void publicshIcPartyAct(String userId, String icPartyActId);
/**
* 删除活动
* @param userId
* @param icPartyActIds
*/
void deleteIcPartyAct(String customerId,String userId, List<String> icPartyActIds);
}

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

@ -497,4 +497,55 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
}
}
/**
* * pc活动列表-发布活动
* pc党建日历左下角列表点击发布
* 工作端小程序点击发布
*
* @param userId
* @param icPartyActId
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void publicshIcPartyAct(String userId, String icPartyActId) {
//谁发布的活动谁编辑
IcPartyActEntity icPartyActEntity = baseDao.selectById(icPartyActId);
if (null == icPartyActEntity) {
String msg = "未找到活动详情";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);
}
if(!userId.equals(icPartyActEntity.getCreatedBy())){
String msg = String.format("当前活动是%s发布的,您无权操作",icPartyActEntity.getPublishStaffName());
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);
}
icPartyActEntity.setIsPublish(NumConstant.ONE_STR);
icPartyActEntity.setUpdatedBy(userId);
baseDao.updateById(icPartyActEntity);
//发送消息
PartyMeetingMessageMQMsg msg = new PartyMeetingMessageMQMsg();
msg.setCustomerId(icPartyActEntity.getCustomerId());
msg.setIcPartyActId(icPartyActEntity.getId());
msg.setType("publish");
SendMqMsgUtil.build().openFeignClient(SpringContextUtils.getBean(EpmetMessageOpenFeignClient.class)).sendRocketMqMsg(SystemMessageType.PARTY_MEETING_MESSAGE, msg);
}
/**
* 删除活动
*
* @param userId
* @param icPartyActIds
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void deleteIcPartyAct(String customerId,String userId, List<String> icPartyActIds) {
if(CollectionUtils.isEmpty(icPartyActIds)){
return;
}
icPartyActIds.forEach(icPartyActId->{
//删除活动主表和参与活动党组织关系表记录
baseDao.deleteIcPartyAct(customerId,userId,icPartyActId);
icPartyActOrgDao.updateToDel(userId,icPartyActId);
});
}
}

9
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml

@ -123,4 +123,13 @@
WHERE
d.type_key = #{actType}
</select>
<update id="deleteIcPartyAct" parameterType="map">
update ic_party_act
set del_flag='1',
UPDATED_BY=#{userId},
UPDATED_TIME=now()
where customerId=#{customerId}
and id=#{icPartyActId}
</update>
</mapper>

8
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActOrgDao.xml

@ -26,4 +26,12 @@
o.DEL_FLAG = '0'
AND o.IC_PARTY_ACT_ID = #{icPartyActId}
</select>
<update id="updateToDel" parameterType="map">
update ic_party_act_org
set del_flag='1',
UPDATED_BY=#{userId},
UPDATED_TIME=now()
where IC_PARTY_ACT_ID=#{icPartyActId}
</update>
</mapper>
Loading…
Cancel
Save