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

lab_gzf 部署微服务接口

上级 48aa7e96
...@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \ ...@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \ sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /assetmanagement-app-assetmanagement.jar 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 ADD assetmanagement-app-assetmanagement.jar /assetmanagement-app-assetmanagement.jar
...@@ -3,25 +3,9 @@ services: ...@@ -3,25 +3,9 @@ services:
assetmanagement-app-assetmanagement: assetmanagement-app-assetmanagement:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/assetmanagement-app-assetmanagement:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/assetmanagement-app-assetmanagement:latest
ports: ports:
- "10325:10325" - "8080:8080"
networks: networks:
- agent_network - 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: deploy:
resources: resources:
limits: limits:
......
...@@ -15,6 +15,10 @@ zuul: ...@@ -15,6 +15,10 @@ zuul:
path: /eamlocationtypes/** path: /eamlocationtypes/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false stripPrefix: false
eamworkorder:
path: /eamworkorders/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamlocation: eamlocation:
path: /eamlocations/** path: /eamlocations/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
...@@ -35,6 +39,10 @@ zuul: ...@@ -35,6 +39,10 @@ zuul:
path: /eamassetstatemodellines/** path: /eamassetstatemodellines/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false stripPrefix: false
eamwoorigin:
path: /woorigins/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamapplytype: eamapplytype:
path: /eamapplytypes/** path: /eamapplytypes/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
...@@ -79,9 +87,17 @@ zuul: ...@@ -79,9 +87,17 @@ zuul:
path: /eamapplies/** path: /eamapplies/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false stripPrefix: false
eamwostate:
path: /eamwostates/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamassetstatemodel: eamassetstatemodel:
path: /eamassetstatemodels/** path: /eamassetstatemodels/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi} serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false stripPrefix: false
eamwotype:
path: /eamwotypes/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
sensitive-headers: sensitive-headers:
- Cookie,Set-Cookie,Authorization - Cookie,Set-Cookie,Authorization
...@@ -125,6 +125,101 @@ public class EAMWorkOrder extends EntityMP implements Serializable { ...@@ -125,6 +125,101 @@ public class EAMWorkOrder extends EntityMP implements Serializable {
@JSONField(name = "wooriginid") @JSONField(name = "wooriginid")
@JsonProperty("wooriginid") @JsonProperty("wooriginid")
private String wooriginid; private String wooriginid;
/**
* 工单编号
*/
@TableField(value = "wonumber")
@JSONField(name = "wonumber")
@JsonProperty("wonumber")
private String wonumber;
/**
* 制定日期
*/
@TableField(value = "mdate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "mdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("mdate")
private Timestamp mdate;
/**
* 执行日期
*/
@TableField(value = "wodate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "wodate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("wodate")
private Timestamp wodate;
/**
* 实际开始时间
*/
@TableField(value = "begintime")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "begintime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("begintime")
private Timestamp begintime;
/**
* 实际结束时间
*/
@TableField(value = "endtime")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "endtime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("endtime")
private Timestamp endtime;
/**
* 服务等级标识
*/
@TableField(value = "eamservicelevelid")
@JSONField(name = "eamservicelevelid")
@JsonProperty("eamservicelevelid")
private String eamservicelevelid;
/**
* 工时
*/
@TableField(value = "worklength")
@JSONField(name = "worklength")
@JsonProperty("worklength")
private Double worklength;
/**
* 资产
*/
@TableField(exist = false)
@JSONField(name = "assetname")
@JsonProperty("assetname")
private String assetname;
/**
* 功能位置
*/
@TableField(exist = false)
@JSONField(name = "eamlocationname")
@JsonProperty("eamlocationname")
private String eamlocationname;
/**
* 服务等级
*/
@TableField(exist = false)
@JSONField(name = "eamservicelevelname")
@JsonProperty("eamservicelevelname")
private String eamservicelevelname;
/**
* 工单来源
*/
@TableField(exist = false)
@JSONField(name = "wooriginname")
@JsonProperty("wooriginname")
private String wooriginname;
/**
* 工单类型
*/
@TableField(exist = false)
@JSONField(name = "eamwotypename")
@JsonProperty("eamwotypename")
private String eamwotypename;
/**
* 上级工单
*/
@TableField(exist = false)
@JSONField(name = "pworkordername")
@JsonProperty("pworkordername")
private String pworkordername;
/** /**
* *
...@@ -142,6 +237,14 @@ public class EAMWorkOrder extends EntityMP implements Serializable { ...@@ -142,6 +237,14 @@ public class EAMWorkOrder extends EntityMP implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private cn.ibizlab.assetmanagement.core.location.domain.EAMLocation eamlocation; private cn.ibizlab.assetmanagement.core.location.domain.EAMLocation eamlocation;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.workorder.domain.EAMServiceLevel eamservicelevel;
/** /**
* *
*/ */
...@@ -216,6 +319,102 @@ public class EAMWorkOrder extends EntityMP implements Serializable { ...@@ -216,6 +319,102 @@ public class EAMWorkOrder extends EntityMP implements Serializable {
this.modify("eamwooriginid",wooriginid); this.modify("eamwooriginid",wooriginid);
} }
/**
* 设置 [工单编号]
*/
public void setWonumber(String wonumber){
this.wonumber = wonumber ;
this.modify("wonumber",wonumber);
}
/**
* 设置 [制定日期]
*/
public void setMdate(Timestamp mdate){
this.mdate = mdate ;
this.modify("mdate",mdate);
}
/**
* 格式化日期 [制定日期]
*/
public String formatMdate(){
if (this.mdate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(mdate);
}
/**
* 设置 [执行日期]
*/
public void setWodate(Timestamp wodate){
this.wodate = wodate ;
this.modify("wodate",wodate);
}
/**
* 格式化日期 [执行日期]
*/
public String formatWodate(){
if (this.wodate == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(wodate);
}
/**
* 设置 [实际开始时间]
*/
public void setBegintime(Timestamp begintime){
this.begintime = begintime ;
this.modify("begintime",begintime);
}
/**
* 格式化日期 [实际开始时间]
*/
public String formatBegintime(){
if (this.begintime == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(begintime);
}
/**
* 设置 [实际结束时间]
*/
public void setEndtime(Timestamp endtime){
this.endtime = endtime ;
this.modify("endtime",endtime);
}
/**
* 格式化日期 [实际结束时间]
*/
public String formatEndtime(){
if (this.endtime == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(endtime);
}
/**
* 设置 [服务等级标识]
*/
public void setEamservicelevelid(String eamservicelevelid){
this.eamservicelevelid = eamservicelevelid ;
this.modify("eamservicelevelid",eamservicelevelid);
}
/**
* 设置 [工时]
*/
public void setWorklength(Double worklength){
this.worklength = worklength ;
this.modify("worklength",worklength);
}
} }
......
...@@ -69,6 +69,97 @@ public class EAMWorkOrderSearchContext extends QueryWrapperContext<EAMWorkOrder> ...@@ -69,6 +69,97 @@ public class EAMWorkOrderSearchContext extends QueryWrapperContext<EAMWorkOrder>
this.getSearchCond().eq("eamwooriginid", n_eamwooriginid_eq); this.getSearchCond().eq("eamwooriginid", n_eamwooriginid_eq);
} }
} }
private String n_eamservicelevelid_eq;//[服务等级标识]
public void setN_eamservicelevelid_eq(String n_eamservicelevelid_eq) {
this.n_eamservicelevelid_eq = n_eamservicelevelid_eq;
if(!ObjectUtils.isEmpty(this.n_eamservicelevelid_eq)){
this.getSearchCond().eq("eamservicelevelid", n_eamservicelevelid_eq);
}
}
private String n_assetname_eq;//[资产]
public void setN_assetname_eq(String n_assetname_eq) {
this.n_assetname_eq = n_assetname_eq;
if(!ObjectUtils.isEmpty(this.n_assetname_eq)){
this.getSearchCond().eq("assetname", n_assetname_eq);
}
}
private String n_assetname_like;//[资产]
public void setN_assetname_like(String n_assetname_like) {
this.n_assetname_like = n_assetname_like;
if(!ObjectUtils.isEmpty(this.n_assetname_like)){
this.getSearchCond().like("assetname", n_assetname_like);
}
}
private String n_eamlocationname_eq;//[功能位置]
public void setN_eamlocationname_eq(String n_eamlocationname_eq) {
this.n_eamlocationname_eq = n_eamlocationname_eq;
if(!ObjectUtils.isEmpty(this.n_eamlocationname_eq)){
this.getSearchCond().eq("eamlocationname", n_eamlocationname_eq);
}
}
private String n_eamlocationname_like;//[功能位置]
public void setN_eamlocationname_like(String n_eamlocationname_like) {
this.n_eamlocationname_like = n_eamlocationname_like;
if(!ObjectUtils.isEmpty(this.n_eamlocationname_like)){
this.getSearchCond().like("eamlocationname", n_eamlocationname_like);
}
}
private String n_eamservicelevelname_eq;//[服务等级]
public void setN_eamservicelevelname_eq(String n_eamservicelevelname_eq) {
this.n_eamservicelevelname_eq = n_eamservicelevelname_eq;
if(!ObjectUtils.isEmpty(this.n_eamservicelevelname_eq)){
this.getSearchCond().eq("eamservicelevelname", n_eamservicelevelname_eq);
}
}
private String n_eamservicelevelname_like;//[服务等级]
public void setN_eamservicelevelname_like(String n_eamservicelevelname_like) {
this.n_eamservicelevelname_like = n_eamservicelevelname_like;
if(!ObjectUtils.isEmpty(this.n_eamservicelevelname_like)){
this.getSearchCond().like("eamservicelevelname", n_eamservicelevelname_like);
}
}
private String n_eamwooriginname_eq;//[工单来源]
public void setN_eamwooriginname_eq(String n_eamwooriginname_eq) {
this.n_eamwooriginname_eq = n_eamwooriginname_eq;
if(!ObjectUtils.isEmpty(this.n_eamwooriginname_eq)){
this.getSearchCond().eq("eamwooriginname", n_eamwooriginname_eq);
}
}
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_eamwotypename_eq;//[工单类型]
public void setN_eamwotypename_eq(String n_eamwotypename_eq) {
this.n_eamwotypename_eq = n_eamwotypename_eq;
if(!ObjectUtils.isEmpty(this.n_eamwotypename_eq)){
this.getSearchCond().eq("eamwotypename", n_eamwotypename_eq);
}
}
private String n_eamwotypename_like;//[工单类型]
public void setN_eamwotypename_like(String n_eamwotypename_like) {
this.n_eamwotypename_like = n_eamwotypename_like;
if(!ObjectUtils.isEmpty(this.n_eamwotypename_like)){
this.getSearchCond().like("eamwotypename", n_eamwotypename_like);
}
}
private String n_pworkordername_eq;//[上级工单]
public void setN_pworkordername_eq(String n_pworkordername_eq) {
this.n_pworkordername_eq = n_pworkordername_eq;
if(!ObjectUtils.isEmpty(this.n_pworkordername_eq)){
this.getSearchCond().eq("pworkordername", n_pworkordername_eq);
}
}
private String n_pworkordername_like;//[上级工单]
public void setN_pworkordername_like(String n_pworkordername_like) {
this.n_pworkordername_like = n_pworkordername_like;
if(!ObjectUtils.isEmpty(this.n_pworkordername_like)){
this.getSearchCond().like("pworkordername", n_pworkordername_like);
}
}
/** /**
* 启用快速搜索 * 启用快速搜索
......
...@@ -66,6 +66,8 @@ public interface EAMWorkOrderMapper extends BaseMapper<EAMWorkOrder>{ ...@@ -66,6 +66,8 @@ public interface EAMWorkOrderMapper extends BaseMapper<EAMWorkOrder>{
List<EAMWorkOrder> selectByEamlocationid(@Param("eamlocationid") Serializable eamlocationid) ; List<EAMWorkOrder> selectByEamlocationid(@Param("eamlocationid") Serializable eamlocationid) ;
List<EAMWorkOrder> selectByEamservicelevelid(@Param("eamservicelevelid") Serializable eamservicelevelid) ;
List<EAMWorkOrder> selectByWooriginid(@Param("wooriginid") Serializable wooriginid) ; List<EAMWorkOrder> selectByWooriginid(@Param("wooriginid") Serializable wooriginid) ;
List<EAMWorkOrder> selectByPworkorderid(@Param("workorderid") Serializable workorderid) ; List<EAMWorkOrder> selectByPworkorderid(@Param("workorderid") Serializable workorderid) ;
......
...@@ -41,6 +41,8 @@ public interface IEAMWorkOrderService extends IService<EAMWorkOrder>{ ...@@ -41,6 +41,8 @@ public interface IEAMWorkOrderService extends IService<EAMWorkOrder>{
void removeByAssetid(String assetid) ; void removeByAssetid(String assetid) ;
List<EAMWorkOrder> selectByEamlocationid(String eamlocationid) ; List<EAMWorkOrder> selectByEamlocationid(String eamlocationid) ;
void removeByEamlocationid(String eamlocationid) ; void removeByEamlocationid(String eamlocationid) ;
List<EAMWorkOrder> selectByEamservicelevelid(String eamservicelevelid) ;
void removeByEamservicelevelid(String eamservicelevelid) ;
List<EAMWorkOrder> selectByWooriginid(String wooriginid) ; List<EAMWorkOrder> selectByWooriginid(String wooriginid) ;
void removeByWooriginid(String wooriginid) ; void removeByWooriginid(String wooriginid) ;
List<EAMWorkOrder> selectByPworkorderid(String workorderid) ; List<EAMWorkOrder> selectByPworkorderid(String workorderid) ;
......
...@@ -48,6 +48,9 @@ public class EAMServiceLevelServiceImpl extends ServiceImpl<EAMServiceLevelMappe ...@@ -48,6 +48,9 @@ public class EAMServiceLevelServiceImpl extends ServiceImpl<EAMServiceLevelMappe
@Autowired @Autowired
@Lazy @Lazy
protected cn.ibizlab.assetmanagement.core.apply.service.IEAMApplyService eamapplyService; protected cn.ibizlab.assetmanagement.core.apply.service.IEAMApplyService eamapplyService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.workorder.service.IEAMWorkOrderService eamworkorderService;
protected int batchSize = 500; protected int batchSize = 500;
......
...@@ -55,6 +55,9 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM ...@@ -55,6 +55,9 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
protected cn.ibizlab.assetmanagement.core.location.service.IEAMLocationService eamlocationService; protected cn.ibizlab.assetmanagement.core.location.service.IEAMLocationService eamlocationService;
@Autowired @Autowired
@Lazy @Lazy
protected cn.ibizlab.assetmanagement.core.workorder.service.IEAMServiceLevelService eamservicelevelService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.workorder.service.IWOOriginService wooriginService; protected cn.ibizlab.assetmanagement.core.workorder.service.IWOOriginService wooriginService;
@Autowired @Autowired
@Lazy @Lazy
...@@ -65,6 +68,7 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM ...@@ -65,6 +68,7 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
@Override @Override
@Transactional @Transactional
public boolean create(EAMWorkOrder et) { public boolean create(EAMWorkOrder et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et))) if(!this.retBool(this.baseMapper.insert(et)))
return false; return false;
CachedBeanCopier.copy(get(et.getWorkorderid()),et); CachedBeanCopier.copy(get(et.getWorkorderid()),et);
...@@ -73,12 +77,14 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM ...@@ -73,12 +77,14 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
@Override @Override
public void createBatch(List<EAMWorkOrder> list) { public void createBatch(List<EAMWorkOrder> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize); this.saveBatch(list,batchSize);
} }
@Override @Override
@Transactional @Transactional
public boolean update(EAMWorkOrder et) { public boolean update(EAMWorkOrder et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("workorderid",et.getWorkorderid()))) if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("workorderid",et.getWorkorderid())))
return false; return false;
CachedBeanCopier.copy(get(et.getWorkorderid()),et); CachedBeanCopier.copy(get(et.getWorkorderid()),et);
...@@ -87,6 +93,7 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM ...@@ -87,6 +93,7 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
@Override @Override
public void updateBatch(List<EAMWorkOrder> list) { public void updateBatch(List<EAMWorkOrder> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize); updateBatchById(list,batchSize);
} }
...@@ -117,6 +124,7 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM ...@@ -117,6 +124,7 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
@Override @Override
public EAMWorkOrder getDraft(EAMWorkOrder et) { public EAMWorkOrder getDraft(EAMWorkOrder et) {
fillParentData(et);
return et; return et;
} }
...@@ -144,12 +152,14 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM ...@@ -144,12 +152,14 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
@Override @Override
public boolean saveBatch(Collection<EAMWorkOrder> list) { public boolean saveBatch(Collection<EAMWorkOrder> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize); saveOrUpdateBatch(list,batchSize);
return true; return true;
} }
@Override @Override
public void saveBatch(List<EAMWorkOrder> list) { public void saveBatch(List<EAMWorkOrder> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize); saveOrUpdateBatch(list,batchSize);
} }
...@@ -174,6 +184,16 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM ...@@ -174,6 +184,16 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
this.remove(new QueryWrapper<EAMWorkOrder>().eq("eamlocationid",eamlocationid)); this.remove(new QueryWrapper<EAMWorkOrder>().eq("eamlocationid",eamlocationid));
} }
@Override
public List<EAMWorkOrder> selectByEamservicelevelid(String eamservicelevelid) {
return baseMapper.selectByEamservicelevelid(eamservicelevelid);
}
@Override
public void removeByEamservicelevelid(String eamservicelevelid) {
this.remove(new QueryWrapper<EAMWorkOrder>().eq("eamservicelevelid",eamservicelevelid));
}
@Override @Override
public List<EAMWorkOrder> selectByWooriginid(String wooriginid) { public List<EAMWorkOrder> selectByWooriginid(String wooriginid) {
return baseMapper.selectByWooriginid(wooriginid); return baseMapper.selectByWooriginid(wooriginid);
...@@ -216,6 +236,72 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM ...@@ -216,6 +236,72 @@ public class EAMWorkOrderServiceImpl extends ServiceImpl<EAMWorkOrderMapper, EAM
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(EAMWorkOrder et){
//实体关系[DER1N_EAMWORKORDER_EAMASSET_ASSETID]
if(!ObjectUtils.isEmpty(et.getAssetid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAsset asset=et.getAsset();
if(ObjectUtils.isEmpty(asset)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAsset majorEntity=eamassetService.get(et.getAssetid());
et.setAsset(majorEntity);
asset=majorEntity;
}
et.setAssetname(asset.getAssetname());
}
//实体关系[DER1N_EAMWORKORDER_EAMLOCATION_EAMLOCATIONID]
if(!ObjectUtils.isEmpty(et.getEamlocationid())){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocation eamlocation=et.getEamlocation();
if(ObjectUtils.isEmpty(eamlocation)){
cn.ibizlab.assetmanagement.core.location.domain.EAMLocation majorEntity=eamlocationService.get(et.getEamlocationid());
et.setEamlocation(majorEntity);
eamlocation=majorEntity;
}
et.setEamlocationname(eamlocation.getEamlocationname());
}
//实体关系[DER1N_EAMWORKORDER_EAMSERVICELEVEL_EAMSERVICELEVELID]
if(!ObjectUtils.isEmpty(et.getEamservicelevelid())){
cn.ibizlab.assetmanagement.core.workorder.domain.EAMServiceLevel eamservicelevel=et.getEamservicelevel();
if(ObjectUtils.isEmpty(eamservicelevel)){
cn.ibizlab.assetmanagement.core.workorder.domain.EAMServiceLevel majorEntity=eamservicelevelService.get(et.getEamservicelevelid());
et.setEamservicelevel(majorEntity);
eamservicelevel=majorEntity;
}
et.setEamservicelevelname(eamservicelevel.getEamservicelevelname());
}
//实体关系[DER1N_EAMWORKORDER_EAMWOORIGIN_EAMWOORIGINID]
if(!ObjectUtils.isEmpty(et.getWooriginid())){
cn.ibizlab.assetmanagement.core.workorder.domain.WOOrigin eamwoorigin=et.getEamwoorigin();
if(ObjectUtils.isEmpty(eamwoorigin)){
cn.ibizlab.assetmanagement.core.workorder.domain.WOOrigin majorEntity=wooriginService.get(et.getWooriginid());
et.setEamwoorigin(majorEntity);
eamwoorigin=majorEntity;
}
et.setWooriginname(eamwoorigin.getWooriginname());
}
//实体关系[DER1N_EAMWORKORDER_EAMWORKORDER_PWORKORDERID]
if(!ObjectUtils.isEmpty(et.getPworkorderid())){
cn.ibizlab.assetmanagement.core.workorder.domain.EAMWorkOrder pworkorder=et.getPworkorder();
if(ObjectUtils.isEmpty(pworkorder)){
cn.ibizlab.assetmanagement.core.workorder.domain.EAMWorkOrder majorEntity=eamworkorderService.get(et.getPworkorderid());
et.setPworkorder(majorEntity);
pworkorder=majorEntity;
}
et.setPworkordername(pworkorder.getWorkordername());
}
//实体关系[DER1N_EAMWORKORDER_EAMWOTYPE_EAMWOTYPEID]
if(!ObjectUtils.isEmpty(et.getEamwotypeid())){
cn.ibizlab.assetmanagement.core.workorder.domain.EAMWOType eamwotype=et.getEamwotype();
if(ObjectUtils.isEmpty(eamwotype)){
cn.ibizlab.assetmanagement.core.workorder.domain.EAMWOType majorEntity=eamwotypeService.get(et.getEamwotypeid());
et.setEamwotype(majorEntity);
eamwotype=majorEntity;
}
et.setEamwotypename(eamwotype.getEamwotypename());
}
}
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性--> <!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMWorkOrderResultMap" databaseId="mysql"> <select id="selectById" resultMap="EAMWorkOrderResultMap" databaseId="mysql">
<![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}]]> <![CDATA[select t1.* from (SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID ) t1 where workorderid=#{id}]]>
</select> </select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 --> <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
<result property="eamlocationid" column="eamlocationid" /> <result property="eamlocationid" column="eamlocationid" />
<result property="pworkorderid" column="pworkorderid" /> <result property="pworkorderid" column="pworkorderid" />
<result property="wooriginid" column="eamwooriginid" /> <result property="wooriginid" column="eamwooriginid" />
<result property="eamservicelevelid" column="eamservicelevelid" />
<result property="wooriginname" column="eamwooriginname" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 --> <!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
...@@ -23,6 +25,8 @@ ...@@ -23,6 +25,8 @@
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 --> <!--通过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> <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"为懒加载配置 --> <!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamservicelevel" javaType="cn.ibizlab.assetmanagement.core.workorder.domain.EAMServiceLevel" column="eamservicelevelid" select="cn.ibizlab.assetmanagement.core.workorder.mapper.EAMServiceLevelMapper.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> <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"为懒加载配置 --> <!--通过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> <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>
...@@ -43,6 +47,13 @@ ...@@ -43,6 +47,13 @@
<include refid="Default" /> <include refid="Default" />
) t1 ) t1
where eamlocationid=#{eamlocationid} where eamlocationid=#{eamlocationid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMWORKORDER_EAMSERVICELEVEL_EAMSERVICELEVELID] -->
<select id="selectByEamservicelevelid" resultMap="EAMWorkOrderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamservicelevelid=#{eamservicelevelid}
</select> </select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMWORKORDER_EAMWOORIGIN_EAMWOORIGINID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMWORKORDER_EAMWOORIGIN_EAMWOORIGINID] -->
<select id="selectByWooriginid" resultMap="EAMWorkOrderResultMap"> <select id="selectByWooriginid" resultMap="EAMWorkOrderResultMap">
...@@ -77,12 +88,12 @@ ...@@ -77,12 +88,12 @@
<!--数据查询[Default]--> <!--数据查询[Default]-->
<sql id="Default" databaseId="mysql"> <sql id="Default" databaseId="mysql">
<![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 <![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID
]]> ]]>
</sql> </sql>
<!--数据查询[View]--> <!--数据查询[View]-->
<sql id="View" databaseId="mysql"> <sql id="View" databaseId="mysql">
<![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 <![CDATA[ SELECT t1.`ASSETID`, t11.`ASSETNAME`, t1.`BEGINTIME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`EAMSERVICELEVELID`, t31.`EAMSERVICELEVELNAME`, t1.`EAMWOORIGINID`, t41.`EAMWOORIGINNAME`, t1.`EAMWOTYPEID`, t51.`EAMWOTYPENAME`, t1.`ENDTIME`, t1.`MDATE`, t1.`PWORKORDERID`, t61.`WORKORDERNAME` AS `PWORKORDERNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WODATE`, t1.`WONUMBER`, t1.`WORKLENGTH`, t1.`WORKORDERID`, t1.`WORKORDERNAME` FROM `WORKORDER` t1 LEFT JOIN ASSET t11 ON t1.ASSETID = t11.ASSETID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMSERVICELEVEL t31 ON t1.EAMSERVICELEVELID = t31.EAMSERVICELEVELID LEFT JOIN EAMWOORIGIN t41 ON t1.EAMWOORIGINID = t41.EAMWOORIGINID LEFT JOIN EAMWOTYPE t51 ON t1.EAMWOTYPEID = t51.EAMWOTYPEID LEFT JOIN WORKORDER t61 ON t1.PWORKORDERID = t61.WORKORDERID
]]> ]]>
</sql> </sql>
</mapper> </mapper>
......
...@@ -20,6 +20,14 @@ ...@@ -20,6 +20,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}] "datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
} }
, { , {
"dename":"EAMWorkOrder",
"delogicname":"工单",
"sysmoudle":{"id":"WORKORDER","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":"EAMLocation", "dename":"EAMLocation",
"delogicname":"功能位置", "delogicname":"功能位置",
"sysmoudle":{"id":"LOCATION","name":"功能位置"}, "sysmoudle":{"id":"LOCATION","name":"功能位置"},
...@@ -60,6 +68,14 @@ ...@@ -60,6 +68,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}] "datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
} }
, { , {
"dename":"WOOrigin",
"delogicname":"工单来源",
"sysmoudle":{"id":"WORKORDER","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":"EAMApplyType", "dename":"EAMApplyType",
"delogicname":"维护申请类型", "delogicname":"维护申请类型",
"sysmoudle":{"id":"APPLY","name":"维护申请"}, "sysmoudle":{"id":"APPLY","name":"维护申请"},
...@@ -148,11 +164,27 @@ ...@@ -148,11 +164,27 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}] "datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
} }
, { , {
"dename":"EAMWOState",
"delogicname":"工单状态",
"sysmoudle":{"id":"WORKORDER","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":"EAMAssetStateModel", "dename":"EAMAssetStateModel",
"delogicname":"资产状态模型", "delogicname":"资产状态模型",
"sysmoudle":{"id":"ASSET","name":"资产管理"}, "sysmoudle":{"id":"ASSET","name":"资产管理"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "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" }], "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":"EAMWOType",
"delogicname":"工单类型",
"sysmoudle":{"id":"WORKORDER","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":"创建人"}] "datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
} }
], ],
...@@ -161,7 +193,7 @@ ...@@ -161,7 +193,7 @@
{ {
"appid":"AssetManagement", "appid":"AssetManagement",
"appname":"资产管理", "appname":"资产管理",
"appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem15" , "name":"系统设置" , "items":[{ "id":"menuitem16" , "name":"服务等级" },{ "id":"menuitem17" , "name":"维护申请类型" }]}]},{ "id":"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":"维护计划" }]}] }] "appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem15" , "name":"系统设置" , "items":[{ "id":"menuitem16" , "name":"服务等级" },{ "id":"menuitem17" , "name":"维护申请类型" }]}]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem1" , "name":"功能位置" , "items":[{ "id":"menuitem6" , "name":"功能位置状态" },{ "id":"menuitem7" , "name":"功能位置状态模型" },{ "id":"menuitem8" , "name":"功能位置类型" },{ "id":"menuitem9" , "name":"功能位置" }]},{ "id":"menuitem2" , "name":"资产管理" , "items":[{ "id":"menuitem10" , "name":"资产状态" },{ "id":"menuitem11" , "name":"资产状态模型" },{ "id":"menuitem12" , "name":"资产类型" },{ "id":"menuitem13" , "name":"资产管理" },{ "id":"menuitem14" , "name":"备件包" }]},{ "id":"menuitem4" , "name":"工单管理" , "items":[{ "id":"menuitem3" , "name":"维护申请" }]},{ "id":"menuitem5" , "name":"维护计划" }]}] }]
} }
] ]
} }
...@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \ ...@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \ sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /assetmanagement-provider-assetapi.jar 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 ADD assetmanagement-provider-assetapi.jar /assetmanagement-provider-assetapi.jar
...@@ -3,9 +3,25 @@ services: ...@@ -3,9 +3,25 @@ services:
assetmanagement-provider-assetapi: assetmanagement-provider-assetapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/assetmanagement-provider-assetapi:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/assetmanagement-provider-assetapi:latest
ports: ports:
- "8081:8081" - "10315:10315"
networks: networks:
- agent_network - 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: deploy:
resources: resources:
limits: 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对象[EAMWOStateDTO]
*/
@Data
public class EAMWOStateDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMWOSTATENAME]
*
*/
@JSONField(name = "eamwostatename")
@JsonProperty("eamwostatename")
private String eamwostatename;
/**
* 属性 [EAMWOSTATEID]
*
*/
@JSONField(name = "eamwostateid")
@JsonProperty("eamwostateid")
private String eamwostateid;
/**
* 属性 [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;
/**
* 属性 [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;
/**
* 设置 [EAMWOSTATENAME]
*/
public void setEamwostatename(String eamwostatename){
this.eamwostatename = eamwostatename ;
this.modify("eamwostatename",eamwostatename);
}
}
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对象[EAMWOTypeDTO]
*/
@Data
public class EAMWOTypeDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMWOTYPENAME]
*
*/
@JSONField(name = "eamwotypename")
@JsonProperty("eamwotypename")
private String eamwotypename;
/**
* 属性 [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;
/**
* 属性 [EAMWOTYPEID]
*
*/
@JSONField(name = "eamwotypeid")
@JsonProperty("eamwotypeid")
private String eamwotypeid;
/**
* 属性 [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;
/**
* 属性 [EAMWOSTATEMODELID]
*
*/
@JSONField(name = "eamwostatemodelid")
@JsonProperty("eamwostatemodelid")
private String eamwostatemodelid;
/**
* 设置 [EAMWOTYPENAME]
*/
public void setEamwotypename(String eamwotypename){
this.eamwotypename = eamwotypename ;
this.modify("eamwotypename",eamwotypename);
}
/**
* 设置 [EAMWOSTATEMODELID]
*/
public void setEamwostatemodelid(String eamwostatemodelid){
this.eamwostatemodelid = eamwostatemodelid ;
this.modify("eamwostatemodelid",eamwostatemodelid);
}
}
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对象[EAMWorkOrderDTO]
*/
@Data
public class EAMWorkOrderDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [WORKORDERID]
*
*/
@JSONField(name = "workorderid")
@JsonProperty("workorderid")
private String workorderid;
/**
* 属性 [WORKORDERNAME]
*
*/
@JSONField(name = "workordername")
@JsonProperty("workordername")
private String workordername;
/**
* 属性 [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;
/**
* 属性 [EAMWOTYPEID]
*
*/
@JSONField(name = "eamwotypeid")
@JsonProperty("eamwotypeid")
private String eamwotypeid;
/**
* 属性 [ASSETID]
*
*/
@JSONField(name = "assetid")
@JsonProperty("assetid")
private String assetid;
/**
* 属性 [EAMLOCATIONID]
*
*/
@JSONField(name = "eamlocationid")
@JsonProperty("eamlocationid")
private String eamlocationid;
/**
* 属性 [PWORKORDERID]
*
*/
@JSONField(name = "pworkorderid")
@JsonProperty("pworkorderid")
private String pworkorderid;
/**
* 属性 [EAMWOORIGINID]
*
*/
@JSONField(name = "wooriginid")
@JsonProperty("wooriginid")
private String wooriginid;
/**
* 属性 [WONUMBER]
*
*/
@JSONField(name = "wonumber")
@JsonProperty("wonumber")
private String wonumber;
/**
* 属性 [MDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "mdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("mdate")
private Timestamp mdate;
/**
* 属性 [WODATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "wodate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("wodate")
private Timestamp wodate;
/**
* 属性 [BEGINTIME]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "begintime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("begintime")
private Timestamp begintime;
/**
* 属性 [ENDTIME]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "endtime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("endtime")
private Timestamp endtime;
/**
* 属性 [EAMSERVICELEVELID]
*
*/
@JSONField(name = "eamservicelevelid")
@JsonProperty("eamservicelevelid")
private String eamservicelevelid;
/**
* 属性 [WORKLENGTH]
*
*/
@JSONField(name = "worklength")
@JsonProperty("worklength")
private Double worklength;
/**
* 属性 [ASSETNAME]
*
*/
@JSONField(name = "assetname")
@JsonProperty("assetname")
private String assetname;
/**
* 属性 [EAMLOCATIONNAME]
*
*/
@JSONField(name = "eamlocationname")
@JsonProperty("eamlocationname")
private String eamlocationname;
/**
* 属性 [EAMSERVICELEVELNAME]
*
*/
@JSONField(name = "eamservicelevelname")
@JsonProperty("eamservicelevelname")
private String eamservicelevelname;
/**
* 属性 [EAMWOORIGINNAME]
*
*/
@JSONField(name = "wooriginname")
@JsonProperty("wooriginname")
private String wooriginname;
/**
* 属性 [EAMWOTYPENAME]
*
*/
@JSONField(name = "eamwotypename")
@JsonProperty("eamwotypename")
private String eamwotypename;
/**
* 属性 [PWORKORDERNAME]
*
*/
@JSONField(name = "pworkordername")
@JsonProperty("pworkordername")
private String pworkordername;
/**
* 设置 [WORKORDERNAME]
*/
public void setWorkordername(String workordername){
this.workordername = workordername ;
this.modify("workordername",workordername);
}
/**
* 设置 [EAMWOTYPEID]
*/
public void setEamwotypeid(String eamwotypeid){
this.eamwotypeid = eamwotypeid ;
this.modify("eamwotypeid",eamwotypeid);
}
/**
* 设置 [ASSETID]
*/
public void setAssetid(String assetid){
this.assetid = assetid ;
this.modify("assetid",assetid);
}
/**
* 设置 [EAMLOCATIONID]
*/
public void setEamlocationid(String eamlocationid){
this.eamlocationid = eamlocationid ;
this.modify("eamlocationid",eamlocationid);
}
/**
* 设置 [PWORKORDERID]
*/
public void setPworkorderid(String pworkorderid){
this.pworkorderid = pworkorderid ;
this.modify("pworkorderid",pworkorderid);
}
/**
* 设置 [EAMWOORIGINID]
*/
public void setWooriginid(String wooriginid){
this.wooriginid = wooriginid ;
this.modify("eamwooriginid",wooriginid);
}
/**
* 设置 [WONUMBER]
*/
public void setWonumber(String wonumber){
this.wonumber = wonumber ;
this.modify("wonumber",wonumber);
}
/**
* 设置 [MDATE]
*/
public void setMdate(Timestamp mdate){
this.mdate = mdate ;
this.modify("mdate",mdate);
}
/**
* 设置 [WODATE]
*/
public void setWodate(Timestamp wodate){
this.wodate = wodate ;
this.modify("wodate",wodate);
}
/**
* 设置 [BEGINTIME]
*/
public void setBegintime(Timestamp begintime){
this.begintime = begintime ;
this.modify("begintime",begintime);
}
/**
* 设置 [ENDTIME]
*/
public void setEndtime(Timestamp endtime){
this.endtime = endtime ;
this.modify("endtime",endtime);
}
/**
* 设置 [EAMSERVICELEVELID]
*/
public void setEamservicelevelid(String eamservicelevelid){
this.eamservicelevelid = eamservicelevelid ;
this.modify("eamservicelevelid",eamservicelevelid);
}
/**
* 设置 [WORKLENGTH]
*/
public void setWorklength(Double worklength){
this.worklength = worklength ;
this.modify("worklength",worklength);
}
}
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对象[WOOriginDTO]
*/
@Data
public class WOOriginDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMWOORIGINID]
*
*/
@JSONField(name = "wooriginid")
@JsonProperty("wooriginid")
private String wooriginid;
/**
* 属性 [EAMWOORIGINNAME]
*
*/
@JSONField(name = "wooriginname")
@JsonProperty("wooriginname")
private String wooriginname;
/**
* 属性 [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;
/**
* 属性 [EAMWOORIGINTYPE]
*
*/
@JSONField(name = "woorigintype")
@JsonProperty("woorigintype")
private String woorigintype;
/**
* 设置 [EAMWOORIGINNAME]
*/
public void setWooriginname(String wooriginname){
this.wooriginname = wooriginname ;
this.modify("eamwooriginname",wooriginname);
}
/**
* 设置 [EAMWOORIGINTYPE]
*/
public void setWoorigintype(String woorigintype){
this.woorigintype = woorigintype ;
this.modify("eamwoorigintype",woorigintype);
}
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMWOState;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMWOStateDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMWOStateMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMWOStateMapping extends MappingBase<EAMWOStateDTO, EAMWOState> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMWOType;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMWOTypeDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMWOTypeMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMWOTypeMapping extends MappingBase<EAMWOTypeDTO, EAMWOType> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.workorder.domain.EAMWorkOrder;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMWorkOrderDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMWorkOrderMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMWorkOrderMapping extends MappingBase<EAMWorkOrderDTO, EAMWorkOrder> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.workorder.domain.WOOrigin;
import cn.ibizlab.assetmanagement.assetapi.dto.WOOriginDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiWOOriginMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface WOOriginMapping extends MappingBase<WOOriginDTO, WOOrigin> {
}
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.workorder.domain.EAMWOState;
import cn.ibizlab.assetmanagement.core.workorder.service.IEAMWOStateService;
import cn.ibizlab.assetmanagement.core.workorder.filter.EAMWOStateSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"工单状态" })
@RestController("AssetApi-eamwostate")
@RequestMapping("")
public class EAMWOStateResource {
@Autowired
public IEAMWOStateService eamwostateService;
@Autowired
@Lazy
public EAMWOStateMapping eamwostateMapping;
@PreAuthorize("hasPermission(this.eamwostateMapping.toDomain(#eamwostatedto),'iBizAssetManagement-EAMWOState-Create')")
@ApiOperation(value = "新建工单状态", tags = {"工单状态" }, notes = "新建工单状态")
@RequestMapping(method = RequestMethod.POST, value = "/eamwostates")
@Transactional
public ResponseEntity<EAMWOStateDTO> create(@RequestBody EAMWOStateDTO eamwostatedto) {
EAMWOState domain = eamwostateMapping.toDomain(eamwostatedto);
eamwostateService.create(domain);
EAMWOStateDTO dto = eamwostateMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamwostateMapping.toDomain(#eamwostatedtos),'iBizAssetManagement-EAMWOState-Create')")
@ApiOperation(value = "批量新建工单状态", tags = {"工单状态" }, notes = "批量新建工单状态")
@RequestMapping(method = RequestMethod.POST, value = "/eamwostates/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMWOStateDTO> eamwostatedtos) {
eamwostateService.createBatch(eamwostateMapping.toDomain(eamwostatedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamwostate" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamwostateService.get(#eamwostate_id),'iBizAssetManagement-EAMWOState-Update')")
@ApiOperation(value = "更新工单状态", tags = {"工单状态" }, notes = "更新工单状态")
@RequestMapping(method = RequestMethod.PUT, value = "/eamwostates/{eamwostate_id}")
@Transactional
public ResponseEntity<EAMWOStateDTO> update(@PathVariable("eamwostate_id") String eamwostate_id, @RequestBody EAMWOStateDTO eamwostatedto) {
EAMWOState domain = eamwostateMapping.toDomain(eamwostatedto);
domain .setEamwostateid(eamwostate_id);
eamwostateService.update(domain );
EAMWOStateDTO dto = eamwostateMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamwostateService.getEamwostateByEntities(this.eamwostateMapping.toDomain(#eamwostatedtos)),'iBizAssetManagement-EAMWOState-Update')")
@ApiOperation(value = "批量更新工单状态", tags = {"工单状态" }, notes = "批量更新工单状态")
@RequestMapping(method = RequestMethod.PUT, value = "/eamwostates/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMWOStateDTO> eamwostatedtos) {
eamwostateService.updateBatch(eamwostateMapping.toDomain(eamwostatedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamwostateService.get(#eamwostate_id),'iBizAssetManagement-EAMWOState-Remove')")
@ApiOperation(value = "删除工单状态", tags = {"工单状态" }, notes = "删除工单状态")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamwostates/{eamwostate_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamwostate_id") String eamwostate_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamwostateService.remove(eamwostate_id));
}
@PreAuthorize("hasPermission(this.eamwostateService.getEamwostateByIds(#ids),'iBizAssetManagement-EAMWOState-Remove')")
@ApiOperation(value = "批量删除工单状态", tags = {"工单状态" }, notes = "批量删除工单状态")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamwostates/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamwostateService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamwostateMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMWOState-Get')")
@ApiOperation(value = "获取工单状态", tags = {"工单状态" }, notes = "获取工单状态")
@RequestMapping(method = RequestMethod.GET, value = "/eamwostates/{eamwostate_id}")
public ResponseEntity<EAMWOStateDTO> get(@PathVariable("eamwostate_id") String eamwostate_id) {
EAMWOState domain = eamwostateService.get(eamwostate_id);
EAMWOStateDTO dto = eamwostateMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取工单状态草稿", tags = {"工单状态" }, notes = "获取工单状态草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamwostates/getdraft")
public ResponseEntity<EAMWOStateDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamwostateMapping.toDto(eamwostateService.getDraft(new EAMWOState())));
}
@ApiOperation(value = "检查工单状态", tags = {"工单状态" }, notes = "检查工单状态")
@RequestMapping(method = RequestMethod.POST, value = "/eamwostates/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMWOStateDTO eamwostatedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamwostateService.checkKey(eamwostateMapping.toDomain(eamwostatedto)));
}
@PreAuthorize("hasPermission(this.eamwostateMapping.toDomain(#eamwostatedto),'iBizAssetManagement-EAMWOState-Save')")
@ApiOperation(value = "保存工单状态", tags = {"工单状态" }, notes = "保存工单状态")
@RequestMapping(method = RequestMethod.POST, value = "/eamwostates/save")
public ResponseEntity<Boolean> save(@RequestBody EAMWOStateDTO eamwostatedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamwostateService.save(eamwostateMapping.toDomain(eamwostatedto)));
}
@PreAuthorize("hasPermission(this.eamwostateMapping.toDomain(#eamwostatedtos),'iBizAssetManagement-EAMWOState-Save')")
@ApiOperation(value = "批量保存工单状态", tags = {"工单状态" }, notes = "批量保存工单状态")
@RequestMapping(method = RequestMethod.POST, value = "/eamwostates/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMWOStateDTO> eamwostatedtos) {
eamwostateService.saveBatch(eamwostateMapping.toDomain(eamwostatedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWOState-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWOState-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"工单状态" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamwostates/fetchdefault")
public ResponseEntity<List<EAMWOStateDTO>> fetchDefault(EAMWOStateSearchContext context) {
Page<EAMWOState> domains = eamwostateService.searchDefault(context) ;
List<EAMWOStateDTO> list = eamwostateMapping.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-EAMWOState-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWOState-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"工单状态" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamwostates/searchdefault")
public ResponseEntity<Page<EAMWOStateDTO>> searchDefault(@RequestBody EAMWOStateSearchContext context) {
Page<EAMWOState> domains = eamwostateService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamwostateMapping.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.workorder.domain.EAMWOType;
import cn.ibizlab.assetmanagement.core.workorder.service.IEAMWOTypeService;
import cn.ibizlab.assetmanagement.core.workorder.filter.EAMWOTypeSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"工单类型" })
@RestController("AssetApi-eamwotype")
@RequestMapping("")
public class EAMWOTypeResource {
@Autowired
public IEAMWOTypeService eamwotypeService;
@Autowired
@Lazy
public EAMWOTypeMapping eamwotypeMapping;
@PreAuthorize("hasPermission(this.eamwotypeMapping.toDomain(#eamwotypedto),'iBizAssetManagement-EAMWOType-Create')")
@ApiOperation(value = "新建工单类型", tags = {"工单类型" }, notes = "新建工单类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamwotypes")
@Transactional
public ResponseEntity<EAMWOTypeDTO> create(@RequestBody EAMWOTypeDTO eamwotypedto) {
EAMWOType domain = eamwotypeMapping.toDomain(eamwotypedto);
eamwotypeService.create(domain);
EAMWOTypeDTO dto = eamwotypeMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamwotypeMapping.toDomain(#eamwotypedtos),'iBizAssetManagement-EAMWOType-Create')")
@ApiOperation(value = "批量新建工单类型", tags = {"工单类型" }, notes = "批量新建工单类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamwotypes/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMWOTypeDTO> eamwotypedtos) {
eamwotypeService.createBatch(eamwotypeMapping.toDomain(eamwotypedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamwotype" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamwotypeService.get(#eamwotype_id),'iBizAssetManagement-EAMWOType-Update')")
@ApiOperation(value = "更新工单类型", tags = {"工单类型" }, notes = "更新工单类型")
@RequestMapping(method = RequestMethod.PUT, value = "/eamwotypes/{eamwotype_id}")
@Transactional
public ResponseEntity<EAMWOTypeDTO> update(@PathVariable("eamwotype_id") String eamwotype_id, @RequestBody EAMWOTypeDTO eamwotypedto) {
EAMWOType domain = eamwotypeMapping.toDomain(eamwotypedto);
domain .setEamwotypeid(eamwotype_id);
eamwotypeService.update(domain );
EAMWOTypeDTO dto = eamwotypeMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamwotypeService.getEamwotypeByEntities(this.eamwotypeMapping.toDomain(#eamwotypedtos)),'iBizAssetManagement-EAMWOType-Update')")
@ApiOperation(value = "批量更新工单类型", tags = {"工单类型" }, notes = "批量更新工单类型")
@RequestMapping(method = RequestMethod.PUT, value = "/eamwotypes/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMWOTypeDTO> eamwotypedtos) {
eamwotypeService.updateBatch(eamwotypeMapping.toDomain(eamwotypedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamwotypeService.get(#eamwotype_id),'iBizAssetManagement-EAMWOType-Remove')")
@ApiOperation(value = "删除工单类型", tags = {"工单类型" }, notes = "删除工单类型")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamwotypes/{eamwotype_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamwotype_id") String eamwotype_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamwotypeService.remove(eamwotype_id));
}
@PreAuthorize("hasPermission(this.eamwotypeService.getEamwotypeByIds(#ids),'iBizAssetManagement-EAMWOType-Remove')")
@ApiOperation(value = "批量删除工单类型", tags = {"工单类型" }, notes = "批量删除工单类型")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamwotypes/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamwotypeService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamwotypeMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMWOType-Get')")
@ApiOperation(value = "获取工单类型", tags = {"工单类型" }, notes = "获取工单类型")
@RequestMapping(method = RequestMethod.GET, value = "/eamwotypes/{eamwotype_id}")
public ResponseEntity<EAMWOTypeDTO> get(@PathVariable("eamwotype_id") String eamwotype_id) {
EAMWOType domain = eamwotypeService.get(eamwotype_id);
EAMWOTypeDTO dto = eamwotypeMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取工单类型草稿", tags = {"工单类型" }, notes = "获取工单类型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamwotypes/getdraft")
public ResponseEntity<EAMWOTypeDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamwotypeMapping.toDto(eamwotypeService.getDraft(new EAMWOType())));
}
@ApiOperation(value = "检查工单类型", tags = {"工单类型" }, notes = "检查工单类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamwotypes/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMWOTypeDTO eamwotypedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamwotypeService.checkKey(eamwotypeMapping.toDomain(eamwotypedto)));
}
@PreAuthorize("hasPermission(this.eamwotypeMapping.toDomain(#eamwotypedto),'iBizAssetManagement-EAMWOType-Save')")
@ApiOperation(value = "保存工单类型", tags = {"工单类型" }, notes = "保存工单类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamwotypes/save")
public ResponseEntity<Boolean> save(@RequestBody EAMWOTypeDTO eamwotypedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamwotypeService.save(eamwotypeMapping.toDomain(eamwotypedto)));
}
@PreAuthorize("hasPermission(this.eamwotypeMapping.toDomain(#eamwotypedtos),'iBizAssetManagement-EAMWOType-Save')")
@ApiOperation(value = "批量保存工单类型", tags = {"工单类型" }, notes = "批量保存工单类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamwotypes/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMWOTypeDTO> eamwotypedtos) {
eamwotypeService.saveBatch(eamwotypeMapping.toDomain(eamwotypedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWOType-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWOType-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"工单类型" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamwotypes/fetchdefault")
public ResponseEntity<List<EAMWOTypeDTO>> fetchDefault(EAMWOTypeSearchContext context) {
Page<EAMWOType> domains = eamwotypeService.searchDefault(context) ;
List<EAMWOTypeDTO> list = eamwotypeMapping.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-EAMWOType-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWOType-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"工单类型" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamwotypes/searchdefault")
public ResponseEntity<Page<EAMWOTypeDTO>> searchDefault(@RequestBody EAMWOTypeSearchContext context) {
Page<EAMWOType> domains = eamwotypeService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamwotypeMapping.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.workorder.domain.WOOrigin;
import cn.ibizlab.assetmanagement.core.workorder.service.IWOOriginService;
import cn.ibizlab.assetmanagement.core.workorder.filter.WOOriginSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"工单来源" })
@RestController("AssetApi-woorigin")
@RequestMapping("")
public class WOOriginResource {
@Autowired
public IWOOriginService wooriginService;
@Autowired
@Lazy
public WOOriginMapping wooriginMapping;
@PreAuthorize("hasPermission(this.wooriginMapping.toDomain(#woorigindto),'iBizAssetManagement-WOOrigin-Create')")
@ApiOperation(value = "新建工单来源", tags = {"工单来源" }, notes = "新建工单来源")
@RequestMapping(method = RequestMethod.POST, value = "/woorigins")
@Transactional
public ResponseEntity<WOOriginDTO> create(@RequestBody WOOriginDTO woorigindto) {
WOOrigin domain = wooriginMapping.toDomain(woorigindto);
wooriginService.create(domain);
WOOriginDTO dto = wooriginMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.wooriginMapping.toDomain(#woorigindtos),'iBizAssetManagement-WOOrigin-Create')")
@ApiOperation(value = "批量新建工单来源", tags = {"工单来源" }, notes = "批量新建工单来源")
@RequestMapping(method = RequestMethod.POST, value = "/woorigins/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WOOriginDTO> woorigindtos) {
wooriginService.createBatch(wooriginMapping.toDomain(woorigindtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "woorigin" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.wooriginService.get(#woorigin_id),'iBizAssetManagement-WOOrigin-Update')")
@ApiOperation(value = "更新工单来源", tags = {"工单来源" }, notes = "更新工单来源")
@RequestMapping(method = RequestMethod.PUT, value = "/woorigins/{woorigin_id}")
@Transactional
public ResponseEntity<WOOriginDTO> update(@PathVariable("woorigin_id") String woorigin_id, @RequestBody WOOriginDTO woorigindto) {
WOOrigin domain = wooriginMapping.toDomain(woorigindto);
domain .setWooriginid(woorigin_id);
wooriginService.update(domain );
WOOriginDTO dto = wooriginMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.wooriginService.getWooriginByEntities(this.wooriginMapping.toDomain(#woorigindtos)),'iBizAssetManagement-WOOrigin-Update')")
@ApiOperation(value = "批量更新工单来源", tags = {"工单来源" }, notes = "批量更新工单来源")
@RequestMapping(method = RequestMethod.PUT, value = "/woorigins/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WOOriginDTO> woorigindtos) {
wooriginService.updateBatch(wooriginMapping.toDomain(woorigindtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.wooriginService.get(#woorigin_id),'iBizAssetManagement-WOOrigin-Remove')")
@ApiOperation(value = "删除工单来源", tags = {"工单来源" }, notes = "删除工单来源")
@RequestMapping(method = RequestMethod.DELETE, value = "/woorigins/{woorigin_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("woorigin_id") String woorigin_id) {
return ResponseEntity.status(HttpStatus.OK).body(wooriginService.remove(woorigin_id));
}
@PreAuthorize("hasPermission(this.wooriginService.getWooriginByIds(#ids),'iBizAssetManagement-WOOrigin-Remove')")
@ApiOperation(value = "批量删除工单来源", tags = {"工单来源" }, notes = "批量删除工单来源")
@RequestMapping(method = RequestMethod.DELETE, value = "/woorigins/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wooriginService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.wooriginMapping.toDomain(returnObject.body),'iBizAssetManagement-WOOrigin-Get')")
@ApiOperation(value = "获取工单来源", tags = {"工单来源" }, notes = "获取工单来源")
@RequestMapping(method = RequestMethod.GET, value = "/woorigins/{woorigin_id}")
public ResponseEntity<WOOriginDTO> get(@PathVariable("woorigin_id") String woorigin_id) {
WOOrigin domain = wooriginService.get(woorigin_id);
WOOriginDTO dto = wooriginMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取工单来源草稿", tags = {"工单来源" }, notes = "获取工单来源草稿")
@RequestMapping(method = RequestMethod.GET, value = "/woorigins/getdraft")
public ResponseEntity<WOOriginDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wooriginMapping.toDto(wooriginService.getDraft(new WOOrigin())));
}
@ApiOperation(value = "检查工单来源", tags = {"工单来源" }, notes = "检查工单来源")
@RequestMapping(method = RequestMethod.POST, value = "/woorigins/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WOOriginDTO woorigindto) {
return ResponseEntity.status(HttpStatus.OK).body(wooriginService.checkKey(wooriginMapping.toDomain(woorigindto)));
}
@PreAuthorize("hasPermission(this.wooriginMapping.toDomain(#woorigindto),'iBizAssetManagement-WOOrigin-Save')")
@ApiOperation(value = "保存工单来源", tags = {"工单来源" }, notes = "保存工单来源")
@RequestMapping(method = RequestMethod.POST, value = "/woorigins/save")
public ResponseEntity<Boolean> save(@RequestBody WOOriginDTO woorigindto) {
return ResponseEntity.status(HttpStatus.OK).body(wooriginService.save(wooriginMapping.toDomain(woorigindto)));
}
@PreAuthorize("hasPermission(this.wooriginMapping.toDomain(#woorigindtos),'iBizAssetManagement-WOOrigin-Save')")
@ApiOperation(value = "批量保存工单来源", tags = {"工单来源" }, notes = "批量保存工单来源")
@RequestMapping(method = RequestMethod.POST, value = "/woorigins/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WOOriginDTO> woorigindtos) {
wooriginService.saveBatch(wooriginMapping.toDomain(woorigindtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-WOOrigin-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-WOOrigin-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"工单来源" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/woorigins/fetchdefault")
public ResponseEntity<List<WOOriginDTO>> fetchDefault(WOOriginSearchContext context) {
Page<WOOrigin> domains = wooriginService.searchDefault(context) ;
List<WOOriginDTO> list = wooriginMapping.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-WOOrigin-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-WOOrigin-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"工单来源" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/woorigins/searchdefault")
public ResponseEntity<Page<WOOriginDTO>> searchDefault(@RequestBody WOOriginSearchContext context) {
Page<WOOrigin> domains = wooriginService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wooriginMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
git clone -b master $para2 ibizassetmanagement/ git clone -b master $para2 ibizassetmanagement/
export NODE_OPTIONS=--max-old-space-size=4096 export NODE_OPTIONS=--max-old-space-size=4096
cd ibizassetmanagement/ cd ibizassetmanagement/
mvn clean package -Passetmanagement mvn clean package -Passetapi
cd assetmanagement-app/assetmanagement-app-assetmanagement cd assetmanagement-provider/assetmanagement-provider-assetapi
mvn -Passetmanagement docker:build mvn -Passetapi docker:build
mvn -Passetmanagement docker:push mvn -Passetapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/assetmanagement-app-assetmanagement.yaml iBizEE --with-registry-auth docker -H $para1 stack deploy --compose-file=src/main/docker/assetmanagement-provider-assetapi.yaml iBizEE --with-registry-auth
</command> </command>
</hudson.tasks.Shell> </hudson.tasks.Shell>
</builders> </builders>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册