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

lab_gzf 部署微服务接口

上级 b3d8553e
......@@ -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:
......
......@@ -35,14 +35,34 @@ zuul:
path: /eamassetstatemodellines/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamapplytype:
path: /eamapplytypes/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamproduct:
path: /eamproducts/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamsparepartspro:
path: /eamsparepartspros/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamapplystatemodelline:
path: /eamapplystatemodellines/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamsparepartsgroup:
path: /eamsparepartsgroups/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamlocationstatemodelline:
path: /eamlocationstatemodellines/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamassetpartsgroup:
path: /eamassetpartsgroups/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamasset:
path: /eamassets/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
......
package cn.ibizlab.assetmanagement.core.apply.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApply;
import cn.ibizlab.assetmanagement.core.workorder.domain.WOOrigin;
import java.util.List;
@Mapper(componentModel = "spring", uses = {})
public interface EAMApplyInheritMapping {
@Mappings({
@Mapping(source ="eamapplyid",target = "wooriginid"),
@Mapping(source ="eamapplyname",target = "wooriginname"),
@Mapping(target ="focusNull",ignore = true),
})
WOOrigin toWoorigin(EAMApply eamapply);
@Mappings({
@Mapping(source ="wooriginid" ,target = "eamapplyid"),
@Mapping(source ="wooriginname" ,target = "eamapplyname"),
@Mapping(target ="focusNull",ignore = true),
})
EAMApply toEamapply(WOOrigin woorigin);
List<WOOrigin> toWoorigin(List<EAMApply> eamapply);
List<EAMApply> toEamapply(List<WOOrigin> woorigin);
}
......@@ -60,6 +60,7 @@ public class EAMApplyServiceImpl extends ServiceImpl<EAMApplyMapper, EAMApply> i
@Override
@Transactional
public boolean create(EAMApply et) {
createIndexMajorEntityData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamapplyid()),et);
......@@ -74,6 +75,7 @@ public class EAMApplyServiceImpl extends ServiceImpl<EAMApplyMapper, EAMApply> i
@Override
@Transactional
public boolean update(EAMApply et) {
wooriginService.update(eamapplyInheritMapping.toWoorigin(et));
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamapplyid",et.getEamapplyid())))
return false;
CachedBeanCopier.copy(get(et.getEamapplyid()),et);
......@@ -88,6 +90,7 @@ public class EAMApplyServiceImpl extends ServiceImpl<EAMApplyMapper, EAMApply> i
@Override
@Transactional
public boolean remove(String key) {
wooriginService.remove(key);
boolean result=removeById(key);
return result ;
}
......@@ -194,6 +197,23 @@ public class EAMApplyServiceImpl extends ServiceImpl<EAMApplyMapper, EAMApply> i
@Autowired
cn.ibizlab.assetmanagement.core.apply.mapping.EAMApplyInheritMapping eamapplyInheritMapping;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.workorder.service.IWOOriginService wooriginService;
/**
* 创建索引主实体数据
* @param et
*/
private void createIndexMajorEntityData(EAMApply et){
if(ObjectUtils.isEmpty(et.getEamapplyid()))
et.setEamapplyid((String)et.getDefaultKey(true));
cn.ibizlab.assetmanagement.core.workorder.domain.WOOrigin woorigin =eamapplyInheritMapping.toWoorigin(et);
woorigin.set("woorigintype","APPLY");
wooriginService.create(woorigin);
}
@Override
public List<JSONObject> select(String sql, Map param){
......
package cn.ibizlab.assetmanagement.core.asset.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 = "EAMASSETPARTSGROUP",resultMap = "EAMAssetPartsGroupResultMap")
public class EAMAssetPartsGroup extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 资产类型标识
*/
@TableField(value = "eamassettypeid")
@JSONField(name = "eamassettypeid")
@JsonProperty("eamassettypeid")
private String eamassettypeid;
/**
* 备件包标识
*/
@TableField(value = "eamsparepartsgroupid")
@JSONField(name = "eamsparepartsgroupid")
@JsonProperty("eamsparepartsgroupid")
private String eamsparepartsgroupid;
/**
* 资产备件包标识
*/
@DEField(isKeyField=true)
@TableId(value= "eamassetpartsgroupid",type=IdType.ASSIGN_UUID)
@JSONField(name = "eamassetpartsgroupid")
@JsonProperty("eamassetpartsgroupid")
private String eamassetpartsgroupid;
/**
* 资产备件包名称
*/
@TableField(value = "eamassetpartsgroupname")
@JSONField(name = "eamassetpartsgroupname")
@JsonProperty("eamassetpartsgroupname")
private String eamassetpartsgroupname;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 建立时间
*/
@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.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;
/**
* 备件包
*/
@TableField(exist = false)
@JSONField(name = "eamsparepartsgroupname")
@JsonProperty("eamsparepartsgroupname")
private String eamsparepartsgroupname;
/**
* 资产类型
*/
@TableField(exist = false)
@JSONField(name = "eamassettypename")
@JsonProperty("eamassettypename")
private String eamassettypename;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetType eamassettype;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup eamsparepartsgroup;
/**
* 设置 [资产类型标识]
*/
public void setEamassettypeid(String eamassettypeid){
this.eamassettypeid = eamassettypeid ;
this.modify("eamassettypeid",eamassettypeid);
}
/**
* 设置 [备件包标识]
*/
public void setEamsparepartsgroupid(String eamsparepartsgroupid){
this.eamsparepartsgroupid = eamsparepartsgroupid ;
this.modify("eamsparepartsgroupid",eamsparepartsgroupid);
}
/**
* 设置 [资产备件包名称]
*/
public void setEamassetpartsgroupname(String eamassetpartsgroupname){
this.eamassetpartsgroupname = eamassetpartsgroupname ;
this.modify("eamassetpartsgroupname",eamassetpartsgroupname);
}
}
package cn.ibizlab.assetmanagement.core.asset.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 = "PRODUCT",resultMap = "EAMPRODUCTResultMap")
public class EAMPRODUCT extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 产品标识
*/
@DEField(isKeyField=true)
@TableId(value= "productid",type=IdType.ASSIGN_UUID)
@JSONField(name = "productid")
@JsonProperty("productid")
private String productid;
/**
* 产品名称
*/
@TableField(value = "productname")
@JSONField(name = "productname")
@JsonProperty("productname")
private String productname;
/**
* 建立时间
*/
@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;
/**
* 更新时间
*/
@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.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 产品编号
*/
@TableField(value = "productnumber")
@JSONField(name = "productnumber")
@JsonProperty("productnumber")
private String productnumber;
/**
* 设置 [产品名称]
*/
public void setProductname(String productname){
this.productname = productname ;
this.modify("productname",productname);
}
/**
* 设置 [产品编号]
*/
public void setProductnumber(String productnumber){
this.productnumber = productnumber ;
this.modify("productnumber",productnumber);
}
}
package cn.ibizlab.assetmanagement.core.asset.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 = "EAMSPAREPARTSGROUP",resultMap = "EAMSparePartsGroupResultMap")
public class EAMSparePartsGroup extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 备件包标识
*/
@DEField(isKeyField=true)
@TableId(value= "eamsparepartsgroupid",type=IdType.ASSIGN_UUID)
@JSONField(name = "eamsparepartsgroupid")
@JsonProperty("eamsparepartsgroupid")
private String eamsparepartsgroupid;
/**
* 备件包名称
*/
@TableField(value = "eamsparepartsgroupname")
@JSONField(name = "eamsparepartsgroupname")
@JsonProperty("eamsparepartsgroupname")
private String eamsparepartsgroupname;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 建立时间
*/
@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.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;
/**
* 备件包编号
*/
@TableField(value = "sparepartsgrpnumber")
@JSONField(name = "sparepartsgrpnumber")
@JsonProperty("sparepartsgrpnumber")
private String sparepartsgrpnumber;
/**
* 设置 [备件包名称]
*/
public void setEamsparepartsgroupname(String eamsparepartsgroupname){
this.eamsparepartsgroupname = eamsparepartsgroupname ;
this.modify("eamsparepartsgroupname",eamsparepartsgroupname);
}
/**
* 设置 [备件包编号]
*/
public void setSparepartsgrpnumber(String sparepartsgrpnumber){
this.sparepartsgrpnumber = sparepartsgrpnumber ;
this.modify("sparepartsgrpnumber",sparepartsgrpnumber);
}
}
package cn.ibizlab.assetmanagement.core.asset.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 = "EAMSPAREPARTSPRO",resultMap = "EAMSparePartsPROResultMap")
public class EAMSparePartsPRO extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 备件包标识
*/
@TableField(value = "eamsparepartsgroupid")
@JSONField(name = "eamsparepartsgroupid")
@JsonProperty("eamsparepartsgroupid")
private String eamsparepartsgroupid;
/**
* 产品标识
*/
@TableField(value = "productid")
@JSONField(name = "productid")
@JsonProperty("productid")
private String productid;
/**
* 备件包物料标识
*/
@DEField(isKeyField=true)
@TableId(value= "eamsparepartsproid",type=IdType.ASSIGN_UUID)
@JSONField(name = "eamsparepartsproid")
@JsonProperty("eamsparepartsproid")
private String eamsparepartsproid;
/**
* 备件包物料名称
*/
@TableField(value = "eamsparepartsproname")
@JSONField(name = "eamsparepartsproname")
@JsonProperty("eamsparepartsproname")
private String eamsparepartsproname;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 建立时间
*/
@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.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;
/**
* 备件包
*/
@TableField(exist = false)
@JSONField(name = "eamsparepartsgroupname")
@JsonProperty("eamsparepartsgroupname")
private String eamsparepartsgroupname;
/**
* 产品
*/
@TableField(exist = false)
@JSONField(name = "productname")
@JsonProperty("productname")
private String productname;
/**
* 产品编号
*/
@TableField(exist = false)
@JSONField(name = "productnumber")
@JsonProperty("productnumber")
private String productnumber;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.asset.domain.EAMPRODUCT product;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup eamsparepartsgroup;
/**
* 设置 [备件包标识]
*/
public void setEamsparepartsgroupid(String eamsparepartsgroupid){
this.eamsparepartsgroupid = eamsparepartsgroupid ;
this.modify("eamsparepartsgroupid",eamsparepartsgroupid);
}
/**
* 设置 [产品标识]
*/
public void setProductid(String productid){
this.productid = productid ;
this.modify("productid",productid);
}
/**
* 设置 [备件包物料名称]
*/
public void setEamsparepartsproname(String eamsparepartsproname){
this.eamsparepartsproname = eamsparepartsproname ;
this.modify("eamsparepartsproname",eamsparepartsproname);
}
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMAssetPartsGroup;
/**
* 关系型数据实体[EAMAssetPartsGroup] 查询条件对象
*/
@Slf4j
@Data
public class EAMAssetPartsGroupSearchContext extends QueryWrapperContext<EAMAssetPartsGroup> {
private String n_eamassettypeid_eq;//[资产类型标识]
public void setN_eamassettypeid_eq(String n_eamassettypeid_eq) {
this.n_eamassettypeid_eq = n_eamassettypeid_eq;
if(!ObjectUtils.isEmpty(this.n_eamassettypeid_eq)){
this.getSearchCond().eq("eamassettypeid", n_eamassettypeid_eq);
}
}
private String n_eamsparepartsgroupid_eq;//[备件包标识]
public void setN_eamsparepartsgroupid_eq(String n_eamsparepartsgroupid_eq) {
this.n_eamsparepartsgroupid_eq = n_eamsparepartsgroupid_eq;
if(!ObjectUtils.isEmpty(this.n_eamsparepartsgroupid_eq)){
this.getSearchCond().eq("eamsparepartsgroupid", n_eamsparepartsgroupid_eq);
}
}
private String n_eamassetpartsgroupname_like;//[资产备件包名称]
public void setN_eamassetpartsgroupname_like(String n_eamassetpartsgroupname_like) {
this.n_eamassetpartsgroupname_like = n_eamassetpartsgroupname_like;
if(!ObjectUtils.isEmpty(this.n_eamassetpartsgroupname_like)){
this.getSearchCond().like("eamassetpartsgroupname", n_eamassetpartsgroupname_like);
}
}
private String n_eamsparepartsgroupname_eq;//[备件包]
public void setN_eamsparepartsgroupname_eq(String n_eamsparepartsgroupname_eq) {
this.n_eamsparepartsgroupname_eq = n_eamsparepartsgroupname_eq;
if(!ObjectUtils.isEmpty(this.n_eamsparepartsgroupname_eq)){
this.getSearchCond().eq("eamsparepartsgroupname", n_eamsparepartsgroupname_eq);
}
}
private String n_eamsparepartsgroupname_like;//[备件包]
public void setN_eamsparepartsgroupname_like(String n_eamsparepartsgroupname_like) {
this.n_eamsparepartsgroupname_like = n_eamsparepartsgroupname_like;
if(!ObjectUtils.isEmpty(this.n_eamsparepartsgroupname_like)){
this.getSearchCond().like("eamsparepartsgroupname", n_eamsparepartsgroupname_like);
}
}
private String n_eamassettypename_eq;//[资产类型]
public void setN_eamassettypename_eq(String n_eamassettypename_eq) {
this.n_eamassettypename_eq = n_eamassettypename_eq;
if(!ObjectUtils.isEmpty(this.n_eamassettypename_eq)){
this.getSearchCond().eq("eamassettypename", n_eamassettypename_eq);
}
}
private String n_eamassettypename_like;//[资产类型]
public void setN_eamassettypename_like(String n_eamassettypename_like) {
this.n_eamassettypename_like = n_eamassettypename_like;
if(!ObjectUtils.isEmpty(this.n_eamassettypename_like)){
this.getSearchCond().like("eamassettypename", n_eamassettypename_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("eamassetpartsgroupname", query)
);
}
}
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMPRODUCT;
/**
* 关系型数据实体[EAMPRODUCT] 查询条件对象
*/
@Slf4j
@Data
public class EAMPRODUCTSearchContext extends QueryWrapperContext<EAMPRODUCT> {
private String n_productname_like;//[产品名称]
public void setN_productname_like(String n_productname_like) {
this.n_productname_like = n_productname_like;
if(!ObjectUtils.isEmpty(this.n_productname_like)){
this.getSearchCond().like("productname", n_productname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("productname", query)
);
}
}
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMSparePartsGroup;
/**
* 关系型数据实体[EAMSparePartsGroup] 查询条件对象
*/
@Slf4j
@Data
public class EAMSparePartsGroupSearchContext extends QueryWrapperContext<EAMSparePartsGroup> {
private String n_eamsparepartsgroupname_like;//[备件包名称]
public void setN_eamsparepartsgroupname_like(String n_eamsparepartsgroupname_like) {
this.n_eamsparepartsgroupname_like = n_eamsparepartsgroupname_like;
if(!ObjectUtils.isEmpty(this.n_eamsparepartsgroupname_like)){
this.getSearchCond().like("eamsparepartsgroupname", n_eamsparepartsgroupname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("eamsparepartsgroupname", query)
);
}
}
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMSparePartsPRO;
/**
* 关系型数据实体[EAMSparePartsPRO] 查询条件对象
*/
@Slf4j
@Data
public class EAMSparePartsPROSearchContext extends QueryWrapperContext<EAMSparePartsPRO> {
private String n_eamsparepartsgroupid_eq;//[备件包标识]
public void setN_eamsparepartsgroupid_eq(String n_eamsparepartsgroupid_eq) {
this.n_eamsparepartsgroupid_eq = n_eamsparepartsgroupid_eq;
if(!ObjectUtils.isEmpty(this.n_eamsparepartsgroupid_eq)){
this.getSearchCond().eq("eamsparepartsgroupid", n_eamsparepartsgroupid_eq);
}
}
private String n_productid_eq;//[产品标识]
public void setN_productid_eq(String n_productid_eq) {
this.n_productid_eq = n_productid_eq;
if(!ObjectUtils.isEmpty(this.n_productid_eq)){
this.getSearchCond().eq("productid", n_productid_eq);
}
}
private String n_eamsparepartsproname_like;//[备件包物料名称]
public void setN_eamsparepartsproname_like(String n_eamsparepartsproname_like) {
this.n_eamsparepartsproname_like = n_eamsparepartsproname_like;
if(!ObjectUtils.isEmpty(this.n_eamsparepartsproname_like)){
this.getSearchCond().like("eamsparepartsproname", n_eamsparepartsproname_like);
}
}
private String n_eamsparepartsgroupname_eq;//[备件包]
public void setN_eamsparepartsgroupname_eq(String n_eamsparepartsgroupname_eq) {
this.n_eamsparepartsgroupname_eq = n_eamsparepartsgroupname_eq;
if(!ObjectUtils.isEmpty(this.n_eamsparepartsgroupname_eq)){
this.getSearchCond().eq("eamsparepartsgroupname", n_eamsparepartsgroupname_eq);
}
}
private String n_eamsparepartsgroupname_like;//[备件包]
public void setN_eamsparepartsgroupname_like(String n_eamsparepartsgroupname_like) {
this.n_eamsparepartsgroupname_like = n_eamsparepartsgroupname_like;
if(!ObjectUtils.isEmpty(this.n_eamsparepartsgroupname_like)){
this.getSearchCond().like("eamsparepartsgroupname", n_eamsparepartsgroupname_like);
}
}
private String n_productname_eq;//[产品]
public void setN_productname_eq(String n_productname_eq) {
this.n_productname_eq = n_productname_eq;
if(!ObjectUtils.isEmpty(this.n_productname_eq)){
this.getSearchCond().eq("productname", n_productname_eq);
}
}
private String n_productname_like;//[产品]
public void setN_productname_like(String n_productname_like) {
this.n_productname_like = n_productname_like;
if(!ObjectUtils.isEmpty(this.n_productname_like)){
this.getSearchCond().like("productname", n_productname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("eamsparepartsproname", query)
);
}
}
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMAssetPartsGroup;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMAssetPartsGroupSearchContext;
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 EAMAssetPartsGroupMapper extends BaseMapper<EAMAssetPartsGroup>{
Page<EAMAssetPartsGroup> searchDefault(IPage page, @Param("srf") EAMAssetPartsGroupSearchContext context, @Param("ew") Wrapper<EAMAssetPartsGroup> wrapper) ;
@Override
EAMAssetPartsGroup selectById(Serializable id);
@Override
int insert(EAMAssetPartsGroup entity);
@Override
int updateById(@Param(Constants.ENTITY) EAMAssetPartsGroup entity);
@Override
int update(@Param(Constants.ENTITY) EAMAssetPartsGroup entity, @Param("ew") Wrapper<EAMAssetPartsGroup> 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);
List<EAMAssetPartsGroup> selectByEamassettypeid(@Param("eamassettypeid") Serializable eamassettypeid) ;
List<EAMAssetPartsGroup> selectByEamsparepartsgroupid(@Param("eamsparepartsgroupid") Serializable eamsparepartsgroupid) ;
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMPRODUCT;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMPRODUCTSearchContext;
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 EAMPRODUCTMapper extends BaseMapper<EAMPRODUCT>{
Page<EAMPRODUCT> searchDefault(IPage page, @Param("srf") EAMPRODUCTSearchContext context, @Param("ew") Wrapper<EAMPRODUCT> wrapper) ;
@Override
EAMPRODUCT selectById(Serializable id);
@Override
int insert(EAMPRODUCT entity);
@Override
int updateById(@Param(Constants.ENTITY) EAMPRODUCT entity);
@Override
int update(@Param(Constants.ENTITY) EAMPRODUCT entity, @Param("ew") Wrapper<EAMPRODUCT> 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.asset.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.asset.domain.EAMSparePartsGroup;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsGroupSearchContext;
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 EAMSparePartsGroupMapper extends BaseMapper<EAMSparePartsGroup>{
Page<EAMSparePartsGroup> searchDefault(IPage page, @Param("srf") EAMSparePartsGroupSearchContext context, @Param("ew") Wrapper<EAMSparePartsGroup> wrapper) ;
@Override
EAMSparePartsGroup selectById(Serializable id);
@Override
int insert(EAMSparePartsGroup entity);
@Override
int updateById(@Param(Constants.ENTITY) EAMSparePartsGroup entity);
@Override
int update(@Param(Constants.ENTITY) EAMSparePartsGroup entity, @Param("ew") Wrapper<EAMSparePartsGroup> 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.asset.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.asset.domain.EAMSparePartsPRO;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsPROSearchContext;
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 EAMSparePartsPROMapper extends BaseMapper<EAMSparePartsPRO>{
Page<EAMSparePartsPRO> searchDefault(IPage page, @Param("srf") EAMSparePartsPROSearchContext context, @Param("ew") Wrapper<EAMSparePartsPRO> wrapper) ;
@Override
EAMSparePartsPRO selectById(Serializable id);
@Override
int insert(EAMSparePartsPRO entity);
@Override
int updateById(@Param(Constants.ENTITY) EAMSparePartsPRO entity);
@Override
int update(@Param(Constants.ENTITY) EAMSparePartsPRO entity, @Param("ew") Wrapper<EAMSparePartsPRO> 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);
List<EAMSparePartsPRO> selectByProductid(@Param("productid") Serializable productid) ;
List<EAMSparePartsPRO> selectByEamsparepartsgroupid(@Param("eamsparepartsgroupid") Serializable eamsparepartsgroupid) ;
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMAssetPartsGroup;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMAssetPartsGroupSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[EAMAssetPartsGroup] 服务对象接口
*/
public interface IEAMAssetPartsGroupService extends IService<EAMAssetPartsGroup>{
boolean create(EAMAssetPartsGroup et) ;
void createBatch(List<EAMAssetPartsGroup> list) ;
boolean update(EAMAssetPartsGroup et) ;
void updateBatch(List<EAMAssetPartsGroup> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
EAMAssetPartsGroup get(String key) ;
EAMAssetPartsGroup getDraft(EAMAssetPartsGroup et) ;
boolean checkKey(EAMAssetPartsGroup et) ;
boolean save(EAMAssetPartsGroup et) ;
void saveBatch(List<EAMAssetPartsGroup> list) ;
Page<EAMAssetPartsGroup> searchDefault(EAMAssetPartsGroupSearchContext context) ;
List<EAMAssetPartsGroup> selectByEamassettypeid(String eamassettypeid) ;
void removeByEamassettypeid(String eamassettypeid) ;
List<EAMAssetPartsGroup> selectByEamsparepartsgroupid(String eamsparepartsgroupid) ;
void removeByEamsparepartsgroupid(String eamsparepartsgroupid) ;
/**
*自定义查询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<EAMAssetPartsGroup> getEamassetpartsgroupByIds(List<String> ids) ;
List<EAMAssetPartsGroup> getEamassetpartsgroupByEntities(List<EAMAssetPartsGroup> entities) ;
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMPRODUCT;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMPRODUCTSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[EAMPRODUCT] 服务对象接口
*/
public interface IEAMPRODUCTService extends IService<EAMPRODUCT>{
boolean create(EAMPRODUCT et) ;
void createBatch(List<EAMPRODUCT> list) ;
boolean update(EAMPRODUCT et) ;
void updateBatch(List<EAMPRODUCT> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
EAMPRODUCT get(String key) ;
EAMPRODUCT getDraft(EAMPRODUCT et) ;
boolean checkKey(EAMPRODUCT et) ;
boolean save(EAMPRODUCT et) ;
void saveBatch(List<EAMPRODUCT> list) ;
Page<EAMPRODUCT> searchDefault(EAMPRODUCTSearchContext 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<EAMPRODUCT> getEamproductByIds(List<String> ids) ;
List<EAMPRODUCT> getEamproductByEntities(List<EAMPRODUCT> entities) ;
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMSparePartsGroup;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsGroupSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[EAMSparePartsGroup] 服务对象接口
*/
public interface IEAMSparePartsGroupService extends IService<EAMSparePartsGroup>{
boolean create(EAMSparePartsGroup et) ;
void createBatch(List<EAMSparePartsGroup> list) ;
boolean update(EAMSparePartsGroup et) ;
void updateBatch(List<EAMSparePartsGroup> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
EAMSparePartsGroup get(String key) ;
EAMSparePartsGroup getDraft(EAMSparePartsGroup et) ;
boolean checkKey(EAMSparePartsGroup et) ;
boolean save(EAMSparePartsGroup et) ;
void saveBatch(List<EAMSparePartsGroup> list) ;
Page<EAMSparePartsGroup> searchDefault(EAMSparePartsGroupSearchContext 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<EAMSparePartsGroup> getEamsparepartsgroupByIds(List<String> ids) ;
List<EAMSparePartsGroup> getEamsparepartsgroupByEntities(List<EAMSparePartsGroup> entities) ;
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMSparePartsPRO;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsPROSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[EAMSparePartsPRO] 服务对象接口
*/
public interface IEAMSparePartsPROService extends IService<EAMSparePartsPRO>{
boolean create(EAMSparePartsPRO et) ;
void createBatch(List<EAMSparePartsPRO> list) ;
boolean update(EAMSparePartsPRO et) ;
void updateBatch(List<EAMSparePartsPRO> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
EAMSparePartsPRO get(String key) ;
EAMSparePartsPRO getDraft(EAMSparePartsPRO et) ;
boolean checkKey(EAMSparePartsPRO et) ;
boolean save(EAMSparePartsPRO et) ;
void saveBatch(List<EAMSparePartsPRO> list) ;
Page<EAMSparePartsPRO> searchDefault(EAMSparePartsPROSearchContext context) ;
List<EAMSparePartsPRO> selectByProductid(String productid) ;
void removeByProductid(String productid) ;
List<EAMSparePartsPRO> selectByEamsparepartsgroupid(String eamsparepartsgroupid) ;
void removeByEamsparepartsgroupid(String eamsparepartsgroupid) ;
/**
*自定义查询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<EAMSparePartsPRO> getEamsparepartsproByIds(List<String> ids) ;
List<EAMSparePartsPRO> getEamsparepartsproByEntities(List<EAMSparePartsPRO> entities) ;
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMAssetPartsGroup;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMAssetPartsGroupSearchContext;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMAssetPartsGroupService;
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.asset.mapper.EAMAssetPartsGroupMapper;
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("EAMAssetPartsGroupServiceImpl")
public class EAMAssetPartsGroupServiceImpl extends ServiceImpl<EAMAssetPartsGroupMapper, EAMAssetPartsGroup> implements IEAMAssetPartsGroupService {
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMAssetTypeService eamassettypeService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMSparePartsGroupService eamsparepartsgroupService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(EAMAssetPartsGroup et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamassetpartsgroupid()),et);
return true;
}
@Override
public void createBatch(List<EAMAssetPartsGroup> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMAssetPartsGroup et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamassetpartsgroupid",et.getEamassetpartsgroupid())))
return false;
CachedBeanCopier.copy(get(et.getEamassetpartsgroupid()),et);
return true;
}
@Override
public void updateBatch(List<EAMAssetPartsGroup> list) {
list.forEach(item->fillParentData(item));
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 EAMAssetPartsGroup get(String key) {
EAMAssetPartsGroup et = getById(key);
if(et==null){
et=new EAMAssetPartsGroup();
et.setEamassetpartsgroupid(key);
}
else{
}
return et;
}
@Override
public EAMAssetPartsGroup getDraft(EAMAssetPartsGroup et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(EAMAssetPartsGroup et) {
return (!ObjectUtils.isEmpty(et.getEamassetpartsgroupid()))&&(!Objects.isNull(this.getById(et.getEamassetpartsgroupid())));
}
@Override
@Transactional
public boolean save(EAMAssetPartsGroup et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(EAMAssetPartsGroup et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<EAMAssetPartsGroup> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMAssetPartsGroup> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<EAMAssetPartsGroup> selectByEamassettypeid(String eamassettypeid) {
return baseMapper.selectByEamassettypeid(eamassettypeid);
}
@Override
public void removeByEamassettypeid(String eamassettypeid) {
this.remove(new QueryWrapper<EAMAssetPartsGroup>().eq("eamassettypeid",eamassettypeid));
}
@Override
public List<EAMAssetPartsGroup> selectByEamsparepartsgroupid(String eamsparepartsgroupid) {
return baseMapper.selectByEamsparepartsgroupid(eamsparepartsgroupid);
}
@Override
public void removeByEamsparepartsgroupid(String eamsparepartsgroupid) {
this.remove(new QueryWrapper<EAMAssetPartsGroup>().eq("eamsparepartsgroupid",eamsparepartsgroupid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<EAMAssetPartsGroup> searchDefault(EAMAssetPartsGroupSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMAssetPartsGroup> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMAssetPartsGroup>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(EAMAssetPartsGroup et){
//实体关系[DER1N_EAMASSETPARTSGROUP_EAMASSETTYPE_EAMASSETTYPEID]
if(!ObjectUtils.isEmpty(et.getEamassettypeid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetType eamassettype=et.getEamassettype();
if(ObjectUtils.isEmpty(eamassettype)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetType majorEntity=eamassettypeService.get(et.getEamassettypeid());
et.setEamassettype(majorEntity);
eamassettype=majorEntity;
}
et.setEamassettypename(eamassettype.getEamassettypename());
}
//实体关系[DER1N_EAMASSETPARTSGROUP_EAMSPAREPARTSGROUP_EAMSPAREPARTSGROUPID]
if(!ObjectUtils.isEmpty(et.getEamsparepartsgroupid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup eamsparepartsgroup=et.getEamsparepartsgroup();
if(ObjectUtils.isEmpty(eamsparepartsgroup)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup majorEntity=eamsparepartsgroupService.get(et.getEamsparepartsgroupid());
et.setEamsparepartsgroup(majorEntity);
eamsparepartsgroup=majorEntity;
}
et.setEamsparepartsgroupname(eamsparepartsgroup.getEamsparepartsgroupname());
}
}
@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<EAMAssetPartsGroup> getEamassetpartsgroupByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<EAMAssetPartsGroup> getEamassetpartsgroupByEntities(List<EAMAssetPartsGroup> entities) {
List ids =new ArrayList();
for(EAMAssetPartsGroup entity : entities){
Serializable id=entity.getEamassetpartsgroupid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -45,6 +45,9 @@ import org.springframework.util.StringUtils;
@Service("EAMAssetTypeServiceImpl")
public class EAMAssetTypeServiceImpl extends ServiceImpl<EAMAssetTypeMapper, EAMAssetType> implements IEAMAssetTypeService {
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMAssetPartsGroupService eamassetpartsgroupService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMAssetService eamassetService;
......
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMPRODUCT;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMPRODUCTSearchContext;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMPRODUCTService;
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.asset.mapper.EAMPRODUCTMapper;
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("EAMPRODUCTServiceImpl")
public class EAMPRODUCTServiceImpl extends ServiceImpl<EAMPRODUCTMapper, EAMPRODUCT> implements IEAMPRODUCTService {
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMSparePartsPROService eamsparepartsproService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(EAMPRODUCT et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getProductid()),et);
return true;
}
@Override
public void createBatch(List<EAMPRODUCT> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMPRODUCT et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("productid",et.getProductid())))
return false;
CachedBeanCopier.copy(get(et.getProductid()),et);
return true;
}
@Override
public void updateBatch(List<EAMPRODUCT> 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 EAMPRODUCT get(String key) {
EAMPRODUCT et = getById(key);
if(et==null){
et=new EAMPRODUCT();
et.setProductid(key);
}
else{
}
return et;
}
@Override
public EAMPRODUCT getDraft(EAMPRODUCT et) {
return et;
}
@Override
public boolean checkKey(EAMPRODUCT et) {
return (!ObjectUtils.isEmpty(et.getProductid()))&&(!Objects.isNull(this.getById(et.getProductid())));
}
@Override
@Transactional
public boolean save(EAMPRODUCT et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(EAMPRODUCT et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<EAMPRODUCT> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMPRODUCT> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<EAMPRODUCT> searchDefault(EAMPRODUCTSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMPRODUCT> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMPRODUCT>(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<EAMPRODUCT> getEamproductByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<EAMPRODUCT> getEamproductByEntities(List<EAMPRODUCT> entities) {
List ids =new ArrayList();
for(EAMPRODUCT entity : entities){
Serializable id=entity.getProductid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMSparePartsGroup;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsGroupSearchContext;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMSparePartsGroupService;
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.asset.mapper.EAMSparePartsGroupMapper;
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("EAMSparePartsGroupServiceImpl")
public class EAMSparePartsGroupServiceImpl extends ServiceImpl<EAMSparePartsGroupMapper, EAMSparePartsGroup> implements IEAMSparePartsGroupService {
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMAssetPartsGroupService eamassetpartsgroupService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMSparePartsPROService eamsparepartsproService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(EAMSparePartsGroup et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamsparepartsgroupid()),et);
return true;
}
@Override
public void createBatch(List<EAMSparePartsGroup> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMSparePartsGroup et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamsparepartsgroupid",et.getEamsparepartsgroupid())))
return false;
CachedBeanCopier.copy(get(et.getEamsparepartsgroupid()),et);
return true;
}
@Override
public void updateBatch(List<EAMSparePartsGroup> 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 EAMSparePartsGroup get(String key) {
EAMSparePartsGroup et = getById(key);
if(et==null){
et=new EAMSparePartsGroup();
et.setEamsparepartsgroupid(key);
}
else{
}
return et;
}
@Override
public EAMSparePartsGroup getDraft(EAMSparePartsGroup et) {
return et;
}
@Override
public boolean checkKey(EAMSparePartsGroup et) {
return (!ObjectUtils.isEmpty(et.getEamsparepartsgroupid()))&&(!Objects.isNull(this.getById(et.getEamsparepartsgroupid())));
}
@Override
@Transactional
public boolean save(EAMSparePartsGroup et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(EAMSparePartsGroup et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<EAMSparePartsGroup> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMSparePartsGroup> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<EAMSparePartsGroup> searchDefault(EAMSparePartsGroupSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMSparePartsGroup> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMSparePartsGroup>(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<EAMSparePartsGroup> getEamsparepartsgroupByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<EAMSparePartsGroup> getEamsparepartsgroupByEntities(List<EAMSparePartsGroup> entities) {
List ids =new ArrayList();
for(EAMSparePartsGroup entity : entities){
Serializable id=entity.getEamsparepartsgroupid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.assetmanagement.core.asset.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.asset.domain.EAMSparePartsPRO;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsPROSearchContext;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMSparePartsPROService;
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.asset.mapper.EAMSparePartsPROMapper;
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("EAMSparePartsPROServiceImpl")
public class EAMSparePartsPROServiceImpl extends ServiceImpl<EAMSparePartsPROMapper, EAMSparePartsPRO> implements IEAMSparePartsPROService {
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMPRODUCTService eamproductService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMSparePartsGroupService eamsparepartsgroupService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(EAMSparePartsPRO et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamsparepartsproid()),et);
return true;
}
@Override
public void createBatch(List<EAMSparePartsPRO> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMSparePartsPRO et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamsparepartsproid",et.getEamsparepartsproid())))
return false;
CachedBeanCopier.copy(get(et.getEamsparepartsproid()),et);
return true;
}
@Override
public void updateBatch(List<EAMSparePartsPRO> list) {
list.forEach(item->fillParentData(item));
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 EAMSparePartsPRO get(String key) {
EAMSparePartsPRO et = getById(key);
if(et==null){
et=new EAMSparePartsPRO();
et.setEamsparepartsproid(key);
}
else{
}
return et;
}
@Override
public EAMSparePartsPRO getDraft(EAMSparePartsPRO et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(EAMSparePartsPRO et) {
return (!ObjectUtils.isEmpty(et.getEamsparepartsproid()))&&(!Objects.isNull(this.getById(et.getEamsparepartsproid())));
}
@Override
@Transactional
public boolean save(EAMSparePartsPRO et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(EAMSparePartsPRO et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<EAMSparePartsPRO> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMSparePartsPRO> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<EAMSparePartsPRO> selectByProductid(String productid) {
return baseMapper.selectByProductid(productid);
}
@Override
public void removeByProductid(String productid) {
this.remove(new QueryWrapper<EAMSparePartsPRO>().eq("productid",productid));
}
@Override
public List<EAMSparePartsPRO> selectByEamsparepartsgroupid(String eamsparepartsgroupid) {
return baseMapper.selectByEamsparepartsgroupid(eamsparepartsgroupid);
}
@Override
public void removeByEamsparepartsgroupid(String eamsparepartsgroupid) {
this.remove(new QueryWrapper<EAMSparePartsPRO>().eq("eamsparepartsgroupid",eamsparepartsgroupid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<EAMSparePartsPRO> searchDefault(EAMSparePartsPROSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMSparePartsPRO> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMSparePartsPRO>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(EAMSparePartsPRO et){
//实体关系[DER1N_EAMSPAREPARTSPRO_EAMPRODUCT_PRODUCTID]
if(!ObjectUtils.isEmpty(et.getProductid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMPRODUCT product=et.getProduct();
if(ObjectUtils.isEmpty(product)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMPRODUCT majorEntity=eamproductService.get(et.getProductid());
et.setProduct(majorEntity);
product=majorEntity;
}
et.setProductname(product.getProductname());
et.setProductnumber(product.getProductnumber());
}
//实体关系[DER1N_EAMSPAREPARTSPRO_EAMSPAREPARTSGROUP_EAMSPAREPARTSGROUPID]
if(!ObjectUtils.isEmpty(et.getEamsparepartsgroupid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup eamsparepartsgroup=et.getEamsparepartsgroup();
if(ObjectUtils.isEmpty(eamsparepartsgroup)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup majorEntity=eamsparepartsgroupService.get(et.getEamsparepartsgroupid());
et.setEamsparepartsgroup(majorEntity);
eamsparepartsgroup=majorEntity;
}
et.setEamsparepartsgroupname(eamsparepartsgroup.getEamsparepartsgroupname());
}
}
@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<EAMSparePartsPRO> getEamsparepartsproByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<EAMSparePartsPRO> getEamsparepartsproByEntities(List<EAMSparePartsPRO> entities) {
List ids =new ArrayList();
for(EAMSparePartsPRO entity : entities){
Serializable id=entity.getEamsparepartsproid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.assetmanagement.core.plan.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.plan.domain.EAMPlan;
import cn.ibizlab.assetmanagement.core.workorder.domain.WOOrigin;
import java.util.List;
@Mapper(componentModel = "spring", uses = {})
public interface EAMPlanInheritMapping {
@Mappings({
@Mapping(source ="eamplanid",target = "wooriginid"),
@Mapping(source ="eamplanname",target = "wooriginname"),
@Mapping(target ="focusNull",ignore = true),
})
WOOrigin toWoorigin(EAMPlan eamplan);
@Mappings({
@Mapping(source ="wooriginid" ,target = "eamplanid"),
@Mapping(source ="wooriginname" ,target = "eamplanname"),
@Mapping(target ="focusNull",ignore = true),
})
EAMPlan toEamplan(WOOrigin woorigin);
List<WOOrigin> toWoorigin(List<EAMPlan> eamplan);
List<EAMPlan> toEamplan(List<WOOrigin> woorigin);
}
......@@ -66,6 +66,7 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
@Override
@Transactional
public boolean create(EAMPlan et) {
createIndexMajorEntityData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamplanid()),et);
......@@ -80,6 +81,7 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
@Override
@Transactional
public boolean update(EAMPlan et) {
wooriginService.update(eamplanInheritMapping.toWoorigin(et));
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamplanid",et.getEamplanid())))
return false;
CachedBeanCopier.copy(get(et.getEamplanid()),et);
......@@ -94,6 +96,7 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
@Override
@Transactional
public boolean remove(String key) {
wooriginService.remove(key);
boolean result=removeById(key);
return result ;
}
......@@ -190,6 +193,23 @@ public class EAMPlanServiceImpl extends ServiceImpl<EAMPlanMapper, EAMPlan> impl
@Autowired
cn.ibizlab.assetmanagement.core.plan.mapping.EAMPlanInheritMapping eamplanInheritMapping;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.workorder.service.IWOOriginService wooriginService;
/**
* 创建索引主实体数据
* @param et
*/
private void createIndexMajorEntityData(EAMPlan et){
if(ObjectUtils.isEmpty(et.getEamplanid()))
et.setEamplanid((String)et.getDefaultKey(true));
cn.ibizlab.assetmanagement.core.workorder.domain.WOOrigin woorigin =eamplanInheritMapping.toWoorigin(et);
woorigin.set("woorigintype","PLAN");
wooriginService.create(woorigin);
}
@Override
public List<JSONObject> select(String sql, Map param){
......
......@@ -117,6 +117,14 @@ public class EAMWorkOrder extends EntityMP implements Serializable {
@JSONField(name = "pworkorderid")
@JsonProperty("pworkorderid")
private String pworkorderid;
/**
* 工单来源标识
*/
@DEField(name = "eamwooriginid")
@TableField(value = "eamwooriginid")
@JSONField(name = "wooriginid")
@JsonProperty("wooriginid")
private String wooriginid;
/**
*
......@@ -134,6 +142,14 @@ public class EAMWorkOrder 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.WOOrigin eamwoorigin;
/**
*
*/
......@@ -192,6 +208,14 @@ public class EAMWorkOrder extends EntityMP implements Serializable {
this.modify("pworkorderid",pworkorderid);
}
/**
* 设置 [工单来源标识]
*/
public void setWooriginid(String wooriginid){
this.wooriginid = wooriginid ;
this.modify("eamwooriginid",wooriginid);
}
}
......
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 = "EAMWOORIGIN",resultMap = "WOOriginResultMap")
public class WOOrigin extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 工单来源标识
*/
@DEField(name = "eamwooriginid" , isKeyField=true)
@TableId(value= "eamwooriginid",type=IdType.ASSIGN_UUID)
@JSONField(name = "wooriginid")
@JsonProperty("wooriginid")
private String wooriginid;
/**
* 工单来源名称
*/
@DEField(name = "eamwooriginname")
@TableField(value = "eamwooriginname")
@JSONField(name = "wooriginname")
@JsonProperty("wooriginname")
private String wooriginname;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 建立时间
*/
@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.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(name = "eamwoorigintype")
@TableField(value = "eamwoorigintype")
@JSONField(name = "woorigintype")
@JsonProperty("woorigintype")
private String woorigintype;
/**
* 设置 [工单来源名称]
*/
public void setWooriginname(String wooriginname){
this.wooriginname = wooriginname ;
this.modify("eamwooriginname",wooriginname);
}
/**
* 设置 [工单来源类型]
*/
public void setWoorigintype(String woorigintype){
this.woorigintype = woorigintype ;
this.modify("eamwoorigintype",woorigintype);
}
}
......@@ -62,6 +62,13 @@ public class EAMWorkOrderSearchContext extends QueryWrapperContext<EAMWorkOrder>
this.getSearchCond().eq("pworkorderid", n_pworkorderid_eq);
}
}
private String n_eamwooriginid_eq;//[工单来源标识]
public void setN_eamwooriginid_eq(String n_eamwooriginid_eq) {
this.n_eamwooriginid_eq = n_eamwooriginid_eq;
if(!ObjectUtils.isEmpty(this.n_eamwooriginid_eq)){
this.getSearchCond().eq("eamwooriginid", n_eamwooriginid_eq);
}
}
/**
* 启用快速搜索
......
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.WOOrigin;
/**
* 关系型数据实体[WOOrigin] 查询条件对象
*/
@Slf4j
@Data
public class WOOriginSearchContext extends QueryWrapperContext<WOOrigin> {
private String n_eamwooriginname_like;//[工单来源名称]
public void setN_eamwooriginname_like(String n_eamwooriginname_like) {
this.n_eamwooriginname_like = n_eamwooriginname_like;
if(!ObjectUtils.isEmpty(this.n_eamwooriginname_like)){
this.getSearchCond().like("eamwooriginname", n_eamwooriginname_like);
}
}
private String n_eamwoorigintype_eq;//[工单来源类型]
public void setN_eamwoorigintype_eq(String n_eamwoorigintype_eq) {
this.n_eamwoorigintype_eq = n_eamwoorigintype_eq;
if(!ObjectUtils.isEmpty(this.n_eamwoorigintype_eq)){
this.getSearchCond().eq("eamwoorigintype", n_eamwoorigintype_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("eamwooriginname", query)
);
}
}
}
......@@ -66,6 +66,8 @@ public interface EAMWorkOrderMapper extends BaseMapper<EAMWorkOrder>{
List<EAMWorkOrder> selectByEamlocationid(@Param("eamlocationid") Serializable eamlocationid) ;
List<EAMWorkOrder> selectByWooriginid(@Param("wooriginid") Serializable wooriginid) ;
List<EAMWorkOrder> selectByPworkorderid(@Param("workorderid") Serializable workorderid) ;
List<EAMWorkOrder> selectByEamwotypeid(@Param("eamwotypeid") Serializable eamwotypeid) ;
......
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.WOOrigin;
import cn.ibizlab.assetmanagement.core.workorder.filter.WOOriginSearchContext;
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 WOOriginMapper extends BaseMapper<WOOrigin>{
Page<WOOrigin> searchDefault(IPage page, @Param("srf") WOOriginSearchContext context, @Param("ew") Wrapper<WOOrigin> wrapper) ;
@Override
WOOrigin selectById(Serializable id);
@Override
int insert(WOOrigin entity);
@Override
int updateById(@Param(Constants.ENTITY) WOOrigin entity);
@Override
int update(@Param(Constants.ENTITY) WOOrigin entity, @Param("ew") Wrapper<WOOrigin> 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);
}
......@@ -41,6 +41,8 @@ public interface IEAMWorkOrderService extends IService<EAMWorkOrder>{
void removeByAssetid(String assetid) ;
List<EAMWorkOrder> selectByEamlocationid(String eamlocationid) ;
void removeByEamlocationid(String eamlocationid) ;
List<EAMWorkOrder> selectByWooriginid(String wooriginid) ;
void removeByWooriginid(String wooriginid) ;
List<EAMWorkOrder> selectByPworkorderid(String workorderid) ;
void removeByPworkorderid(String workorderid) ;
List<EAMWorkOrder> selectByEamwotypeid(String eamwotypeid) ;
......
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.WOOrigin;
import cn.ibizlab.assetmanagement.core.workorder.filter.WOOriginSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[WOOrigin] 服务对象接口
*/
public interface IWOOriginService extends IService<WOOrigin>{
boolean create(WOOrigin et) ;
void createBatch(List<WOOrigin> list) ;
boolean update(WOOrigin et) ;
void updateBatch(List<WOOrigin> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WOOrigin get(String key) ;
WOOrigin getDraft(WOOrigin et) ;
boolean checkKey(WOOrigin et) ;
boolean save(WOOrigin et) ;
void saveBatch(List<WOOrigin> list) ;
Page<WOOrigin> searchDefault(WOOriginSearchContext 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<WOOrigin> getWooriginByIds(List<String> ids) ;
List<WOOrigin> getWooriginByEntities(List<WOOrigin> entities) ;
}
......@@ -55,6 +55,9 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
protected cn.ibizlab.assetmanagement.core.location.service.IEAMLocationService eamlocationService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.workorder.service.IWOOriginService wooriginService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.workorder.service.IEAMWOTypeService eamwotypeService;
protected int batchSize = 500;
......@@ -171,6 +174,16 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
this.remove(new QueryWrapper<EAMWorkOrder>().eq("eamlocationid",eamlocationid));
}
@Override
public List<EAMWorkOrder> selectByWooriginid(String wooriginid) {
return baseMapper.selectByWooriginid(wooriginid);
}
@Override
public void removeByWooriginid(String wooriginid) {
this.remove(new QueryWrapper<EAMWorkOrder>().eq("eamwooriginid",wooriginid));
}
@Override
public List<EAMWorkOrder> selectByPworkorderid(String workorderid) {
return baseMapper.selectByPworkorderid(workorderid);
......
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.WOOrigin;
import cn.ibizlab.assetmanagement.core.workorder.filter.WOOriginSearchContext;
import cn.ibizlab.assetmanagement.core.workorder.service.IWOOriginService;
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.WOOriginMapper;
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("WOOriginServiceImpl")
public class WOOriginServiceImpl extends ServiceImpl<WOOriginMapper, WOOrigin> implements IWOOriginService {
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.workorder.service.IEAMWorkOrderService eamworkorderService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(WOOrigin et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getWooriginid()),et);
return true;
}
@Override
public void createBatch(List<WOOrigin> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(WOOrigin et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamwooriginid",et.getWooriginid())))
return false;
CachedBeanCopier.copy(get(et.getWooriginid()),et);
return true;
}
@Override
public void updateBatch(List<WOOrigin> 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 WOOrigin get(String key) {
WOOrigin et = getById(key);
if(et==null){
et=new WOOrigin();
et.setWooriginid(key);
}
else{
}
return et;
}
@Override
public WOOrigin getDraft(WOOrigin et) {
return et;
}
@Override
public boolean checkKey(WOOrigin et) {
return (!ObjectUtils.isEmpty(et.getWooriginid()))&&(!Objects.isNull(this.getById(et.getWooriginid())));
}
@Override
@Transactional
public boolean save(WOOrigin et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(WOOrigin et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WOOrigin> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<WOOrigin> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<WOOrigin> searchDefault(WOOriginSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WOOrigin> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<WOOrigin>(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<WOOrigin> getWooriginByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<WOOrigin> getWooriginByEntities(List<WOOrigin> entities) {
List ids =new ArrayList();
for(WOOrigin entity : entities){
Serializable id=entity.getWooriginid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -4,7 +4,7 @@
<!--输出实体[EAMAPPLY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamapply-9-1">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamapply-11-1">
<createTable tableName="EAMAPPLY">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -94,7 +94,7 @@
<!--输出实体[EAMAPPLYTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamapplytype-7-5">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamapplytype-8-5">
<createTable tableName="EAMAPPLYTYPE">
<column name="EAMAPPLYTYPEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMAPPLYTYPE_EAMAPPLYTYPEID"/>
......@@ -145,8 +145,32 @@
</changeSet>
<!--输出实体[EAMASSETPARTSGROUP]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetpartsgroup-16-7">
<createTable tableName="EAMASSETPARTSGROUP">
<column name="EAMASSETTYPEID" remarks="" type="VARCHAR(100)">
</column>
<column name="EAMSPAREPARTSGROUPID" remarks="" type="VARCHAR(100)">
</column>
<column name="EAMASSETPARTSGROUPID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMASSETPARTSGROUP_EAMASSET"/>
</column>
<column name="EAMASSETPARTSGROUPNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMASSETSTATE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstate-25-7">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstate-25-8">
<createTable tableName="EAMASSETSTATE">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -168,7 +192,7 @@
<!--输出实体[EAMASSETSTATEMODEL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstatemodel-17-8">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstatemodel-17-9">
<createTable tableName="EAMASSETSTATEMODEL">
<column name="EAMASSETSTATEMODELID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMASSETSTATEMODEL_EAMASSET"/>
......@@ -188,7 +212,7 @@
<!--输出实体[EAMASSETSTATEMODELLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstatemodelline-21-9">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetstatemodelline-21-10">
<createTable tableName="EAMASSETSTATEMODELLINE">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -212,7 +236,7 @@
<!--输出实体[EAMASSETTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassettype-21-10">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassettype-22-11">
<createTable tableName="EAMASSETTYPE">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -236,7 +260,7 @@
<!--输出实体[EAMLOCATION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-90-11">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-90-12">
<createTable tableName="EAMLOCATION">
<column name="EAMLOCATIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMLOCATION_EAMLOCATIONID"/>
......@@ -264,7 +288,7 @@
<!--输出实体[EAMLOCATIONSTATE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstate-44-12">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstate-44-13">
<createTable tableName="EAMLOCATIONSTATE">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -288,7 +312,7 @@
<!--输出实体[EAMLOCATIONSTATEMODEL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodel-22-13">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodel-22-14">
<createTable tableName="EAMLOCATIONSTATEMODEL">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -308,7 +332,7 @@
<!--输出实体[EAMLOCATIONSTATEMODELLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodelline-29-14">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodelline-29-15">
<createTable tableName="EAMLOCATIONSTATEMODELLINE">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -332,7 +356,7 @@
<!--输出实体[EAMLOCATIONTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationtype-22-15">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationtype-22-16">
<createTable tableName="EAMLOCATIONTYPE">
<column name="EAMLOCATIONTYPENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -353,8 +377,30 @@
</changeSet>
<!--输出实体[EAMPRODUCT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamproduct-14-17">
<createTable tableName="PRODUCT">
<column name="PRODUCTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMPRODUCT_PRODUCTID"/>
</column>
<column name="PRODUCTNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="PRODUCTNUMBER" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMPLAN]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplan-10-16">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplan-12-18">
<createTable tableName="EAMPLAN">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -378,7 +424,7 @@
<!--输出实体[EAMPLANCDT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplancdt-6-17">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplancdt-6-19">
<createTable tableName="EAMPLANCDT">
<column name="EAMPLANCDTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMPLANCDT_EAMPLANCDTID"/>
......@@ -400,7 +446,7 @@
<!--输出实体[EAMPLANLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplanline-8-18">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplanline-8-20">
<createTable tableName="EAMPLANLINE">
<column name="EAMPLANLINEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMPLANLINE_EAMPLANLINEID"/>
......@@ -426,7 +472,7 @@
<!--输出实体[EAMPLANSCHEDULE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplanschedule-6-19">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplanschedule-6-21">
<createTable tableName="EAMPLANSCHEDULE">
<column name="EAMPLANSCHEDULEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMPLANSCHEDULE_EAMPLANSCHE"/>
......@@ -447,8 +493,54 @@
</changeSet>
<!--输出实体[EAMSPAREPARTSGROUP]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamsparepartsgroup-28-22">
<createTable tableName="EAMSPAREPARTSGROUP">
<column name="EAMSPAREPARTSGROUPID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMSPAREPARTSGROUP_EAMSPARE"/>
</column>
<column name="EAMSPAREPARTSGROUPNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="SPAREPARTSGRPNUMBER" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMSPAREPARTSPRO]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamsparepartspro-20-23">
<createTable tableName="EAMSPAREPARTSPRO">
<column name="EAMSPAREPARTSGROUPID" remarks="" type="VARCHAR(100)">
</column>
<column name="PRODUCTID" remarks="" type="VARCHAR(100)">
</column>
<column name="EAMSPAREPARTSPROID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMSPAREPARTSPRO_EAMSPAREPA"/>
</column>
<column name="EAMSPAREPARTSPRONAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMWOSTATE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostate-6-20">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostate-6-24">
<createTable tableName="EAMWOSTATE">
<column name="EAMWOSTATENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -468,7 +560,7 @@
<!--输出实体[EAMWOSTATEMODEL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostatemodel-7-21">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostatemodel-7-25">
<createTable tableName="EAMWOSTATEMODEL">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -488,7 +580,7 @@
<!--输出实体[EAMWOSTATEMODELLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostatemodelline-7-22">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostatemodelline-7-26">
<createTable tableName="EAMWOSTATEMODELLINE">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -512,7 +604,7 @@
<!--输出实体[EAMWOTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwotype-7-23">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwotype-7-27">
<createTable tableName="EAMWOTYPE">
<column name="EAMWOTYPENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -534,7 +626,7 @@
<!--输出实体[EAMWORKORDER]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamworkorder-12-24">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamworkorder-13-28">
<createTable tableName="WORKORDER">
<column name="WORKORDERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMWORKORDER_WORKORDERID"/>
......@@ -557,119 +649,163 @@
</column>
<column name="PWORKORDERID" remarks="" type="VARCHAR(100)">
</column>
<column name="EAMWOORIGINID" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMWOORIGIN]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwoorigin-15-29">
<createTable tableName="EAMWOORIGIN">
<column name="EAMWOORIGINID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMWOORIGIN_EAMWOORIGINID"/>
</column>
<column name="EAMWOORIGINNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="EAMWOORIGINTYPE" remarks="" type="VARCHAR(60)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMAPPLY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-9-25">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-11-30">
<addForeignKeyConstraint baseColumnNames="EAMAPPLYTYPEID" baseTableName="EAMAPPLY" constraintName="DER1N_EAMAPPLY_EAMAPPLYTYPE_EA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMAPPLYTYPEID" referencedTableName="EAMAPPLYTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-9-26">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-11-31">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="EAMAPPLY" constraintName="DER1N_EAMAPPLY_EAMASSET_ASSETI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-9-27">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-11-32">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="EAMAPPLY" constraintName="DER1N_EAMAPPLY_EAMLOCATION_EAM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<!--输出实体[EAMAPPLYSTATE]外键关系 -->
<!--输出实体[EAMAPPLYSTATEMODEL]外键关系 -->
<!--输出实体[EAMAPPLYSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapplystatemodelline-8-28">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapplystatemodelline-8-33">
<addForeignKeyConstraint baseColumnNames="EAMAPPLYSTATEMODELID" baseTableName="EAMAPPLYSTATEMODELLINE" constraintName="DER1N_EAMAPPLYSTATEMODELLINE_E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMAPPLYSTATEMODELID" referencedTableName="EAMAPPLYSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMAPPLYTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapplytype-7-30">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapplytype-8-35">
<addForeignKeyConstraint baseColumnNames="EAMAPPLYSTATEMODELID" baseTableName="EAMAPPLYTYPE" constraintName="DER1N_EAMAPPLYTYPE_EAMAPPLYSTA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMAPPLYSTATEMODELID" referencedTableName="EAMAPPLYSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMASSET]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-87-31">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-87-36">
<addForeignKeyConstraint baseColumnNames="EAMASSETSTATEID" baseTableName="ASSET" constraintName="DER1N_EAMASSET_EAMASSETSTATE_E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETSTATEID" referencedTableName="EAMASSETSTATE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-87-32">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-87-37">
<addForeignKeyConstraint baseColumnNames="EAMASSETTYPEID" baseTableName="ASSET" constraintName="DER1N_EAMASSET_EAMASSETTYPE_EA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETTYPEID" referencedTableName="EAMASSETTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-87-33">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-87-38">
<addForeignKeyConstraint baseColumnNames="PASSETID" baseTableName="ASSET" constraintName="DER1N_EAMASSET_EAMASSET_PASSET" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-87-34">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-87-39">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="ASSET" constraintName="DER1N_EAMASSET_EAMLOCATION_EAM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<!--输出实体[EAMASSETPARTSGROUP]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetpartsgroup-16-40">
<addForeignKeyConstraint baseColumnNames="EAMASSETTYPEID" baseTableName="EAMASSETPARTSGROUP" constraintName="DER1N_EAMASSETPARTSGROUP_EAMAS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETTYPEID" referencedTableName="EAMASSETTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetpartsgroup-16-41">
<addForeignKeyConstraint baseColumnNames="EAMSPAREPARTSGROUPID" baseTableName="EAMASSETPARTSGROUP" constraintName="DER1N_EAMASSETPARTSGROUP_EAMSP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMSPAREPARTSGROUPID" referencedTableName="EAMSPAREPARTSGROUP" validate="true"/>
</changeSet>
<!--输出实体[EAMASSETSTATE]外键关系 -->
<!--输出实体[EAMASSETSTATEMODEL]外键关系 -->
<!--输出实体[EAMASSETSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetstatemodelline-21-35">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetstatemodelline-21-42">
<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-21-37">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassettype-22-44">
<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-90-38">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-90-45">
<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-90-39">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-90-46">
<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-90-40">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-90-47">
<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-29-41">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationstatemodelline-29-48">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEMODELID" baseTableName="EAMLOCATIONSTATEMODELLINE" constraintName="DER1N_EAMLOCATIONSTATEMODELLIN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEMODELID" referencedTableName="EAMLOCATIONSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATIONTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationtype-22-43">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationtype-22-50">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEMODELID" baseTableName="EAMLOCATIONTYPE" constraintName="DER1N_EAMLOCATIONTYPE_EAMLOCAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEMODELID" referencedTableName="EAMLOCATIONSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMPRODUCT]外键关系 -->
<!--输出实体[EAMPLAN]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-10-44">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-12-51">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="EAMPLAN" constraintName="DER1N_EAMPLAN_EAMASSET_ASSETID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-10-45">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-12-52">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="EAMPLAN" constraintName="DER1N_EAMPLAN_EAMLOCATION_EAML" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANCDT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplancdt-6-46">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplancdt-6-53">
<addForeignKeyConstraint baseColumnNames="EAMPLANID" baseTableName="EAMPLANCDT" constraintName="DER1N_EAMPLANCDT_EAMPLAN_EAMPL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMPLANID" referencedTableName="EAMPLAN" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-47">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-54">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMASSET_ASS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-48">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-55">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMLOCATION_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-49">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-8-56">
<addForeignKeyConstraint baseColumnNames="EAMPLANID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMPLAN_EAMP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMPLANID" referencedTableName="EAMPLAN" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANSCHEDULE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanschedule-6-50">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanschedule-6-57">
<addForeignKeyConstraint baseColumnNames="EAMPLANID" baseTableName="EAMPLANSCHEDULE" constraintName="DER1N_EAMPLANSCHEDULE_EAMPLAN_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMPLANID" referencedTableName="EAMPLAN" validate="true"/>
</changeSet>
<!--输出实体[EAMSPAREPARTSGROUP]外键关系 -->
<!--输出实体[EAMSPAREPARTSPRO]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamsparepartspro-20-58">
<addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="EAMSPAREPARTSPRO" constraintName="DER1N_EAMSPAREPARTSPRO_EAMPROD" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamsparepartspro-20-59">
<addForeignKeyConstraint baseColumnNames="EAMSPAREPARTSGROUPID" baseTableName="EAMSPAREPARTSPRO" constraintName="DER1N_EAMSPAREPARTSPRO_EAMSPAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMSPAREPARTSGROUPID" referencedTableName="EAMSPAREPARTSGROUP" validate="true"/>
</changeSet>
<!--输出实体[EAMWOSTATE]外键关系 -->
<!--输出实体[EAMWOSTATEMODEL]外键关系 -->
<!--输出实体[EAMWOSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwostatemodelline-7-51">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwostatemodelline-7-60">
<addForeignKeyConstraint baseColumnNames="EAMWOSTATEMODELID" baseTableName="EAMWOSTATEMODELLINE" constraintName="DER1N_EAMWOSTATEMODELLINE_EAMW" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOSTATEMODELID" referencedTableName="EAMWOSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMWOTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwotype-7-53">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwotype-7-62">
<addForeignKeyConstraint baseColumnNames="EAMWOSTATEMODELID" baseTableName="EAMWOTYPE" constraintName="DER1N_EAMWOTYPE_EAMWOSTATEMODE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOSTATEMODELID" referencedTableName="EAMWOSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMWORKORDER]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-54">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-13-63">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMASSET_AS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-55">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-13-64">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMLOCATION" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-56">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-13-65">
<addForeignKeyConstraint baseColumnNames="EAMWOORIGINID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMWOORIGIN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOORIGINID" referencedTableName="EAMWOORIGIN" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-13-66">
<addForeignKeyConstraint baseColumnNames="PWORKORDERID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMWORKORDE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WORKORDERID" referencedTableName="WORKORDER" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-12-57">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-13-67">
<addForeignKeyConstraint baseColumnNames="EAMWOTYPEID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMWOTYPE_E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOTYPEID" referencedTableName="EAMWOTYPE" validate="true"/>
</changeSet>
<!--输出实体[EAMWOORIGIN]外键关系 -->
</databaseChangeLog>
<?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.asset.mapper.EAMAssetPartsGroupMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMAssetPartsGroupResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETPARTSGROUPID`, t1.`EAMASSETPARTSGROUPNAME`, t1.`EAMASSETTYPEID`, t21.`EAMASSETTYPENAME`, t1.`EAMSPAREPARTSGROUPID`, t11.`EAMSPAREPARTSGROUPNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETPARTSGROUP` t1 LEFT JOIN EAMSPAREPARTSGROUP t11 ON t1.EAMSPAREPARTSGROUPID = t11.EAMSPAREPARTSGROUPID LEFT JOIN EAMASSETTYPE t21 ON t1.EAMASSETTYPEID = t21.EAMASSETTYPEID ) t1 where eamassetpartsgroupid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="EAMAssetPartsGroupResultMap" type="cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetPartsGroup" autoMapping="true">
<id property="eamassetpartsgroupid" column="eamassetpartsgroupid" /><!--主键字段映射-->
<result property="eamassettypeid" column="eamassettypeid" />
<result property="eamsparepartsgroupid" column="eamsparepartsgroupid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamassettype" javaType="cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetType" column="eamassettypeid" select="cn.ibizlab.assetmanagement.core.asset.mapper.EAMAssetTypeMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamsparepartsgroup" javaType="cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup" column="eamsparepartsgroupid" select="cn.ibizlab.assetmanagement.core.asset.mapper.EAMSparePartsGroupMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMASSETPARTSGROUP_EAMASSETTYPE_EAMASSETTYPEID] -->
<select id="selectByEamassettypeid" resultMap="EAMAssetPartsGroupResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamassettypeid=#{eamassettypeid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMASSETPARTSGROUP_EAMSPAREPARTSGROUP_EAMSPAREPARTSGROUPID] -->
<select id="selectByEamsparepartsgroupid" resultMap="EAMAssetPartsGroupResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamsparepartsgroupid=#{eamsparepartsgroupid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.assetmanagement.core.asset.filter.EAMAssetPartsGroupSearchContext" resultMap="EAMAssetPartsGroupResultMap">
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.`EAMASSETPARTSGROUPID`, t1.`EAMASSETPARTSGROUPNAME`, t1.`EAMASSETTYPEID`, t21.`EAMASSETTYPENAME`, t1.`EAMSPAREPARTSGROUPID`, t11.`EAMSPAREPARTSGROUPNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETPARTSGROUP` t1 LEFT JOIN EAMSPAREPARTSGROUP t11 ON t1.EAMSPAREPARTSGROUPID = t11.EAMSPAREPARTSGROUPID LEFT JOIN EAMASSETTYPE t21 ON t1.EAMASSETTYPEID = t21.EAMASSETTYPEID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETPARTSGROUPID`, t1.`EAMASSETPARTSGROUPNAME`, t1.`EAMASSETTYPEID`, t21.`EAMASSETTYPENAME`, t1.`EAMSPAREPARTSGROUPID`, t11.`EAMSPAREPARTSGROUPNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETPARTSGROUP` t1 LEFT JOIN EAMSPAREPARTSGROUP t11 ON t1.EAMSPAREPARTSGROUPID = t11.EAMSPAREPARTSGROUPID LEFT JOIN EAMASSETTYPE t21 ON t1.EAMASSETTYPEID = t21.EAMASSETTYPEID
]]>
</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.asset.mapper.EAMPRODUCTMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMPRODUCTResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`PRODUCTID`, t1.`PRODUCTNAME`, t1.`PRODUCTNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `PRODUCT` t1 ) t1 where productid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="EAMPRODUCTResultMap" type="cn.ibizlab.assetmanagement.core.asset.domain.EAMPRODUCT" autoMapping="true">
<id property="productid" column="productid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.assetmanagement.core.asset.filter.EAMPRODUCTSearchContext" resultMap="EAMPRODUCTResultMap">
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.`PRODUCTID`, t1.`PRODUCTNAME`, t1.`PRODUCTNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `PRODUCT` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`PRODUCTID`, t1.`PRODUCTNAME`, t1.`PRODUCTNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `PRODUCT` t1
]]>
</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.asset.mapper.EAMSparePartsGroupMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMSparePartsGroupResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMSPAREPARTSGROUPID`, t1.`EAMSPAREPARTSGROUPNAME`, t1.`SPAREPARTSGRPNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMSPAREPARTSGROUP` t1 ) t1 where eamsparepartsgroupid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="EAMSparePartsGroupResultMap" type="cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup" autoMapping="true">
<id property="eamsparepartsgroupid" column="eamsparepartsgroupid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsGroupSearchContext" resultMap="EAMSparePartsGroupResultMap">
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.`EAMSPAREPARTSGROUPID`, t1.`EAMSPAREPARTSGROUPNAME`, t1.`SPAREPARTSGRPNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMSPAREPARTSGROUP` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMSPAREPARTSGROUPID`, t1.`EAMSPAREPARTSGROUPNAME`, t1.`SPAREPARTSGRPNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMSPAREPARTSGROUP` t1
]]>
</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.asset.mapper.EAMSparePartsPROMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMSparePartsPROResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMSPAREPARTSGROUPID`, t11.`EAMSPAREPARTSGROUPNAME`, t1.`EAMSPAREPARTSPROID`, t1.`EAMSPAREPARTSPRONAME`, t1.`PRODUCTID`, t21.`PRODUCTNAME`, t21.`PRODUCTNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMSPAREPARTSPRO` t1 LEFT JOIN EAMSPAREPARTSGROUP t11 ON t1.EAMSPAREPARTSGROUPID = t11.EAMSPAREPARTSGROUPID LEFT JOIN PRODUCT t21 ON t1.PRODUCTID = t21.PRODUCTID ) t1 where eamsparepartsproid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="EAMSparePartsPROResultMap" type="cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsPRO" autoMapping="true">
<id property="eamsparepartsproid" column="eamsparepartsproid" /><!--主键字段映射-->
<result property="eamsparepartsgroupid" column="eamsparepartsgroupid" />
<result property="productid" column="productid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="product" javaType="cn.ibizlab.assetmanagement.core.asset.domain.EAMPRODUCT" column="productid" select="cn.ibizlab.assetmanagement.core.asset.mapper.EAMPRODUCTMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamsparepartsgroup" javaType="cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup" column="eamsparepartsgroupid" select="cn.ibizlab.assetmanagement.core.asset.mapper.EAMSparePartsGroupMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMSPAREPARTSPRO_EAMPRODUCT_PRODUCTID] -->
<select id="selectByProductid" resultMap="EAMSparePartsPROResultMap">
select t1.* from (
<include refid="Default" />
) t1
where productid=#{productid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMSPAREPARTSPRO_EAMSPAREPARTSGROUP_EAMSPAREPARTSGROUPID] -->
<select id="selectByEamsparepartsgroupid" resultMap="EAMSparePartsPROResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamsparepartsgroupid=#{eamsparepartsgroupid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsPROSearchContext" resultMap="EAMSparePartsPROResultMap">
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.`EAMSPAREPARTSGROUPID`, t11.`EAMSPAREPARTSGROUPNAME`, t1.`EAMSPAREPARTSPROID`, t1.`EAMSPAREPARTSPRONAME`, t1.`PRODUCTID`, t21.`PRODUCTNAME`, t21.`PRODUCTNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMSPAREPARTSPRO` t1 LEFT JOIN EAMSPAREPARTSGROUP t11 ON t1.EAMSPAREPARTSGROUPID = t11.EAMSPAREPARTSGROUPID LEFT JOIN PRODUCT t21 ON t1.PRODUCTID = t21.PRODUCTID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMSPAREPARTSGROUPID`, t11.`EAMSPAREPARTSGROUPNAME`, t1.`EAMSPAREPARTSPROID`, t1.`EAMSPAREPARTSPRONAME`, t1.`PRODUCTID`, t21.`PRODUCTNAME`, t21.`PRODUCTNUMBER`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMSPAREPARTSPRO` t1 LEFT JOIN EAMSPAREPARTSGROUP t11 ON t1.EAMSPAREPARTSGROUPID = t11.EAMSPAREPARTSGROUPID LEFT JOIN PRODUCT t21 ON t1.PRODUCTID = t21.PRODUCTID
]]>
</sql>
</mapper>
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMWorkOrderResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ASSETID`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMWOTYPEID`, t1.`PWORKORDERID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 ) t1 where workorderid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`ASSETID`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMWOORIGINID`, t1.`EAMWOTYPEID`, t1.`PWORKORDERID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 ) t1 where workorderid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -15,6 +15,7 @@
<result property="assetid" column="assetid" />
<result property="eamlocationid" column="eamlocationid" />
<result property="pworkorderid" column="pworkorderid" />
<result property="wooriginid" column="eamwooriginid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
......@@ -22,6 +23,8 @@
<!--通过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="eamwoorigin" javaType="cn.ibizlab.assetmanagement.core.workorder.domain.WOOrigin" column="eamwooriginid" select="cn.ibizlab.assetmanagement.core.workorder.mapper.WOOriginMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="pworkorder" javaType="cn.ibizlab.assetmanagement.core.workorder.domain.EAMWorkOrder" column="pworkorderid" select="cn.ibizlab.assetmanagement.core.workorder.mapper.EAMWorkOrderMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamwotype" javaType="cn.ibizlab.assetmanagement.core.workorder.domain.EAMWOType" column="eamwotypeid" select="cn.ibizlab.assetmanagement.core.workorder.mapper.EAMWOTypeMapper.selectById" fetchType="lazy"></association>
......@@ -40,6 +43,13 @@
<include refid="Default" />
) t1
where eamlocationid=#{eamlocationid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMWORKORDER_EAMWOORIGIN_EAMWOORIGINID] -->
<select id="selectByWooriginid" resultMap="EAMWorkOrderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamwooriginid=#{wooriginid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMWORKORDER_EAMWORKORDER_PWORKORDERID] -->
<select id="selectByPworkorderid" resultMap="EAMWorkOrderResultMap">
......@@ -67,12 +77,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMWOTYPEID`, t1.`PWORKORDERID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1
<![CDATA[ SELECT t1.`ASSETID`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMWOORIGINID`, t1.`EAMWOTYPEID`, t1.`PWORKORDERID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMWOTYPEID`, t1.`PWORKORDERID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1
<![CDATA[ SELECT t1.`ASSETID`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t1.`EAMWOORIGINID`, t1.`EAMWOTYPEID`, t1.`PWORKORDERID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1
]]>
</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.WOOriginMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="WOOriginResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMWOORIGINID`, t1.`EAMWOORIGINNAME`, t1.`EAMWOORIGINTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMWOORIGIN` t1 ) t1 where eamwooriginid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="WOOriginResultMap" type="cn.ibizlab.assetmanagement.core.workorder.domain.WOOrigin" autoMapping="true">
<id property="wooriginid" column="eamwooriginid" /><!--主键字段映射-->
<result property="wooriginname" column="eamwooriginname" />
<result property="woorigintype" column="eamwoorigintype" />
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.assetmanagement.core.workorder.filter.WOOriginSearchContext" resultMap="WOOriginResultMap">
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.`EAMWOORIGINID`, t1.`EAMWOORIGINNAME`, t1.`EAMWOORIGINTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMWOORIGIN` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMWOORIGINID`, t1.`EAMWOORIGINNAME`, t1.`EAMWOORIGINTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMWOORIGIN` t1
]]>
</sql>
</mapper>
......@@ -60,6 +60,30 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMApplyType",
"delogicname":"维护申请类型",
"sysmoudle":{"id":"APPLY","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":"EAMPRODUCT",
"delogicname":"产品",
"sysmoudle":{"id":"ASSET","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":"资产管理"},
"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":"EAMApplyStateModelLine",
"delogicname":"维护申请状态模型明细",
"sysmoudle":{"id":"APPLY","name":"维护申请"},
......@@ -68,6 +92,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMSparePartsGroup",
"delogicname":"备件包",
"sysmoudle":{"id":"ASSET","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":"功能位置"},
......@@ -76,6 +108,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMAssetPartsGroup",
"delogicname":"资产备件包",
"sysmoudle":{"id":"ASSET","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":"EAMAsset",
"delogicname":"资产",
"sysmoudle":{"id":"ASSET","name":"资产管理"},
......@@ -113,7 +153,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":"menuitem11" , "name":"资产状态模型" },{ "id":"menuitem12" , "name":"资产类型" },{ "id":"menuitem13" , "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":"menuitem12" , "name":"资产类型" },{ "id":"menuitem13" , "name":"资产管理" },{ "id":"menuitem14" , "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,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 lombok.Data;
/**
* 服务DTO对象[EAMApplyTypeDTO]
*/
@Data
public class EAMApplyTypeDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMAPPLYTYPEID]
*
*/
@JSONField(name = "eamapplytypeid")
@JsonProperty("eamapplytypeid")
private String eamapplytypeid;
/**
* 属性 [EAMAPPLYTYPENAME]
*
*/
@JSONField(name = "eamapplytypename")
@JsonProperty("eamapplytypename")
private String eamapplytypename;
/**
* 属性 [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;
/**
* 属性 [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;
/**
* 属性 [EAMAPPLYSTATEMODELID]
*
*/
@JSONField(name = "eamapplystatemodelid")
@JsonProperty("eamapplystatemodelid")
private String eamapplystatemodelid;
/**
* 设置 [EAMAPPLYTYPENAME]
*/
public void setEamapplytypename(String eamapplytypename){
this.eamapplytypename = eamapplytypename ;
this.modify("eamapplytypename",eamapplytypename);
}
/**
* 设置 [EAMAPPLYSTATEMODELID]
*/
public void setEamapplystatemodelid(String eamapplystatemodelid){
this.eamapplystatemodelid = eamapplystatemodelid ;
this.modify("eamapplystatemodelid",eamapplystatemodelid);
}
}
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 lombok.Data;
/**
* 服务DTO对象[EAMAssetPartsGroupDTO]
*/
@Data
public class EAMAssetPartsGroupDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMASSETTYPEID]
*
*/
@JSONField(name = "eamassettypeid")
@JsonProperty("eamassettypeid")
private String eamassettypeid;
/**
* 属性 [EAMSPAREPARTSGROUPID]
*
*/
@JSONField(name = "eamsparepartsgroupid")
@JsonProperty("eamsparepartsgroupid")
private String eamsparepartsgroupid;
/**
* 属性 [EAMASSETPARTSGROUPID]
*
*/
@JSONField(name = "eamassetpartsgroupid")
@JsonProperty("eamassetpartsgroupid")
private String eamassetpartsgroupid;
/**
* 属性 [EAMASSETPARTSGROUPNAME]
*
*/
@JSONField(name = "eamassetpartsgroupname")
@JsonProperty("eamassetpartsgroupname")
private String eamassetpartsgroupname;
/**
* 属性 [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;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [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;
/**
* 属性 [EAMSPAREPARTSGROUPNAME]
*
*/
@JSONField(name = "eamsparepartsgroupname")
@JsonProperty("eamsparepartsgroupname")
private String eamsparepartsgroupname;
/**
* 属性 [EAMASSETTYPENAME]
*
*/
@JSONField(name = "eamassettypename")
@JsonProperty("eamassettypename")
private String eamassettypename;
/**
* 设置 [EAMASSETTYPEID]
*/
public void setEamassettypeid(String eamassettypeid){
this.eamassettypeid = eamassettypeid ;
this.modify("eamassettypeid",eamassettypeid);
}
/**
* 设置 [EAMSPAREPARTSGROUPID]
*/
public void setEamsparepartsgroupid(String eamsparepartsgroupid){
this.eamsparepartsgroupid = eamsparepartsgroupid ;
this.modify("eamsparepartsgroupid",eamsparepartsgroupid);
}
/**
* 设置 [EAMASSETPARTSGROUPNAME]
*/
public void setEamassetpartsgroupname(String eamassetpartsgroupname){
this.eamassetpartsgroupname = eamassetpartsgroupname ;
this.modify("eamassetpartsgroupname",eamassetpartsgroupname);
}
}
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 lombok.Data;
/**
* 服务DTO对象[EAMPRODUCTDTO]
*/
@Data
public class EAMPRODUCTDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [PRODUCTID]
*
*/
@JSONField(name = "productid")
@JsonProperty("productid")
private String productid;
/**
* 属性 [PRODUCTNAME]
*
*/
@JSONField(name = "productname")
@JsonProperty("productname")
private String productname;
/**
* 属性 [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;
/**
* 属性 [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;
/**
* 属性 [PRODUCTNUMBER]
*
*/
@JSONField(name = "productnumber")
@JsonProperty("productnumber")
private String productnumber;
/**
* 设置 [PRODUCTNAME]
*/
public void setProductname(String productname){
this.productname = productname ;
this.modify("productname",productname);
}
/**
* 设置 [PRODUCTNUMBER]
*/
public void setProductnumber(String productnumber){
this.productnumber = productnumber ;
this.modify("productnumber",productnumber);
}
}
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 lombok.Data;
/**
* 服务DTO对象[EAMSparePartsGroupDTO]
*/
@Data
public class EAMSparePartsGroupDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMSPAREPARTSGROUPID]
*
*/
@JSONField(name = "eamsparepartsgroupid")
@JsonProperty("eamsparepartsgroupid")
private String eamsparepartsgroupid;
/**
* 属性 [EAMSPAREPARTSGROUPNAME]
*
*/
@JSONField(name = "eamsparepartsgroupname")
@JsonProperty("eamsparepartsgroupname")
private String eamsparepartsgroupname;
/**
* 属性 [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;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [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;
/**
* 属性 [SPAREPARTSGRPNUMBER]
*
*/
@JSONField(name = "sparepartsgrpnumber")
@JsonProperty("sparepartsgrpnumber")
private String sparepartsgrpnumber;
/**
* 设置 [EAMSPAREPARTSGROUPNAME]
*/
public void setEamsparepartsgroupname(String eamsparepartsgroupname){
this.eamsparepartsgroupname = eamsparepartsgroupname ;
this.modify("eamsparepartsgroupname",eamsparepartsgroupname);
}
/**
* 设置 [SPAREPARTSGRPNUMBER]
*/
public void setSparepartsgrpnumber(String sparepartsgrpnumber){
this.sparepartsgrpnumber = sparepartsgrpnumber ;
this.modify("sparepartsgrpnumber",sparepartsgrpnumber);
}
}
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 lombok.Data;
/**
* 服务DTO对象[EAMSparePartsPRODTO]
*/
@Data
public class EAMSparePartsPRODTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMSPAREPARTSGROUPID]
*
*/
@JSONField(name = "eamsparepartsgroupid")
@JsonProperty("eamsparepartsgroupid")
private String eamsparepartsgroupid;
/**
* 属性 [PRODUCTID]
*
*/
@JSONField(name = "productid")
@JsonProperty("productid")
private String productid;
/**
* 属性 [EAMSPAREPARTSPROID]
*
*/
@JSONField(name = "eamsparepartsproid")
@JsonProperty("eamsparepartsproid")
private String eamsparepartsproid;
/**
* 属性 [EAMSPAREPARTSPRONAME]
*
*/
@JSONField(name = "eamsparepartsproname")
@JsonProperty("eamsparepartsproname")
private String eamsparepartsproname;
/**
* 属性 [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;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [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;
/**
* 属性 [EAMSPAREPARTSGROUPNAME]
*
*/
@JSONField(name = "eamsparepartsgroupname")
@JsonProperty("eamsparepartsgroupname")
private String eamsparepartsgroupname;
/**
* 属性 [PRODUCTNAME]
*
*/
@JSONField(name = "productname")
@JsonProperty("productname")
private String productname;
/**
* 属性 [PRODUCTNUMBER]
*
*/
@JSONField(name = "productnumber")
@JsonProperty("productnumber")
private String productnumber;
/**
* 设置 [EAMSPAREPARTSGROUPID]
*/
public void setEamsparepartsgroupid(String eamsparepartsgroupid){
this.eamsparepartsgroupid = eamsparepartsgroupid ;
this.modify("eamsparepartsgroupid",eamsparepartsgroupid);
}
/**
* 设置 [PRODUCTID]
*/
public void setProductid(String productid){
this.productid = productid ;
this.modify("productid",productid);
}
/**
* 设置 [EAMSPAREPARTSPRONAME]
*/
public void setEamsparepartsproname(String eamsparepartsproname){
this.eamsparepartsproname = eamsparepartsproname ;
this.modify("eamsparepartsproname",eamsparepartsproname);
}
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.apply.domain.EAMApplyType;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMApplyTypeDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMApplyTypeMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMApplyTypeMapping extends MappingBase<EAMApplyTypeDTO, EAMApplyType> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetPartsGroup;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMAssetPartsGroupDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMAssetPartsGroupMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMAssetPartsGroupMapping extends MappingBase<EAMAssetPartsGroupDTO, EAMAssetPartsGroup> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMPRODUCT;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMPRODUCTDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMPRODUCTMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMPRODUCTMapping extends MappingBase<EAMPRODUCTDTO, EAMPRODUCT> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsGroup;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMSparePartsGroupDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMSparePartsGroupMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMSparePartsGroupMapping extends MappingBase<EAMSparePartsGroupDTO, EAMSparePartsGroup> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMSparePartsPRO;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMSparePartsPRODTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMSparePartsPROMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMSparePartsPROMapping extends MappingBase<EAMSparePartsPRODTO, EAMSparePartsPRO> {
}
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.apply.domain.EAMApplyType;
import cn.ibizlab.assetmanagement.core.apply.service.IEAMApplyTypeService;
import cn.ibizlab.assetmanagement.core.apply.filter.EAMApplyTypeSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"维护申请类型" })
@RestController("AssetApi-eamapplytype")
@RequestMapping("")
public class EAMApplyTypeResource {
@Autowired
public IEAMApplyTypeService eamapplytypeService;
@Autowired
@Lazy
public EAMApplyTypeMapping eamapplytypeMapping;
@PreAuthorize("hasPermission(this.eamapplytypeMapping.toDomain(#eamapplytypedto),'iBizAssetManagement-EAMApplyType-Create')")
@ApiOperation(value = "新建维护申请类型", tags = {"维护申请类型" }, notes = "新建维护申请类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplytypes")
@Transactional
public ResponseEntity<EAMApplyTypeDTO> create(@RequestBody EAMApplyTypeDTO eamapplytypedto) {
EAMApplyType domain = eamapplytypeMapping.toDomain(eamapplytypedto);
eamapplytypeService.create(domain);
EAMApplyTypeDTO dto = eamapplytypeMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplytypeMapping.toDomain(#eamapplytypedtos),'iBizAssetManagement-EAMApplyType-Create')")
@ApiOperation(value = "批量新建维护申请类型", tags = {"维护申请类型" }, notes = "批量新建维护申请类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplytypes/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMApplyTypeDTO> eamapplytypedtos) {
eamapplytypeService.createBatch(eamapplytypeMapping.toDomain(eamapplytypedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamapplytype" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamapplytypeService.get(#eamapplytype_id),'iBizAssetManagement-EAMApplyType-Update')")
@ApiOperation(value = "更新维护申请类型", tags = {"维护申请类型" }, notes = "更新维护申请类型")
@RequestMapping(method = RequestMethod.PUT, value = "/eamapplytypes/{eamapplytype_id}")
@Transactional
public ResponseEntity<EAMApplyTypeDTO> update(@PathVariable("eamapplytype_id") String eamapplytype_id, @RequestBody EAMApplyTypeDTO eamapplytypedto) {
EAMApplyType domain = eamapplytypeMapping.toDomain(eamapplytypedto);
domain .setEamapplytypeid(eamapplytype_id);
eamapplytypeService.update(domain );
EAMApplyTypeDTO dto = eamapplytypeMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplytypeService.getEamapplytypeByEntities(this.eamapplytypeMapping.toDomain(#eamapplytypedtos)),'iBizAssetManagement-EAMApplyType-Update')")
@ApiOperation(value = "批量更新维护申请类型", tags = {"维护申请类型" }, notes = "批量更新维护申请类型")
@RequestMapping(method = RequestMethod.PUT, value = "/eamapplytypes/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMApplyTypeDTO> eamapplytypedtos) {
eamapplytypeService.updateBatch(eamapplytypeMapping.toDomain(eamapplytypedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamapplytypeService.get(#eamapplytype_id),'iBizAssetManagement-EAMApplyType-Remove')")
@ApiOperation(value = "删除维护申请类型", tags = {"维护申请类型" }, notes = "删除维护申请类型")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamapplytypes/{eamapplytype_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamapplytype_id") String eamapplytype_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplytypeService.remove(eamapplytype_id));
}
@PreAuthorize("hasPermission(this.eamapplytypeService.getEamapplytypeByIds(#ids),'iBizAssetManagement-EAMApplyType-Remove')")
@ApiOperation(value = "批量删除维护申请类型", tags = {"维护申请类型" }, notes = "批量删除维护申请类型")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamapplytypes/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamapplytypeService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamapplytypeMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMApplyType-Get')")
@ApiOperation(value = "获取维护申请类型", tags = {"维护申请类型" }, notes = "获取维护申请类型")
@RequestMapping(method = RequestMethod.GET, value = "/eamapplytypes/{eamapplytype_id}")
public ResponseEntity<EAMApplyTypeDTO> get(@PathVariable("eamapplytype_id") String eamapplytype_id) {
EAMApplyType domain = eamapplytypeService.get(eamapplytype_id);
EAMApplyTypeDTO dto = eamapplytypeMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取维护申请类型草稿", tags = {"维护申请类型" }, notes = "获取维护申请类型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamapplytypes/getdraft")
public ResponseEntity<EAMApplyTypeDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamapplytypeMapping.toDto(eamapplytypeService.getDraft(new EAMApplyType())));
}
@ApiOperation(value = "检查维护申请类型", tags = {"维护申请类型" }, notes = "检查维护申请类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplytypes/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMApplyTypeDTO eamapplytypedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplytypeService.checkKey(eamapplytypeMapping.toDomain(eamapplytypedto)));
}
@PreAuthorize("hasPermission(this.eamapplytypeMapping.toDomain(#eamapplytypedto),'iBizAssetManagement-EAMApplyType-Save')")
@ApiOperation(value = "保存维护申请类型", tags = {"维护申请类型" }, notes = "保存维护申请类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplytypes/save")
public ResponseEntity<Boolean> save(@RequestBody EAMApplyTypeDTO eamapplytypedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplytypeService.save(eamapplytypeMapping.toDomain(eamapplytypedto)));
}
@PreAuthorize("hasPermission(this.eamapplytypeMapping.toDomain(#eamapplytypedtos),'iBizAssetManagement-EAMApplyType-Save')")
@ApiOperation(value = "批量保存维护申请类型", tags = {"维护申请类型" }, notes = "批量保存维护申请类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamapplytypes/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMApplyTypeDTO> eamapplytypedtos) {
eamapplytypeService.saveBatch(eamapplytypeMapping.toDomain(eamapplytypedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMApplyType-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApplyType-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"维护申请类型" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamapplytypes/fetchdefault")
public ResponseEntity<List<EAMApplyTypeDTO>> fetchDefault(EAMApplyTypeSearchContext context) {
Page<EAMApplyType> domains = eamapplytypeService.searchDefault(context) ;
List<EAMApplyTypeDTO> list = eamapplytypeMapping.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-EAMApplyType-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApplyType-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"维护申请类型" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamapplytypes/searchdefault")
public ResponseEntity<Page<EAMApplyTypeDTO>> searchDefault(@RequestBody EAMApplyTypeSearchContext context) {
Page<EAMApplyType> domains = eamapplytypeService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamapplytypeMapping.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.asset.domain.EAMAssetPartsGroup;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMAssetPartsGroupService;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMAssetPartsGroupSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"资产备件包" })
@RestController("AssetApi-eamassetpartsgroup")
@RequestMapping("")
public class EAMAssetPartsGroupResource {
@Autowired
public IEAMAssetPartsGroupService eamassetpartsgroupService;
@Autowired
@Lazy
public EAMAssetPartsGroupMapping eamassetpartsgroupMapping;
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdto),'iBizAssetManagement-EAMAssetPartsGroup-Create')")
@ApiOperation(value = "新建资产备件包", tags = {"资产备件包" }, notes = "新建资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassetpartsgroups")
@Transactional
public ResponseEntity<EAMAssetPartsGroupDTO> create(@RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
EAMAssetPartsGroup domain = eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto);
eamassetpartsgroupService.create(domain);
EAMAssetPartsGroupDTO dto = eamassetpartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdtos),'iBizAssetManagement-EAMAssetPartsGroup-Create')")
@ApiOperation(value = "批量新建资产备件包", tags = {"资产备件包" }, notes = "批量新建资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassetpartsgroups/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMAssetPartsGroupDTO> eamassetpartsgroupdtos) {
eamassetpartsgroupService.createBatch(eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamassetpartsgroup" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.get(#eamassetpartsgroup_id),'iBizAssetManagement-EAMAssetPartsGroup-Update')")
@ApiOperation(value = "更新资产备件包", tags = {"资产备件包" }, notes = "更新资产备件包")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassetpartsgroups/{eamassetpartsgroup_id}")
@Transactional
public ResponseEntity<EAMAssetPartsGroupDTO> update(@PathVariable("eamassetpartsgroup_id") String eamassetpartsgroup_id, @RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
EAMAssetPartsGroup domain = eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto);
domain .setEamassetpartsgroupid(eamassetpartsgroup_id);
eamassetpartsgroupService.update(domain );
EAMAssetPartsGroupDTO dto = eamassetpartsgroupMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.getEamassetpartsgroupByEntities(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdtos)),'iBizAssetManagement-EAMAssetPartsGroup-Update')")
@ApiOperation(value = "批量更新资产备件包", tags = {"资产备件包" }, notes = "批量更新资产备件包")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassetpartsgroups/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMAssetPartsGroupDTO> eamassetpartsgroupdtos) {
eamassetpartsgroupService.updateBatch(eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.get(#eamassetpartsgroup_id),'iBizAssetManagement-EAMAssetPartsGroup-Remove')")
@ApiOperation(value = "删除资产备件包", tags = {"资产备件包" }, notes = "删除资产备件包")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassetpartsgroups/{eamassetpartsgroup_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamassetpartsgroup_id") String eamassetpartsgroup_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupService.remove(eamassetpartsgroup_id));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.getEamassetpartsgroupByIds(#ids),'iBizAssetManagement-EAMAssetPartsGroup-Remove')")
@ApiOperation(value = "批量删除资产备件包", tags = {"资产备件包" }, notes = "批量删除资产备件包")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassetpartsgroups/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamassetpartsgroupService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMAssetPartsGroup-Get')")
@ApiOperation(value = "获取资产备件包", tags = {"资产备件包" }, notes = "获取资产备件包")
@RequestMapping(method = RequestMethod.GET, value = "/eamassetpartsgroups/{eamassetpartsgroup_id}")
public ResponseEntity<EAMAssetPartsGroupDTO> get(@PathVariable("eamassetpartsgroup_id") String eamassetpartsgroup_id) {
EAMAssetPartsGroup domain = eamassetpartsgroupService.get(eamassetpartsgroup_id);
EAMAssetPartsGroupDTO dto = eamassetpartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取资产备件包草稿", tags = {"资产备件包" }, notes = "获取资产备件包草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamassetpartsgroups/getdraft")
public ResponseEntity<EAMAssetPartsGroupDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupMapping.toDto(eamassetpartsgroupService.getDraft(new EAMAssetPartsGroup())));
}
@ApiOperation(value = "检查资产备件包", tags = {"资产备件包" }, notes = "检查资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassetpartsgroups/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupService.checkKey(eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto)));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdto),'iBizAssetManagement-EAMAssetPartsGroup-Save')")
@ApiOperation(value = "保存资产备件包", tags = {"资产备件包" }, notes = "保存资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassetpartsgroups/save")
public ResponseEntity<Boolean> save(@RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupService.save(eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto)));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdtos),'iBizAssetManagement-EAMAssetPartsGroup-Save')")
@ApiOperation(value = "批量保存资产备件包", tags = {"资产备件包" }, notes = "批量保存资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassetpartsgroups/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMAssetPartsGroupDTO> eamassetpartsgroupdtos) {
eamassetpartsgroupService.saveBatch(eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMAssetPartsGroup-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMAssetPartsGroup-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"资产备件包" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamassetpartsgroups/fetchdefault")
public ResponseEntity<List<EAMAssetPartsGroupDTO>> fetchDefault(EAMAssetPartsGroupSearchContext context) {
Page<EAMAssetPartsGroup> domains = eamassetpartsgroupService.searchDefault(context) ;
List<EAMAssetPartsGroupDTO> list = eamassetpartsgroupMapping.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-EAMAssetPartsGroup-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMAssetPartsGroup-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"资产备件包" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamassetpartsgroups/searchdefault")
public ResponseEntity<Page<EAMAssetPartsGroupDTO>> searchDefault(@RequestBody EAMAssetPartsGroupSearchContext context) {
Page<EAMAssetPartsGroup> domains = eamassetpartsgroupService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamassetpartsgroupMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdto),'iBizAssetManagement-EAMAssetPartsGroup-Create')")
@ApiOperation(value = "根据备件包建立资产备件包", tags = {"资产备件包" }, notes = "根据备件包建立资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups")
@Transactional
public ResponseEntity<EAMAssetPartsGroupDTO> createByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
EAMAssetPartsGroup domain = eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto);
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
eamassetpartsgroupService.create(domain);
EAMAssetPartsGroupDTO dto = eamassetpartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdtos),'iBizAssetManagement-EAMAssetPartsGroup-Create')")
@ApiOperation(value = "根据备件包批量建立资产备件包", tags = {"资产备件包" }, notes = "根据备件包批量建立资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/batch")
public ResponseEntity<Boolean> createBatchByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody List<EAMAssetPartsGroupDTO> eamassetpartsgroupdtos) {
List<EAMAssetPartsGroup> domainlist=eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdtos);
for(EAMAssetPartsGroup domain:domainlist){
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
}
eamassetpartsgroupService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamassetpartsgroup" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.get(#eamassetpartsgroup_id),'iBizAssetManagement-EAMAssetPartsGroup-Update')")
@ApiOperation(value = "根据备件包更新资产备件包", tags = {"资产备件包" }, notes = "根据备件包更新资产备件包")
@RequestMapping(method = RequestMethod.PUT, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/{eamassetpartsgroup_id}")
@Transactional
public ResponseEntity<EAMAssetPartsGroupDTO> updateByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @PathVariable("eamassetpartsgroup_id") String eamassetpartsgroup_id, @RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
EAMAssetPartsGroup domain = eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto);
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
domain.setEamassetpartsgroupid(eamassetpartsgroup_id);
eamassetpartsgroupService.update(domain);
EAMAssetPartsGroupDTO dto = eamassetpartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.getEamassetpartsgroupByEntities(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdtos)),'iBizAssetManagement-EAMAssetPartsGroup-Update')")
@ApiOperation(value = "根据备件包批量更新资产备件包", tags = {"资产备件包" }, notes = "根据备件包批量更新资产备件包")
@RequestMapping(method = RequestMethod.PUT, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/batch")
public ResponseEntity<Boolean> updateBatchByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody List<EAMAssetPartsGroupDTO> eamassetpartsgroupdtos) {
List<EAMAssetPartsGroup> domainlist=eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdtos);
for(EAMAssetPartsGroup domain:domainlist){
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
}
eamassetpartsgroupService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.get(#eamassetpartsgroup_id),'iBizAssetManagement-EAMAssetPartsGroup-Remove')")
@ApiOperation(value = "根据备件包删除资产备件包", tags = {"资产备件包" }, notes = "根据备件包删除资产备件包")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/{eamassetpartsgroup_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @PathVariable("eamassetpartsgroup_id") String eamassetpartsgroup_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupService.remove(eamassetpartsgroup_id));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.getEamassetpartsgroupByIds(#ids),'iBizAssetManagement-EAMAssetPartsGroup-Remove')")
@ApiOperation(value = "根据备件包批量删除资产备件包", tags = {"资产备件包" }, notes = "根据备件包批量删除资产备件包")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/batch")
public ResponseEntity<Boolean> removeBatchByEAMSparePartsGroup(@RequestBody List<String> ids) {
eamassetpartsgroupService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMAssetPartsGroup-Get')")
@ApiOperation(value = "根据备件包获取资产备件包", tags = {"资产备件包" }, notes = "根据备件包获取资产备件包")
@RequestMapping(method = RequestMethod.GET, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/{eamassetpartsgroup_id}")
public ResponseEntity<EAMAssetPartsGroupDTO> getByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @PathVariable("eamassetpartsgroup_id") String eamassetpartsgroup_id) {
EAMAssetPartsGroup domain = eamassetpartsgroupService.get(eamassetpartsgroup_id);
EAMAssetPartsGroupDTO dto = eamassetpartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据备件包获取资产备件包草稿", tags = {"资产备件包" }, notes = "根据备件包获取资产备件包草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/getdraft")
public ResponseEntity<EAMAssetPartsGroupDTO> getDraftByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id) {
EAMAssetPartsGroup domain = new EAMAssetPartsGroup();
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupMapping.toDto(eamassetpartsgroupService.getDraft(domain)));
}
@ApiOperation(value = "根据备件包检查资产备件包", tags = {"资产备件包" }, notes = "根据备件包检查资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupService.checkKey(eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto)));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdto),'iBizAssetManagement-EAMAssetPartsGroup-Save')")
@ApiOperation(value = "根据备件包保存资产备件包", tags = {"资产备件包" }, notes = "根据备件包保存资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/save")
public ResponseEntity<Boolean> saveByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
EAMAssetPartsGroup domain = eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto);
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupService.save(domain));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdtos),'iBizAssetManagement-EAMAssetPartsGroup-Save')")
@ApiOperation(value = "根据备件包批量保存资产备件包", tags = {"资产备件包" }, notes = "根据备件包批量保存资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody List<EAMAssetPartsGroupDTO> eamassetpartsgroupdtos) {
List<EAMAssetPartsGroup> domainlist=eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdtos);
for(EAMAssetPartsGroup domain:domainlist){
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
}
eamassetpartsgroupService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMAssetPartsGroup-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMAssetPartsGroup-Get')")
@ApiOperation(value = "根据备件包获取DEFAULT", tags = {"资产备件包" } ,notes = "根据备件包获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/fetchdefault")
public ResponseEntity<List<EAMAssetPartsGroupDTO>> fetchEAMAssetPartsGroupDefaultByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id,EAMAssetPartsGroupSearchContext context) {
context.setN_eamsparepartsgroupid_eq(eamsparepartsgroup_id);
Page<EAMAssetPartsGroup> domains = eamassetpartsgroupService.searchDefault(context) ;
List<EAMAssetPartsGroupDTO> list = eamassetpartsgroupMapping.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-EAMAssetPartsGroup-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMAssetPartsGroup-Get')")
@ApiOperation(value = "根据备件包查询DEFAULT", tags = {"资产备件包" } ,notes = "根据备件包查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups/searchdefault")
public ResponseEntity<Page<EAMAssetPartsGroupDTO>> searchEAMAssetPartsGroupDefaultByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody EAMAssetPartsGroupSearchContext context) {
context.setN_eamsparepartsgroupid_eq(eamsparepartsgroup_id);
Page<EAMAssetPartsGroup> domains = eamassetpartsgroupService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamassetpartsgroupMapping.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.asset.domain.EAMPRODUCT;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMPRODUCTService;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMPRODUCTSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"产品" })
@RestController("AssetApi-eamproduct")
@RequestMapping("")
public class EAMPRODUCTResource {
@Autowired
public IEAMPRODUCTService eamproductService;
@Autowired
@Lazy
public EAMPRODUCTMapping eamproductMapping;
@PreAuthorize("hasPermission(this.eamproductMapping.toDomain(#eamproductdto),'iBizAssetManagement-EAMPRODUCT-Create')")
@ApiOperation(value = "新建产品", tags = {"产品" }, notes = "新建产品")
@RequestMapping(method = RequestMethod.POST, value = "/eamproducts")
@Transactional
public ResponseEntity<EAMPRODUCTDTO> create(@RequestBody EAMPRODUCTDTO eamproductdto) {
EAMPRODUCT domain = eamproductMapping.toDomain(eamproductdto);
eamproductService.create(domain);
EAMPRODUCTDTO dto = eamproductMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamproductMapping.toDomain(#eamproductdtos),'iBizAssetManagement-EAMPRODUCT-Create')")
@ApiOperation(value = "批量新建产品", tags = {"产品" }, notes = "批量新建产品")
@RequestMapping(method = RequestMethod.POST, value = "/eamproducts/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMPRODUCTDTO> eamproductdtos) {
eamproductService.createBatch(eamproductMapping.toDomain(eamproductdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamproduct" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamproductService.get(#eamproduct_id),'iBizAssetManagement-EAMPRODUCT-Update')")
@ApiOperation(value = "更新产品", tags = {"产品" }, notes = "更新产品")
@RequestMapping(method = RequestMethod.PUT, value = "/eamproducts/{eamproduct_id}")
@Transactional
public ResponseEntity<EAMPRODUCTDTO> update(@PathVariable("eamproduct_id") String eamproduct_id, @RequestBody EAMPRODUCTDTO eamproductdto) {
EAMPRODUCT domain = eamproductMapping.toDomain(eamproductdto);
domain .setProductid(eamproduct_id);
eamproductService.update(domain );
EAMPRODUCTDTO dto = eamproductMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamproductService.getEamproductByEntities(this.eamproductMapping.toDomain(#eamproductdtos)),'iBizAssetManagement-EAMPRODUCT-Update')")
@ApiOperation(value = "批量更新产品", tags = {"产品" }, notes = "批量更新产品")
@RequestMapping(method = RequestMethod.PUT, value = "/eamproducts/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMPRODUCTDTO> eamproductdtos) {
eamproductService.updateBatch(eamproductMapping.toDomain(eamproductdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamproductService.get(#eamproduct_id),'iBizAssetManagement-EAMPRODUCT-Remove')")
@ApiOperation(value = "删除产品", tags = {"产品" }, notes = "删除产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamproducts/{eamproduct_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamproduct_id") String eamproduct_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamproductService.remove(eamproduct_id));
}
@PreAuthorize("hasPermission(this.eamproductService.getEamproductByIds(#ids),'iBizAssetManagement-EAMPRODUCT-Remove')")
@ApiOperation(value = "批量删除产品", tags = {"产品" }, notes = "批量删除产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamproducts/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamproductService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamproductMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMPRODUCT-Get')")
@ApiOperation(value = "获取产品", tags = {"产品" }, notes = "获取产品")
@RequestMapping(method = RequestMethod.GET, value = "/eamproducts/{eamproduct_id}")
public ResponseEntity<EAMPRODUCTDTO> get(@PathVariable("eamproduct_id") String eamproduct_id) {
EAMPRODUCT domain = eamproductService.get(eamproduct_id);
EAMPRODUCTDTO dto = eamproductMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取产品草稿", tags = {"产品" }, notes = "获取产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamproducts/getdraft")
public ResponseEntity<EAMPRODUCTDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamproductMapping.toDto(eamproductService.getDraft(new EAMPRODUCT())));
}
@ApiOperation(value = "检查产品", tags = {"产品" }, notes = "检查产品")
@RequestMapping(method = RequestMethod.POST, value = "/eamproducts/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMPRODUCTDTO eamproductdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamproductService.checkKey(eamproductMapping.toDomain(eamproductdto)));
}
@PreAuthorize("hasPermission(this.eamproductMapping.toDomain(#eamproductdto),'iBizAssetManagement-EAMPRODUCT-Save')")
@ApiOperation(value = "保存产品", tags = {"产品" }, notes = "保存产品")
@RequestMapping(method = RequestMethod.POST, value = "/eamproducts/save")
public ResponseEntity<Boolean> save(@RequestBody EAMPRODUCTDTO eamproductdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamproductService.save(eamproductMapping.toDomain(eamproductdto)));
}
@PreAuthorize("hasPermission(this.eamproductMapping.toDomain(#eamproductdtos),'iBizAssetManagement-EAMPRODUCT-Save')")
@ApiOperation(value = "批量保存产品", tags = {"产品" }, notes = "批量保存产品")
@RequestMapping(method = RequestMethod.POST, value = "/eamproducts/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMPRODUCTDTO> eamproductdtos) {
eamproductService.saveBatch(eamproductMapping.toDomain(eamproductdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPRODUCT-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPRODUCT-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"产品" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamproducts/fetchdefault")
public ResponseEntity<List<EAMPRODUCTDTO>> fetchDefault(EAMPRODUCTSearchContext context) {
Page<EAMPRODUCT> domains = eamproductService.searchDefault(context) ;
List<EAMPRODUCTDTO> list = eamproductMapping.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-EAMPRODUCT-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPRODUCT-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"产品" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamproducts/searchdefault")
public ResponseEntity<Page<EAMPRODUCTDTO>> searchDefault(@RequestBody EAMPRODUCTSearchContext context) {
Page<EAMPRODUCT> domains = eamproductService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamproductMapping.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.asset.domain.EAMSparePartsGroup;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMSparePartsGroupService;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsGroupSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"备件包" })
@RestController("AssetApi-eamsparepartsgroup")
@RequestMapping("")
public class EAMSparePartsGroupResource {
@Autowired
public IEAMSparePartsGroupService eamsparepartsgroupService;
@Autowired
@Lazy
public EAMSparePartsGroupMapping eamsparepartsgroupMapping;
@PreAuthorize("hasPermission(this.eamsparepartsgroupMapping.toDomain(#eamsparepartsgroupdto),'iBizAssetManagement-EAMSparePartsGroup-Create')")
@ApiOperation(value = "新建备件包", tags = {"备件包" }, notes = "新建备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups")
@Transactional
public ResponseEntity<EAMSparePartsGroupDTO> create(@RequestBody EAMSparePartsGroupDTO eamsparepartsgroupdto) {
EAMSparePartsGroup domain = eamsparepartsgroupMapping.toDomain(eamsparepartsgroupdto);
eamsparepartsgroupService.create(domain);
EAMSparePartsGroupDTO dto = eamsparepartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamsparepartsgroupMapping.toDomain(#eamsparepartsgroupdtos),'iBizAssetManagement-EAMSparePartsGroup-Create')")
@ApiOperation(value = "批量新建备件包", tags = {"备件包" }, notes = "批量新建备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMSparePartsGroupDTO> eamsparepartsgroupdtos) {
eamsparepartsgroupService.createBatch(eamsparepartsgroupMapping.toDomain(eamsparepartsgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamsparepartsgroup" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamsparepartsgroupService.get(#eamsparepartsgroup_id),'iBizAssetManagement-EAMSparePartsGroup-Update')")
@ApiOperation(value = "更新备件包", tags = {"备件包" }, notes = "更新备件包")
@RequestMapping(method = RequestMethod.PUT, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}")
@Transactional
public ResponseEntity<EAMSparePartsGroupDTO> update(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody EAMSparePartsGroupDTO eamsparepartsgroupdto) {
EAMSparePartsGroup domain = eamsparepartsgroupMapping.toDomain(eamsparepartsgroupdto);
domain .setEamsparepartsgroupid(eamsparepartsgroup_id);
eamsparepartsgroupService.update(domain );
EAMSparePartsGroupDTO dto = eamsparepartsgroupMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamsparepartsgroupService.getEamsparepartsgroupByEntities(this.eamsparepartsgroupMapping.toDomain(#eamsparepartsgroupdtos)),'iBizAssetManagement-EAMSparePartsGroup-Update')")
@ApiOperation(value = "批量更新备件包", tags = {"备件包" }, notes = "批量更新备件包")
@RequestMapping(method = RequestMethod.PUT, value = "/eamsparepartsgroups/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMSparePartsGroupDTO> eamsparepartsgroupdtos) {
eamsparepartsgroupService.updateBatch(eamsparepartsgroupMapping.toDomain(eamsparepartsgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamsparepartsgroupService.get(#eamsparepartsgroup_id),'iBizAssetManagement-EAMSparePartsGroup-Remove')")
@ApiOperation(value = "删除备件包", tags = {"备件包" }, notes = "删除备件包")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsgroupService.remove(eamsparepartsgroup_id));
}
@PreAuthorize("hasPermission(this.eamsparepartsgroupService.getEamsparepartsgroupByIds(#ids),'iBizAssetManagement-EAMSparePartsGroup-Remove')")
@ApiOperation(value = "批量删除备件包", tags = {"备件包" }, notes = "批量删除备件包")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamsparepartsgroups/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamsparepartsgroupService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamsparepartsgroupMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMSparePartsGroup-Get')")
@ApiOperation(value = "获取备件包", tags = {"备件包" }, notes = "获取备件包")
@RequestMapping(method = RequestMethod.GET, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}")
public ResponseEntity<EAMSparePartsGroupDTO> get(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id) {
EAMSparePartsGroup domain = eamsparepartsgroupService.get(eamsparepartsgroup_id);
EAMSparePartsGroupDTO dto = eamsparepartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取备件包草稿", tags = {"备件包" }, notes = "获取备件包草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamsparepartsgroups/getdraft")
public ResponseEntity<EAMSparePartsGroupDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsgroupMapping.toDto(eamsparepartsgroupService.getDraft(new EAMSparePartsGroup())));
}
@ApiOperation(value = "检查备件包", tags = {"备件包" }, notes = "检查备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMSparePartsGroupDTO eamsparepartsgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsgroupService.checkKey(eamsparepartsgroupMapping.toDomain(eamsparepartsgroupdto)));
}
@PreAuthorize("hasPermission(this.eamsparepartsgroupMapping.toDomain(#eamsparepartsgroupdto),'iBizAssetManagement-EAMSparePartsGroup-Save')")
@ApiOperation(value = "保存备件包", tags = {"备件包" }, notes = "保存备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/save")
public ResponseEntity<Boolean> save(@RequestBody EAMSparePartsGroupDTO eamsparepartsgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsgroupService.save(eamsparepartsgroupMapping.toDomain(eamsparepartsgroupdto)));
}
@PreAuthorize("hasPermission(this.eamsparepartsgroupMapping.toDomain(#eamsparepartsgroupdtos),'iBizAssetManagement-EAMSparePartsGroup-Save')")
@ApiOperation(value = "批量保存备件包", tags = {"备件包" }, notes = "批量保存备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMSparePartsGroupDTO> eamsparepartsgroupdtos) {
eamsparepartsgroupService.saveBatch(eamsparepartsgroupMapping.toDomain(eamsparepartsgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMSparePartsGroup-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMSparePartsGroup-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"备件包" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamsparepartsgroups/fetchdefault")
public ResponseEntity<List<EAMSparePartsGroupDTO>> fetchDefault(EAMSparePartsGroupSearchContext context) {
Page<EAMSparePartsGroup> domains = eamsparepartsgroupService.searchDefault(context) ;
List<EAMSparePartsGroupDTO> list = eamsparepartsgroupMapping.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-EAMSparePartsGroup-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMSparePartsGroup-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"备件包" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamsparepartsgroups/searchdefault")
public ResponseEntity<Page<EAMSparePartsGroupDTO>> searchDefault(@RequestBody EAMSparePartsGroupSearchContext context) {
Page<EAMSparePartsGroup> domains = eamsparepartsgroupService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamsparepartsgroupMapping.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.asset.domain.EAMSparePartsPRO;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMSparePartsPROService;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMSparePartsPROSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"备件包物料" })
@RestController("AssetApi-eamsparepartspro")
@RequestMapping("")
public class EAMSparePartsPROResource {
@Autowired
public IEAMSparePartsPROService eamsparepartsproService;
@Autowired
@Lazy
public EAMSparePartsPROMapping eamsparepartsproMapping;
@PreAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodto),'iBizAssetManagement-EAMSparePartsPRO-Create')")
@ApiOperation(value = "新建备件包物料", tags = {"备件包物料" }, notes = "新建备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartspros")
@Transactional
public ResponseEntity<EAMSparePartsPRODTO> create(@RequestBody EAMSparePartsPRODTO eamsparepartsprodto) {
EAMSparePartsPRO domain = eamsparepartsproMapping.toDomain(eamsparepartsprodto);
eamsparepartsproService.create(domain);
EAMSparePartsPRODTO dto = eamsparepartsproMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodtos),'iBizAssetManagement-EAMSparePartsPRO-Create')")
@ApiOperation(value = "批量新建备件包物料", tags = {"备件包物料" }, notes = "批量新建备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartspros/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMSparePartsPRODTO> eamsparepartsprodtos) {
eamsparepartsproService.createBatch(eamsparepartsproMapping.toDomain(eamsparepartsprodtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamsparepartspro" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamsparepartsproService.get(#eamsparepartspro_id),'iBizAssetManagement-EAMSparePartsPRO-Update')")
@ApiOperation(value = "更新备件包物料", tags = {"备件包物料" }, notes = "更新备件包物料")
@RequestMapping(method = RequestMethod.PUT, value = "/eamsparepartspros/{eamsparepartspro_id}")
@Transactional
public ResponseEntity<EAMSparePartsPRODTO> update(@PathVariable("eamsparepartspro_id") String eamsparepartspro_id, @RequestBody EAMSparePartsPRODTO eamsparepartsprodto) {
EAMSparePartsPRO domain = eamsparepartsproMapping.toDomain(eamsparepartsprodto);
domain .setEamsparepartsproid(eamsparepartspro_id);
eamsparepartsproService.update(domain );
EAMSparePartsPRODTO dto = eamsparepartsproMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamsparepartsproService.getEamsparepartsproByEntities(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodtos)),'iBizAssetManagement-EAMSparePartsPRO-Update')")
@ApiOperation(value = "批量更新备件包物料", tags = {"备件包物料" }, notes = "批量更新备件包物料")
@RequestMapping(method = RequestMethod.PUT, value = "/eamsparepartspros/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMSparePartsPRODTO> eamsparepartsprodtos) {
eamsparepartsproService.updateBatch(eamsparepartsproMapping.toDomain(eamsparepartsprodtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamsparepartsproService.get(#eamsparepartspro_id),'iBizAssetManagement-EAMSparePartsPRO-Remove')")
@ApiOperation(value = "删除备件包物料", tags = {"备件包物料" }, notes = "删除备件包物料")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamsparepartspros/{eamsparepartspro_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamsparepartspro_id") String eamsparepartspro_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsproService.remove(eamsparepartspro_id));
}
@PreAuthorize("hasPermission(this.eamsparepartsproService.getEamsparepartsproByIds(#ids),'iBizAssetManagement-EAMSparePartsPRO-Remove')")
@ApiOperation(value = "批量删除备件包物料", tags = {"备件包物料" }, notes = "批量删除备件包物料")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamsparepartspros/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamsparepartsproService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMSparePartsPRO-Get')")
@ApiOperation(value = "获取备件包物料", tags = {"备件包物料" }, notes = "获取备件包物料")
@RequestMapping(method = RequestMethod.GET, value = "/eamsparepartspros/{eamsparepartspro_id}")
public ResponseEntity<EAMSparePartsPRODTO> get(@PathVariable("eamsparepartspro_id") String eamsparepartspro_id) {
EAMSparePartsPRO domain = eamsparepartsproService.get(eamsparepartspro_id);
EAMSparePartsPRODTO dto = eamsparepartsproMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取备件包物料草稿", tags = {"备件包物料" }, notes = "获取备件包物料草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamsparepartspros/getdraft")
public ResponseEntity<EAMSparePartsPRODTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsproMapping.toDto(eamsparepartsproService.getDraft(new EAMSparePartsPRO())));
}
@ApiOperation(value = "检查备件包物料", tags = {"备件包物料" }, notes = "检查备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartspros/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMSparePartsPRODTO eamsparepartsprodto) {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsproService.checkKey(eamsparepartsproMapping.toDomain(eamsparepartsprodto)));
}
@PreAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodto),'iBizAssetManagement-EAMSparePartsPRO-Save')")
@ApiOperation(value = "保存备件包物料", tags = {"备件包物料" }, notes = "保存备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartspros/save")
public ResponseEntity<Boolean> save(@RequestBody EAMSparePartsPRODTO eamsparepartsprodto) {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsproService.save(eamsparepartsproMapping.toDomain(eamsparepartsprodto)));
}
@PreAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodtos),'iBizAssetManagement-EAMSparePartsPRO-Save')")
@ApiOperation(value = "批量保存备件包物料", tags = {"备件包物料" }, notes = "批量保存备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartspros/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMSparePartsPRODTO> eamsparepartsprodtos) {
eamsparepartsproService.saveBatch(eamsparepartsproMapping.toDomain(eamsparepartsprodtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMSparePartsPRO-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMSparePartsPRO-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"备件包物料" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamsparepartspros/fetchdefault")
public ResponseEntity<List<EAMSparePartsPRODTO>> fetchDefault(EAMSparePartsPROSearchContext context) {
Page<EAMSparePartsPRO> domains = eamsparepartsproService.searchDefault(context) ;
List<EAMSparePartsPRODTO> list = eamsparepartsproMapping.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-EAMSparePartsPRO-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMSparePartsPRO-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"备件包物料" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamsparepartspros/searchdefault")
public ResponseEntity<Page<EAMSparePartsPRODTO>> searchDefault(@RequestBody EAMSparePartsPROSearchContext context) {
Page<EAMSparePartsPRO> domains = eamsparepartsproService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamsparepartsproMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodto),'iBizAssetManagement-EAMSparePartsPRO-Create')")
@ApiOperation(value = "根据备件包建立备件包物料", tags = {"备件包物料" }, notes = "根据备件包建立备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros")
@Transactional
public ResponseEntity<EAMSparePartsPRODTO> createByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody EAMSparePartsPRODTO eamsparepartsprodto) {
EAMSparePartsPRO domain = eamsparepartsproMapping.toDomain(eamsparepartsprodto);
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
eamsparepartsproService.create(domain);
EAMSparePartsPRODTO dto = eamsparepartsproMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodtos),'iBizAssetManagement-EAMSparePartsPRO-Create')")
@ApiOperation(value = "根据备件包批量建立备件包物料", tags = {"备件包物料" }, notes = "根据备件包批量建立备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/batch")
public ResponseEntity<Boolean> createBatchByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody List<EAMSparePartsPRODTO> eamsparepartsprodtos) {
List<EAMSparePartsPRO> domainlist=eamsparepartsproMapping.toDomain(eamsparepartsprodtos);
for(EAMSparePartsPRO domain:domainlist){
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
}
eamsparepartsproService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamsparepartspro" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamsparepartsproService.get(#eamsparepartspro_id),'iBizAssetManagement-EAMSparePartsPRO-Update')")
@ApiOperation(value = "根据备件包更新备件包物料", tags = {"备件包物料" }, notes = "根据备件包更新备件包物料")
@RequestMapping(method = RequestMethod.PUT, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/{eamsparepartspro_id}")
@Transactional
public ResponseEntity<EAMSparePartsPRODTO> updateByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @PathVariable("eamsparepartspro_id") String eamsparepartspro_id, @RequestBody EAMSparePartsPRODTO eamsparepartsprodto) {
EAMSparePartsPRO domain = eamsparepartsproMapping.toDomain(eamsparepartsprodto);
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
domain.setEamsparepartsproid(eamsparepartspro_id);
eamsparepartsproService.update(domain);
EAMSparePartsPRODTO dto = eamsparepartsproMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamsparepartsproService.getEamsparepartsproByEntities(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodtos)),'iBizAssetManagement-EAMSparePartsPRO-Update')")
@ApiOperation(value = "根据备件包批量更新备件包物料", tags = {"备件包物料" }, notes = "根据备件包批量更新备件包物料")
@RequestMapping(method = RequestMethod.PUT, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/batch")
public ResponseEntity<Boolean> updateBatchByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody List<EAMSparePartsPRODTO> eamsparepartsprodtos) {
List<EAMSparePartsPRO> domainlist=eamsparepartsproMapping.toDomain(eamsparepartsprodtos);
for(EAMSparePartsPRO domain:domainlist){
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
}
eamsparepartsproService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamsparepartsproService.get(#eamsparepartspro_id),'iBizAssetManagement-EAMSparePartsPRO-Remove')")
@ApiOperation(value = "根据备件包删除备件包物料", tags = {"备件包物料" }, notes = "根据备件包删除备件包物料")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/{eamsparepartspro_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @PathVariable("eamsparepartspro_id") String eamsparepartspro_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsproService.remove(eamsparepartspro_id));
}
@PreAuthorize("hasPermission(this.eamsparepartsproService.getEamsparepartsproByIds(#ids),'iBizAssetManagement-EAMSparePartsPRO-Remove')")
@ApiOperation(value = "根据备件包批量删除备件包物料", tags = {"备件包物料" }, notes = "根据备件包批量删除备件包物料")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/batch")
public ResponseEntity<Boolean> removeBatchByEAMSparePartsGroup(@RequestBody List<String> ids) {
eamsparepartsproService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMSparePartsPRO-Get')")
@ApiOperation(value = "根据备件包获取备件包物料", tags = {"备件包物料" }, notes = "根据备件包获取备件包物料")
@RequestMapping(method = RequestMethod.GET, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/{eamsparepartspro_id}")
public ResponseEntity<EAMSparePartsPRODTO> getByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @PathVariable("eamsparepartspro_id") String eamsparepartspro_id) {
EAMSparePartsPRO domain = eamsparepartsproService.get(eamsparepartspro_id);
EAMSparePartsPRODTO dto = eamsparepartsproMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据备件包获取备件包物料草稿", tags = {"备件包物料" }, notes = "根据备件包获取备件包物料草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/getdraft")
public ResponseEntity<EAMSparePartsPRODTO> getDraftByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id) {
EAMSparePartsPRO domain = new EAMSparePartsPRO();
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsproMapping.toDto(eamsparepartsproService.getDraft(domain)));
}
@ApiOperation(value = "根据备件包检查备件包物料", tags = {"备件包物料" }, notes = "根据备件包检查备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody EAMSparePartsPRODTO eamsparepartsprodto) {
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsproService.checkKey(eamsparepartsproMapping.toDomain(eamsparepartsprodto)));
}
@PreAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodto),'iBizAssetManagement-EAMSparePartsPRO-Save')")
@ApiOperation(value = "根据备件包保存备件包物料", tags = {"备件包物料" }, notes = "根据备件包保存备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/save")
public ResponseEntity<Boolean> saveByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody EAMSparePartsPRODTO eamsparepartsprodto) {
EAMSparePartsPRO domain = eamsparepartsproMapping.toDomain(eamsparepartsprodto);
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
return ResponseEntity.status(HttpStatus.OK).body(eamsparepartsproService.save(domain));
}
@PreAuthorize("hasPermission(this.eamsparepartsproMapping.toDomain(#eamsparepartsprodtos),'iBizAssetManagement-EAMSparePartsPRO-Save')")
@ApiOperation(value = "根据备件包批量保存备件包物料", tags = {"备件包物料" }, notes = "根据备件包批量保存备件包物料")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody List<EAMSparePartsPRODTO> eamsparepartsprodtos) {
List<EAMSparePartsPRO> domainlist=eamsparepartsproMapping.toDomain(eamsparepartsprodtos);
for(EAMSparePartsPRO domain:domainlist){
domain.setEamsparepartsgroupid(eamsparepartsgroup_id);
}
eamsparepartsproService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMSparePartsPRO-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMSparePartsPRO-Get')")
@ApiOperation(value = "根据备件包获取DEFAULT", tags = {"备件包物料" } ,notes = "根据备件包获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/fetchdefault")
public ResponseEntity<List<EAMSparePartsPRODTO>> fetchEAMSparePartsPRODefaultByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id,EAMSparePartsPROSearchContext context) {
context.setN_eamsparepartsgroupid_eq(eamsparepartsgroup_id);
Page<EAMSparePartsPRO> domains = eamsparepartsproService.searchDefault(context) ;
List<EAMSparePartsPRODTO> list = eamsparepartsproMapping.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-EAMSparePartsPRO-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMSparePartsPRO-Get')")
@ApiOperation(value = "根据备件包查询DEFAULT", tags = {"备件包物料" } ,notes = "根据备件包查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamsparepartsgroups/{eamsparepartsgroup_id}/eamsparepartspros/searchdefault")
public ResponseEntity<Page<EAMSparePartsPRODTO>> searchEAMSparePartsPRODefaultByEAMSparePartsGroup(@PathVariable("eamsparepartsgroup_id") String eamsparepartsgroup_id, @RequestBody EAMSparePartsPROSearchContext context) {
context.setN_eamsparepartsgroupid_eq(eamsparepartsgroup_id);
Page<EAMSparePartsPRO> domains = eamsparepartsproService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamsparepartsproMapping.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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册