diff --git a/ant-design-vue-jeecg/public/index.html b/ant-design-vue-jeecg/public/index.html
index d99759e..2ffd6a0 100644
--- a/ant-design-vue-jeecg/public/index.html
+++ b/ant-design-vue-jeecg/public/index.html
@@ -268,7 +268,7 @@
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/requiremententity/RequirementEntityList1.vue b/ant-design-vue-jeecg/src/views/requiremententity/RequirementEntityList1.vue
new file mode 100644
index 0000000..90d1715
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/requiremententity/RequirementEntityList1.vue
@@ -0,0 +1,382 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityForm.vue b/ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityForm.vue
new file mode 100644
index 0000000..2bc44a7
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityForm.vue
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityModal.vue b/ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityModal.vue
new file mode 100644
index 0000000..20fcb28
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityModal.vue
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityModal__Style#Drawer.vue
new file mode 100644
index 0000000..edfb89a
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityModal__Style#Drawer.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/requirementitem/RequirementItemList.vue b/ant-design-vue-jeecg/src/views/requirementitem/RequirementItemList.vue
index 1e94e75..56dbb56 100644
--- a/ant-design-vue-jeecg/src/views/requirementitem/RequirementItemList.vue
+++ b/ant-design-vue-jeecg/src/views/requirementitem/RequirementItemList.vue
@@ -119,6 +119,8 @@
拆分
+ 抽取对象
+
确认需求
@@ -129,6 +131,7 @@
+
@@ -143,12 +146,13 @@
import ModulexModal1 from "../modulex/modules/ModulexModal1";
import FunctionxModal1 from "../functionx/modules/FunctionxModal1";
import RulexModal1 from "../rulex/modules/RulexModal1";
+ import RequirementEntityList1 from "../requiremententity/RequirementEntityList1";
export default {
name: 'RequirementItemList',
mixins:[JeecgListMixin, mixinDevice],
components: {
- RequirementItemModal,ModulexModal1,FunctionxModal1,RulexModal1
+ RequirementItemModal,ModulexModal1,FunctionxModal1,RulexModal1,RequirementEntityList1
},
data () {
return {
@@ -171,8 +175,8 @@
dataIndex: 'projectId_dictText'
},
{
- title:'类型',
- align:"center",
+ title: '类型',
+ align: "center",
dataIndex: 'typeId_dictText'
},
{
@@ -310,6 +314,11 @@
}
});
},
+ cqdx(record){
+ this.$refs.rel1.showModal();
+ this.$refs.rel1.edit(record);
+ this.$refs.rel1.disableSubmit = false;
+ },
wdxq(){
this.searchQuerywdxq();
},
diff --git a/ant-design-vue-jeecg/src/views/requirementitem/modules/RequirementItemForm.vue b/ant-design-vue-jeecg/src/views/requirementitem/modules/RequirementItemForm.vue
index 3e06c82..c5cf02f 100644
--- a/ant-design-vue-jeecg/src/views/requirementitem/modules/RequirementItemForm.vue
+++ b/ant-design-vue-jeecg/src/views/requirementitem/modules/RequirementItemForm.vue
@@ -8,11 +8,31 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -28,14 +48,19 @@
+
+
+
+
+
-
+
-
+
@@ -43,13 +68,11 @@
-
-
-
-
-
-
-
+
+
+
+
+
@@ -78,25 +101,37 @@
},
data () {
return {
- disablecol:false,
- num:0,
- model:{
+ multi: false,
+ disablecol: false,
+ num: 0,
+ model: {
},
labelCol: {
- xs: { span: 24 },
- sm: { span: 5 },
+ xs: { span: 23 },
+ sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
+ labelCol1: {
+ xs: { span: 24 },
+ sm: { span: 3 },
+ },
+ wrapperCol1: {
+ xs: { span: 24 },
+ sm: { span: 20 },
+ },
confirmLoading: false,
validatorRules: {
projectId: [
{ required: true, message: '请输入项目!'},
],
- typeId: [
- { required: true, message: '请输入类型!'},
+ // typeId: [
+ // { required: true, message: '请输入类型!'},
+ // ],
+ typeName: [
+ { required: true, message: '请选择类型!'},
],
/* upperId: [
{ required: true, message: '请输入上级需求!'},
@@ -127,6 +162,9 @@
//备份model原始值
},
methods: {
+ popupCallback(value,row){
+ this.model = Object.assign(this.model, row);
+ },
getxqbm(){
if(this.model.upperId===undefined||this.model.upperId===null){
this.model.upperId = "";
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/controller/FunctionxController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/controller/FunctionxController.java
index ab5d776..bbde1a4 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/controller/FunctionxController.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/controller/FunctionxController.java
@@ -28,6 +28,7 @@ import org.jeecg.modules.demo.requirementfun.entity.RequirementFun;
import org.jeecg.modules.demo.requirementfun.service.IRequirementFunService;
import org.jeecg.modules.demo.requirementitem.entity.RequirementItem;
import org.jeecg.modules.demo.requirementitem.service.IRequirementItemService;
+import org.jeecg.modules.demo.rulex.service.IRulexService;
import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.modulex.service.IModulexService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
@@ -66,6 +67,9 @@ public class FunctionxController extends JeecgController {
+ @Autowired
+ private IRequirementEntityService requirementEntityService;
+
+ /**
+ * 分页列表查询
+ *
+ * @param requirementEntity
+ * @param pageNo
+ * @param pageSize
+ * @param req
+ * @return
+ */
+ @AutoLog(value = "需求实体抽取管理-分页列表查询")
+ @ApiOperation(value="需求实体抽取管理-分页列表查询", notes="需求实体抽取管理-分页列表查询")
+ @GetMapping(value = "/list")
+ public Result> queryPageList(RequirementEntity requirementEntity,
+ @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+ HttpServletRequest req) {
+ QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(requirementEntity, req.getParameterMap());
+ Page page = new Page(pageNo, pageSize);
+ IPage pageList = requirementEntityService.page(page, queryWrapper);
+ return Result.OK(pageList);
+ }
+
+ /**
+ * 添加
+ *
+ * @param requirementEntity
+ * @return
+ */
+ @AutoLog(value = "需求实体抽取管理-添加")
+ @ApiOperation(value="需求实体抽取管理-添加", notes="需求实体抽取管理-添加")
+ @PostMapping(value = "/add")
+ public Result> add(@RequestBody RequirementEntity requirementEntity) {
+ requirementEntityService.save(requirementEntity);
+ return Result.OK(requirementEntity);
+ }
+
+ /**
+ * 编辑
+ *
+ * @param requirementEntity
+ * @return
+ */
+ @AutoLog(value = "需求实体抽取管理-编辑")
+ @ApiOperation(value="需求实体抽取管理-编辑", notes="需求实体抽取管理-编辑")
+ @PutMapping(value = "/edit")
+ public Result> edit(@RequestBody RequirementEntity requirementEntity) {
+ requirementEntityService.updateById(requirementEntity);
+ return Result.OK("编辑成功!");
+ }
+
+ /**
+ * 通过id删除
+ *
+ * @param id
+ * @return
+ */
+ @AutoLog(value = "需求实体抽取管理-通过id删除")
+ @ApiOperation(value="需求实体抽取管理-通过id删除", notes="需求实体抽取管理-通过id删除")
+ @DeleteMapping(value = "/delete")
+ public Result> delete(@RequestParam(name="id",required=true) String id) {
+ requirementEntityService.removeById(id);
+ return Result.OK("删除成功!");
+ }
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return
+ */
+ @AutoLog(value = "需求实体抽取管理-批量删除")
+ @ApiOperation(value="需求实体抽取管理-批量删除", notes="需求实体抽取管理-批量删除")
+ @DeleteMapping(value = "/deleteBatch")
+ public Result> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+ this.requirementEntityService.removeByIds(Arrays.asList(ids.split(",")));
+ return Result.OK("批量删除成功!");
+ }
+
+ /**
+ * 通过id查询
+ *
+ * @param id
+ * @return
+ */
+ @AutoLog(value = "需求实体抽取管理-通过id查询")
+ @ApiOperation(value="需求实体抽取管理-通过id查询", notes="需求实体抽取管理-通过id查询")
+ @GetMapping(value = "/queryById")
+ public Result> queryById(@RequestParam(name="id",required=true) String id) {
+ RequirementEntity requirementEntity = requirementEntityService.getById(id);
+ if(requirementEntity==null) {
+ return Result.error("未找到对应数据");
+ }
+ return Result.OK(requirementEntity);
+ }
+
+ /**
+ * 导出excel
+ *
+ * @param request
+ * @param requirementEntity
+ */
+ @RequestMapping(value = "/exportXls")
+ public ModelAndView exportXls(HttpServletRequest request, RequirementEntity requirementEntity) {
+ return super.exportXls(request, requirementEntity, RequirementEntity.class, "需求实体抽取管理");
+ }
+
+ /**
+ * 通过excel导入数据
+ *
+ * @param request
+ * @param response
+ * @return
+ */
+ @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+ public Result> importExcel(HttpServletRequest request, HttpServletResponse response) {
+ return super.importExcel(request, response, RequirementEntity.class);
+ }
+
+}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/entity/RequirementEntity.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/entity/RequirementEntity.java
new file mode 100644
index 0000000..a194949
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/entity/RequirementEntity.java
@@ -0,0 +1,79 @@
+package org.jeecg.modules.demo.requiremententity.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 需求实体抽取管理
+ * @Author: jeecg-boot
+ * @Date: 2023-07-10
+ * @Version: V1.0
+ */
+@Data
+@TableName("requirement_entity")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="requirement_entity对象", description="需求实体抽取管理")
+public class RequirementEntity implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**主键*/
+ @TableId(type = IdType.ASSIGN_ID)
+ @ApiModelProperty(value = "主键")
+ private java.lang.String id;
+ /**创建人*/
+ @ApiModelProperty(value = "创建人")
+ private java.lang.String createBy;
+ /**创建日期*/
+ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty(value = "创建日期")
+ private java.util.Date createTime;
+ /**更新人*/
+ @ApiModelProperty(value = "更新人")
+ private java.lang.String updateBy;
+ /**更新日期*/
+ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty(value = "更新日期")
+ private java.util.Date updateTime;
+ /**所属部门*/
+ @ApiModelProperty(value = "所属部门")
+ private java.lang.String sysOrgCode;
+ /**需求id*/
+ @Excel(name = "需求id", width = 15, dictTable = "requirement_item", dicText = "requirement_name", dicCode = "id")
+ @Dict(dictTable = "requirement_item", dicText = "requirement_name", dicCode = "id")
+ @ApiModelProperty(value = "需求id")
+ private java.lang.String requirementId;
+ /**名称*/
+ @Excel(name = "名称", width = 15)
+ @ApiModelProperty(value = "名称")
+ private java.lang.String entityName;
+ /**英文名称*/
+ @Excel(name = "英文名称", width = 15)
+ @ApiModelProperty(value = "英文名称")
+ private java.lang.String entityEnName;
+ /**实体描述*/
+ @Excel(name = "实体描述", width = 15)
+ @ApiModelProperty(value = "实体描述")
+ private java.lang.String entityDescribe;
+ /**实体状态*/
+ @Excel(name = "实体状态", width = 15, dicCode = "entity_status")
+ @Dict(dicCode = "entity_status")
+ @ApiModelProperty(value = "实体状态")
+ private java.lang.Integer entityStatus;
+}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/mapper/RequirementEntityMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/mapper/RequirementEntityMapper.java
new file mode 100644
index 0000000..e2fe915
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/mapper/RequirementEntityMapper.java
@@ -0,0 +1,17 @@
+package org.jeecg.modules.demo.requiremententity.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 需求实体抽取管理
+ * @Author: jeecg-boot
+ * @Date: 2023-07-10
+ * @Version: V1.0
+ */
+public interface RequirementEntityMapper extends BaseMapper {
+
+}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/mapper/xml/RequirementEntityMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/mapper/xml/RequirementEntityMapper.xml
new file mode 100644
index 0000000..fa57acf
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/mapper/xml/RequirementEntityMapper.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/service/IRequirementEntityService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/service/IRequirementEntityService.java
new file mode 100644
index 0000000..cd54740
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/service/IRequirementEntityService.java
@@ -0,0 +1,14 @@
+package org.jeecg.modules.demo.requiremententity.service;
+
+import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 需求实体抽取管理
+ * @Author: jeecg-boot
+ * @Date: 2023-07-10
+ * @Version: V1.0
+ */
+public interface IRequirementEntityService extends IService {
+
+}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/service/impl/RequirementEntityServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/service/impl/RequirementEntityServiceImpl.java
new file mode 100644
index 0000000..c3c8506
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/service/impl/RequirementEntityServiceImpl.java
@@ -0,0 +1,19 @@
+package org.jeecg.modules.demo.requiremententity.service.impl;
+
+import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity;
+import org.jeecg.modules.demo.requiremententity.mapper.RequirementEntityMapper;
+import org.jeecg.modules.demo.requiremententity.service.IRequirementEntityService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 需求实体抽取管理
+ * @Author: jeecg-boot
+ * @Date: 2023-07-10
+ * @Version: V1.0
+ */
+@Service
+public class RequirementEntityServiceImpl extends ServiceImpl implements IRequirementEntityService {
+
+}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementitem/entity/RequirementItem.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementitem/entity/RequirementItem.java
index 75522d7..53b0968 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementitem/entity/RequirementItem.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementitem/entity/RequirementItem.java
@@ -62,11 +62,15 @@ public class RequirementItem implements Serializable {
@Dict(dictTable = "projectx", dicText = "project_name", dicCode = "id")
@ApiModelProperty(value = "项目id")
private java.lang.String projectId;
- /**类型id*/
- @Excel(name = "类型id", width = 15, dictTable = "requirement_type", dicText = "type_name", dicCode = "id")
- @Dict(dictTable = "requirement_type", dicText = "type_name", dicCode = "id")
+ /**类型id*/
+ @Excel(name = "类型id", width = 15, dictTable = "requirement_type", dicText = "type_name", dicCode = "id")
+ @Dict(dictTable = "requirement_type", dicText = "type_name", dicCode = "id")
@ApiModelProperty(value = "类型id")
private java.lang.String typeId;
+ /**类型*/
+ @Excel(name = "类型", width = 15)
+ @ApiModelProperty(value = "类型")
+ private java.lang.String typeName;
/**上级需求id*/
@Excel(name = "上级需求id", width = 15)
@ApiModelProperty(value = "上级需求id")
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/IRulexService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/IRulexService.java
index 7049105..0829b0c 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/IRulexService.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/IRulexService.java
@@ -18,4 +18,6 @@ public interface IRulexService extends IService {
Result> sort(String id);
List queryRuleListByFunctionId(Functionx functionx);
+
+ void saveRulex(Functionx functionx);
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/impl/RulexServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/impl/RulexServiceImpl.java
index 8b3babc..126b80e 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/impl/RulexServiceImpl.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/impl/RulexServiceImpl.java
@@ -1,16 +1,23 @@
package org.jeecg.modules.demo.rulex.service.impl;
+import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import org.jeecg.modules.demo.rulex.mapper.RulexMapper;
import org.jeecg.modules.demo.rulex.service.IRulexService;
+import org.jeecg.modules.fieldx.entity.Fieldx;
+import org.jeecg.modules.fieldx.service.IFieldxService;
+import org.jeecg.modules.tablex.entity.Tablex;
+import org.jeecg.modules.tablex.service.ITablexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
+import java.util.Date;
import java.util.List;
/**
@@ -19,39 +26,86 @@ import java.util.List;
* @Date: 2023-04-10
* @Version: V1.0
*/
+
+@Slf4j
@Service
public class RulexServiceImpl extends ServiceImpl implements IRulexService {
- @Autowired
- RulexMapper rulexMapper;
-
- @Override
- public Result> sort(String id) {
- String sort = rulexMapper.sort(id);
- String functioncode = rulexMapper.find(id);
- if (sort == null) {
- return Result.OK("001" + functioncode);
- } else {
- int i = Integer.parseInt(sort);
- i++;
- String s = Integer.toString(i);
- while (s.length() < 3) {
- s = "0" + s;
- }
- return Result.OK(s + functioncode);
+ @Autowired
+ RulexMapper rulexMapper;
+
+ @Autowired
+ private ITablexService iTablexService;
+
+ @Autowired
+ private IFieldxService iFieldxService;
+
+ @Override
+ public Result> sort(String id) {
+ String sort = rulexMapper.sort(id);
+ String functioncode = rulexMapper.find(id);
+ if (sort == null) {
+ return Result.OK("001" + functioncode);
+ } else {
+ int i = Integer.parseInt(sort);
+ i++;
+ String s = Integer.toString(i);
+ while (s.length() < 3) {
+ s = "0" + s;
+ }
+ return Result.OK(s + functioncode);
+ }
+ }
+
+ /**
+ * 根据功能id查询对应的规则
+ *
+ * @param functionx functionx
+ * @return {@link List}<{@link Rulex}>
+ */
+ @Override
+ public List queryRuleListByFunctionId(Functionx functionx) {
+ LambdaQueryWrapper ruleWrapper = new LambdaQueryWrapper<>();
+ ruleWrapper.eq(Rulex::getFunctionId, functionx.getId());
+ return this.list(ruleWrapper);
+ }
+
+ /**
+ * 功能管理新增规则操作时,如果功能类型是‘新增’和‘修改’,自动根据实体对应的字段,自动生成若干条记录(根据实体的字段生成多条规则)
+ *
+ * @param functionx
+ */
+ @Override
+ public void saveRulex(Functionx functionx) {
+ int functionType = functionx.getFunctionType().intValue();
+ if (1 == functionType || 3 == functionType) {
+ String moduleId = functionx.getModuleId();
+ Tablex tablex = iTablexService.getOne(new LambdaQueryWrapper().eq(Tablex::getModuleId, moduleId));
+ if (!ObjectUtils.isEmpty(tablex)) {
+ List fieldxList = iFieldxService.list(new LambdaQueryWrapper().eq(Fieldx::getTableId, tablex.getId()));
+ if (!ObjectUtils.isEmpty(fieldxList)) {
+ fieldxList.stream().forEach(o -> {
+ //主键字段不创建规则
+ if (0 == o.getIsPk()) {
+ Rulex rulex = new Rulex();
+ rulex.setModuleId(moduleId);
+ rulex.setTableId(tablex.getId());
+ rulex.setFunctionId(functionx.getId());
+ rulex.setFieldId(o.getId());
+ rulex.setCreateTime(new Date());
+ Result> result = this.sort(functionx.getId());
+ String roleCodeStr = result.getResult().toString();
+ log.info("-----------------the roleCodeStr:{}", roleCodeStr);
+ String ruleNo = roleCodeStr.substring(0, 3);
+ String ruleCode = roleCodeStr.substring(3) + ruleNo;
+ rulex.setRuleNo(ruleNo);
+ rulex.setRuleCode(ruleCode);
+ rulex.setPmDescribe(JSON.toJSONString(o));
+ this.save(rulex);
+ }
+ });
+ }
+ }
+ }
}
- }
-
- /**
- * 根据功能id查询对应的规则
- *
- * @param functionx functionx
- * @return {@link List}<{@link Rulex}>
- */
- @Override
- public List queryRuleListByFunctionId(Functionx functionx) {
- LambdaQueryWrapper ruleWrapper = new LambdaQueryWrapper<>();
- ruleWrapper.eq(Rulex::getFunctionId, functionx.getId());
- return this.list(ruleWrapper);
- }
}