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

lab_gzf 部署微服务接口

上级 70e7149d
......@@ -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,25 +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&allowMultiQueries=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_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -55,6 +55,14 @@ zuul:
path: /eamservicelevels/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamplancdt:
path: /eamplancdts/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamplan:
path: /eamplans/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamsparepartspro:
path: /eamsparepartspros/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
......@@ -67,10 +75,18 @@ zuul:
path: /eamsparepartsgroups/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamplanline:
path: /eamplanlines/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamlocationstatemodelline:
path: /eamlocationstatemodellines/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamplanschedule:
path: /eamplanschedules/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamassetpartsgroup:
path: /eamassetpartsgroups/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
......
......@@ -103,6 +103,56 @@ public class EAMPlan extends EntityMP implements Serializable {
@JSONField(name = "assetid")
@JsonProperty("assetid")
private String assetid;
/**
* 资产
*/
@TableField(exist = false)
@JSONField(name = "assetname")
@JsonProperty("assetname")
private String assetname;
/**
* 功能位置
*/
@TableField(exist = false)
@JSONField(name = "eamlocationname")
@JsonProperty("eamlocationname")
private String eamlocationname;
/**
* 计划编号
*/
@TableField(value = "plannumber")
@JSONField(name = "plannumber")
@JsonProperty("plannumber")
private String plannumber;
/**
* 测点标识
*/
@TableField(value = "eammonitorpointid")
@JSONField(name = "eammonitorpointid")
@JsonProperty("eammonitorpointid")
private String eammonitorpointid;
/**
* 测点
*/
@TableField(exist = false)
@JSONField(name = "eammonitorpointname")
@JsonProperty("eammonitorpointname")
private String eammonitorpointname;
/**
* 描述
*/
@TableField(value = "description")
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
* 制定日期
*/
@TableField(value = "mdate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "mdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("mdate")
private Timestamp mdate;
/**
*
......@@ -120,6 +170,14 @@ public class EAMPlan extends EntityMP implements Serializable {
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.location.domain.EAMLocation eamlocation;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.workorder.domain.EAMMonitorPoint eammonitorpoint;
/**
......@@ -146,6 +204,48 @@ public class EAMPlan extends EntityMP implements Serializable {
this.modify("assetid",assetid);
}
/**
* 设置 [计划编号]
*/
public void setPlannumber(String plannumber){
this.plannumber = plannumber ;
this.modify("plannumber",plannumber);
}
/**
* 设置 [测点标识]
*/
public void setEammonitorpointid(String eammonitorpointid){
this.eammonitorpointid = eammonitorpointid ;
this.modify("eammonitorpointid",eammonitorpointid);
}
/**
* 设置 [描述]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
/**
* 设置 [制定日期]
*/
public void setMdate(Timestamp mdate){
this.mdate = mdate ;
this.modify("mdate",mdate);
}
/**
* 格式化日期 [制定日期]
*/
public String formatMdate(){
if (this.mdate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(mdate);
}
}
......
......@@ -48,6 +48,55 @@ public class EAMPlanSearchContext extends QueryWrapperContext<EAMPlan> {
this.getSearchCond().eq("assetid", n_assetid_eq);
}
}
private String n_assetname_eq;//[资产]
public void setN_assetname_eq(String n_assetname_eq) {
this.n_assetname_eq = n_assetname_eq;
if(!ObjectUtils.isEmpty(this.n_assetname_eq)){
this.getSearchCond().eq("assetname", n_assetname_eq);
}
}
private String n_assetname_like;//[资产]
public void setN_assetname_like(String n_assetname_like) {
this.n_assetname_like = n_assetname_like;
if(!ObjectUtils.isEmpty(this.n_assetname_like)){
this.getSearchCond().like("assetname", n_assetname_like);
}
}
private String n_eamlocationname_eq;//[功能位置]
public void setN_eamlocationname_eq(String n_eamlocationname_eq) {
this.n_eamlocationname_eq = n_eamlocationname_eq;
if(!ObjectUtils.isEmpty(this.n_eamlocationname_eq)){
this.getSearchCond().eq("eamlocationname", n_eamlocationname_eq);
}
}
private String n_eamlocationname_like;//[功能位置]
public void setN_eamlocationname_like(String n_eamlocationname_like) {
this.n_eamlocationname_like = n_eamlocationname_like;
if(!ObjectUtils.isEmpty(this.n_eamlocationname_like)){
this.getSearchCond().like("eamlocationname", n_eamlocationname_like);
}
}
private String n_eammonitorpointid_eq;//[测点标识]
public void setN_eammonitorpointid_eq(String n_eammonitorpointid_eq) {
this.n_eammonitorpointid_eq = n_eammonitorpointid_eq;
if(!ObjectUtils.isEmpty(this.n_eammonitorpointid_eq)){
this.getSearchCond().eq("eammonitorpointid", n_eammonitorpointid_eq);
}
}
private String n_eammonitorpointname_eq;//[测点]
public void setN_eammonitorpointname_eq(String n_eammonitorpointname_eq) {
this.n_eammonitorpointname_eq = n_eammonitorpointname_eq;
if(!ObjectUtils.isEmpty(this.n_eammonitorpointname_eq)){
this.getSearchCond().eq("eammonitorpointname", n_eammonitorpointname_eq);
}
}
private String n_eammonitorpointname_like;//[测点]
public void setN_eammonitorpointname_like(String n_eammonitorpointname_like) {
this.n_eammonitorpointname_like = n_eammonitorpointname_like;
if(!ObjectUtils.isEmpty(this.n_eammonitorpointname_like)){
this.getSearchCond().like("eammonitorpointname", n_eammonitorpointname_like);
}
}
/**
* 启用快速搜索
......
......@@ -66,4 +66,6 @@ public interface EAMPlanMapper extends BaseMapper<EAMPlan>{
List<EAMPlan> selectByEamlocationid(@Param("eamlocationid") Serializable eamlocationid) ;
List<EAMPlan> selectByEammonitorpointid(@Param("eammonitorpointid") Serializable eammonitorpointid) ;
}
......@@ -41,6 +41,8 @@ public interface IEAMPlanService extends IService<EAMPlan>{
void removeByAssetid(String assetid) ;
List<EAMPlan> selectByEamlocationid(String eamlocationid) ;
void removeByEamlocationid(String eamlocationid) ;
List<EAMPlan> selectByEammonitorpointid(String eammonitorpointid) ;
void removeByEammonitorpointid(String eammonitorpointid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -60,12 +60,16 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.location.service.IEAMLocationService eamlocationService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.workorder.service.IEAMMonitorPointService eammonitorpointService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(EAMPlan et) {
fillParentData(et);
createIndexMajorEntityData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
......@@ -75,12 +79,14 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
@Override
public void createBatch(List<EAMPlan> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMPlan et) {
fillParentData(et);
wooriginService.update(eamplanInheritMapping.toWoorigin(et));
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamplanid",et.getEamplanid())))
return false;
......@@ -90,6 +96,7 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
@Override
public void updateBatch(List<EAMPlan> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
......@@ -121,6 +128,7 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
@Override
public EAMPlan getDraft(EAMPlan et) {
fillParentData(et);
return et;
}
......@@ -148,12 +156,14 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
@Override
public boolean saveBatch(Collection<EAMPlan> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMPlan> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
......@@ -178,6 +188,16 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
this.remove(new QueryWrapper<EAMPlan>().eq("eamlocationid",eamlocationid));
}
@Override
public List<EAMPlan> selectByEammonitorpointid(String eammonitorpointid) {
return baseMapper.selectByEammonitorpointid(eammonitorpointid);
}
@Override
public void removeByEammonitorpointid(String eammonitorpointid) {
this.remove(new QueryWrapper<EAMPlan>().eq("eammonitorpointid",eammonitorpointid));
}
/**
* 查询集合 DEFAULT
......@@ -190,6 +210,42 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(EAMPlan et){
//实体关系[DER1N_EAMPLAN_EAMASSET_ASSETID]
if(!ObjectUtils.isEmpty(et.getAssetid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAsset asset=et.getAsset();
if(ObjectUtils.isEmpty(asset)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAsset majorEntity=eamassetService.get(et.getAssetid());
et.setAsset(majorEntity);
asset=majorEntity;
}
et.setAssetname(asset.getAssetname());
}
//实体关系[DER1N_EAMPLAN_EAMLOCATION_EAMLOCATIONID]
if(!ObjectUtils.isEmpty(et.getEamlocationid())){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocation eamlocation=et.getEamlocation();
if(ObjectUtils.isEmpty(eamlocation)){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocation majorEntity=eamlocationService.get(et.getEamlocationid());
et.setEamlocation(majorEntity);
eamlocation=majorEntity;
}
et.setEamlocationname(eamlocation.getEamlocationname());
}
//实体关系[DER1N_EAMPLAN_EAMMONITORPOINT_EAMMONITORPOINTID]
if(!ObjectUtils.isEmpty(et.getEammonitorpointid())){
cn.ibizlab.assetmanagement.core.workorder.domain.EAMMonitorPoint eammonitorpoint=et.getEammonitorpoint();
if(ObjectUtils.isEmpty(eammonitorpoint)){
cn.ibizlab.assetmanagement.core.workorder.domain.EAMMonitorPoint majorEntity=eammonitorpointService.get(et.getEammonitorpointid());
et.setEammonitorpoint(majorEntity);
eammonitorpoint=majorEntity;
}
et.setEammonitorpointname(eammonitorpoint.getEammonitorpointname());
}
}
......
package cn.ibizlab.assetmanagement.core.workorder.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.assetmanagement.util.domain.EntityBase;
import cn.ibizlab.assetmanagement.util.annotation.DEField;
import cn.ibizlab.assetmanagement.util.enums.DEPredefinedFieldType;
import cn.ibizlab.assetmanagement.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.assetmanagement.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.assetmanagement.util.domain.EntityMP;
/**
* 实体[测点]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "EAMMONITORPOINT",resultMap = "EAMMonitorPointResultMap")
public class EAMMonitorPoint extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 测点标识
*/
@DEField(isKeyField=true)
@TableId(value= "eammonitorpointid",type=IdType.ASSIGN_UUID)
@JSONField(name = "eammonitorpointid")
@JsonProperty("eammonitorpointid")
private String eammonitorpointid;
/**
* 测点名称
*/
@TableField(value = "eammonitorpointname")
@JSONField(name = "eammonitorpointname")
@JsonProperty("eammonitorpointname")
private String eammonitorpointname;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 设置 [测点名称]
*/
public void setEammonitorpointname(String eammonitorpointname){
this.eammonitorpointname = eammonitorpointname ;
this.modify("eammonitorpointname",eammonitorpointname);
}
}
......@@ -220,6 +220,13 @@ public class EAMWorkOrder extends EntityMP implements Serializable {
@JSONField(name = "pworkordername")
@JsonProperty("pworkordername")
private String pworkordername;
/**
* 描述
*/
@TableField(value = "description")
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
*
......@@ -415,6 +422,14 @@ public class EAMWorkOrder extends EntityMP implements Serializable {
this.modify("worklength",worklength);
}
/**
* 设置 [描述]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
}
......
package cn.ibizlab.assetmanagement.core.workorder.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.assetmanagement.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMMonitorPoint;
/**
* 关系型数据实体[EAMMonitorPoint] 查询条件对象
*/
@Slf4j
@Data
public class EAMMonitorPointSearchContext extends QueryWrapperContext<EAMMonitorPoint> {
private String n_eammonitorpointname_like;//[测点名称]
public void setN_eammonitorpointname_like(String n_eammonitorpointname_like) {
this.n_eammonitorpointname_like = n_eammonitorpointname_like;
if(!ObjectUtils.isEmpty(this.n_eammonitorpointname_like)){
this.getSearchCond().like("eammonitorpointname", n_eammonitorpointname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("eammonitorpointname", query)
);
}
}
}
package cn.ibizlab.assetmanagement.core.workorder.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMMonitorPoint;
import cn.ibizlab.assetmanagement.core.workorder.filter.EAMMonitorPointSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface EAMMonitorPointMapper extends BaseMapper<EAMMonitorPoint>{
Page<EAMMonitorPoint> searchDefault(IPage page, @Param("srf") EAMMonitorPointSearchContext context, @Param("ew") Wrapper<EAMMonitorPoint> wrapper) ;
@Override
EAMMonitorPoint selectById(Serializable id);
@Override
int insert(EAMMonitorPoint entity);
@Override
int updateById(@Param(Constants.ENTITY) EAMMonitorPoint entity);
@Override
int update(@Param(Constants.ENTITY) EAMMonitorPoint entity, @Param("ew") Wrapper<EAMMonitorPoint> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.assetmanagement.core.workorder.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMMonitorPoint;
import cn.ibizlab.assetmanagement.core.workorder.filter.EAMMonitorPointSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[EAMMonitorPoint] 服务对象接口
*/
public interface IEAMMonitorPointService extends IService<EAMMonitorPoint>{
boolean create(EAMMonitorPoint et) ;
void createBatch(List<EAMMonitorPoint> list) ;
boolean update(EAMMonitorPoint et) ;
void updateBatch(List<EAMMonitorPoint> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
EAMMonitorPoint get(String key) ;
EAMMonitorPoint getDraft(EAMMonitorPoint et) ;
boolean checkKey(EAMMonitorPoint et) ;
boolean save(EAMMonitorPoint et) ;
void saveBatch(List<EAMMonitorPoint> list) ;
Page<EAMMonitorPoint> searchDefault(EAMMonitorPointSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<EAMMonitorPoint> getEammonitorpointByIds(List<String> ids) ;
List<EAMMonitorPoint> getEammonitorpointByEntities(List<EAMMonitorPoint> entities) ;
}
package cn.ibizlab.assetmanagement.core.workorder.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMMonitorPoint;
import cn.ibizlab.assetmanagement.core.workorder.filter.EAMMonitorPointSearchContext;
import cn.ibizlab.assetmanagement.core.workorder.service.IEAMMonitorPointService;
import cn.ibizlab.assetmanagement.util.helper.CachedBeanCopier;
import cn.ibizlab.assetmanagement.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.assetmanagement.core.workorder.mapper.EAMMonitorPointMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[测点] 服务对象接口实现
*/
@Slf4j
@Service("EAMMonitorPointServiceImpl")
public class EAMMonitorPointServiceImpl extends ServiceImpl<EAMMonitorPointMapper, EAMMonitorPoint> implements IEAMMonitorPointService {
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.plan.service.IEAMPlanService eamplanService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(EAMMonitorPoint et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEammonitorpointid()),et);
return true;
}
@Override
public void createBatch(List<EAMMonitorPoint> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMMonitorPoint et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eammonitorpointid",et.getEammonitorpointid())))
return false;
CachedBeanCopier.copy(get(et.getEammonitorpointid()),et);
return true;
}
@Override
public void updateBatch(List<EAMMonitorPoint> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public EAMMonitorPoint get(String key) {
EAMMonitorPoint et = getById(key);
if(et==null){
et=new EAMMonitorPoint();
et.setEammonitorpointid(key);
}
else{
}
return et;
}
@Override
public EAMMonitorPoint getDraft(EAMMonitorPoint et) {
return et;
}
@Override
public boolean checkKey(EAMMonitorPoint et) {
return (!ObjectUtils.isEmpty(et.getEammonitorpointid()))&&(!Objects.isNull(this.getById(et.getEammonitorpointid())));
}
@Override
@Transactional
public boolean save(EAMMonitorPoint et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(EAMMonitorPoint et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<EAMMonitorPoint> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMMonitorPoint> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<EAMMonitorPoint> searchDefault(EAMMonitorPointSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMMonitorPoint> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMMonitorPoint>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<EAMMonitorPoint> getEammonitorpointByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<EAMMonitorPoint> getEammonitorpointByEntities(List<EAMMonitorPoint> entities) {
List ids =new ArrayList();
for(EAMMonitorPoint entity : entities){
Serializable id=entity.getEammonitorpointid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMPlanResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ASSETID`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMPLANID`, t1.`EAMPLANNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMPLAN` t1 ) t1 where eamplanid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMMONITORPOINTID`, t31.`EAMMONITORPOINTNAME`, t1.`EAMPLANID`, t1.`EAMPLANNAME`, t1.`MDATE`, t1.`PLANNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMPLAN` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMMONITORPOINT t31 ON t1.EAMMONITORPOINTID = t31.EAMMONITORPOINTID ) t1 where eamplanid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -13,12 +13,15 @@
<id property="eamplanid" column="eamplanid" /><!--主键字段映射-->
<result property="eamlocationid" column="eamlocationid" />
<result property="assetid" column="assetid" />
<result property="eammonitorpointid" column="eammonitorpointid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="asset" javaType="cn.ibizlab.assetmanagement.core.asset.domain.EAMAsset" column="assetid" select="cn.ibizlab.assetmanagement.core.asset.mapper.EAMAssetMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamlocation" javaType="cn.ibizlab.assetmanagement.core.location.domain.EAMLocation" column="eamlocationid" select="cn.ibizlab.assetmanagement.core.location.mapper.EAMLocationMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eammonitorpoint" javaType="cn.ibizlab.assetmanagement.core.workorder.domain.EAMMonitorPoint" column="eammonitorpointid" select="cn.ibizlab.assetmanagement.core.workorder.mapper.EAMMonitorPointMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMPLAN_EAMASSET_ASSETID] -->
......@@ -34,6 +37,13 @@
<include refid="Default" />
) t1
where eamlocationid=#{eamlocationid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMPLAN_EAMMONITORPOINT_EAMMONITORPOINTID] -->
<select id="selectByEammonitorpointid" resultMap="EAMPlanResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eammonitorpointid=#{eammonitorpointid}
</select>
<!--数据集合[Default]-->
......@@ -47,12 +57,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMPLANID`, t1.`EAMPLANNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMPLAN` t1
<![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMMONITORPOINTID`, t31.`EAMMONITORPOINTNAME`, t1.`EAMPLANID`, t1.`EAMPLANNAME`, t1.`MDATE`, t1.`PLANNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMPLAN` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMMONITORPOINT t31 ON t1.EAMMONITORPOINTID = t31.EAMMONITORPOINTID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMPLANID`, t1.`EAMPLANNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMPLAN` t1
<![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMMONITORPOINTID`, t31.`EAMMONITORPOINTNAME`, t1.`EAMPLANID`, t1.`EAMPLANNAME`, t1.`MDATE`, t1.`PLANNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMPLAN` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMMONITORPOINT t31 ON t1.EAMMONITORPOINTID = t31.EAMMONITORPOINTID
]]>
</sql>
</mapper>
......
<?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="cn.ibizlab.assetmanagement.core.workorder.mapper.EAMMonitorPointMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMMonitorPointResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMMONITORPOINTID`, t1.`EAMMONITORPOINTNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMMONITORPOINT` t1 ) t1 where eammonitorpointid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="EAMMonitorPointResultMap" type="cn.ibizlab.assetmanagement.core.workorder.domain.EAMMonitorPoint" autoMapping="true">
<id property="eammonitorpointid" column="eammonitorpointid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.assetmanagement.core.workorder.filter.EAMMonitorPointSearchContext" resultMap="EAMMonitorPointResultMap">
select t1.* from (
<include refid="Default" />
)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]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMMONITORPOINTID`, t1.`EAMMONITORPOINTNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMMONITORPOINT` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMMONITORPOINTID`, t1.`EAMMONITORPOINTNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMMONITORPOINT` t1
]]>
</sql>
</mapper>
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMWorkOrderResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID ) t1 where workorderid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID ) t1 where workorderid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -97,18 +97,18 @@
<!--数据查询[ChildWO]-->
<sql id="ChildWO" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID
<![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID
WHERE ( t1.`PWORKORDERID` = #{srf.datacontext.srfparentkey} )
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID
<![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID
<![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID
]]>
</sql>
</mapper>
......
......@@ -100,6 +100,22 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMPlanCDT",
"delogicname":"维护计划条件",
"sysmoudle":{"id":"PLAN","name":"维护计划"},
"dedataset":[{"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":"创建人"}]
}
, {
"dename":"EAMPlan",
"delogicname":"维护计划",
"sysmoudle":{"id":"PLAN","name":"维护计划"},
"dedataset":[{"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":"创建人"}]
}
, {
"dename":"EAMSparePartsPRO",
"delogicname":"备件包物料",
"sysmoudle":{"id":"ASSET","name":"资产管理"},
......@@ -124,6 +140,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMPlanLine",
"delogicname":"计划步骤",
"sysmoudle":{"id":"PLAN","name":"维护计划"},
"dedataset":[{"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":"创建人"}]
}
, {
"dename":"EAMLocationStateModelLine",
"delogicname":"功能位置状态模型明细",
"sysmoudle":{"id":"LOCATION","name":"功能位置"},
......@@ -132,6 +156,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMPlanSchedule",
"delogicname":"维护计划时刻设置",
"sysmoudle":{"id":"PLAN","name":"维护计划"},
"dedataset":[{"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":"创建人"}]
}
, {
"dename":"EAMAssetPartsGroup",
"delogicname":"资产备件包",
"sysmoudle":{"id":"ASSET","name":"资产管理"},
......@@ -193,7 +225,7 @@
{
"appid":"AssetManagement",
"appname":"资产管理",
"appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem15" , "name":"系统设置" , "items":[{ "id":"menuitem16" , "name":"服务等级" },{ "id":"menuitem17" , "name":"维护申请类型" },{ "id":"menuitem19" , "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":"menuitem12" , "name":"资产类型" },{ "id":"menuitem13" , "name":"资产管理" },{ "id":"menuitem14" , "name":"备件包" }]},{ "id":"menuitem4" , "name":"工单管理" , "items":[{ "id":"menuitem3" , "name":"维护申请" },{ "id":"menuitem18" , "name":"工单" }]},{ "id":"menuitem5" , "name":"维护计划" }]}] }]
"appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem15" , "name":"系统设置" , "items":[{ "id":"menuitem16" , "name":"服务等级" },{ "id":"menuitem17" , "name":"维护申请类型" },{ "id":"menuitem19" , "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":"menuitem12" , "name":"资产类型" },{ "id":"menuitem13" , "name":"资产管理" },{ "id":"menuitem14" , "name":"备件包" }]},{ "id":"menuitem4" , "name":"工单管理" , "items":[{ "id":"menuitem3" , "name":"维护申请" },{ "id":"menuitem18" , "name":"工单" }]},{ "id":"menuitem5" , "name":"维护计划" , "items":[{ "id":"menuitem20" , "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,25 @@ 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&allowMultiQueries=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_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
package cn.ibizlab.assetmanagement.assetapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[EAMPlanCDTDTO]
*/
@Data
public class EAMPlanCDTDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMPLANCDTID]
*
*/
@JSONField(name = "eamplancdtid")
@JsonProperty("eamplancdtid")
private String eamplancdtid;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [EAMPLANCDTNAME]
*
*/
@JSONField(name = "eamplancdtname")
@JsonProperty("eamplancdtname")
private String eamplancdtname;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [EAMPLANID]
*
*/
@JSONField(name = "eamplanid")
@JsonProperty("eamplanid")
private String eamplanid;
/**
* 设置 [EAMPLANCDTNAME]
*/
public void setEamplancdtname(String eamplancdtname){
this.eamplancdtname = eamplancdtname ;
this.modify("eamplancdtname",eamplancdtname);
}
/**
* 设置 [EAMPLANID]
*/
public void setEamplanid(String eamplanid){
this.eamplanid = eamplanid ;
this.modify("eamplanid",eamplanid);
}
}
package cn.ibizlab.assetmanagement.assetapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[EAMPlanDTO]
*/
@Data
public class EAMPlanDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [EAMPLANNAME]
*
*/
@JSONField(name = "eamplanname")
@JsonProperty("eamplanname")
private String eamplanname;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [EAMPLANID]
*
*/
@JSONField(name = "eamplanid")
@JsonProperty("eamplanid")
private String eamplanid;
/**
* 属性 [EAMLOCATIONID]
*
*/
@JSONField(name = "eamlocationid")
@JsonProperty("eamlocationid")
private String eamlocationid;
/**
* 属性 [ASSETID]
*
*/
@JSONField(name = "assetid")
@JsonProperty("assetid")
private String assetid;
/**
* 属性 [ASSETNAME]
*
*/
@JSONField(name = "assetname")
@JsonProperty("assetname")
private String assetname;
/**
* 属性 [EAMLOCATIONNAME]
*
*/
@JSONField(name = "eamlocationname")
@JsonProperty("eamlocationname")
private String eamlocationname;
/**
* 属性 [PLANNUMBER]
*
*/
@JSONField(name = "plannumber")
@JsonProperty("plannumber")
private String plannumber;
/**
* 属性 [EAMMONITORPOINTID]
*
*/
@JSONField(name = "eammonitorpointid")
@JsonProperty("eammonitorpointid")
private String eammonitorpointid;
/**
* 属性 [EAMMONITORPOINTNAME]
*
*/
@JSONField(name = "eammonitorpointname")
@JsonProperty("eammonitorpointname")
private String eammonitorpointname;
/**
* 属性 [DESCRIPTION]
*
*/
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
* 属性 [MDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "mdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("mdate")
private Timestamp mdate;
/**
* 设置 [EAMPLANNAME]
*/
public void setEamplanname(String eamplanname){
this.eamplanname = eamplanname ;
this.modify("eamplanname",eamplanname);
}
/**
* 设置 [EAMLOCATIONID]
*/
public void setEamlocationid(String eamlocationid){
this.eamlocationid = eamlocationid ;
this.modify("eamlocationid",eamlocationid);
}
/**
* 设置 [ASSETID]
*/
public void setAssetid(String assetid){
this.assetid = assetid ;
this.modify("assetid",assetid);
}
/**
* 设置 [PLANNUMBER]
*/
public void setPlannumber(String plannumber){
this.plannumber = plannumber ;
this.modify("plannumber",plannumber);
}
/**
* 设置 [EAMMONITORPOINTID]
*/
public void setEammonitorpointid(String eammonitorpointid){
this.eammonitorpointid = eammonitorpointid ;
this.modify("eammonitorpointid",eammonitorpointid);
}
/**
* 设置 [DESCRIPTION]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
/**
* 设置 [MDATE]
*/
public void setMdate(Timestamp mdate){
this.mdate = mdate ;
this.modify("mdate",mdate);
}
}
package cn.ibizlab.assetmanagement.assetapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[EAMPlanLineDTO]
*/
@Data
public class EAMPlanLineDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMPLANLINEID]
*
*/
@JSONField(name = "eamplanlineid")
@JsonProperty("eamplanlineid")
private String eamplanlineid;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [EAMPLANLINENAME]
*
*/
@JSONField(name = "eamplanlinename")
@JsonProperty("eamplanlinename")
private String eamplanlinename;
/**
* 属性 [EAMPLANID]
*
*/
@JSONField(name = "eamplanid")
@JsonProperty("eamplanid")
private String eamplanid;
/**
* 属性 [EAMLOCATIONID]
*
*/
@JSONField(name = "eamlocationid")
@JsonProperty("eamlocationid")
private String eamlocationid;
/**
* 属性 [ASSETID]
*
*/
@JSONField(name = "assetid")
@JsonProperty("assetid")
private String assetid;
/**
* 设置 [EAMPLANLINENAME]
*/
public void setEamplanlinename(String eamplanlinename){
this.eamplanlinename = eamplanlinename ;
this.modify("eamplanlinename",eamplanlinename);
}
/**
* 设置 [EAMPLANID]
*/
public void setEamplanid(String eamplanid){
this.eamplanid = eamplanid ;
this.modify("eamplanid",eamplanid);
}
/**
* 设置 [EAMLOCATIONID]
*/
public void setEamlocationid(String eamlocationid){
this.eamlocationid = eamlocationid ;
this.modify("eamlocationid",eamlocationid);
}
/**
* 设置 [ASSETID]
*/
public void setAssetid(String assetid){
this.assetid = assetid ;
this.modify("assetid",assetid);
}
}
package cn.ibizlab.assetmanagement.assetapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[EAMPlanScheduleDTO]
*/
@Data
public class EAMPlanScheduleDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMPLANSCHEDULEID]
*
*/
@JSONField(name = "eamplanscheduleid")
@JsonProperty("eamplanscheduleid")
private String eamplanscheduleid;
/**
* 属性 [EAMPLANSCHEDULENAME]
*
*/
@JSONField(name = "eamplanschedulename")
@JsonProperty("eamplanschedulename")
private String eamplanschedulename;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [EAMPLANID]
*
*/
@JSONField(name = "eamplanid")
@JsonProperty("eamplanid")
private String eamplanid;
/**
* 设置 [EAMPLANSCHEDULENAME]
*/
public void setEamplanschedulename(String eamplanschedulename){
this.eamplanschedulename = eamplanschedulename ;
this.modify("eamplanschedulename",eamplanschedulename);
}
/**
* 设置 [EAMPLANID]
*/
public void setEamplanid(String eamplanid){
this.eamplanid = eamplanid ;
this.modify("eamplanid",eamplanid);
}
}
......@@ -222,6 +222,14 @@ public class EAMWorkOrderDTO extends DTOBase implements Serializable {
@JsonProperty("pworkordername")
private String pworkordername;
/**
* 属性 [DESCRIPTION]
*
*/
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
* 设置 [WORKORDERNAME]
......@@ -327,6 +335,14 @@ public class EAMWorkOrderDTO extends DTOBase implements Serializable {
this.modify("worklength",worklength);
}
/**
* 设置 [DESCRIPTION]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlanCDT;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMPlanCDTDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMPlanCDTMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMPlanCDTMapping extends MappingBase<EAMPlanCDTDTO, EAMPlanCDT> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlanLine;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMPlanLineDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMPlanLineMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMPlanLineMapping extends MappingBase<EAMPlanLineDTO, EAMPlanLine> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlan;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMPlanDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMPlanMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMPlanMapping extends MappingBase<EAMPlanDTO, EAMPlan> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlanSchedule;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMPlanScheduleDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMPlanScheduleMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMPlanScheduleMapping extends MappingBase<EAMPlanScheduleDTO, EAMPlanSchedule> {
}
package cn.ibizlab.assetmanagement.assetapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.assetmanagement.assetapi.dto.*;
import cn.ibizlab.assetmanagement.assetapi.mapping.*;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlanCDT;
import cn.ibizlab.assetmanagement.core.plan.service.IEAMPlanCDTService;
import cn.ibizlab.assetmanagement.core.plan.filter.EAMPlanCDTSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"维护计划条件" })
@RestController("AssetApi-eamplancdt")
@RequestMapping("")
public class EAMPlanCDTResource {
@Autowired
public IEAMPlanCDTService eamplancdtService;
@Autowired
@Lazy
public EAMPlanCDTMapping eamplancdtMapping;
@PreAuthorize("hasPermission(this.eamplancdtMapping.toDomain(#eamplancdtdto),'iBizAssetManagement-EAMPlanCDT-Create')")
@ApiOperation(value = "新建维护计划条件", tags = {"维护计划条件" }, notes = "新建维护计划条件")
@RequestMapping(method = RequestMethod.POST, value = "/eamplancdts")
@Transactional
public ResponseEntity<EAMPlanCDTDTO> create(@RequestBody EAMPlanCDTDTO eamplancdtdto) {
EAMPlanCDT domain = eamplancdtMapping.toDomain(eamplancdtdto);
eamplancdtService.create(domain);
EAMPlanCDTDTO dto = eamplancdtMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplancdtMapping.toDomain(#eamplancdtdtos),'iBizAssetManagement-EAMPlanCDT-Create')")
@ApiOperation(value = "批量新建维护计划条件", tags = {"维护计划条件" }, notes = "批量新建维护计划条件")
@RequestMapping(method = RequestMethod.POST, value = "/eamplancdts/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMPlanCDTDTO> eamplancdtdtos) {
eamplancdtService.createBatch(eamplancdtMapping.toDomain(eamplancdtdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamplancdt" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamplancdtService.get(#eamplancdt_id),'iBizAssetManagement-EAMPlanCDT-Update')")
@ApiOperation(value = "更新维护计划条件", tags = {"维护计划条件" }, notes = "更新维护计划条件")
@RequestMapping(method = RequestMethod.PUT, value = "/eamplancdts/{eamplancdt_id}")
@Transactional
public ResponseEntity<EAMPlanCDTDTO> update(@PathVariable("eamplancdt_id") String eamplancdt_id, @RequestBody EAMPlanCDTDTO eamplancdtdto) {
EAMPlanCDT domain = eamplancdtMapping.toDomain(eamplancdtdto);
domain .setEamplancdtid(eamplancdt_id);
eamplancdtService.update(domain );
EAMPlanCDTDTO dto = eamplancdtMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplancdtService.getEamplancdtByEntities(this.eamplancdtMapping.toDomain(#eamplancdtdtos)),'iBizAssetManagement-EAMPlanCDT-Update')")
@ApiOperation(value = "批量更新维护计划条件", tags = {"维护计划条件" }, notes = "批量更新维护计划条件")
@RequestMapping(method = RequestMethod.PUT, value = "/eamplancdts/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMPlanCDTDTO> eamplancdtdtos) {
eamplancdtService.updateBatch(eamplancdtMapping.toDomain(eamplancdtdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamplancdtService.get(#eamplancdt_id),'iBizAssetManagement-EAMPlanCDT-Remove')")
@ApiOperation(value = "删除维护计划条件", tags = {"维护计划条件" }, notes = "删除维护计划条件")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamplancdts/{eamplancdt_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamplancdt_id") String eamplancdt_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamplancdtService.remove(eamplancdt_id));
}
@PreAuthorize("hasPermission(this.eamplancdtService.getEamplancdtByIds(#ids),'iBizAssetManagement-EAMPlanCDT-Remove')")
@ApiOperation(value = "批量删除维护计划条件", tags = {"维护计划条件" }, notes = "批量删除维护计划条件")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamplancdts/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamplancdtService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamplancdtMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMPlanCDT-Get')")
@ApiOperation(value = "获取维护计划条件", tags = {"维护计划条件" }, notes = "获取维护计划条件")
@RequestMapping(method = RequestMethod.GET, value = "/eamplancdts/{eamplancdt_id}")
public ResponseEntity<EAMPlanCDTDTO> get(@PathVariable("eamplancdt_id") String eamplancdt_id) {
EAMPlanCDT domain = eamplancdtService.get(eamplancdt_id);
EAMPlanCDTDTO dto = eamplancdtMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取维护计划条件草稿", tags = {"维护计划条件" }, notes = "获取维护计划条件草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamplancdts/getdraft")
public ResponseEntity<EAMPlanCDTDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamplancdtMapping.toDto(eamplancdtService.getDraft(new EAMPlanCDT())));
}
@ApiOperation(value = "检查维护计划条件", tags = {"维护计划条件" }, notes = "检查维护计划条件")
@RequestMapping(method = RequestMethod.POST, value = "/eamplancdts/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMPlanCDTDTO eamplancdtdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplancdtService.checkKey(eamplancdtMapping.toDomain(eamplancdtdto)));
}
@PreAuthorize("hasPermission(this.eamplancdtMapping.toDomain(#eamplancdtdto),'iBizAssetManagement-EAMPlanCDT-Save')")
@ApiOperation(value = "保存维护计划条件", tags = {"维护计划条件" }, notes = "保存维护计划条件")
@RequestMapping(method = RequestMethod.POST, value = "/eamplancdts/save")
public ResponseEntity<Boolean> save(@RequestBody EAMPlanCDTDTO eamplancdtdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplancdtService.save(eamplancdtMapping.toDomain(eamplancdtdto)));
}
@PreAuthorize("hasPermission(this.eamplancdtMapping.toDomain(#eamplancdtdtos),'iBizAssetManagement-EAMPlanCDT-Save')")
@ApiOperation(value = "批量保存维护计划条件", tags = {"维护计划条件" }, notes = "批量保存维护计划条件")
@RequestMapping(method = RequestMethod.POST, value = "/eamplancdts/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMPlanCDTDTO> eamplancdtdtos) {
eamplancdtService.saveBatch(eamplancdtMapping.toDomain(eamplancdtdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlanCDT-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlanCDT-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"维护计划条件" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamplancdts/fetchdefault")
public ResponseEntity<List<EAMPlanCDTDTO>> fetchDefault(EAMPlanCDTSearchContext context) {
Page<EAMPlanCDT> domains = eamplancdtService.searchDefault(context) ;
List<EAMPlanCDTDTO> list = eamplancdtMapping.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-EAMPlanCDT-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlanCDT-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"维护计划条件" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamplancdts/searchdefault")
public ResponseEntity<Page<EAMPlanCDTDTO>> searchDefault(@RequestBody EAMPlanCDTSearchContext context) {
Page<EAMPlanCDT> domains = eamplancdtService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamplancdtMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.assetmanagement.assetapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.assetmanagement.assetapi.dto.*;
import cn.ibizlab.assetmanagement.assetapi.mapping.*;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlanLine;
import cn.ibizlab.assetmanagement.core.plan.service.IEAMPlanLineService;
import cn.ibizlab.assetmanagement.core.plan.filter.EAMPlanLineSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"计划步骤" })
@RestController("AssetApi-eamplanline")
@RequestMapping("")
public class EAMPlanLineResource {
@Autowired
public IEAMPlanLineService eamplanlineService;
@Autowired
@Lazy
public EAMPlanLineMapping eamplanlineMapping;
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedto),'iBizAssetManagement-EAMPlanLine-Create')")
@ApiOperation(value = "新建计划步骤", tags = {"计划步骤" }, notes = "新建计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamplanlines")
@Transactional
public ResponseEntity<EAMPlanLineDTO> create(@RequestBody EAMPlanLineDTO eamplanlinedto) {
EAMPlanLine domain = eamplanlineMapping.toDomain(eamplanlinedto);
eamplanlineService.create(domain);
EAMPlanLineDTO dto = eamplanlineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedtos),'iBizAssetManagement-EAMPlanLine-Create')")
@ApiOperation(value = "批量新建计划步骤", tags = {"计划步骤" }, notes = "批量新建计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamplanlines/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMPlanLineDTO> eamplanlinedtos) {
eamplanlineService.createBatch(eamplanlineMapping.toDomain(eamplanlinedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamplanline" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamplanlineService.get(#eamplanline_id),'iBizAssetManagement-EAMPlanLine-Update')")
@ApiOperation(value = "更新计划步骤", tags = {"计划步骤" }, notes = "更新计划步骤")
@RequestMapping(method = RequestMethod.PUT, value = "/eamplanlines/{eamplanline_id}")
@Transactional
public ResponseEntity<EAMPlanLineDTO> update(@PathVariable("eamplanline_id") String eamplanline_id, @RequestBody EAMPlanLineDTO eamplanlinedto) {
EAMPlanLine domain = eamplanlineMapping.toDomain(eamplanlinedto);
domain .setEamplanlineid(eamplanline_id);
eamplanlineService.update(domain );
EAMPlanLineDTO dto = eamplanlineMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanlineService.getEamplanlineByEntities(this.eamplanlineMapping.toDomain(#eamplanlinedtos)),'iBizAssetManagement-EAMPlanLine-Update')")
@ApiOperation(value = "批量更新计划步骤", tags = {"计划步骤" }, notes = "批量更新计划步骤")
@RequestMapping(method = RequestMethod.PUT, value = "/eamplanlines/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMPlanLineDTO> eamplanlinedtos) {
eamplanlineService.updateBatch(eamplanlineMapping.toDomain(eamplanlinedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamplanlineService.get(#eamplanline_id),'iBizAssetManagement-EAMPlanLine-Remove')")
@ApiOperation(value = "删除计划步骤", tags = {"计划步骤" }, notes = "删除计划步骤")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamplanlines/{eamplanline_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamplanline_id") String eamplanline_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineService.remove(eamplanline_id));
}
@PreAuthorize("hasPermission(this.eamplanlineService.getEamplanlineByIds(#ids),'iBizAssetManagement-EAMPlanLine-Remove')")
@ApiOperation(value = "批量删除计划步骤", tags = {"计划步骤" }, notes = "批量删除计划步骤")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamplanlines/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamplanlineService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamplanlineMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMPlanLine-Get')")
@ApiOperation(value = "获取计划步骤", tags = {"计划步骤" }, notes = "获取计划步骤")
@RequestMapping(method = RequestMethod.GET, value = "/eamplanlines/{eamplanline_id}")
public ResponseEntity<EAMPlanLineDTO> get(@PathVariable("eamplanline_id") String eamplanline_id) {
EAMPlanLine domain = eamplanlineService.get(eamplanline_id);
EAMPlanLineDTO dto = eamplanlineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取计划步骤草稿", tags = {"计划步骤" }, notes = "获取计划步骤草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamplanlines/getdraft")
public ResponseEntity<EAMPlanLineDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineMapping.toDto(eamplanlineService.getDraft(new EAMPlanLine())));
}
@ApiOperation(value = "检查计划步骤", tags = {"计划步骤" }, notes = "检查计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamplanlines/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMPlanLineDTO eamplanlinedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineService.checkKey(eamplanlineMapping.toDomain(eamplanlinedto)));
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedto),'iBizAssetManagement-EAMPlanLine-Save')")
@ApiOperation(value = "保存计划步骤", tags = {"计划步骤" }, notes = "保存计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamplanlines/save")
public ResponseEntity<Boolean> save(@RequestBody EAMPlanLineDTO eamplanlinedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineService.save(eamplanlineMapping.toDomain(eamplanlinedto)));
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedtos),'iBizAssetManagement-EAMPlanLine-Save')")
@ApiOperation(value = "批量保存计划步骤", tags = {"计划步骤" }, notes = "批量保存计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamplanlines/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMPlanLineDTO> eamplanlinedtos) {
eamplanlineService.saveBatch(eamplanlineMapping.toDomain(eamplanlinedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlanLine-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlanLine-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"计划步骤" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamplanlines/fetchdefault")
public ResponseEntity<List<EAMPlanLineDTO>> fetchDefault(EAMPlanLineSearchContext context) {
Page<EAMPlanLine> domains = eamplanlineService.searchDefault(context) ;
List<EAMPlanLineDTO> list = eamplanlineMapping.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-EAMPlanLine-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlanLine-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"计划步骤" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamplanlines/searchdefault")
public ResponseEntity<Page<EAMPlanLineDTO>> searchDefault(@RequestBody EAMPlanLineSearchContext context) {
Page<EAMPlanLine> domains = eamplanlineService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamplanlineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.assetmanagement.assetapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.assetmanagement.assetapi.dto.*;
import cn.ibizlab.assetmanagement.assetapi.mapping.*;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlan;
import cn.ibizlab.assetmanagement.core.plan.service.IEAMPlanService;
import cn.ibizlab.assetmanagement.core.plan.filter.EAMPlanSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"维护计划" })
@RestController("AssetApi-eamplan")
@RequestMapping("")
public class EAMPlanResource {
@Autowired
public IEAMPlanService eamplanService;
@Autowired
@Lazy
public EAMPlanMapping eamplanMapping;
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandto),'iBizAssetManagement-EAMPlan-Create')")
@ApiOperation(value = "新建维护计划", tags = {"维护计划" }, notes = "新建维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamplans")
@Transactional
public ResponseEntity<EAMPlanDTO> create(@RequestBody EAMPlanDTO eamplandto) {
EAMPlan domain = eamplanMapping.toDomain(eamplandto);
eamplanService.create(domain);
EAMPlanDTO dto = eamplanMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandtos),'iBizAssetManagement-EAMPlan-Create')")
@ApiOperation(value = "批量新建维护计划", tags = {"维护计划" }, notes = "批量新建维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamplans/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMPlanDTO> eamplandtos) {
eamplanService.createBatch(eamplanMapping.toDomain(eamplandtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamplan" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamplanService.get(#eamplan_id),'iBizAssetManagement-EAMPlan-Update')")
@ApiOperation(value = "更新维护计划", tags = {"维护计划" }, notes = "更新维护计划")
@RequestMapping(method = RequestMethod.PUT, value = "/eamplans/{eamplan_id}")
@Transactional
public ResponseEntity<EAMPlanDTO> update(@PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanDTO eamplandto) {
EAMPlan domain = eamplanMapping.toDomain(eamplandto);
domain .setEamplanid(eamplan_id);
eamplanService.update(domain );
EAMPlanDTO dto = eamplanMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanService.getEamplanByEntities(this.eamplanMapping.toDomain(#eamplandtos)),'iBizAssetManagement-EAMPlan-Update')")
@ApiOperation(value = "批量更新维护计划", tags = {"维护计划" }, notes = "批量更新维护计划")
@RequestMapping(method = RequestMethod.PUT, value = "/eamplans/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMPlanDTO> eamplandtos) {
eamplanService.updateBatch(eamplanMapping.toDomain(eamplandtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamplanService.get(#eamplan_id),'iBizAssetManagement-EAMPlan-Remove')")
@ApiOperation(value = "删除维护计划", tags = {"维护计划" }, notes = "删除维护计划")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamplans/{eamplan_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamplan_id") String eamplan_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanService.remove(eamplan_id));
}
@PreAuthorize("hasPermission(this.eamplanService.getEamplanByIds(#ids),'iBizAssetManagement-EAMPlan-Remove')")
@ApiOperation(value = "批量删除维护计划", tags = {"维护计划" }, notes = "批量删除维护计划")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamplans/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamplanService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamplanMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMPlan-Get')")
@ApiOperation(value = "获取维护计划", tags = {"维护计划" }, notes = "获取维护计划")
@RequestMapping(method = RequestMethod.GET, value = "/eamplans/{eamplan_id}")
public ResponseEntity<EAMPlanDTO> get(@PathVariable("eamplan_id") String eamplan_id) {
EAMPlan domain = eamplanService.get(eamplan_id);
EAMPlanDTO dto = eamplanMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取维护计划草稿", tags = {"维护计划" }, notes = "获取维护计划草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamplans/getdraft")
public ResponseEntity<EAMPlanDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamplanMapping.toDto(eamplanService.getDraft(new EAMPlan())));
}
@ApiOperation(value = "检查维护计划", tags = {"维护计划" }, notes = "检查维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamplans/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMPlanDTO eamplandto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanService.checkKey(eamplanMapping.toDomain(eamplandto)));
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandto),'iBizAssetManagement-EAMPlan-Save')")
@ApiOperation(value = "保存维护计划", tags = {"维护计划" }, notes = "保存维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamplans/save")
public ResponseEntity<Boolean> save(@RequestBody EAMPlanDTO eamplandto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanService.save(eamplanMapping.toDomain(eamplandto)));
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandtos),'iBizAssetManagement-EAMPlan-Save')")
@ApiOperation(value = "批量保存维护计划", tags = {"维护计划" }, notes = "批量保存维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamplans/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMPlanDTO> eamplandtos) {
eamplanService.saveBatch(eamplanMapping.toDomain(eamplandtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlan-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlan-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"维护计划" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamplans/fetchdefault")
public ResponseEntity<List<EAMPlanDTO>> fetchDefault(EAMPlanSearchContext context) {
Page<EAMPlan> domains = eamplanService.searchDefault(context) ;
List<EAMPlanDTO> list = eamplanMapping.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-EAMPlan-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlan-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"维护计划" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamplans/searchdefault")
public ResponseEntity<Page<EAMPlanDTO>> searchDefault(@RequestBody EAMPlanSearchContext context) {
Page<EAMPlan> domains = eamplanService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamplanMapping.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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册