Commit df6cf3e4 by 吴迪

编辑字段 最后编辑字段 修改提交

parent d244b3ef
......@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import io.office.common.annotation.SysLog;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
......@@ -20,6 +21,7 @@ import io.office.modules.manage.service.HomePopupService;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -32,7 +34,6 @@ import org.springframework.web.bind.annotation.RestController;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
......@@ -52,6 +53,10 @@ public class HomePopupController extends AbstractController {
private HomePopupService homePopupService;
@Autowired
private WebsiteHitCountDetailDao websiteHitCountDetailDao;
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
/**
* 列表
......@@ -64,7 +69,6 @@ public class HomePopupController extends AbstractController {
return R.ok().put("data", page);
}
/**
* 信息
*/
......@@ -115,11 +119,19 @@ public class HomePopupController extends AbstractController {
@RequestMapping("/delete")
//@RequiresPermissions("manage:homepopup:delete")
public R delete(@RequestBody String[] ids) {
homePopupService.removeByIds(Arrays.asList(ids));
if (ArrayUtils.isNotEmpty(ids)) {
for (String id : ids) {
UpdateWrapper<HomePopupEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("levels", 0);
updateWrapper.eq("id", id);
homePopupService.update(updateWrapper);
}
} else{
return R.error("请选择要删除的数据!");
}
return R.ok();
}
@SysLog("审核首页弹窗表")
@Transactional
@RequestMapping("/verify")
......@@ -131,14 +143,8 @@ public class HomePopupController extends AbstractController {
}
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
@RequestMapping("/api/getHomePopup/{id}/{token}")
public R getHomePopup(@PathVariable("id") Long id,@PathVariable("token") String token) {
public R getHomePopup(@PathVariable("id") Long id, @PathVariable("token") String token) {
if (StringUtils.isNotBlank(token)) {
......@@ -212,5 +218,4 @@ public class HomePopupController extends AbstractController {
}
}
......@@ -72,6 +72,7 @@ public class KnowledgeinfoController extends AbstractController {
knowledgeinfo.setInputdate(new Date());
knowledgeinfo.setEditor(getUser().getUsername());
knowledgeinfo.setStatus(0);
knowledgeinfo.setLasteditor(getUser().getUsername());
knowledgeinfoService.save(knowledgeinfo);
return R.ok("新增成功!");
}
......@@ -84,7 +85,8 @@ public class KnowledgeinfoController extends AbstractController {
@RequestMapping("/update")
@RequiresPermissions("manage:knowledgeinfo:update")
public R update(@RequestBody KnowledgeinfoEntity knowledgeinfo){
knowledgeinfo.setEditor(getUser().getUsername());
// knowledgeinfo.setEditor(getUser().getUsername());
knowledgeinfo.setLasteditor(getUser().getUsername());
knowledgeinfoService.updateById(knowledgeinfo);
return R.ok("修改成功!");
}
......@@ -108,7 +110,7 @@ public class KnowledgeinfoController extends AbstractController {
}
KnowledgeinfoEntity knowledgeinfo = new KnowledgeinfoEntity();
knowledgeinfo.setEditor(getUser().getUsername());
knowledgeinfo.setLasteditor(getUser().getUsername());
knowledgeinfo.setLevels(0);
QueryWrapper<KnowledgeinfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("knowledgeinfoid",knowledgeinfoids);
......@@ -127,6 +129,7 @@ public class KnowledgeinfoController extends AbstractController {
//knowledgeinfo.setAuditor(getUser().getUsername());
QueryWrapper<KnowledgeinfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("knowledgeinfoid",knowledgeinfo.getKnowledgeinfoid());
knowledgeinfo.setChecker(getUser().getUsername());
knowledgeinfoService.update(knowledgeinfo,queryWrapper);
return R.ok("审核成功!");
}
......
......@@ -3,10 +3,10 @@ package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
......@@ -76,4 +76,11 @@ public class KnowledgeinfoEntity implements Serializable {
@TableField(exist = false)
private String class2id;
private String lasteditor;
private String checker;
private String showtime;
}
......@@ -76,5 +76,8 @@ public class HomePopupForm implements Serializable {
*/
private String checkTime;
private Integer levels;
private String keyWord;
}
......@@ -82,6 +82,7 @@ public class HomePopupServiceImpl extends ServiceImpl<HomePopupDao, HomePopupEnt
homePopupEntity.setId(idWorkService.getSEQByKey(IdKeysConstant.ID_SEQ_KEY));
homePopupEntity.setAuthor(loginUser.getUsername());
homePopupEntity.setEditor(loginUser.getUsername());
homePopupEntity.setLastEditor(loginUser.getUsername());
homePopupEntity.setStatus(0);
homePopupEntity.setCreateTime(DateUtils.format(new Date(),DateUtils.DATE_TIME_PATTERN));
homePopupEntity.setUpdateTime(DateUtils.format(new Date(),DateUtils.DATE_TIME_PATTERN));
......
......@@ -58,6 +58,7 @@ public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, Know
.eq("status", 1);
// 设置排序
queryWrapper.orderByDesc("levels");
queryWrapper.orderByDesc("inputDate");
// 执行查询并返回结果
return baseMapper.selectList(queryWrapper);
}
......
......@@ -16,6 +16,9 @@
<result property="hits" column="hits"/>
<result property="status" column="status"/>
<result property="auditor" column="auditor"/>
<result property="lasteditor" column="lasteditor"/>
<result property="checker" column="checker"/>
<result property="showtime" column="showtime"/>
</resultMap>
<select id="knowledgeinfoList" resultMap="knowledgeinfoMap">
......
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