提交 7762ea01 编写于 作者: ibizdev's avatar ibizdev

lab_gzf 部署微服务应用

上级 2662a9b3
......@@ -271,6 +271,50 @@ mock.onPost(new RegExp(/^\/eamlocations\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).repl
return [status, data];
});
// FetchChildLocation
mock.onGet(new RegExp(/^\/eamlocations\/fetchchildlocation$/)).reply((config: any) => {
console.groupCollapsed("实体:eamlocation 方法: FetchChildLocation");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchChildLocation
mock.onGet(new RegExp(/^\/eamlocations\/fetchchildlocation(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:eamlocation 方法: FetchChildLocation");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/eamlocations\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:eamlocation 方法: FetchDefault");
......
......@@ -34,7 +34,7 @@
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
fetchAction="FetchChildLocation"
:newdata="newdata.bind(_self)"
:opendata="opendata.bind(_self)"
name="grid"
......
......@@ -211,6 +211,20 @@ export default class EAMLocationServiceBase extends EntityService {
return res;
}
/**
* FetchChildLocation接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EAMLocationServiceBase
*/
public async FetchChildLocation(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/eamlocations/fetchchildlocation`,tempData,isloading);
}
/**
* FetchDefault接口方法
*
......
......@@ -6,7 +6,7 @@
<i-col :md="{ span: 24, offset: 0 }">
<card class="portlet-card" :bordered="false" dis-hover :padding="0">
<span>
<div class='portlet-container summary-viewdashboard-container1 ' :style="{}">
<div class='portlet-container summary-viewdashboard-container1 portlet-container-no-border' :style="{}">
<row>
<i-col :md="{ span: 24, offset: 0 }">
<div class="portlet-without-title">
......
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface EAMLocationMapper extends BaseMapper<EAMLocation>{
Page<EAMLocation> searchChildLocation(IPage page, @Param("srf") EAMLocationSearchContext context, @Param("ew") Wrapper<EAMLocation> wrapper) ;
Page<EAMLocation> searchDefault(IPage page, @Param("srf") EAMLocationSearchContext context, @Param("ew") Wrapper<EAMLocation> wrapper) ;
@Override
EAMLocation selectById(Serializable id);
......
......@@ -36,6 +36,7 @@ public interface IEAMLocationService extends IService<EAMLocation>{
boolean checkKey(EAMLocation et) ;
boolean save(EAMLocation et) ;
void saveBatch(List<EAMLocation> list) ;
Page<EAMLocation> searchChildLocation(EAMLocationSearchContext context) ;
Page<EAMLocation> searchDefault(EAMLocationSearchContext context) ;
List<EAMLocation> selectByEamlocationstateid(String eamlocationstateid) ;
void removeByEamlocationstateid(String eamlocationstateid) ;
......
......@@ -202,6 +202,15 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
}
/**
* 查询集合 下级位置
*/
@Override
public Page<EAMLocation> searchChildLocation(EAMLocationSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMLocation> pages=baseMapper.searchChildLocation(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMLocation>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 DEFAULT
*/
......
......@@ -228,7 +228,7 @@
<!--输出实体[EAMLOCATION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-51-11">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-52-11">
<createTable tableName="EAMLOCATION">
<column name="EAMLOCATIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMLOCATION_EAMLOCATIONID"/>
......@@ -591,13 +591,13 @@
<addForeignKeyConstraint baseColumnNames="EAMASSETSTATEMODELID" baseTableName="EAMASSETTYPE" constraintName="DER1N_EAMASSETTYPE_EAMASSETSTA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETSTATEMODELID" referencedTableName="EAMASSETSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATION]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-51-37">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-52-37">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEID" baseTableName="EAMLOCATION" constraintName="DER1N_EAMLOCATION_EAMLOCATIONS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEID" referencedTableName="EAMLOCATIONSTATE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-51-38">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-52-38">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONTYPEID" baseTableName="EAMLOCATION" constraintName="DER1N_EAMLOCATION_EAMLOCATIONT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONTYPEID" referencedTableName="EAMLOCATIONTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-51-39">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-52-39">
<addForeignKeyConstraint baseColumnNames="PEAMLOCATIONID" baseTableName="EAMLOCATION" constraintName="DER1N_EAMLOCATION_EAMLOCATION_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATIONSTATE]外键关系 -->
......
......@@ -46,6 +46,15 @@
where peamlocationid=#{eamlocationid}
</select>
<!--数据集合[ChildLocation]-->
<select id="searchChildLocation" parameterType="cn.ibizlab.assetmanagement.core.location.filter.EAMLocationSearchContext" resultMap="EAMLocationResultMap">
select t1.* from (
<include refid="ChildLocation" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.assetmanagement.core.location.filter.EAMLocationSearchContext" resultMap="EAMLocationResultMap">
select t1.* from (
......@@ -55,6 +64,12 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[ChildLocation]-->
<sql id="ChildLocation" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`PEAMLOCATIONID`, t11.`EAMLOCATIONNAME` AS `PEAMLOCATIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATION` t1 LEFT JOIN EAMLOCATION t11 ON t1.PEAMLOCATIONID = t11.EAMLOCATIONID LEFT JOIN EAMLOCATIONTYPE t21 ON t1.EAMLOCATIONTYPEID = t21.EAMLOCATIONTYPEID LEFT JOIN EAMLOCATIONSTATE t31 ON t1.EAMLOCATIONSTATEID = t31.EAMLOCATIONSTATEID
WHERE ( t1.`PEAMLOCATIONID` = #{srf.datacontext.eamlocationid} )
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`PEAMLOCATIONID`, t11.`EAMLOCATIONNAME` AS `PEAMLOCATIONNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMLOCATION` t1 LEFT JOIN EAMLOCATION t11 ON t1.PEAMLOCATIONID = t11.EAMLOCATIONID LEFT JOIN EAMLOCATIONTYPE t21 ON t1.EAMLOCATIONTYPEID = t21.EAMLOCATIONTYPEID LEFT JOIN EAMLOCATIONSTATE t31 ON t1.EAMLOCATIONSTATEID = t31.EAMLOCATIONSTATEID
......
......@@ -23,7 +23,7 @@
"dename":"EAMLocation",
"delogicname":"功能位置",
"sysmoudle":{"id":"LOCATION","name":"功能位置"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"dedataset":[{"id":"ChildLocation" , "name":"下级位置"},{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
......
......@@ -139,6 +139,27 @@ public class EAMLocationResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMLocation-searchChildLocation-all') and hasPermission(#context,'iBizAssetManagement-EAMLocation-Get')")
@ApiOperation(value = "获取下级位置", tags = {"功能位置" } ,notes = "获取下级位置")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/fetchchildlocation")
public ResponseEntity<List<EAMLocationDTO>> fetchChildLocation(EAMLocationSearchContext context) {
Page<EAMLocation> domains = eamlocationService.searchChildLocation(context) ;
List<EAMLocationDTO> list = eamlocationMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMLocation-searchChildLocation-all') and hasPermission(#context,'iBizAssetManagement-EAMLocation-Get')")
@ApiOperation(value = "查询下级位置", tags = {"功能位置" } ,notes = "查询下级位置")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/searchchildlocation")
public ResponseEntity<Page<EAMLocationDTO>> searchChildLocation(@RequestBody EAMLocationSearchContext context) {
Page<EAMLocation> domains = eamlocationService.searchChildLocation(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamlocationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMLocation-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMLocation-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"功能位置" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/fetchdefault")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册