|
|
@@ -9,6 +9,7 @@ import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.banding.dto.AddBandingTaskDto;
|
|
|
+import com.xjrsoft.module.banding.dto.AddBandingTaskRuleDto;
|
|
|
import com.xjrsoft.module.banding.dto.BandingTaskPageDto;
|
|
|
import com.xjrsoft.module.banding.dto.UpdateBandingTaskDto;
|
|
|
import com.xjrsoft.module.banding.entity.BandingRule;
|
|
|
@@ -36,6 +37,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -96,6 +98,22 @@ public class BandingTaskController {
|
|
|
return RT.ok(isSuccess);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/set-rule")
|
|
|
+ @ApiOperation(value = "设置规则")
|
|
|
+ @SaCheckPermission("bandingtask:set-rule")
|
|
|
+ public RT<Boolean> setRule(@Valid @RequestBody AddBandingTaskRuleDto dto){
|
|
|
+ List<BandingTaskRule> ruleList = new ArrayList<>();
|
|
|
+ for (Long bandingRuleId : dto.getBandingRuleIds()) {
|
|
|
+ BandingTaskRule taskRule = new BandingTaskRule();
|
|
|
+ taskRule.setBandingTaskId(dto.getBandingTaskId());
|
|
|
+ taskRule.setBandingRuleId(bandingRuleId);
|
|
|
+ taskRule.setCreateDate(new Date());
|
|
|
+ ruleList.add(taskRule);
|
|
|
+ }
|
|
|
+ boolean isSuccess = taskRuleService.saveBatch(ruleList);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
@PutMapping
|
|
|
@ApiOperation(value = "修改新生分班任务")
|
|
|
@SaCheckPermission("bandingtask:edit")
|