Commit ddcdf2ef by 吴迪

修改bug 05.16-05.18

parent 5285653b
......@@ -9,9 +9,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
import io.office.modules.manage.entity.GlossaryEntity;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.sys.controller.AbstractController;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -101,6 +103,14 @@ public class AnnounceController extends AbstractController {
@RequestMapping("/delete")
@RequiresPermissions("manage:announce:delete")
public R delete(@RequestBody List<String> ids){
if(CollectionUtils.isNotEmpty(ids)) {
for (String id : ids) {
AnnounceEntity announceEntity = announceService.getById(id);
if(announceEntity.getLevels()==0) {
return R.error("当前级别为0不能删除!");
}
}
}
AnnounceEntity announce = new AnnounceEntity();
announce.setEditor(getUser().getUsername());
announce.setUpdatedate(new Date());
......
......@@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
......@@ -122,6 +123,14 @@ public class CasesController extends AbstractController {
@RequiresPermissions("standard:cases:delete")
public R delete(@RequestBody List<Long> ids){
try {
if (CollectionUtil.isNotEmpty(ids)) {
for (Long id : ids) {
CasesEntity casesEntity = casesService.getById(id);
if (casesEntity.getLevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.casesService.delete(ids, getUser());
return r;
} catch (Exception e) {
......
......@@ -4,12 +4,14 @@ 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.manage.entity.IndexCarouselManageEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.TopicnewsEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.TopicnewsService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -99,6 +101,15 @@ public class CenterController extends AbstractController {
@RequiresPermissions("manage:center:delete")
public R delete(@RequestBody List<Long> ids){
try {
if (CollectionUtils.isNotEmpty(ids)) {
for (Long id : ids) {
TopicnewsEntity topicnewsEntity = topicnewsService.getById(id);
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (topicnewsEntity.getNewslevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.topicnewsService.deleteHdbd(ids, getUser());
return r;
} catch (Exception e) {
......
......@@ -113,12 +113,7 @@ public class GlossaryController extends AbstractController {
@RequestMapping("/delete")
@RequiresPermissions("plate:glossary:delete")
public R delete(@RequestBody List<String> ids) {
GlossaryEntity glossary = new GlossaryEntity();
glossary.setEditor(getUser().getUsername());
glossary.setLasteditor(getUser().getUsername());
QueryWrapper<GlossaryEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id", ids);
glossaryService.update(glossary, queryWrapper);
glossaryService.removeByIds(ids);
return R.ok("术语删除成功!");
}
......
......@@ -6,11 +6,13 @@ 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.NewsMovieEntity;
import io.office.modules.manage.entity.TopicnewsEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.TopicnewsService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -100,6 +102,17 @@ public class HotFollowController extends AbstractController {
@RequiresPermissions("manage:hotFlow:delete")
public R delete(@RequestBody List<Long> ids){
try {
if (CollectionUtils.isNotEmpty(ids)) {
for (Long id : ids) {
TopicnewsEntity topicnewsEntity = topicnewsService.getById(id);
//NewsMovieEntity newsMovieEntity = (NewsMovieEntity) topicnewsEntity;
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (topicnewsEntity.getNewslevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.topicnewsService.deleteHdbd(ids, getUser());
return r;
} catch (Exception e) {
......
......@@ -19,6 +19,7 @@ import io.office.modules.manage.service.IndexCarouselManageService;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -146,9 +147,18 @@ public class IndexCarouselManageController extends AbstractController {
@SysLog("删除首页轮播[indexcarouselmanage]")
@RequestMapping("/delete")
@RequiresPermissions("manage:indexcarouselmanage:delete")
public R delete(@RequestBody Integer[] ids) {
public R delete(@RequestBody List<Integer> ids) {
try {
R r = indexCarouselManageService.deleteIndexCarouselManage(Arrays.asList(ids), getUser());
if (CollectionUtils.isNotEmpty(ids)) {
for (Integer id : ids) {
IndexCarouselManageEntity indexCarouselManageEntity = indexCarouselManageService.getById(id);
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (indexCarouselManageEntity.getLevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = indexCarouselManageService.deleteIndexCarouselManage(ids, getUser());
return r;
} catch (Exception e) {
log.error("indexCarouselManage delete error:", e);
......
......@@ -5,10 +5,12 @@ import java.util.Date;
import java.util.List;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
import io.office.modules.manage.entity.RetailpictureEntity;
import io.office.modules.manage.entity.dto.KnowledgeCategoryVo;
import io.office.modules.sys.controller.AbstractController;
......@@ -102,6 +104,16 @@ public class KnowledgeinfoController extends AbstractController {
@RequestMapping("/delete")
@RequiresPermissions("manage:knowledgeinfo:delete")
public R delete(@RequestBody List<String> knowledgeinfoids){
if (CollectionUtil.isNotEmpty(knowledgeinfoids)) {
for (String id : knowledgeinfoids) {
KnowledgeinfoEntity knowledgeinfoEntity = knowledgeinfoService.getById(id);
if (knowledgeinfoEntity.getLevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
KnowledgeinfoEntity knowledgeinfo = new KnowledgeinfoEntity();
knowledgeinfo.setEditor(getUser().getUsername());
knowledgeinfo.setLevels(0);
......
......@@ -5,8 +5,10 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.office.common.annotation.SysLog;
import io.office.modules.manage.entity.ProductEntity;
import io.office.modules.manage.utils.IdKeysConstant;
import io.office.modules.manage.utils.IdWorkerUtils;
import io.office.modules.sys.controller.AbstractController;
......@@ -98,9 +100,20 @@ public class LogisticsController extends AbstractController {
@RequestMapping("/delete")
@RequiresPermissions("manage:logistics:delete")
public R delete(@RequestBody List<String> ids){
if (CollectionUtil.isNotEmpty(ids)) {
for (String id : ids) {
LogisticsEntity logisticsEntity = logisticsService.getById(id);
if (logisticsEntity.getLevel() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
LogisticsEntity logistics = new LogisticsEntity();
String username = getUser().getUsername();
logistics.setEditor(username);
// logistics.setEditor(username);
logistics.setLasteditor(username);
logistics.setUpdatetime(new Date());
logistics.setLevel(0);
......
......@@ -6,11 +6,13 @@ import io.office.common.annotation.SysLog;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import io.office.modules.manage.entity.NewsMovieEntity;
import io.office.modules.manage.entity.NewtopicEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.NewsMovieService;
import io.office.modules.manage.vo.request.NewsMovieEntityVo;
import io.office.modules.sys.controller.AbstractController;
import io.office.modules.sys.entity.SysUserEntity;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
......@@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List;
/**
......@@ -101,13 +104,23 @@ public class NewsMovieController extends AbstractController {
@Transactional
@RequestMapping("/delete")
@RequiresPermissions("manage:newsmovie:delete")
public R delete(@RequestBody Integer[] ids) {
public R delete(@RequestBody List<Integer> ids) {
if (CollectionUtils.isNotEmpty(ids)) {
for (Integer id : ids) {
NewsMovieEntity newsMovieEntity = newsMovieService.getById(id);
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (newsMovieEntity.getLevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
SysUserEntity user = getUser();
NewsMovieEntity newsMovieEntity = new NewsMovieEntity();
newsMovieEntity.setLasteditor(user.getUsername());
newsMovieEntity.setLevels(0);
QueryWrapper<NewsMovieEntity> newsMovieEntityQueryWrapper = new QueryWrapper<>();
newsMovieEntityQueryWrapper.in("id", Arrays.asList(ids));
newsMovieEntityQueryWrapper.in("id", ids);
newsMovieService.update(newsMovieEntity, newsMovieEntityQueryWrapper);
return R.ok();
}
......
......@@ -3,15 +3,18 @@ package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.office.common.annotation.SysLog;
import io.office.modules.manage.entity.IndexCarouselManageEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.vo.request.NewtopicEntityVo;
import io.office.modules.sys.controller.AbstractController;
import io.office.modules.sys.entity.SysUserEntity;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -99,7 +102,17 @@ public class NewtopicController extends AbstractController {
@Transactional
@RequestMapping("/delete")
@RequiresPermissions("manage:newtopic:delete")
public R delete(@RequestBody Integer[] classids) {
public R delete(@RequestBody List<Integer> classids) {
if (CollectionUtils.isNotEmpty(classids)) {
for (Integer id : classids) {
NewtopicEntity newtopicEntity = newtopicService.getById(id);
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (newtopicEntity.getLevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
Date date = new Date();
SysUserEntity user = getUser();
NewtopicEntity newtopicEntity = new NewtopicEntity();
......@@ -107,7 +120,7 @@ public class NewtopicController extends AbstractController {
newtopicEntity.setLasteditor(user.getUsername());
newtopicEntity.setLevels(0);
QueryWrapper<NewtopicEntity> newtopicEntityQueryWrapper = new QueryWrapper<>();
newtopicEntityQueryWrapper.in("classid",Arrays.asList(classids));
newtopicEntityQueryWrapper.in("classid",classids);
newtopicService.update(newtopicEntity,newtopicEntityQueryWrapper);
return R.ok();
}
......
......@@ -4,10 +4,12 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.RetailpictureEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.TokenCountService;
......@@ -118,6 +120,19 @@ public class PartnersController extends AbstractController {
@RequiresPermissions("standard:partners:delete")
public R delete(@RequestBody List<Long> ids){
try {
if (CollectionUtil.isNotEmpty(ids)) {
for (Long id : ids) {
PartnersEntity partnersEntity = partnersService.getById(id);
// RetailpictureEntity retailpictureEntity = (RetailpictureEntity) partnersEntity;
// PolicyEntity policyEntity = (PolicyEntity) retailpictureEntity;
// NewsMovieEntity newsMovieEntity = (NewsMovieEntity) policyEntity;
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (partnersEntity.getLevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.partnersService.deletePartners(ids, getUser());
return r;
} catch (Exception e) {
......
......@@ -97,6 +97,8 @@ public class PcategoryController extends AbstractController {
@RequestMapping("/delete")
@RequiresPermissions("plate:pcategory:delete")
public R delete(@RequestBody Integer[] categoryids){
pcategoryService.removeByIds(Arrays.asList(categoryids));
return R.ok();
}
......
......@@ -10,16 +10,14 @@ 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;
import io.office.modules.manage.entity.*;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.entity.dto.PolicyParams;
import io.office.modules.manage.service.PolicyService;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -109,6 +107,17 @@ public class PolicyController extends AbstractController {
@RequiresPermissions("manage:policy:delete")
public R delete(@RequestBody Integer[] ids) {
try {
if (ids.length>0) {
for (Integer id : ids) {
PolicyEntity policyEntity = policyService.getById(id);
// NewsMovieEntity newsMovieEntity = (NewsMovieEntity) policyEntity;
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (policyEntity.getLevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.policyService.deletePolicy(ids, getUser());
return r;
} catch (Exception e) {
......@@ -217,7 +226,7 @@ public class PolicyController extends AbstractController {
}
//点击量+1
PolicyEntity policyUpdate = new PolicyEntity();
policyUpdate.setHits(policy.getHits()+1);
policyUpdate.setHits(policyUpdate.getHits()+1);
UpdateWrapper<PolicyEntity> updateWrapper = new UpdateWrapper();
updateWrapper.eq("id",id);
policyService.update(policyUpdate,updateWrapper);
......
......@@ -3,10 +3,12 @@ package io.office.modules.manage.controller;
import java.util.List;
import java.util.Map;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.CasesEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
......@@ -101,6 +103,16 @@ public class ProductController extends AbstractController {
@RequiresPermissions("plate:product:delete")
public R delete(@RequestBody List<Long> ids){
try {
if (CollectionUtil.isNotEmpty(ids)) {
for (Long id : ids) {
ProductEntity productEntity = productService.getById(id);
if (productEntity.getLevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.productService.deleteProduct(ids, getUser());
return r;
} catch (Exception e) {
......
......@@ -2,10 +2,13 @@ package io.office.modules.manage.controller;
import java.util.List;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mchange.v1.util.CollectionUtils;
import io.office.common.annotation.SysLog;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.PolicyEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.RetailPictureParams;
import io.office.modules.manage.service.TokenCountService;
......@@ -106,6 +109,19 @@ public class RetailpictureController extends AbstractController {
@RequiresPermissions("manage:retailPicture:delete")
public R delete(@RequestBody List<Long> ids){
try {
if (CollectionUtil.isNotEmpty(ids)) {
for (Long id : ids) {
RetailpictureEntity retailpictureEntity = retailpictureService.getById(id);
// PolicyEntity policyEntity = (PolicyEntity) retailpictureEntity;
// NewsMovieEntity newsMovieEntity = (NewsMovieEntity) policyEntity;
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (retailpictureEntity.getPiclevel() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.retailpictureService.deletePicture(ids, getUser());
return r;
} catch (Exception e) {
......
......@@ -4,12 +4,14 @@ 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.manage.entity.IndexCarouselManageEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.TopicnewsEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.TopicnewsService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -100,6 +102,17 @@ public class RulesAndRegulationsController extends AbstractController {
@RequiresPermissions("manage:rules:delete")
public R delete(@RequestBody List<Long> ids){
try {
if (CollectionUtils.isNotEmpty(ids)) {
for (Long id : ids) {
TopicnewsEntity topicnewsEntity = topicnewsService.getById(id);
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (topicnewsEntity.getNewslevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.topicnewsService.deleteHdbd(ids, getUser());
return r;
} catch (Exception e) {
......
......@@ -7,6 +7,7 @@ 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.IndexCarouselManageEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.TopicnewsEntity;
import io.office.modules.manage.entity.dto.NewsParams;
......@@ -14,6 +15,7 @@ import io.office.modules.manage.service.TopicnewsService;
import io.office.modules.manage.vo.request.TopicNewsPartyRequestVo;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -104,6 +106,17 @@ public class TopicnewsController extends AbstractController {
@RequiresPermissions("manage:topicnews:delete")
public R delete(@RequestBody List<Long> ids){
try {
if (CollectionUtils.isNotEmpty(ids)) {
for (Long id : ids) {
TopicnewsEntity topicnewsEntity = topicnewsService.getById(id);
//IndexCarouselManageEntity indexCarouselManageEntity = (IndexCarouselManageEntity) topicnewsEntity;
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (topicnewsEntity.getNewslevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.topicnewsService.deleteHdbd(ids, getUser());
return r;
} catch (Exception e) {
......
......@@ -61,7 +61,7 @@
and inputDate BETWEEN #{params.inputDateStart} AND #{params.inputDateEnd}
</if>
<choose>
<when test="params.pictureLevel !=null ">
<when test="params.pictureLevel !=null and params.pictureLevel !=0">
AND PicLevel = #{params.pictureLevel}
</when>
<otherwise>
......
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