parent
530784f436
commit
cea9b2641a
30 changed files with 1669 additions and 204 deletions
@ -0,0 +1,60 @@ |
||||
<template> |
||||
<j-modal |
||||
:title="title" |
||||
:width="width" |
||||
:visible="visible" |
||||
switchFullscreen |
||||
@ok="handleOk" |
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||
@cancel="handleCancel" |
||||
cancelText="关闭"> |
||||
<skill-points-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></skill-points-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import SkillPointsForm from './SkillPointsForm' |
||||
export default { |
||||
name: 'SkillPointsModal', |
||||
components: { |
||||
SkillPointsForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:'', |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}) |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,84 @@ |
||||
<template> |
||||
<a-drawer |
||||
:title="title" |
||||
:width="width" |
||||
placement="right" |
||||
:closable="false" |
||||
@close="close" |
||||
destroyOnClose |
||||
:visible="visible"> |
||||
<skill-points-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></skill-points-form> |
||||
<div class="drawer-footer"> |
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> |
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> |
||||
</div> |
||||
</a-drawer> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import SkillPointsForm from './SkillPointsForm' |
||||
|
||||
export default { |
||||
name: 'SkillPointsModal', |
||||
components: { |
||||
SkillPointsForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:"操作", |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}); |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
/** Button按钮间距 */ |
||||
.ant-btn { |
||||
margin-left: 30px; |
||||
margin-bottom: 30px; |
||||
float: right; |
||||
} |
||||
.drawer-footer{ |
||||
position: absolute; |
||||
bottom: -8px; |
||||
width: 100%; |
||||
border-top: 1px solid #e8e8e8; |
||||
padding: 10px 16px; |
||||
text-align: right; |
||||
left: 0; |
||||
background: #fff; |
||||
border-radius: 0 0 2px 2px; |
||||
} |
||||
</style> |
@ -0,0 +1,119 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="父类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supertypeId"> |
||||
<j-search-select-tag v-model="model.supertypeId" dict="skill_type,type_name,id" placeholder="请选择父类型" ></j-search-select-tag> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeName"> |
||||
<a-input v-model="model.typeName" placeholder="请输入类型名称" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="skillDesc"> |
||||
<j-editor v-model="model.skillDesc" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="图标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="skillIcon"> |
||||
<j-image-upload isMultiple v-model="model.skillIcon" ></j-image-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form-model> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
|
||||
export default { |
||||
name: 'SkillTypeForm', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
model:{ |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
}, |
||||
url: { |
||||
add: "/skillType/skillType/add", |
||||
edit: "/skillType/skillType/edit", |
||||
queryById: "/skillType/skillType/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.edit(this.modelDefault); |
||||
}, |
||||
edit (record) { |
||||
this.model = Object.assign({}, record); |
||||
this.visible = true; |
||||
}, |
||||
submitForm () { |
||||
const that = this; |
||||
// 触发表单验证 |
||||
this.$refs.form.validate(valid => { |
||||
if (valid) { |
||||
that.confirmLoading = true; |
||||
let httpurl = ''; |
||||
let method = ''; |
||||
if(!this.model.id){ |
||||
httpurl+=this.url.add; |
||||
method = 'post'; |
||||
}else{ |
||||
httpurl+=this.url.edit; |
||||
method = 'put'; |
||||
} |
||||
httpAction(httpurl,this.model,method).then((res)=>{ |
||||
if(res.success){ |
||||
that.$message.success(res.message); |
||||
that.$emit('ok'); |
||||
}else{ |
||||
that.$message.warning(res.message); |
||||
} |
||||
}).finally(() => { |
||||
that.confirmLoading = false; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,178 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
||||
<a-row :gutter="24"> |
||||
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
||||
<!-- <a-button type="primary" icon="download" @click="handleExportXls('任务技能管理')">导出</a-button>--> |
||||
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> |
||||
<!-- <a-button type="primary" icon="import">导入</a-button>--> |
||||
<!-- </a-upload>--> |
||||
<!-- 高级查询区域 --> |
||||
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
||||
<a-dropdown v-if="selectedRowKeys.length > 0"> |
||||
<a-menu slot="overlay"> |
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> |
||||
</a-menu> |
||||
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> |
||||
</a-dropdown> |
||||
</div> |
||||
|
||||
<!-- table区域-begin --> |
||||
<div> |
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
||||
</div> |
||||
|
||||
<a-table |
||||
ref="table" |
||||
size="middle" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<template slot="htmlSlot" slot-scope="text"> |
||||
<div v-html="text"></div> |
||||
</template> |
||||
<template slot="imgSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
||||
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
||||
</template> |
||||
<template slot="fileSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<span slot="action" slot-scope="text, record"> |
||||
<a @click="handleEdit(record)">编辑</a> |
||||
<a-divider type="vertical" /> |
||||
|
||||
<a @click="handleDetail(record)">详情</a> |
||||
<a-divider type="vertical" /> |
||||
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
||||
<a>删除</a> |
||||
</a-popconfirm> |
||||
|
||||
</span> |
||||
|
||||
</a-table> |
||||
</div> |
||||
|
||||
<task-skill-modal ref="modalForm" @ok="modalFormOk"></task-skill-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import TaskSkillModal from './modules/TaskSkillModal' |
||||
|
||||
export default { |
||||
name: 'TaskSkillList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
TaskSkillModal |
||||
}, |
||||
data () { |
||||
return { |
||||
description: '任务技能管理管理页面', |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key:'rowIndex', |
||||
width:60, |
||||
align:"center", |
||||
customRender:function (t,r,index) { |
||||
return parseInt(index)+1; |
||||
} |
||||
}, |
||||
{ |
||||
title:'任务类型', |
||||
align:"center", |
||||
dataIndex: 'taskType_dictText' |
||||
}, |
||||
{ |
||||
title:'任务', |
||||
align:"center", |
||||
dataIndex: 'taskId_dictText' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/taskSkill/taskSkill/list", |
||||
delete: "/taskSkill/taskSkill/delete", |
||||
deleteBatch: "/taskSkill/taskSkill/deleteBatch", |
||||
exportXlsUrl: "/taskSkill/taskSkill/exportXls", |
||||
importExcelUrl: "taskSkill/taskSkill/importExcel", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'int',value:'taskType',text:'任务类型',dictCode:''}) |
||||
fieldList.push({type:'string',value:'taskId',text:'任务id',dictCode:''}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,138 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="技能点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="skillId"> |
||||
<j-dict-select-tag v-model="model.skillId" dictCode="skill_points,skill_name,id" placeholder="请选择技能点" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="任务类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskType"> |
||||
<j-dict-select-tag v-model="model.taskType" dictCode="task_type" @change="settask" placeholder="请选择任务类型" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskId"> |
||||
<j-dict-select-tag v-model="model.taskId" :dictCode="taskdict" placeholder="请选择任务" ></j-dict-select-tag> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form-model> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
|
||||
export default { |
||||
name: 'TaskSkillForm', |
||||
components: { |
||||
taskType:'' |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
taskdict:"a,a,a", |
||||
model:{ |
||||
taskId:'', |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
skillId: [ |
||||
{ required: true, message: '请选择技能点!'}, |
||||
], |
||||
taskType: [ |
||||
{ required: true, message: '请选择任务类型!'}, |
||||
], |
||||
taskId: [ |
||||
{ required: true, message: '请选择任务!'}, |
||||
], |
||||
}, |
||||
url: { |
||||
add: "/taskSkill/taskSkill/add", |
||||
edit: "/taskSkill/taskSkill/edit", |
||||
queryById: "/taskSkill/taskSkill/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
settask() { |
||||
if(this.model.taskType == '0'){ |
||||
this.taskdict="projectx,project_name,id" |
||||
}else if(this.model.taskType == '1'){ |
||||
this.taskdict="modulex,module_name,id" |
||||
}else if(this.model.taskType == '2'){ |
||||
this.taskdict="functionx,function_name,id" |
||||
}else if(this.model.taskType == '3'){ |
||||
this.taskdict="rulex,rule_code,id" |
||||
}else { this.taskdict=""} |
||||
this.model.taskId=''; |
||||
}, |
||||
add () { |
||||
this.edit(this.modelDefault); |
||||
}, |
||||
edit (record) { |
||||
this.model = Object.assign({}, record); |
||||
this.visible = true; |
||||
}, |
||||
submitForm () { |
||||
const that = this; |
||||
// 触发表单验证 |
||||
this.$refs.form.validate(valid => { |
||||
if (valid) { |
||||
that.confirmLoading = true; |
||||
let httpurl = ''; |
||||
let method = ''; |
||||
if(!this.model.id){ |
||||
httpurl+=this.url.add; |
||||
method = 'post'; |
||||
}else{ |
||||
httpurl+=this.url.edit; |
||||
method = 'put'; |
||||
} |
||||
httpAction(httpurl,this.model,method).then((res)=>{ |
||||
if(res.success){ |
||||
that.$message.success(res.message); |
||||
that.$emit('ok'); |
||||
}else{ |
||||
that.$message.warning(res.message); |
||||
} |
||||
}).finally(() => { |
||||
that.confirmLoading = false; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,179 @@ |
||||
package org.jeecg.modules.skillPoints.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.skillPoints.entity.SkillPoints; |
||||
import org.jeecg.modules.skillPoints.service.ISkillPointsService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 技能点管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="技能点管理") |
||||
@RestController |
||||
@RequestMapping("/skillPoints/skillPoints") |
||||
@Slf4j |
||||
public class SkillPointsController extends JeecgController<SkillPoints, ISkillPointsService> { |
||||
@Autowired |
||||
private ISkillPointsService skillPointsService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param skillPoints |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "技能点管理-分页列表查询") |
||||
@ApiOperation(value="技能点管理-分页列表查询", notes="技能点管理-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(SkillPoints skillPoints, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<SkillPoints> queryWrapper = QueryGenerator.initQueryWrapper(skillPoints, req.getParameterMap()); |
||||
Page<SkillPoints> page = new Page<SkillPoints>(pageNo, pageSize); |
||||
IPage<SkillPoints> pageList = skillPointsService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param skillPoints |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "技能点管理-添加") |
||||
@ApiOperation(value="技能点管理-添加", notes="技能点管理-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody SkillPoints skillPoints) { |
||||
String code = ""; |
||||
SkillPoints skillPoints1 = skillPointsService.getOne(new QueryWrapper<SkillPoints>().lambda().orderByDesc(SkillPoints::getSkillCode)); |
||||
if (skillPoints1 == null){ |
||||
code = "J0000000001"; |
||||
}else { |
||||
code = skillPoints1.getSkillCode()+1; |
||||
} |
||||
System.out.println(code); |
||||
skillPointsService.save(skillPoints); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param skillPoints |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "技能点管理-编辑") |
||||
@ApiOperation(value="技能点管理-编辑", notes="技能点管理-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody SkillPoints skillPoints) { |
||||
skillPointsService.updateById(skillPoints); |
||||
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) { |
||||
skillPointsService.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.skillPointsService.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) { |
||||
SkillPoints skillPoints = skillPointsService.getById(id); |
||||
if(skillPoints==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(skillPoints); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param skillPoints |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, SkillPoints skillPoints) { |
||||
return super.exportXls(request, skillPoints, SkillPoints.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, SkillPoints.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,90 @@ |
||||
package org.jeecg.modules.skillPoints.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-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("skill_points") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="skill_points对象", description="技能点管理") |
||||
public class SkillPoints implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**编码*/ |
||||
@Excel(name = "编码", width = 15) |
||||
@ApiModelProperty(value = "编码") |
||||
private java.lang.String skillCode; |
||||
/**类型*/ |
||||
@Excel(name = "类型", width = 15) |
||||
@ApiModelProperty(value = "类型") |
||||
@Dict(dictTable = "skill_type",dicText = "type_name",dicCode = "id") |
||||
private java.lang.Integer skillType; |
||||
/**技能点名称*/ |
||||
@Excel(name = "技能点名称", width = 15) |
||||
@ApiModelProperty(value = "技能点名称") |
||||
private java.lang.String skillName; |
||||
/**等级*/ |
||||
@Excel(name = "等级", width = 15) |
||||
@ApiModelProperty(value = "等级") |
||||
private java.lang.Integer skillLevel; |
||||
/**描述*/ |
||||
@Excel(name = "描述", width = 15) |
||||
@ApiModelProperty(value = "描述") |
||||
private java.lang.String skillDesc; |
||||
/**图标*/ |
||||
@Excel(name = "图标", width = 15) |
||||
@ApiModelProperty(value = "图标") |
||||
private java.lang.String skillIcon; |
||||
/**图片*/ |
||||
@Excel(name = "图片", width = 15) |
||||
@ApiModelProperty(value = "图片") |
||||
private java.lang.String skillPic; |
||||
/**技能点状态*/ |
||||
@Excel(name = "技能点状态", width = 15) |
||||
@ApiModelProperty(value = "技能点状态") |
||||
@Dict(dicCode = "skill_status") |
||||
private java.lang.Integer skillStatus; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
@Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") |
||||
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 = "修改人") |
||||
@Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") |
||||
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; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.skillPoints.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.skillPoints.entity.SkillPoints; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 技能点管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface SkillPointsMapper extends BaseMapper<SkillPoints> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace=".skillPoints.mapper.SkillPointsMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.skillPoints.service; |
||||
|
||||
import org.jeecg.modules.skillPoints.entity.SkillPoints; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 技能点管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ISkillPointsService extends IService<SkillPoints> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.skillPoints.service.impl; |
||||
|
||||
import org.jeecg.modules.skillPoints.entity.SkillPoints; |
||||
import org.jeecg.modules.skillPoints.mapper.SkillPointsMapper; |
||||
import org.jeecg.modules.skillPoints.service.ISkillPointsService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 技能点管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class SkillPointsServiceImpl extends ServiceImpl<SkillPointsMapper, SkillPoints> implements ISkillPointsService { |
||||
|
||||
} |
@ -0,0 +1,179 @@ |
||||
package org.jeecg.modules.skillType.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.skillType.entity.SkillType; |
||||
import org.jeecg.modules.skillType.service.ISkillTypeService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 技能类型管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="技能类型管理") |
||||
@RestController |
||||
@RequestMapping("/skillType/skillType") |
||||
@Slf4j |
||||
public class SkillTypeController extends JeecgController<SkillType, ISkillTypeService> { |
||||
@Autowired |
||||
private ISkillTypeService skillTypeService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param skillType |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "技能类型管理-分页列表查询") |
||||
@ApiOperation(value="技能类型管理-分页列表查询", notes="技能类型管理-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(SkillType skillType, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<SkillType> queryWrapper = QueryGenerator.initQueryWrapper(skillType, req.getParameterMap()); |
||||
Page<SkillType> page = new Page<SkillType>(pageNo, pageSize); |
||||
IPage<SkillType> pageList = skillTypeService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param skillType |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "技能类型管理-添加") |
||||
@ApiOperation(value="技能类型管理-添加", notes="技能类型管理-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody SkillType skillType) { |
||||
if (skillType.getSupertypeId() == null){ |
||||
skillType.setSupertypeId("-1"); |
||||
} |
||||
skillTypeService.save(skillType); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param skillType |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "技能类型管理-编辑") |
||||
@ApiOperation(value="技能类型管理-编辑", notes="技能类型管理-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody SkillType skillType) { |
||||
skillTypeService.updateById(skillType); |
||||
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) { |
||||
SkillType skillType = skillTypeService.getById(id); |
||||
List<SkillType> list = skillTypeService.list(new QueryWrapper<SkillType>().lambda().eq(SkillType::getSupertypeId, skillType.getId())); |
||||
if (!list.isEmpty()){ |
||||
return Result.error("该类型有子类型,无法删除"); |
||||
} |
||||
skillTypeService.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.skillTypeService.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) { |
||||
SkillType skillType = skillTypeService.getById(id); |
||||
if(skillType==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(skillType); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param skillType |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, SkillType skillType) { |
||||
return super.exportXls(request, skillType, SkillType.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, SkillType.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,73 @@ |
||||
package org.jeecg.modules.skillType.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-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("skill_type") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="skill_type对象", description="技能类型管理") |
||||
public class SkillType implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**类型名称*/ |
||||
@Excel(name = "类型名称", width = 15) |
||||
@ApiModelProperty(value = "类型名称") |
||||
private java.lang.String typeName; |
||||
/**父类型id*/ |
||||
@Excel(name = "父类型id", width = 15) |
||||
@ApiModelProperty(value = "父类型id") |
||||
@Dict(dictTable = "skill_type",dicText = "type_name",dicCode = "id") |
||||
private java.lang.String supertypeId; |
||||
/**描述*/ |
||||
@Excel(name = "描述", width = 15) |
||||
@ApiModelProperty(value = "描述") |
||||
private java.lang.String skillDesc; |
||||
/**图标*/ |
||||
@Excel(name = "图标", width = 15) |
||||
@ApiModelProperty(value = "图标") |
||||
private java.lang.String skillIcon; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
@Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") |
||||
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 = "修改人") |
||||
@Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") |
||||
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; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.skillType.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.skillType.entity.SkillType; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 技能类型管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface SkillTypeMapper extends BaseMapper<SkillType> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace=".skillType.mapper.SkillTypeMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.skillType.service; |
||||
|
||||
import org.jeecg.modules.skillType.entity.SkillType; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 技能类型管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ISkillTypeService extends IService<SkillType> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.skillType.service.impl; |
||||
|
||||
import org.jeecg.modules.skillType.entity.SkillType; |
||||
import org.jeecg.modules.skillType.mapper.SkillTypeMapper; |
||||
import org.jeecg.modules.skillType.service.ISkillTypeService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 技能类型管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class SkillTypeServiceImpl extends ServiceImpl<SkillTypeMapper, SkillType> implements ISkillTypeService { |
||||
|
||||
} |
@ -0,0 +1,171 @@ |
||||
package org.jeecg.modules.taskSkill.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.taskSkill.entity.TaskSkill; |
||||
import org.jeecg.modules.taskSkill.service.ITaskSkillService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 任务技能管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="任务技能管理") |
||||
@RestController |
||||
@RequestMapping("/taskSkill/taskSkill") |
||||
@Slf4j |
||||
public class TaskSkillController extends JeecgController<TaskSkill, ITaskSkillService> { |
||||
@Autowired |
||||
private ITaskSkillService taskSkillService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param taskSkill |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "任务技能管理-分页列表查询") |
||||
@ApiOperation(value="任务技能管理-分页列表查询", notes="任务技能管理-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(TaskSkill taskSkill, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<TaskSkill> queryWrapper = QueryGenerator.initQueryWrapper(taskSkill, req.getParameterMap()); |
||||
Page<TaskSkill> page = new Page<TaskSkill>(pageNo, pageSize); |
||||
IPage<TaskSkill> pageList = taskSkillService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param taskSkill |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "任务技能管理-添加") |
||||
@ApiOperation(value="任务技能管理-添加", notes="任务技能管理-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody TaskSkill taskSkill) { |
||||
taskSkillService.save(taskSkill); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param taskSkill |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "任务技能管理-编辑") |
||||
@ApiOperation(value="任务技能管理-编辑", notes="任务技能管理-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody TaskSkill taskSkill) { |
||||
taskSkillService.updateById(taskSkill); |
||||
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) { |
||||
taskSkillService.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.taskSkillService.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) { |
||||
TaskSkill taskSkill = taskSkillService.getById(id); |
||||
if(taskSkill==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(taskSkill); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param taskSkill |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, TaskSkill taskSkill) { |
||||
return super.exportXls(request, taskSkill, TaskSkill.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, TaskSkill.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,70 @@ |
||||
package org.jeecg.modules.taskSkill.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-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("task_skill") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="task_skill对象", description="任务技能管理") |
||||
public class TaskSkill implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**技能点id*/ |
||||
@Excel(name = "技能点id", width = 15) |
||||
@ApiModelProperty(value = "技能点id") |
||||
@Dict(dictTable = "skill_points", dicText = "skill_name", dicCode = "id") |
||||
private java.lang.String skillId; |
||||
/**任务类型*/ |
||||
@Excel(name = "任务类型", width = 15) |
||||
@ApiModelProperty(value = "任务类型") |
||||
@Dict(dicCode = "task_type") |
||||
private java.lang.Integer taskType; |
||||
/**任务id*/ |
||||
@Excel(name = "任务id", width = 15) |
||||
@ApiModelProperty(value = "任务id") |
||||
private java.lang.String taskId; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
@Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") |
||||
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 = "修改人") |
||||
@Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") |
||||
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; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.taskSkill.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.taskSkill.entity.TaskSkill; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 任务技能管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface TaskSkillMapper extends BaseMapper<TaskSkill> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace=".taskSkill.mapper.TaskSkillMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.taskSkill.service; |
||||
|
||||
import org.jeecg.modules.taskSkill.entity.TaskSkill; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 任务技能管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ITaskSkillService extends IService<TaskSkill> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.taskSkill.service.impl; |
||||
|
||||
import org.jeecg.modules.taskSkill.entity.TaskSkill; |
||||
import org.jeecg.modules.taskSkill.mapper.TaskSkillMapper; |
||||
import org.jeecg.modules.taskSkill.service.ITaskSkillService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 任务技能管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-05-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class TaskSkillServiceImpl extends ServiceImpl<TaskSkillMapper, TaskSkill> implements ITaskSkillService { |
||||
|
||||
} |
Loading…
Reference in new issue