|
@@ -5,6 +5,9 @@ import com.hz.employmentsite.filter.exception.BaseErrorEnum;
|
|
|
import com.hz.employmentsite.filter.exception.BaseException;
|
|
|
import com.hz.employmentsite.filter.exception.BaseResponse;
|
|
|
import com.hz.employmentsite.filter.exception.RespGenerstor;
|
|
|
+import com.hz.employmentsite.mapper.PcRecommendMgtMapper;
|
|
|
+import com.hz.employmentsite.model.PcRecommendMgt;
|
|
|
+import com.hz.employmentsite.model.PcRecommendMgtExample;
|
|
|
import com.hz.employmentsite.services.service.AccountService;
|
|
|
import com.hz.employmentsite.services.service.companyService.PostService;
|
|
|
import com.hz.employmentsite.util.DateUtils;
|
|
@@ -29,6 +32,9 @@ public class PostController {
|
|
|
@Autowired
|
|
|
private AccountService accountService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PcRecommendMgtMapper pcRecommendMgtMapper;
|
|
|
+
|
|
|
@ResponseBody
|
|
|
@GetMapping("/getList")
|
|
|
public BaseResponse getList(@RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize,
|
|
@@ -121,8 +127,14 @@ public class PostController {
|
|
|
|
|
|
@ResponseBody
|
|
|
@PostMapping("/delete")
|
|
|
- public BaseResponse<Integer> delete(@RequestBody List<String> ids) {
|
|
|
- var result = postService.delete(ids);
|
|
|
+ public BaseResponse<Integer> delete(@RequestBody List<String> idList) {
|
|
|
+ PcRecommendMgtExample recommendMgtExp = new PcRecommendMgtExample();
|
|
|
+ recommendMgtExp.or().andPostIDIn(idList);
|
|
|
+ List<PcRecommendMgt> resultList = pcRecommendMgtMapper.selectByExample(recommendMgtExp).stream().toList();
|
|
|
+ if( resultList.size() > 0 ) {
|
|
|
+ throw new BaseException("1004","已存在该岗位的推荐数据,删除失败!");
|
|
|
+ }
|
|
|
+ var result = postService.delete(idList);
|
|
|
if (result <= 0) {
|
|
|
throw new BaseException(BaseErrorEnum.DELETE_NOT_DATA_ERROR);
|
|
|
}
|