update 标签管理-删除
This commit is contained in:
+4
-6
@@ -6,12 +6,10 @@ import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.modules.enums.FixedFieldEnum;
|
||||
import com.jero.modules.tag.entity.LawsTag;
|
||||
import com.jero.modules.tag.entity.LawsArea;
|
||||
import com.jero.modules.tag.enums.FileTableIdEnum;
|
||||
import com.jero.modules.tag.service.ILawsTagService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -98,7 +96,7 @@ public class LawsTagController extends JeroController<LawsTag, ILawsTagService>
|
||||
if(!existCgformTagList.isEmpty()){
|
||||
LawsTag lawsTagDB = existCgformTagList.get(0);
|
||||
//存在重复同名标签,且已删
|
||||
if(lawsTagDB.getIsDelete() == CommonConstant.DEL_FLAG_1){
|
||||
if(lawsTagDB.getDelFlag() == CommonConstant.DEL_FLAG_1){
|
||||
//判断属性类型是否一样
|
||||
if (lawsTagDB.getFieldShowType().equals(lawsTag.getFieldShowType())){
|
||||
//属性类型一样,恢复
|
||||
@@ -175,7 +173,7 @@ public class LawsTagController extends JeroController<LawsTag, ILawsTagService>
|
||||
//已存在同名的数据,不是正在编辑的这个
|
||||
} else {
|
||||
//有已删数据,恢复
|
||||
if (Objects.equals(lawsTagOld.getIsDelete(), CommonConstant.DEL_FLAG_1)) {
|
||||
if (Objects.equals(lawsTagOld.getDelFlag(), CommonConstant.DEL_FLAG_1)) {
|
||||
lawsTagService.updateDictDelFlag(CommonConstant.DEL_FLAG_0, lawsTagOld.getId());
|
||||
lawsTag.setId(lawsTagOld.getId());
|
||||
lawsTagService.editById(lawsTag);
|
||||
@@ -222,7 +220,7 @@ public class LawsTagController extends JeroController<LawsTag, ILawsTagService>
|
||||
//中英切换提示语
|
||||
return Result.error(MessageUtils.getMessage("tag.edit.固定字段,不可删除"));
|
||||
} else {
|
||||
lawsTagService.updateDictDelFlag(CommonConstant.DEL_FLAG_1,id);
|
||||
lawsTagService.removeById(id);
|
||||
////onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID),"normal");//逻辑删除-->改变状态,数据库不删
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -259,7 +257,7 @@ public class LawsTagController extends JeroController<LawsTag, ILawsTagService>
|
||||
result.error500("It contains fixed fields and cannot be deleted.");
|
||||
}
|
||||
} else {
|
||||
lawsTagService.updateDictDelFlag(CommonConstant.DEL_FLAG_1, midTag.getId());
|
||||
lawsTagService.removeById(midTag.getId());
|
||||
////onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID),"normal");//逻辑删除-->改变状态,数据库不删
|
||||
//中英切换提示语
|
||||
if(LanguageEnum.CN.getValue().equals(midTag.getCut())) {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.jero.modules.tag.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import lombok.Data;
|
||||
@@ -136,7 +133,8 @@ public class LawsTag implements Serializable {
|
||||
private Integer isShowSearch;
|
||||
|
||||
/**逻辑删除标识 0未删 1已删*/
|
||||
private Integer isDelete;
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
/**是否主键 0否 1是*/
|
||||
private Integer dbIsKey;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<result column="is_query" property="isQuery" />
|
||||
<result column="is_show_laws_list" property="isShowLawsList" />
|
||||
<result column="is_show_search" property="isShowSearch" />
|
||||
<result column="is_delete" property="isDelete" />
|
||||
<result column="delFlag" property="delFlag" />
|
||||
</resultMap>
|
||||
<select id="queryPageList" resultType="com.jero.modules.tag.entity.LawsTag">
|
||||
select f.id,f.create_by,f.create_time,f.update_by,f.update_time,f.cgform_head_id,
|
||||
|
||||
+5
-9
@@ -3,17 +3,14 @@ package com.jero.modules.tag.service.impl;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||
import com.jero.modules.enums.FixedFieldEnum;
|
||||
@@ -33,7 +30,6 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -68,7 +64,7 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
|
||||
//校验--逻辑删除
|
||||
Integer count=queryExitData(lawsTag);
|
||||
if (count > 0) {
|
||||
lawsTag.setIsDelete(CommonConstant.DEL_FLAG_0);
|
||||
lawsTag.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
} else {
|
||||
Integer inputOrderNum = lawsTag.getOrderNum();
|
||||
//查询展示顺序相同的
|
||||
@@ -120,7 +116,7 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
|
||||
lawsTag.setDbLength(2000); // 多选默认设置为2000,即可选择2000/36=55个属性
|
||||
}
|
||||
}
|
||||
lawsTag.setIsDelete(CommonConstant.DEL_FLAG_0);
|
||||
lawsTag.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
//if(lawsTag.getIsModel().equals(FileTableIdEnum.FILE_TABLE_IS_MODEL.getValue())) {//设置文档库-表id
|
||||
// lawsTag.setCgformHeadId(FileTableIdEnum.FILE_TABLE_ID.getValue());
|
||||
//}else {//设置文档拆分-表id
|
||||
@@ -227,7 +223,7 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
|
||||
lawsTag.setDbLength(2000);
|
||||
}
|
||||
}
|
||||
lawsTag.setIsDelete(CommonConstant.DEL_FLAG_0);
|
||||
lawsTag.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
lawsTag.setDbIsKey(Integer.valueOf(YesOrNoEnum.NO.getValue()));
|
||||
lawsTag.setDbIsNull(Integer.valueOf(YesOrNoEnum.YES.getValue()));
|
||||
//lawsTag.setDbPointLength(0); //默认为0
|
||||
@@ -351,7 +347,7 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
|
||||
queryWrapper.eq(LawsTag::getIsModel, lawsTag.getIsModel())
|
||||
.eq(LawsTag::getDbFieldTxt, lawsTag.getDbFieldTxt())
|
||||
.eq(LawsTag::getDbFieldEnName, lawsTag.getDbFieldEnName())
|
||||
.eq(LawsTag::getIsDelete,0);
|
||||
.eq(LawsTag::getDelFlag,0);
|
||||
}
|
||||
Integer count = lawsTagMapper.selectCount(queryWrapper);
|
||||
return count;
|
||||
@@ -368,7 +364,7 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
|
||||
if (StringUtils.isNotBlank(lawsArea.getShowArea())) {
|
||||
queryWrapper.select(LawsTag::getShowArea)
|
||||
.eq(LawsTag::getShowArea, lawsArea.getId())
|
||||
.eq(LawsTag::getIsDelete,0);
|
||||
.eq(LawsTag::getDelFlag,0);
|
||||
}
|
||||
Integer count = lawsTagMapper.selectCount(queryWrapper);
|
||||
return count;
|
||||
|
||||
Reference in New Issue
Block a user