Commit 772814ed authored by jiawei's avatar jiawei
parents d3f347bf 863e08c5
...@@ -38,4 +38,6 @@ public interface AuditService extends IService<Audit> { ...@@ -38,4 +38,6 @@ public interface AuditService extends IService<Audit> {
* @return * @return
*/ */
boolean updateAuditAllById(Audit audit); boolean updateAuditAllById(Audit audit);
Audit selectOne(String id, String type);
} }
...@@ -11,6 +11,7 @@ import cn.wisenergy.chnmuseum.party.service.AuditService; ...@@ -11,6 +11,7 @@ import cn.wisenergy.chnmuseum.party.service.AuditService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService; import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService;
import cn.wisenergy.chnmuseum.party.service.LearningContentService; import cn.wisenergy.chnmuseum.party.service.LearningContentService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -137,6 +138,20 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements ...@@ -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;
}
/** /**
* 初审级别的修改情况 * 初审级别的修改情况
* *
......
...@@ -199,19 +199,8 @@ public class AuditController extends BaseController { ...@@ -199,19 +199,8 @@ public class AuditController extends BaseController {
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
try { try {
Audit audit = null; 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); audit = auditService.selectOne(id,type);
if (list.size() > 0) {
audit = list.get(0);
}
resultMap.put("resultCode", "200"); resultMap.put("resultCode", "200");
resultMap.put("message", "操作成功"); resultMap.put("message", "操作成功");
resultMap.put("data", audit); resultMap.put("data", audit);
......
...@@ -509,6 +509,7 @@ public class TUserController extends BaseController { ...@@ -509,6 +509,7 @@ public class TUserController extends BaseController {
TUser entity = new TUser(); TUser entity = new TUser();
entity.setId(userId); entity.setId(userId);
entity.setStatus(AuditOperationEnum.ENABLE.name()); entity.setStatus(AuditOperationEnum.ENABLE.name());
entity.setAuditStatus(AuditStatusEnum.APPROVED_FINAL.name());
entity.setUpdateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis())); entity.setUpdateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
boolean ret = this.userService.updateById(entity); boolean ret = this.userService.updateById(entity);
if (!ret) { if (!ret) {
......
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