Commit 863e08c5 authored by wzp's avatar wzp

修改bug

parent 859a53e3
......@@ -38,4 +38,6 @@ public interface AuditService extends IService<Audit> {
* @return
*/
boolean updateAuditAllById(Audit audit);
Audit selectOne(String id, String type);
}
......@@ -11,6 +11,7 @@ import cn.wisenergy.chnmuseum.party.service.AuditService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService;
import cn.wisenergy.chnmuseum.party.service.LearningContentService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
......@@ -137,6 +138,20 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
}
}
@Override
public Audit selectOne(String id, String type) {
UpdateWrapper<Audit> wrapper = new UpdateWrapper<>();
if (StringUtils.isNotBlank(id)) {
wrapper.eq("ref_item_id", id);
}
if (StringUtils.isNotBlank(type)) {
wrapper.eq("type", type);
}
wrapper.orderByDesc("create_time").last("limit 1");
Audit one = getOne(wrapper);
return one;
}
/**
* 初审级别的修改情况
*
......
......@@ -198,19 +198,8 @@ public class AuditController extends BaseController {
HashMap<String, Object> resultMap = new HashMap<>();
try {
Audit audit = null;
UpdateWrapper<Audit> wrapper = new UpdateWrapper<>();
if (StringUtils.isNotBlank(id)) {
wrapper.eq("ref_item_id", id);
}
if (StringUtils.isNotBlank(type)) {
wrapper.eq("type", type);
}
wrapper.orderByDesc("create_time");
//只获取最新的一条审核数据
List<Audit> list = auditService.list(wrapper);
if (list.size() > 0) {
audit = list.get(0);
}
audit = auditService.selectOne(id,type);
resultMap.put("resultCode", "200");
resultMap.put("message", "操作成功");
resultMap.put("data", audit);
......
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