diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/BatchAddPartyActFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/BatchAddPartyActFormDTO.java new file mode 100644 index 0000000000..128eaaae3a --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/BatchAddPartyActFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.resi.partymember.dto.icpartyact.form; + +import lombok.Data; + +import javax.validation.Valid; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/8/22 12:25 + */ +@Data +public class BatchAddPartyActFormDTO implements Serializable { + private static final long serialVersionUID = 2616937693642413548L; + private List delActIds; + @Valid + private List actList; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java index 1f1ccfe249..d1dddac4a5 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.modules.partyOrg.service.IcPartyActService; +import com.epmet.resi.partymember.dto.icpartyact.form.BatchAddPartyActFormDTO; import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO; import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO; @@ -61,6 +62,30 @@ public class IcPartyActController { return new Result>().ok(map); } + /** + * 生成年度计划 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("batch-add") + public Result batchAdd(@LoginUser TokenDto tokenDto,@RequestBody BatchAddPartyActFormDTO formDTO){ + formDTO.getActList().forEach(dto->{ + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setPublishStaffId(tokenDto.getUserId()); + if(StringUtils.isNotBlank(dto.getIcPartyActId())){ + //修改活动 + ValidatorUtils.validateEntity(dto,IcPartyActAddOrUpdateFormDTO.UpdateUserShowGroup.class,IcPartyActAddOrUpdateFormDTO.UpdateUserInternalGroup.class); + }else{ + //添加活动 + ValidatorUtils.validateEntity(dto,IcPartyActAddOrUpdateFormDTO.AddUserShowGroup.class,IcPartyActAddOrUpdateFormDTO.AddUserInternalGroup.class); + } + icPartyActService.addOrUpdate(dto); + }); + icPartyActService.deleteIcPartyAct(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getDelActIds()); + return new Result(); + } + /** * 【活动列表】分页查询(工作端小程序通用) * @param tokenDto