Commit 139a4db5 authored by chenzhao's avatar chenzhao

增加批量删除约束条件

parent d57bf1e2
......@@ -19,6 +19,7 @@ import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -138,6 +139,14 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
public void deleteBatchData(List<Long> sequenceNbr){
List<JyjcInspectionApplication> jyjcInspectionApplications = this.getBaseMapper().selectBatchIds(sequenceNbr);
long count = jyjcInspectionApplications.stream().filter(e -> !e.getStatus().equals("已撤销") && !e.getStatus().equals("已撤回")).count();
if (count > 0){
throw new BadRequest("存在 非已撤销、已退回状态的报检单 不可删除!")
}
this.deleteBatchSeq(sequenceNbr);
for (Long seq : sequenceNbr) {
jyjcInspectionApplicationEquipService.getBaseMapper().deleteByApplicationSeq(seq);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment