部署服务-环境维护
This commit is contained in:
parent
c3c25761ea
commit
63dbc08425
@ -137,10 +137,10 @@ file:
|
|||||||
defaultMaxSize: 52428800
|
defaultMaxSize: 52428800
|
||||||
access:
|
access:
|
||||||
#key: iEJhVfZ8ColMeAnooVFx
|
#key: iEJhVfZ8ColMeAnooVFx
|
||||||
key: UVtE4aBgbzCfYthfCV9P
|
key: CvproVoq7XiXDTK1RLFT
|
||||||
secret:
|
secret:
|
||||||
#key: SNTORcnq76xiaegoJ7Ap7Clldoq8HJUXqyn484o0
|
#key: SNTORcnq76xiaegoJ7Ap7Clldoq8HJUXqyn484o0
|
||||||
key: 5rOuC0FPPrD2qEj2Eux4sGKKDgAKQ6dEatfLJOpZ
|
key: dekJkBHBkO4HccNKsiqAC2mkeNxVKEWSRoll3yqp
|
||||||
bucket:
|
bucket:
|
||||||
#name: ruoyi
|
#name: ruoyi
|
||||||
name: sc-device-manage
|
name: sac
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.sf.common.core.domain.entity;
|
package com.sf.common.core.domain.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Pattern;
|
import javax.validation.constraints.Pattern;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
@ -34,6 +36,8 @@ public class SysDictType extends BaseEntity
|
|||||||
/** 状态(0正常 1停用) */
|
/** 状态(0正常 1停用) */
|
||||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private List<SysDictData> sysDictDataList;
|
||||||
|
|
||||||
public Long getDictId()
|
public Long getDictId()
|
||||||
{
|
{
|
||||||
@ -80,7 +84,15 @@ public class SysDictType extends BaseEntity
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public List<SysDictData> getSysDictDataList() {
|
||||||
|
return sysDictDataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSysDictDataList(List<SysDictData> sysDictDataList) {
|
||||||
|
this.sysDictDataList = sysDictDataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("dictId", getDictId())
|
.append("dictId", getDictId())
|
||||||
|
@ -0,0 +1,67 @@
|
|||||||
|
package com.sf.system.deployment.service.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.sf.common.annotation.Log;
|
||||||
|
import com.sf.common.core.controller.BaseController;
|
||||||
|
import com.sf.common.core.domain.AjaxResult;
|
||||||
|
import com.sf.common.core.domain.entity.SysDictData;
|
||||||
|
import com.sf.common.core.domain.entity.SysDictType;
|
||||||
|
import com.sf.common.core.page.TableDataInfo;
|
||||||
|
import com.sf.common.enums.BusinessType;
|
||||||
|
import com.sf.system.service.ISysDictDataService;
|
||||||
|
import com.sf.system.service.ISysDictTypeService;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 部署服务-环境维护
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/deployment/service/server")
|
||||||
|
public class DeploymentServerController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ISysDictTypeService dictTypeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDictDataService dictDataService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询应用环境维护列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('deployment:service:server:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysDictType dictType) {
|
||||||
|
startPage();
|
||||||
|
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||||
|
// 查询字典数据
|
||||||
|
for (SysDictType sysDictType : list) {
|
||||||
|
List<SysDictData> data = dictTypeService.selectDictDataByType(sysDictType.getDictType());
|
||||||
|
sysDictType.setSysDictDataList(data);
|
||||||
|
}
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('deployment:service:server:add')")
|
||||||
|
@Log(title = "新增", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysDictType dict) {
|
||||||
|
if (!dictTypeService.checkDictTypeUnique(dict)) {
|
||||||
|
return error("新增部署服务环境维护'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||||
|
}
|
||||||
|
dict.setCreateBy(getUsername());
|
||||||
|
dictTypeService.insertDictType(dict);
|
||||||
|
dictDataService.insertDictData(dict.getSysDictDataList());
|
||||||
|
return toAjax();
|
||||||
|
}
|
||||||
|
}
|
@ -121,4 +121,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchInsertDictData" parameterType="SysDictData">
|
||||||
|
insert into sys_dict_data(
|
||||||
|
<if test="dictSort != null">dict_sort,</if>
|
||||||
|
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
||||||
|
<if test="dictValue != null and dictValue != ''">dict_value,</if>
|
||||||
|
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||||
|
<if test="cssClass != null and cssClass != ''">css_class,</if>
|
||||||
|
<if test="listClass != null and listClass != ''">list_class,</if>
|
||||||
|
<if test="isDefault != null and isDefault != ''">is_default,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="remark != null and remark != ''">remark,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
create_time
|
||||||
|
)values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(
|
||||||
|
<if test="dictSort != null">#{dictSort},</if>
|
||||||
|
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
|
||||||
|
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
|
||||||
|
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||||
|
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
|
||||||
|
<if test="listClass != null and listClass != ''">#{listClass},</if>
|
||||||
|
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
sysdate()
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user