Commit df6cf3e4 by 吴迪

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

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