Commit 5285653b by 吴迪

修改bug 05.16-05.18

parent d0037d5e
......@@ -60,6 +60,7 @@ public class BikecodeController {
@RequestMapping("/save")
// @RequiresPermissions("manage:bikecode:save")
public R save(@RequestBody BikecodeEntity bikecode){
bikecodeService.save(bikecode);
return R.ok();
......
......@@ -93,6 +93,7 @@ public class CasesController extends AbstractController {
cases.setLasteditor(getUser().getUsername());
cases.setRegisterdate(new Date());
cases.setUpdatedate(new Date());
cases.setStatus(0);
casesService.save(cases);
return R.ok("新增成功!");
}
......@@ -171,6 +172,8 @@ public class CasesController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (casesEntity.getStatus() != 1) {
return R.error("没有可显示的内容");
......
......@@ -70,6 +70,7 @@ public class DocController extends AbstractController {
@RequestMapping("/save")
@RequiresPermissions("manage:doc:save")
public R save(@RequestBody DocEntity doc){
doc.setStatus(0);
docService.save(doc);
return R.ok();
}
......
......@@ -93,6 +93,8 @@ public class IndexCarouselManageController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (indexCarouselManage.getCheckflagIndex() != 1) {
return R.error("没有可显示的内容");
......
......@@ -76,6 +76,7 @@ public class KnowledgeinfoController extends AbstractController {
public R save(@RequestBody KnowledgeinfoEntity knowledgeinfo){
knowledgeinfo.setInputdate(new Date());
knowledgeinfo.setEditor(getUser().getUsername());
knowledgeinfo.setStatus(0);
knowledgeinfoService.save(knowledgeinfo);
return R.ok("新增成功!");
}
......
......@@ -69,6 +69,7 @@ public class LogisticsController extends AbstractController {
String username = getUser().getUsername();
logistics.setEditor(username);
logistics.setLasteditor(username);
logistics.setStatus("0");
logisticsService.save(logistics);
return R.ok("新增成功!");
}
......
......@@ -72,6 +72,7 @@ public class MedicalController extends AbstractController {
medical.setInputDate(new Date());
medical.setEditor(username);
medical.setLasteditor(username);
medical.setStatus("0");
if(medical.getReleasetime()==null) {
medical.setReleasetime(new Date());
}
......@@ -181,7 +182,7 @@ public class MedicalController extends AbstractController {
@Value("${token.count}")
private int tokenCountConfig;
@PostMapping("/api/getDetailById")
@PostMapping({"/api/getDetailById"})
public R getDetailById(@RequestBody MedicalEntity medical) {
MedicalEntity medicalEntity = medicalService.getById(medical.getId());
if (medicalEntity == null) {
......@@ -198,6 +199,8 @@ public class MedicalController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (medicalEntity.getStatus()!=null && !medicalEntity.getStatus().equals("1")) {
return R.error("没有可显示的内容");
......
......@@ -5,7 +5,9 @@ import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
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 io.office.common.annotation.SysLog;
......@@ -220,10 +222,19 @@ public class NewsController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (news.getStatus() != 1) {
return R.error("没有可显示的内容");
}
//点击量+1
NewsEntity newsUpdate = new NewsEntity();
newsUpdate.setHits(news.getHits()+1);
UpdateWrapper<NewsEntity> updateWrapper = new UpdateWrapper();
updateWrapper.eq("id",id);
newsService.update(newsUpdate,updateWrapper);
}
return R.ok().put("data", news);
}
......@@ -386,6 +397,8 @@ public class NewsController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (announceEntity.getStatus() != 1) {
return R.error("没有可显示的内容");
......@@ -501,6 +514,8 @@ public class NewsController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (retMap.getStatus() != 1) {
return R.error("没有可显示的内容");
......@@ -604,7 +619,7 @@ public class NewsController extends AbstractController {
* 专题推荐
*/
@Login
@GetMapping({"/api/newsTopicInfo/{id}", ",/api/newsTopicInfo/{id}/{token}"})
@GetMapping({"/api/newsTopicInfo/{id}", "/api/newsTopicInfo/{id}/{token}"})
public R newsTopicInfo(@PathVariable("id") String id, @PathVariable(value = "token", required = false) String token) {
NewtopicEntity newtopic = newtopicService.getById(id);
if (newtopic == null) {
......@@ -621,6 +636,8 @@ public class NewsController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (newtopic.getCheckflag() != 1) {
return R.error("没有可显示的内容");
......@@ -779,6 +796,8 @@ public class NewsController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (newsMovie.getStatus() != 1) {
return R.error("没有可显示的内容");
......
......@@ -168,6 +168,8 @@ public class PartnersController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (partners.getStatus() != 1) {
return R.error("没有可显示的内容");
......
......@@ -211,6 +211,8 @@ public class PictureController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (picture.getStatus() != 1) {
return R.error("没有可显示的内容");
......
......@@ -4,11 +4,13 @@ import java.util.List;
import cn.hutool.core.util.StrUtil;
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 io.office.common.annotation.SysLog;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.PictureEntity;
import io.office.modules.manage.entity.PolicyEntity;
import io.office.modules.manage.entity.TokenCount;
......@@ -207,10 +209,18 @@ public class PolicyController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else{
if(StrUtil.equals("0",policy.getStatus())) {
return R.error("没有可显示的内容");
}
//点击量+1
PolicyEntity policyUpdate = new PolicyEntity();
policyUpdate.setHits(policy.getHits()+1);
UpdateWrapper<PolicyEntity> updateWrapper = new UpdateWrapper();
updateWrapper.eq("id",id);
policyService.update(policyUpdate,updateWrapper);
}
......
......@@ -142,9 +142,9 @@ public class ProductController extends AbstractController {
public R findPage(@RequestBody Map<String,String> param){
Page<ProductEntity> pag = this.productService.findPage(
new Page(Integer.valueOf(param.get("page")),
Integer.valueOf(param.get("size"))),param.get("id"));
Integer.valueOf(param.get("size"))),param.get("id"),param.get("token"));
PageUtils pageUtils = new PageUtils(pag);
if (pageUtils.getTotalCount() != 0) {
if (pageUtils.getTotalCount() == 0) {
return R.error("没有可显示的内容");
}
if (param.get("token") != null && StringUtils.isNotBlank(param.get("token").toString())) {
......@@ -158,10 +158,16 @@ public class ProductController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
ProductEntity productEntity = (ProductEntity) pageUtils.getList().get(0);
if (productEntity.getStatus() != 1) {
if (pageUtils.getTotalCount() == 0) {
return R.error("没有可显示的内容");
}else if(pageUtils.getTotalCount() == 1){
ProductEntity productEntity = (ProductEntity) pageUtils.getList().get(0);
if (productEntity.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
}
return R.ok().put("page", pageUtils);
......
......@@ -60,6 +60,7 @@ public class RetailController {
@RequestMapping("/save")
// @RequiresPermissions("manage:retail:save")
public R save(@RequestBody RetailEntity retail) {
retail.setStatus(0);
retailService.save(retail);
return R.ok();
......
......@@ -157,6 +157,8 @@ public class RetailpictureController extends AbstractController {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount);
} else {
if (picture.getStatus() != 1) {
return R.error("没有可显示的内容");
......
......@@ -41,6 +41,11 @@ public class TokenController extends AbstractController {
tokenCount.setCreateTime(DateUtils.getCurrentTime(DateUtils.FORMAT1));
tokenCount.setId(Long.parseLong(IdWorkerUtils.getSEQByKey(IdKeysConstant.ID_SEQ_KEY)));
tokenCount.setCountFlag(0);
tokenCountService.save(tokenCount);
return R.ok().put("data", token);
}
public static void main(String[] args) {
System.out.println(IdWorkerUtils.getSEQByKey(IdKeysConstant.ID_SEQ_KEY));
}
}
......@@ -19,5 +19,5 @@ import java.util.Map;
public interface ProductDao extends BaseMapper<ProductEntity> {
List<ProductEntity> selectProductList(@Param("params") Map<String, Object> params, Page page);
List<ProductEntity> findPage(Page page,@Param("id") Object id);
List<ProductEntity> findPage(Page page,@Param("id") Object id,@Param("token") String token);
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
......@@ -16,6 +18,7 @@ import java.io.Serializable;
public class TokenCount implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.INPUT)
private long id;
private String token;
......
......@@ -28,6 +28,6 @@ public interface ProductService extends IService<ProductEntity> {
Page<ProductEntity> selectProductList(Map<String, Object> params, Page page);
Page<ProductEntity> findPage(Page page,Object id);
Page<ProductEntity> findPage(Page page,Object id,String token);
}
......@@ -47,6 +47,7 @@ public class IndexCarouselManageServiceImpl extends ServiceImpl<IndexCarouselMan
indexCarouselManage.setCheckIndexAuthor(user.getUsername());
indexCarouselManage.setBriefShow(indexCarouselManage.getBrief());
indexCarouselManage.setLevelsIndex(indexCarouselManage.getLevels()-1);
indexCarouselManage.setCheckflagIndex(0);
int insert = baseMapper.insert(indexCarouselManage);
if (insert>0){
return R.ok("新增成功!");
......
......@@ -67,6 +67,7 @@ public class NewsMovieServiceImpl extends ServiceImpl<NewsMovieDao, NewsMovieEnt
newtopicEntityVo.setLittlepic(newtopicEntityVo.getPic());
newtopicEntityVo.setBigpic(newtopicEntityVo.getPic());
}
newtopicEntityVo.setStatus(0);
NewsMovieEntity newsMovieEntity = new NewsMovieEntity();
BeanUtils.copyProperties(newtopicEntityVo,newsMovieEntity);
baseMapper.insert(newsMovieEntity);
......
......@@ -50,6 +50,7 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
news.setLasteditor(user.getUsername());
news.setStartdate(new Date());
news.setPublicdate(new Date());
news.setStatus(0);
//二级栏目不为空时 classid取值二级栏目id值
if (news.getCclassid() != null&&StringUtils.isNotBlank(news.getCclassid().toString())) {
news.setClassid(news.getCclassid());
......
......@@ -38,6 +38,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductDao, ProductEntity> i
@Override
public R insertProduct(ProductEntity product, SysUserEntity user) {
product.setAdddate(new Date());
product.setStatus(0);
int insert = baseMapper.insert(product);
if (insert>0){
return R.ok("新增成功!");
......@@ -81,8 +82,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductDao, ProductEntity> i
}
@Override
public Page<ProductEntity> findPage(Page page,Object id) {
List<ProductEntity> list =this.productDao.findPage(page,id);
public Page<ProductEntity> findPage(Page page,Object id,String token) {
List<ProductEntity> list =this.productDao.findPage(page,id,token);
page.setRecords(list);
return page;
}
......
......@@ -54,6 +54,7 @@ public class TopicnewsServiceImpl extends ServiceImpl<TopicnewsDao, TopicnewsEnt
TopicnewsEntity topicnewsEntity = new TopicnewsEntity();
topicnewsEntity.setClassid(news.getClassid());
news.setClassid(35);
news.setStatus(0);
newsService.insertNews(news,user);
topicnewsEntity.setNewsid(news.getId());
topicnewsEntity.setNewslevels(news.getLevels());
......
......@@ -69,6 +69,10 @@
<if test="id!=null and id !=''">
and id =#{id}
</if>
<if test="token==null ||token==''">
and status > 0
</if>
ORDER BY levels DESC, adddate DESC
</select>
</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