|
@@ -1,5 +1,6 @@
|
|
|
package com.huimv.guowei.admin.group.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -56,14 +57,13 @@ public class GroupBatchServiceImpl extends ServiceImpl<GroupBatchMapper, GroupBa
|
|
|
Page<GroupBatch> page = new Page(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
QueryWrapper<GroupBatch> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("farm_id", farmId).like(StringUtils.isNotBlank(batchNum), "batch_num", batchNum)
|
|
|
- .orderByDesc("create_time");
|
|
|
+ .orderByDesc("id");
|
|
|
return new Result(ResultCode.SUCCESS, batchMapper.selectPage(page, queryWrapper));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Result add(GroupBatch groupBatch) {
|
|
|
- Integer count = batchMapper.selectCount(new QueryWrapper<GroupBatch>().eq("batch_num", groupBatch.getBatchNum())
|
|
|
- .eq("farm_id", groupBatch.getFarmId()));
|
|
|
+ Integer count = batchMapper.selectCount(new QueryWrapper<GroupBatch>().eq("batch_num", groupBatch.getBatchNum()));
|
|
|
if (count != 0) {
|
|
|
return new Result(10001, "添加失败,批次号已存在", false);
|
|
|
}
|
|
@@ -94,9 +94,13 @@ public class GroupBatchServiceImpl extends ServiceImpl<GroupBatchMapper, GroupBa
|
|
|
String id = paramsMap.get("id");
|
|
|
GroupBatch groupBatch = batchMapper.selectById(id);
|
|
|
String duckId = groupBatch.getDuckId();
|
|
|
- if (groupBatch.getDisable() == 0) {
|
|
|
+// if (groupBatch.getDisable() == 0) {
|
|
|
+// return new Result(10001,"删除失败,批次号未离场",false);
|
|
|
+// }
|
|
|
+
|
|
|
+ if (ObjectUtil.isNotEmpty(groupBatch.getDuckId()) && groupBatch.getDisable() == 0 ) {
|
|
|
return new Result(10001,"删除失败,批次号未离场",false);
|
|
|
- } else {
|
|
|
+ }else {
|
|
|
if (StringUtils.isNotBlank(duckId)) {
|
|
|
String[] split = duckId.split(",");
|
|
|
for (String muskId : split) {
|