提交 1c01f7f3 编写于 作者: ibizdev's avatar ibizdev

lab_gzf 部署微服务接口

上级 12d68968
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /assetmanagement-app-assetmanagement.jar
EXPOSE 10325
EXPOSE 8080
ADD assetmanagement-app-assetmanagement.jar /assetmanagement-app-assetmanagement.jar
......@@ -3,24 +3,9 @@ services:
assetmanagement-app-assetmanagement:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/assetmanagement-app-assetmanagement:latest
ports:
- "10325:10325"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10325
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -96,6 +96,20 @@ public class EAMAssetType extends EntityMP implements Serializable {
@JSONField(name = "eamassetstatemodelid")
@JsonProperty("eamassetstatemodelid")
private String eamassetstatemodelid;
/**
* 资产状态模型
*/
@TableField(exist = false)
@JSONField(name = "eamassetstatemodelname")
@JsonProperty("eamassetstatemodelname")
private String eamassetstatemodelname;
/**
* 资产类型编号
*/
@TableField(value = "assettypenumber")
@JSONField(name = "assettypenumber")
@JsonProperty("assettypenumber")
private String assettypenumber;
/**
*
......@@ -123,6 +137,14 @@ public class EAMAssetType extends EntityMP implements Serializable {
this.modify("eamassetstatemodelid",eamassetstatemodelid);
}
/**
* 设置 [资产类型编号]
*/
public void setAssettypenumber(String assettypenumber){
this.assettypenumber = assettypenumber ;
this.modify("assettypenumber",assettypenumber);
}
}
......
......@@ -41,6 +41,20 @@ public class EAMAssetTypeSearchContext extends QueryWrapperContext<EAMAssetType>
this.getSearchCond().eq("eamassetstatemodelid", n_eamassetstatemodelid_eq);
}
}
private String n_eamassetstatemodelname_eq;//[资产状态模型]
public void setN_eamassetstatemodelname_eq(String n_eamassetstatemodelname_eq) {
this.n_eamassetstatemodelname_eq = n_eamassetstatemodelname_eq;
if(!ObjectUtils.isEmpty(this.n_eamassetstatemodelname_eq)){
this.getSearchCond().eq("eamassetstatemodelname", n_eamassetstatemodelname_eq);
}
}
private String n_eamassetstatemodelname_like;//[资产状态模型]
public void setN_eamassetstatemodelname_like(String n_eamassetstatemodelname_like) {
this.n_eamassetstatemodelname_like = n_eamassetstatemodelname_like;
if(!ObjectUtils.isEmpty(this.n_eamassetstatemodelname_like)){
this.getSearchCond().like("eamassetstatemodelname", n_eamassetstatemodelname_like);
}
}
/**
* 启用快速搜索
......
......@@ -58,6 +58,7 @@ public class EAMAssetTypeServiceImpl extends ServiceImpl<EAMAssetTypeMapper, EAM
@Override
@Transactional
public boolean create(EAMAssetType et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamassettypeid()),et);
......@@ -66,12 +67,14 @@ public class EAMAssetTypeServiceImpl extends ServiceImpl<EAMAssetTypeMapper, EAM
@Override
public void createBatch(List<EAMAssetType> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMAssetType et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamassettypeid",et.getEamassettypeid())))
return false;
CachedBeanCopier.copy(get(et.getEamassettypeid()),et);
......@@ -80,6 +83,7 @@ public class EAMAssetTypeServiceImpl extends ServiceImpl<EAMAssetTypeMapper, EAM
@Override
public void updateBatch(List<EAMAssetType> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
......@@ -110,6 +114,7 @@ public class EAMAssetTypeServiceImpl extends ServiceImpl<EAMAssetTypeMapper, EAM
@Override
public EAMAssetType getDraft(EAMAssetType et) {
fillParentData(et);
return et;
}
......@@ -137,12 +142,14 @@ public class EAMAssetTypeServiceImpl extends ServiceImpl<EAMAssetTypeMapper, EAM
@Override
public boolean saveBatch(Collection<EAMAssetType> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMAssetType> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
......@@ -169,6 +176,22 @@ public class EAMAssetTypeServiceImpl extends ServiceImpl<EAMAssetTypeMapper, EAM
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(EAMAssetType et){
//实体关系[DER1N_EAMASSETTYPE_EAMASSETSTATEMODEL_EAMASSETSTATEMODELID]
if(!ObjectUtils.isEmpty(et.getEamassetstatemodelid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetStateModel eamassetstatemodel=et.getEamassetstatemodel();
if(ObjectUtils.isEmpty(eamassetstatemodel)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetStateModel majorEntity=eamassetstatemodelService.get(et.getEamassetstatemodelid());
et.setEamassetstatemodel(majorEntity);
eamassetstatemodel=majorEntity;
}
et.setEamassetstatemodelname(eamassetstatemodel.getEamassetstatemodelname());
}
}
......
......@@ -131,6 +131,13 @@ public class EAMLocation extends EntityMP implements Serializable {
@JSONField(name = "eamlocationstatename")
@JsonProperty("eamlocationstatename")
private String eamlocationstatename;
/**
* 功能位置编号
*/
@TableField(value = "locationnumber")
@JSONField(name = "locationnumber")
@JsonProperty("locationnumber")
private String locationnumber;
/**
*
......@@ -190,6 +197,14 @@ public class EAMLocation extends EntityMP implements Serializable {
this.modify("eamlocationstateid",eamlocationstateid);
}
/**
* 设置 [功能位置编号]
*/
public void setLocationnumber(String locationnumber){
this.locationnumber = locationnumber ;
this.modify("locationnumber",locationnumber);
}
}
......
......@@ -19,8 +19,10 @@ import com.alibaba.fastjson.JSONObject;
public interface EAMLocationMapper extends BaseMapper<EAMLocation>{
Page<EAMLocation> searchChild(IPage page, @Param("srf") EAMLocationSearchContext context, @Param("ew") Wrapper<EAMLocation> wrapper) ;
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) ;
Page<EAMLocation> searchTop(IPage page, @Param("srf") EAMLocationSearchContext context, @Param("ew") Wrapper<EAMLocation> wrapper) ;
@Override
EAMLocation selectById(Serializable id);
@Override
......
......@@ -36,8 +36,10 @@ public interface IEAMLocationService extends IService<EAMLocation>{
boolean checkKey(EAMLocation et) ;
boolean save(EAMLocation et) ;
void saveBatch(List<EAMLocation> list) ;
Page<EAMLocation> searchChild(EAMLocationSearchContext context) ;
Page<EAMLocation> searchChildLocation(EAMLocationSearchContext context) ;
Page<EAMLocation> searchDefault(EAMLocationSearchContext context) ;
Page<EAMLocation> searchTop(EAMLocationSearchContext context) ;
List<EAMLocation> selectByEamlocationstateid(String eamlocationstateid) ;
void removeByEamlocationstateid(String eamlocationstateid) ;
List<EAMLocation> selectByEamlocationtypeid(String eamlocationtypeid) ;
......
......@@ -202,6 +202,15 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
}
/**
* 查询集合 子位置(树)
*/
@Override
public Page<EAMLocation> searchChild(EAMLocationSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMLocation> pages=baseMapper.searchChild(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMLocation>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 下级位置
*/
......@@ -220,6 +229,15 @@ public class EAMLocationServiceImpl extends ServiceImpl<EAMLocationMapper, EAMLo
return new PageImpl<EAMLocation>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 顶级位置
*/
@Override
public Page<EAMLocation> searchTop(EAMLocationSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMLocation> pages=baseMapper.searchTop(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMLocation>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
......
......@@ -142,7 +142,7 @@
<!--输出实体[EAMASSETSTATE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstate-20-7">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstate-22-7">
<createTable tableName="EAMASSETSTATE">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -164,7 +164,7 @@
<!--输出实体[EAMASSETSTATEMODEL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstatemodel-12-8">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstatemodel-16-8">
<createTable tableName="EAMASSETSTATEMODEL">
<column name="EAMASSETSTATEMODELID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMASSETSTATEMODEL_EAMASSET"/>
......@@ -184,7 +184,7 @@
<!--输出实体[EAMASSETSTATEMODELLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstatemodelline-14-9">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstatemodelline-17-9">
<createTable tableName="EAMASSETSTATEMODELLINE">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -208,7 +208,7 @@
<!--输出实体[EAMASSETTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassettype-8-10">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassettype-14-10">
<createTable tableName="EAMASSETTYPE">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -225,12 +225,14 @@
</column>
<column name="EAMASSETSTATEMODELID" remarks="" type="VARCHAR(100)">
</column>
<column name="ASSETTYPENUMBER" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMLOCATION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-61-11">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-82-11">
<createTable tableName="EAMLOCATION">
<column name="EAMLOCATIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMLOCATION_EAMLOCATIONID"/>
......@@ -251,12 +253,14 @@
</column>
<column name="EAMLOCATIONSTATEID" remarks="" type="VARCHAR(100)">
</column>
<column name="LOCATIONNUMBER" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMLOCATIONSTATE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstate-37-12">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstate-41-12">
<createTable tableName="EAMLOCATIONSTATE">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -300,7 +304,7 @@
<!--输出实体[EAMLOCATIONSTATEMODELLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodelline-28-14">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodelline-29-14">
<createTable tableName="EAMLOCATIONSTATEMODELLINE">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -585,27 +589,27 @@
<!--输出实体[EAMASSETSTATE]外键关系 -->
<!--输出实体[EAMASSETSTATEMODEL]外键关系 -->
<!--输出实体[EAMASSETSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetstatemodelline-14-34">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetstatemodelline-17-34">
<addForeignKeyConstraint baseColumnNames="EAMASSETSTATEMODELID" baseTableName="EAMASSETSTATEMODELLINE" constraintName="DER1N_EAMASSETSTATEMODELLINE_E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETSTATEMODELID" referencedTableName="EAMASSETSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMASSETTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassettype-8-36">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassettype-14-36">
<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-61-37">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-82-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-61-38">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-82-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-61-39">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-82-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]外键关系 -->
<!--输出实体[EAMLOCATIONSTATEMODEL]外键关系 -->
<!--输出实体[EAMLOCATIONSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationstatemodelline-28-40">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationstatemodelline-29-40">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEMODELID" baseTableName="EAMLOCATIONSTATEMODELLINE" constraintName="DER1N_EAMLOCATIONSTATEMODELLIN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEMODELID" referencedTableName="EAMLOCATIONSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATIONTYPE]外键关系 -->
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMAssetTypeResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEMODELID`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 ) t1 where eamassettypeid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`ASSETTYPENUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEMODELID`, t11.`EAMASSETSTATEMODELNAME`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 LEFT JOIN EAMASSETSTATEMODEL t11 ON t1.EAMASSETSTATEMODELID = t11.EAMASSETSTATEMODELID ) t1 where eamassettypeid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -37,12 +37,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEMODELID`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1
<![CDATA[ SELECT t1.`ASSETTYPENUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEMODELID`, t11.`EAMASSETSTATEMODELNAME`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 LEFT JOIN EAMASSETSTATEMODEL t11 ON t1.EAMASSETSTATEMODELID = t11.EAMASSETSTATEMODELID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEMODELID`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1
<![CDATA[ SELECT t1.`ASSETTYPENUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEMODELID`, t11.`EAMASSETSTATEMODELNAME`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 LEFT JOIN EAMASSETSTATEMODEL t11 ON t1.EAMASSETSTATEMODELID = t11.EAMASSETSTATEMODELID
]]>
</sql>
</mapper>
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMLocationResultMap" databaseId="mysql">
<![CDATA[select t1.* from (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 ) t1 where eamlocationid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`LOCATIONNUMBER`, 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 ) t1 where eamlocationid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -46,6 +46,15 @@
where peamlocationid=#{eamlocationid}
</select>
<!--数据集合[Child]-->
<select id="searchChild" parameterType="cn.ibizlab.assetmanagement.core.location.filter.EAMLocationSearchContext" resultMap="EAMLocationResultMap">
select t1.* from (
<include refid="Child" />
)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>
<!--数据集合[ChildLocation]-->
<select id="searchChildLocation" parameterType="cn.ibizlab.assetmanagement.core.location.filter.EAMLocationSearchContext" resultMap="EAMLocationResultMap">
select t1.* from (
......@@ -64,20 +73,41 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Top]-->
<select id="searchTop" parameterType="cn.ibizlab.assetmanagement.core.location.filter.EAMLocationSearchContext" resultMap="EAMLocationResultMap">
select t1.* from (
<include refid="Top" />
)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>
<!--数据查询[Child]-->
<sql id="Child" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`LOCATIONNUMBER`, 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>
<!--数据查询[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} )
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`LOCATIONNUMBER`, 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.srfparentkey} )
]]>
</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
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`LOCATIONNUMBER`, 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
]]>
</sql>
<!--数据查询[Top]-->
<sql id="Top" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`LOCATIONNUMBER`, 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` IS NULL )
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" 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
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMLOCATIONNAME`, t1.`EAMLOCATIONSTATEID`, t31.`EAMLOCATIONSTATENAME`, t1.`EAMLOCATIONTYPEID`, t21.`EAMLOCATIONTYPENAME`, t1.`LOCATIONNUMBER`, 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
]]>
</sql>
</mapper>
......
......@@ -23,7 +23,7 @@
"dename":"EAMLocation",
"delogicname":"功能位置",
"sysmoudle":{"id":"LOCATION","name":"功能位置"},
"dedataset":[{"id":"ChildLocation" , "name":"下级位置"},{"id":"Default" , "name":"DEFAULT"}],
"dedataset":[{"id":"Child" , "name":"子位置(树)"},{"id":"ChildLocation" , "name":"下级位置"},{"id":"Default" , "name":"DEFAULT"},{"id":"Top" , "name":"顶级位置"}],
"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":"创建人"}]
}
......@@ -113,7 +113,7 @@
{
"appid":"AssetManagement",
"appname":"资产管理",
"appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" },{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem1" , "name":"功能位置" , "items":[{ "id":"menuitem6" , "name":"功能位置状态" },{ "id":"menuitem7" , "name":"功能位置状态模型" },{ "id":"menuitem8" , "name":"功能位置类型" },{ "id":"menuitem9" , "name":"功能位置" }]},{ "id":"menuitem2" , "name":"资产管理" , "items":[{ "id":"menuitem10" , "name":"资产状态" }]},{ "id":"menuitem3" , "name":"维护申请" },{ "id":"menuitem4" , "name":"工单管理" },{ "id":"menuitem5" , "name":"维护计划" }]}] }]
"appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" },{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem1" , "name":"功能位置" , "items":[{ "id":"menuitem6" , "name":"功能位置状态" },{ "id":"menuitem7" , "name":"功能位置状态模型" },{ "id":"menuitem8" , "name":"功能位置类型" },{ "id":"menuitem9" , "name":"功能位置" }]},{ "id":"menuitem2" , "name":"资产管理" , "items":[{ "id":"menuitem10" , "name":"资产状态" },{ "id":"menuitem11" , "name":"资产状态模型" }]},{ "id":"menuitem3" , "name":"维护申请" },{ "id":"menuitem4" , "name":"工单管理" },{ "id":"menuitem5" , "name":"维护计划" }]}] }]
}
]
}
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /assetmanagement-provider-assetapi.jar
EXPOSE 8081
EXPOSE 10315
ADD assetmanagement-provider-assetapi.jar /assetmanagement-provider-assetapi.jar
......@@ -3,9 +3,24 @@ services:
assetmanagement-provider-assetapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/assetmanagement-provider-assetapi:latest
ports:
- "8081:8081"
- "10315:10315"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10315
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -81,6 +81,22 @@ public class EAMAssetTypeDTO extends DTOBase implements Serializable {
@JsonProperty("eamassetstatemodelid")
private String eamassetstatemodelid;
/**
* 属性 [EAMASSETSTATEMODELNAME]
*
*/
@JSONField(name = "eamassetstatemodelname")
@JsonProperty("eamassetstatemodelname")
private String eamassetstatemodelname;
/**
* 属性 [ASSETTYPENUMBER]
*
*/
@JSONField(name = "assettypenumber")
@JsonProperty("assettypenumber")
private String assettypenumber;
/**
* 设置 [EAMASSETTYPENAME]
......@@ -98,6 +114,14 @@ public class EAMAssetTypeDTO extends DTOBase implements Serializable {
this.modify("eamassetstatemodelid",eamassetstatemodelid);
}
/**
* 设置 [ASSETTYPENUMBER]
*/
public void setAssettypenumber(String assettypenumber){
this.assettypenumber = assettypenumber ;
this.modify("assettypenumber",assettypenumber);
}
}
......@@ -121,6 +121,14 @@ public class EAMLocationDTO extends DTOBase implements Serializable {
@JsonProperty("eamlocationstatename")
private String eamlocationstatename;
/**
* 属性 [LOCATIONNUMBER]
*
*/
@JSONField(name = "locationnumber")
@JsonProperty("locationnumber")
private String locationnumber;
/**
* 设置 [EAMLOCATIONNAME]
......@@ -154,6 +162,14 @@ public class EAMLocationDTO extends DTOBase implements Serializable {
this.modify("eamlocationstateid",eamlocationstateid);
}
/**
* 设置 [LOCATIONNUMBER]
*/
public void setLocationnumber(String locationnumber){
this.locationnumber = locationnumber ;
this.modify("locationnumber",locationnumber);
}
}
......@@ -160,5 +160,138 @@ public class EAMAssetResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamassetMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamassetMapping.toDomain(#eamassetdto),'iBizAssetManagement-EAMAsset-Create')")
@ApiOperation(value = "根据功能位置建立资产", tags = {"资产" }, notes = "根据功能位置建立资产")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets")
@Transactional
public ResponseEntity<EAMAssetDTO> createByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @RequestBody EAMAssetDTO eamassetdto) {
EAMAsset domain = eamassetMapping.toDomain(eamassetdto);
domain.setEamlocationid(eamlocation_id);
eamassetService.create(domain);
EAMAssetDTO dto = eamassetMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamassetMapping.toDomain(#eamassetdtos),'iBizAssetManagement-EAMAsset-Create')")
@ApiOperation(value = "根据功能位置批量建立资产", tags = {"资产" }, notes = "根据功能位置批量建立资产")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/batch")
public ResponseEntity<Boolean> createBatchByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @RequestBody List<EAMAssetDTO> eamassetdtos) {
List<EAMAsset> domainlist=eamassetMapping.toDomain(eamassetdtos);
for(EAMAsset domain:domainlist){
domain.setEamlocationid(eamlocation_id);
}
eamassetService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamasset" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamassetService.get(#eamasset_id),'iBizAssetManagement-EAMAsset-Update')")
@ApiOperation(value = "根据功能位置更新资产", tags = {"资产" }, notes = "根据功能位置更新资产")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}")
@Transactional
public ResponseEntity<EAMAssetDTO> updateByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMAssetDTO eamassetdto) {
EAMAsset domain = eamassetMapping.toDomain(eamassetdto);
domain.setEamlocationid(eamlocation_id);
domain.setAssetid(eamasset_id);
eamassetService.update(domain);
EAMAssetDTO dto = eamassetMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamassetService.getEamassetByEntities(this.eamassetMapping.toDomain(#eamassetdtos)),'iBizAssetManagement-EAMAsset-Update')")
@ApiOperation(value = "根据功能位置批量更新资产", tags = {"资产" }, notes = "根据功能位置批量更新资产")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/batch")
public ResponseEntity<Boolean> updateBatchByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @RequestBody List<EAMAssetDTO> eamassetdtos) {
List<EAMAsset> domainlist=eamassetMapping.toDomain(eamassetdtos);
for(EAMAsset domain:domainlist){
domain.setEamlocationid(eamlocation_id);
}
eamassetService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamassetService.get(#eamasset_id),'iBizAssetManagement-EAMAsset-Remove')")
@ApiOperation(value = "根据功能位置删除资产", tags = {"资产" }, notes = "根据功能位置删除资产")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamassetService.remove(eamasset_id));
}
@PreAuthorize("hasPermission(this.eamassetService.getEamassetByIds(#ids),'iBizAssetManagement-EAMAsset-Remove')")
@ApiOperation(value = "根据功能位置批量删除资产", tags = {"资产" }, notes = "根据功能位置批量删除资产")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/batch")
public ResponseEntity<Boolean> removeBatchByEAMLocation(@RequestBody List<String> ids) {
eamassetService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamassetMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMAsset-Get')")
@ApiOperation(value = "根据功能位置获取资产", tags = {"资产" }, notes = "根据功能位置获取资产")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}")
public ResponseEntity<EAMAssetDTO> getByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id) {
EAMAsset domain = eamassetService.get(eamasset_id);
EAMAssetDTO dto = eamassetMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据功能位置获取资产草稿", tags = {"资产" }, notes = "根据功能位置获取资产草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/getdraft")
public ResponseEntity<EAMAssetDTO> getDraftByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id) {
EAMAsset domain = new EAMAsset();
domain.setEamlocationid(eamlocation_id);
return ResponseEntity.status(HttpStatus.OK).body(eamassetMapping.toDto(eamassetService.getDraft(domain)));
}
@ApiOperation(value = "根据功能位置检查资产", tags = {"资产" }, notes = "根据功能位置检查资产")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @RequestBody EAMAssetDTO eamassetdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamassetService.checkKey(eamassetMapping.toDomain(eamassetdto)));
}
@PreAuthorize("hasPermission(this.eamassetMapping.toDomain(#eamassetdto),'iBizAssetManagement-EAMAsset-Save')")
@ApiOperation(value = "根据功能位置保存资产", tags = {"资产" }, notes = "根据功能位置保存资产")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/save")
public ResponseEntity<Boolean> saveByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @RequestBody EAMAssetDTO eamassetdto) {
EAMAsset domain = eamassetMapping.toDomain(eamassetdto);
domain.setEamlocationid(eamlocation_id);
return ResponseEntity.status(HttpStatus.OK).body(eamassetService.save(domain));
}
@PreAuthorize("hasPermission(this.eamassetMapping.toDomain(#eamassetdtos),'iBizAssetManagement-EAMAsset-Save')")
@ApiOperation(value = "根据功能位置批量保存资产", tags = {"资产" }, notes = "根据功能位置批量保存资产")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @RequestBody List<EAMAssetDTO> eamassetdtos) {
List<EAMAsset> domainlist=eamassetMapping.toDomain(eamassetdtos);
for(EAMAsset domain:domainlist){
domain.setEamlocationid(eamlocation_id);
}
eamassetService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMAsset-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMAsset-Get')")
@ApiOperation(value = "根据功能位置获取DEFAULT", tags = {"资产" } ,notes = "根据功能位置获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/fetchdefault")
public ResponseEntity<List<EAMAssetDTO>> fetchEAMAssetDefaultByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id,EAMAssetSearchContext context) {
context.setN_eamlocationid_eq(eamlocation_id);
Page<EAMAsset> domains = eamassetService.searchDefault(context) ;
List<EAMAssetDTO> list = eamassetMapping.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-EAMAsset-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMAsset-Get')")
@ApiOperation(value = "根据功能位置查询DEFAULT", tags = {"资产" } ,notes = "根据功能位置查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/searchdefault")
public ResponseEntity<Page<EAMAssetDTO>> searchEAMAssetDefaultByEAMLocation(@PathVariable("eamlocation_id") String eamlocation_id, @RequestBody EAMAssetSearchContext context) {
context.setN_eamlocationid_eq(eamlocation_id);
Page<EAMAsset> domains = eamassetService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamassetMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -139,6 +139,27 @@ public class EAMLocationResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMLocation-searchChild-all') and hasPermission(#context,'iBizAssetManagement-EAMLocation-Get')")
@ApiOperation(value = "获取子位置(树)", tags = {"功能位置" } ,notes = "获取子位置(树)")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/fetchchild")
public ResponseEntity<List<EAMLocationDTO>> fetchChild(EAMLocationSearchContext context) {
Page<EAMLocation> domains = eamlocationService.searchChild(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-searchChild-all') and hasPermission(#context,'iBizAssetManagement-EAMLocation-Get')")
@ApiOperation(value = "查询子位置(树)", tags = {"功能位置" } ,notes = "查询子位置(树)")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/searchchild")
public ResponseEntity<Page<EAMLocationDTO>> searchChild(@RequestBody EAMLocationSearchContext context) {
Page<EAMLocation> domains = eamlocationService.searchChild(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamlocationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@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")
......@@ -181,5 +202,26 @@ public class EAMLocationResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamlocationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMLocation-searchTop-all') and hasPermission(#context,'iBizAssetManagement-EAMLocation-Get')")
@ApiOperation(value = "获取顶级位置", tags = {"功能位置" } ,notes = "获取顶级位置")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/fetchtop")
public ResponseEntity<List<EAMLocationDTO>> fetchTop(EAMLocationSearchContext context) {
Page<EAMLocation> domains = eamlocationService.searchTop(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-searchTop-all') and hasPermission(#context,'iBizAssetManagement-EAMLocation-Get')")
@ApiOperation(value = "查询顶级位置", tags = {"功能位置" } ,notes = "查询顶级位置")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/searchtop")
public ResponseEntity<Page<EAMLocationDTO>> searchTop(@RequestBody EAMLocationSearchContext context) {
Page<EAMLocation> domains = eamlocationService.searchTop(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamlocationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -37,11 +37,11 @@
git clone -b master $para2 ibizassetmanagement/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizassetmanagement/
mvn clean package -Passetmanagement
cd assetmanagement-app/assetmanagement-app-assetmanagement
mvn -Passetmanagement docker:build
mvn -Passetmanagement docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/assetmanagement-app-assetmanagement.yaml iBizEE --with-registry-auth
mvn clean package -Passetapi
cd assetmanagement-provider/assetmanagement-provider-assetapi
mvn -Passetapi docker:build
mvn -Passetapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/assetmanagement-provider-assetapi.yaml iBizEE --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册