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

lab_gzf 部署微服务接口

上级 13dead03
......@@ -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:
......
......@@ -128,7 +128,7 @@
<!--输出实体[EAMASSET]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamasset-90-6">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamasset-91-6">
<createTable tableName="ASSET">
<column name="ASSETID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMASSET_ASSETID"/>
......@@ -436,7 +436,7 @@
<!--输出实体[EAMPLAN]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplan-49-19">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplan-54-19">
<createTable tableName="EAMPLAN">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -790,16 +790,16 @@
<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-90-39">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-91-39">
<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-90-40">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-91-40">
<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-90-41">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-91-41">
<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-90-42">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-91-42">
<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]外键关系 -->
......@@ -842,13 +842,13 @@
<!--输出实体[EAMMONITORPOINT]外键关系 -->
<!--输出实体[EAMPRODUCT]外键关系 -->
<!--输出实体[EAMPLAN]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-49-54">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-54-54">
<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-49-55">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-54-55">
<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>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-49-56">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-54-56">
<addForeignKeyConstraint baseColumnNames="EAMMONITORPOINTID" baseTableName="EAMPLAN" constraintName="DER1N_EAMPLAN_EAMMONITORPOINT_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMMONITORPOINTID" referencedTableName="EAMMONITORPOINT" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANCDT]外键关系 -->
......
......@@ -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:
......
......@@ -160,5 +160,271 @@ public class EAMApplyResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamapplyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydto),'iBizAssetManagement-EAMApply-Create')")
@ApiOperation(value = "根据资产建立维护申请", tags = {"维护申请" }, notes = "根据资产建立维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies")
@Transactional
public ResponseEntity<EAMApplyDTO> createByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMApplyDTO eamapplydto) {
EAMApply domain = eamapplyMapping.toDomain(eamapplydto);
domain.setAssetid(eamasset_id);
eamapplyService.create(domain);
EAMApplyDTO dto = eamapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydtos),'iBizAssetManagement-EAMApply-Create')")
@ApiOperation(value = "根据资产批量建立维护申请", tags = {"维护申请" }, notes = "根据资产批量建立维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies/batch")
public ResponseEntity<Boolean> createBatchByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMApplyDTO> eamapplydtos) {
List<EAMApply> domainlist=eamapplyMapping.toDomain(eamapplydtos);
for(EAMApply domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamapplyService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamapply" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamapplyService.get(#eamapply_id),'iBizAssetManagement-EAMApply-Update')")
@ApiOperation(value = "根据资产更新维护申请", tags = {"维护申请" }, notes = "根据资产更新维护申请")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}")
@Transactional
public ResponseEntity<EAMApplyDTO> updateByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMApplyDTO eamapplydto) {
EAMApply domain = eamapplyMapping.toDomain(eamapplydto);
domain.setAssetid(eamasset_id);
domain.setEamapplyid(eamapply_id);
eamapplyService.update(domain);
EAMApplyDTO dto = eamapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplyService.getEamapplyByEntities(this.eamapplyMapping.toDomain(#eamapplydtos)),'iBizAssetManagement-EAMApply-Update')")
@ApiOperation(value = "根据资产批量更新维护申请", tags = {"维护申请" }, notes = "根据资产批量更新维护申请")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamapplies/batch")
public ResponseEntity<Boolean> updateBatchByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMApplyDTO> eamapplydtos) {
List<EAMApply> domainlist=eamapplyMapping.toDomain(eamapplydtos);
for(EAMApply domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamapplyService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamapplyService.get(#eamapply_id),'iBizAssetManagement-EAMApply-Remove')")
@ApiOperation(value = "根据资产删除维护申请", tags = {"维护申请" }, notes = "根据资产删除维护申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplyService.remove(eamapply_id));
}
@PreAuthorize("hasPermission(this.eamapplyService.getEamapplyByIds(#ids),'iBizAssetManagement-EAMApply-Remove')")
@ApiOperation(value = "根据资产批量删除维护申请", tags = {"维护申请" }, notes = "根据资产批量删除维护申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamapplies/batch")
public ResponseEntity<Boolean> removeBatchByEAMAsset(@RequestBody List<String> ids) {
eamapplyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamapplyMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMApply-Get')")
@ApiOperation(value = "根据资产获取维护申请", tags = {"维护申请" }, notes = "根据资产获取维护申请")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}")
public ResponseEntity<EAMApplyDTO> getByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id) {
EAMApply domain = eamapplyService.get(eamapply_id);
EAMApplyDTO dto = eamapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据资产获取维护申请草稿", tags = {"维护申请" }, notes = "根据资产获取维护申请草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamapplies/getdraft")
public ResponseEntity<EAMApplyDTO> getDraftByEAMAsset(@PathVariable("eamasset_id") String eamasset_id) {
EAMApply domain = new EAMApply();
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamapplyMapping.toDto(eamapplyService.getDraft(domain)));
}
@ApiOperation(value = "根据资产检查维护申请", tags = {"维护申请" }, notes = "根据资产检查维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMApplyDTO eamapplydto) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplyService.checkKey(eamapplyMapping.toDomain(eamapplydto)));
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydto),'iBizAssetManagement-EAMApply-Save')")
@ApiOperation(value = "根据资产保存维护申请", tags = {"维护申请" }, notes = "根据资产保存维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies/save")
public ResponseEntity<Boolean> saveByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMApplyDTO eamapplydto) {
EAMApply domain = eamapplyMapping.toDomain(eamapplydto);
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamapplyService.save(domain));
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydtos),'iBizAssetManagement-EAMApply-Save')")
@ApiOperation(value = "根据资产批量保存维护申请", tags = {"维护申请" }, notes = "根据资产批量保存维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMApplyDTO> eamapplydtos) {
List<EAMApply> domainlist=eamapplyMapping.toDomain(eamapplydtos);
for(EAMApply domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamapplyService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMApply-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApply-Get')")
@ApiOperation(value = "根据资产获取DEFAULT", tags = {"维护申请" } ,notes = "根据资产获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamassets/{eamasset_id}/eamapplies/fetchdefault")
public ResponseEntity<List<EAMApplyDTO>> fetchEAMApplyDefaultByEAMAsset(@PathVariable("eamasset_id") String eamasset_id,EAMApplySearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMApply> domains = eamapplyService.searchDefault(context) ;
List<EAMApplyDTO> list = eamapplyMapping.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-EAMApply-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApply-Get')")
@ApiOperation(value = "根据资产查询DEFAULT", tags = {"维护申请" } ,notes = "根据资产查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamassets/{eamasset_id}/eamapplies/searchdefault")
public ResponseEntity<Page<EAMApplyDTO>> searchEAMApplyDefaultByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMApplySearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMApply> domains = eamapplyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamapplyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydto),'iBizAssetManagement-EAMApply-Create')")
@ApiOperation(value = "根据功能位置资产建立维护申请", tags = {"维护申请" }, notes = "根据功能位置资产建立维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies")
@Transactional
public ResponseEntity<EAMApplyDTO> createByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMApplyDTO eamapplydto) {
EAMApply domain = eamapplyMapping.toDomain(eamapplydto);
domain.setAssetid(eamasset_id);
eamapplyService.create(domain);
EAMApplyDTO dto = eamapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydtos),'iBizAssetManagement-EAMApply-Create')")
@ApiOperation(value = "根据功能位置资产批量建立维护申请", tags = {"维护申请" }, notes = "根据功能位置资产批量建立维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/batch")
public ResponseEntity<Boolean> createBatchByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMApplyDTO> eamapplydtos) {
List<EAMApply> domainlist=eamapplyMapping.toDomain(eamapplydtos);
for(EAMApply domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamapplyService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamapply" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamapplyService.get(#eamapply_id),'iBizAssetManagement-EAMApply-Update')")
@ApiOperation(value = "根据功能位置资产更新维护申请", tags = {"维护申请" }, notes = "根据功能位置资产更新维护申请")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}")
@Transactional
public ResponseEntity<EAMApplyDTO> updateByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMApplyDTO eamapplydto) {
EAMApply domain = eamapplyMapping.toDomain(eamapplydto);
domain.setAssetid(eamasset_id);
domain.setEamapplyid(eamapply_id);
eamapplyService.update(domain);
EAMApplyDTO dto = eamapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamapplyService.getEamapplyByEntities(this.eamapplyMapping.toDomain(#eamapplydtos)),'iBizAssetManagement-EAMApply-Update')")
@ApiOperation(value = "根据功能位置资产批量更新维护申请", tags = {"维护申请" }, notes = "根据功能位置资产批量更新维护申请")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/batch")
public ResponseEntity<Boolean> updateBatchByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMApplyDTO> eamapplydtos) {
List<EAMApply> domainlist=eamapplyMapping.toDomain(eamapplydtos);
for(EAMApply domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamapplyService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamapplyService.get(#eamapply_id),'iBizAssetManagement-EAMApply-Remove')")
@ApiOperation(value = "根据功能位置资产删除维护申请", tags = {"维护申请" }, notes = "根据功能位置资产删除维护申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplyService.remove(eamapply_id));
}
@PreAuthorize("hasPermission(this.eamapplyService.getEamapplyByIds(#ids),'iBizAssetManagement-EAMApply-Remove')")
@ApiOperation(value = "根据功能位置资产批量删除维护申请", tags = {"维护申请" }, notes = "根据功能位置资产批量删除维护申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/batch")
public ResponseEntity<Boolean> removeBatchByEAMLocationEAMAsset(@RequestBody List<String> ids) {
eamapplyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamapplyMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMApply-Get')")
@ApiOperation(value = "根据功能位置资产获取维护申请", tags = {"维护申请" }, notes = "根据功能位置资产获取维护申请")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}")
public ResponseEntity<EAMApplyDTO> getByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id) {
EAMApply domain = eamapplyService.get(eamapply_id);
EAMApplyDTO dto = eamapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据功能位置资产获取维护申请草稿", tags = {"维护申请" }, notes = "根据功能位置资产获取维护申请草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/getdraft")
public ResponseEntity<EAMApplyDTO> getDraftByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id) {
EAMApply domain = new EAMApply();
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamapplyMapping.toDto(eamapplyService.getDraft(domain)));
}
@ApiOperation(value = "根据功能位置资产检查维护申请", tags = {"维护申请" }, notes = "根据功能位置资产检查维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMApplyDTO eamapplydto) {
return ResponseEntity.status(HttpStatus.OK).body(eamapplyService.checkKey(eamapplyMapping.toDomain(eamapplydto)));
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydto),'iBizAssetManagement-EAMApply-Save')")
@ApiOperation(value = "根据功能位置资产保存维护申请", tags = {"维护申请" }, notes = "根据功能位置资产保存维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/save")
public ResponseEntity<Boolean> saveByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMApplyDTO eamapplydto) {
EAMApply domain = eamapplyMapping.toDomain(eamapplydto);
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamapplyService.save(domain));
}
@PreAuthorize("hasPermission(this.eamapplyMapping.toDomain(#eamapplydtos),'iBizAssetManagement-EAMApply-Save')")
@ApiOperation(value = "根据功能位置资产批量保存维护申请", tags = {"维护申请" }, notes = "根据功能位置资产批量保存维护申请")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMApplyDTO> eamapplydtos) {
List<EAMApply> domainlist=eamapplyMapping.toDomain(eamapplydtos);
for(EAMApply domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamapplyService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMApply-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApply-Get')")
@ApiOperation(value = "根据功能位置资产获取DEFAULT", tags = {"维护申请" } ,notes = "根据功能位置资产获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/fetchdefault")
public ResponseEntity<List<EAMApplyDTO>> fetchEAMApplyDefaultByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id,EAMApplySearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMApply> domains = eamapplyService.searchDefault(context) ;
List<EAMApplyDTO> list = eamapplyMapping.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-EAMApply-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMApply-Get')")
@ApiOperation(value = "根据功能位置资产查询DEFAULT", tags = {"维护申请" } ,notes = "根据功能位置资产查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/searchdefault")
public ResponseEntity<Page<EAMApplyDTO>> searchEAMApplyDefaultByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMApplySearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMApply> domains = eamapplyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamapplyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -293,5 +293,271 @@ public class EAMPlanLineResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamplanlineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedto),'iBizAssetManagement-EAMPlanLine-Create')")
@ApiOperation(value = "根据资产维护计划建立计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划建立计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines")
@Transactional
public ResponseEntity<EAMPlanLineDTO> createByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanLineDTO eamplanlinedto) {
EAMPlanLine domain = eamplanlineMapping.toDomain(eamplanlinedto);
domain.setEamplanid(eamplan_id);
eamplanlineService.create(domain);
EAMPlanLineDTO dto = eamplanlineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedtos),'iBizAssetManagement-EAMPlanLine-Create')")
@ApiOperation(value = "根据资产维护计划批量建立计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划批量建立计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/batch")
public ResponseEntity<Boolean> createBatchByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMPlanLineDTO> eamplanlinedtos) {
List<EAMPlanLine> domainlist=eamplanlineMapping.toDomain(eamplanlinedtos);
for(EAMPlanLine domain:domainlist){
domain.setEamplanid(eamplan_id);
}
eamplanlineService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamplanline" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamplanlineService.get(#eamplanline_id),'iBizAssetManagement-EAMPlanLine-Update')")
@ApiOperation(value = "根据资产维护计划更新计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划更新计划步骤")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/{eamplanline_id}")
@Transactional
public ResponseEntity<EAMPlanLineDTO> updateByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamplanline_id") String eamplanline_id, @RequestBody EAMPlanLineDTO eamplanlinedto) {
EAMPlanLine domain = eamplanlineMapping.toDomain(eamplanlinedto);
domain.setEamplanid(eamplan_id);
domain.setEamplanlineid(eamplanline_id);
eamplanlineService.update(domain);
EAMPlanLineDTO dto = eamplanlineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanlineService.getEamplanlineByEntities(this.eamplanlineMapping.toDomain(#eamplanlinedtos)),'iBizAssetManagement-EAMPlanLine-Update')")
@ApiOperation(value = "根据资产维护计划批量更新计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划批量更新计划步骤")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/batch")
public ResponseEntity<Boolean> updateBatchByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMPlanLineDTO> eamplanlinedtos) {
List<EAMPlanLine> domainlist=eamplanlineMapping.toDomain(eamplanlinedtos);
for(EAMPlanLine domain:domainlist){
domain.setEamplanid(eamplan_id);
}
eamplanlineService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamplanlineService.get(#eamplanline_id),'iBizAssetManagement-EAMPlanLine-Remove')")
@ApiOperation(value = "根据资产维护计划删除计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划删除计划步骤")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/{eamplanline_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamplanline_id") String eamplanline_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineService.remove(eamplanline_id));
}
@PreAuthorize("hasPermission(this.eamplanlineService.getEamplanlineByIds(#ids),'iBizAssetManagement-EAMPlanLine-Remove')")
@ApiOperation(value = "根据资产维护计划批量删除计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划批量删除计划步骤")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/batch")
public ResponseEntity<Boolean> removeBatchByEAMAssetEAMPlan(@RequestBody List<String> ids) {
eamplanlineService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamplanlineMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMPlanLine-Get')")
@ApiOperation(value = "根据资产维护计划获取计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划获取计划步骤")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/{eamplanline_id}")
public ResponseEntity<EAMPlanLineDTO> getByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamplanline_id") String eamplanline_id) {
EAMPlanLine domain = eamplanlineService.get(eamplanline_id);
EAMPlanLineDTO dto = eamplanlineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据资产维护计划获取计划步骤草稿", tags = {"计划步骤" }, notes = "根据资产维护计划获取计划步骤草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/getdraft")
public ResponseEntity<EAMPlanLineDTO> getDraftByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id) {
EAMPlanLine domain = new EAMPlanLine();
domain.setEamplanid(eamplan_id);
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineMapping.toDto(eamplanlineService.getDraft(domain)));
}
@ApiOperation(value = "根据资产维护计划检查计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划检查计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanLineDTO eamplanlinedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineService.checkKey(eamplanlineMapping.toDomain(eamplanlinedto)));
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedto),'iBizAssetManagement-EAMPlanLine-Save')")
@ApiOperation(value = "根据资产维护计划保存计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划保存计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/save")
public ResponseEntity<Boolean> saveByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanLineDTO eamplanlinedto) {
EAMPlanLine domain = eamplanlineMapping.toDomain(eamplanlinedto);
domain.setEamplanid(eamplan_id);
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineService.save(domain));
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedtos),'iBizAssetManagement-EAMPlanLine-Save')")
@ApiOperation(value = "根据资产维护计划批量保存计划步骤", tags = {"计划步骤" }, notes = "根据资产维护计划批量保存计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMPlanLineDTO> eamplanlinedtos) {
List<EAMPlanLine> domainlist=eamplanlineMapping.toDomain(eamplanlinedtos);
for(EAMPlanLine domain:domainlist){
domain.setEamplanid(eamplan_id);
}
eamplanlineService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlanLine-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlanLine-Get')")
@ApiOperation(value = "根据资产维护计划获取DEFAULT", tags = {"计划步骤" } ,notes = "根据资产维护计划获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/fetchdefault")
public ResponseEntity<List<EAMPlanLineDTO>> fetchEAMPlanLineDefaultByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id,EAMPlanLineSearchContext context) {
context.setN_eamplanid_eq(eamplan_id);
Page<EAMPlanLine> domains = eamplanlineService.searchDefault(context) ;
List<EAMPlanLineDTO> list = eamplanlineMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlanLine-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlanLine-Get')")
@ApiOperation(value = "根据资产维护计划查询DEFAULT", tags = {"计划步骤" } ,notes = "根据资产维护计划查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/searchdefault")
public ResponseEntity<Page<EAMPlanLineDTO>> searchEAMPlanLineDefaultByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanLineSearchContext context) {
context.setN_eamplanid_eq(eamplan_id);
Page<EAMPlanLine> domains = eamplanlineService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamplanlineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedto),'iBizAssetManagement-EAMPlanLine-Create')")
@ApiOperation(value = "根据功能位置资产维护计划建立计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划建立计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines")
@Transactional
public ResponseEntity<EAMPlanLineDTO> createByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanLineDTO eamplanlinedto) {
EAMPlanLine domain = eamplanlineMapping.toDomain(eamplanlinedto);
domain.setEamplanid(eamplan_id);
eamplanlineService.create(domain);
EAMPlanLineDTO dto = eamplanlineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedtos),'iBizAssetManagement-EAMPlanLine-Create')")
@ApiOperation(value = "根据功能位置资产维护计划批量建立计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划批量建立计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/batch")
public ResponseEntity<Boolean> createBatchByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMPlanLineDTO> eamplanlinedtos) {
List<EAMPlanLine> domainlist=eamplanlineMapping.toDomain(eamplanlinedtos);
for(EAMPlanLine domain:domainlist){
domain.setEamplanid(eamplan_id);
}
eamplanlineService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamplanline" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamplanlineService.get(#eamplanline_id),'iBizAssetManagement-EAMPlanLine-Update')")
@ApiOperation(value = "根据功能位置资产维护计划更新计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划更新计划步骤")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/{eamplanline_id}")
@Transactional
public ResponseEntity<EAMPlanLineDTO> updateByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamplanline_id") String eamplanline_id, @RequestBody EAMPlanLineDTO eamplanlinedto) {
EAMPlanLine domain = eamplanlineMapping.toDomain(eamplanlinedto);
domain.setEamplanid(eamplan_id);
domain.setEamplanlineid(eamplanline_id);
eamplanlineService.update(domain);
EAMPlanLineDTO dto = eamplanlineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanlineService.getEamplanlineByEntities(this.eamplanlineMapping.toDomain(#eamplanlinedtos)),'iBizAssetManagement-EAMPlanLine-Update')")
@ApiOperation(value = "根据功能位置资产维护计划批量更新计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划批量更新计划步骤")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/batch")
public ResponseEntity<Boolean> updateBatchByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMPlanLineDTO> eamplanlinedtos) {
List<EAMPlanLine> domainlist=eamplanlineMapping.toDomain(eamplanlinedtos);
for(EAMPlanLine domain:domainlist){
domain.setEamplanid(eamplan_id);
}
eamplanlineService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamplanlineService.get(#eamplanline_id),'iBizAssetManagement-EAMPlanLine-Remove')")
@ApiOperation(value = "根据功能位置资产维护计划删除计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划删除计划步骤")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/{eamplanline_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamplanline_id") String eamplanline_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineService.remove(eamplanline_id));
}
@PreAuthorize("hasPermission(this.eamplanlineService.getEamplanlineByIds(#ids),'iBizAssetManagement-EAMPlanLine-Remove')")
@ApiOperation(value = "根据功能位置资产维护计划批量删除计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划批量删除计划步骤")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/batch")
public ResponseEntity<Boolean> removeBatchByEAMLocationEAMAssetEAMPlan(@RequestBody List<String> ids) {
eamplanlineService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamplanlineMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMPlanLine-Get')")
@ApiOperation(value = "根据功能位置资产维护计划获取计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划获取计划步骤")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/{eamplanline_id}")
public ResponseEntity<EAMPlanLineDTO> getByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamplanline_id") String eamplanline_id) {
EAMPlanLine domain = eamplanlineService.get(eamplanline_id);
EAMPlanLineDTO dto = eamplanlineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据功能位置资产维护计划获取计划步骤草稿", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划获取计划步骤草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/getdraft")
public ResponseEntity<EAMPlanLineDTO> getDraftByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id) {
EAMPlanLine domain = new EAMPlanLine();
domain.setEamplanid(eamplan_id);
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineMapping.toDto(eamplanlineService.getDraft(domain)));
}
@ApiOperation(value = "根据功能位置资产维护计划检查计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划检查计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanLineDTO eamplanlinedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineService.checkKey(eamplanlineMapping.toDomain(eamplanlinedto)));
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedto),'iBizAssetManagement-EAMPlanLine-Save')")
@ApiOperation(value = "根据功能位置资产维护计划保存计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划保存计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/save")
public ResponseEntity<Boolean> saveByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanLineDTO eamplanlinedto) {
EAMPlanLine domain = eamplanlineMapping.toDomain(eamplanlinedto);
domain.setEamplanid(eamplan_id);
return ResponseEntity.status(HttpStatus.OK).body(eamplanlineService.save(domain));
}
@PreAuthorize("hasPermission(this.eamplanlineMapping.toDomain(#eamplanlinedtos),'iBizAssetManagement-EAMPlanLine-Save')")
@ApiOperation(value = "根据功能位置资产维护计划批量保存计划步骤", tags = {"计划步骤" }, notes = "根据功能位置资产维护计划批量保存计划步骤")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMPlanLineDTO> eamplanlinedtos) {
List<EAMPlanLine> domainlist=eamplanlineMapping.toDomain(eamplanlinedtos);
for(EAMPlanLine domain:domainlist){
domain.setEamplanid(eamplan_id);
}
eamplanlineService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlanLine-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlanLine-Get')")
@ApiOperation(value = "根据功能位置资产维护计划获取DEFAULT", tags = {"计划步骤" } ,notes = "根据功能位置资产维护计划获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/fetchdefault")
public ResponseEntity<List<EAMPlanLineDTO>> fetchEAMPlanLineDefaultByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id,EAMPlanLineSearchContext context) {
context.setN_eamplanid_eq(eamplan_id);
Page<EAMPlanLine> domains = eamplanlineService.searchDefault(context) ;
List<EAMPlanLineDTO> list = eamplanlineMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlanLine-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlanLine-Get')")
@ApiOperation(value = "根据功能位置资产维护计划查询DEFAULT", tags = {"计划步骤" } ,notes = "根据功能位置资产维护计划查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamplanlines/searchdefault")
public ResponseEntity<Page<EAMPlanLineDTO>> searchEAMPlanLineDefaultByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanLineSearchContext context) {
context.setN_eamplanid_eq(eamplan_id);
Page<EAMPlanLine> domains = eamplanlineService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamplanlineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -160,5 +160,271 @@ public class EAMPlanResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamplanMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandto),'iBizAssetManagement-EAMPlan-Create')")
@ApiOperation(value = "根据资产建立维护计划", tags = {"维护计划" }, notes = "根据资产建立维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans")
@Transactional
public ResponseEntity<EAMPlanDTO> createByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMPlanDTO eamplandto) {
EAMPlan domain = eamplanMapping.toDomain(eamplandto);
domain.setAssetid(eamasset_id);
eamplanService.create(domain);
EAMPlanDTO dto = eamplanMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandtos),'iBizAssetManagement-EAMPlan-Create')")
@ApiOperation(value = "根据资产批量建立维护计划", tags = {"维护计划" }, notes = "根据资产批量建立维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/batch")
public ResponseEntity<Boolean> createBatchByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMPlanDTO> eamplandtos) {
List<EAMPlan> domainlist=eamplanMapping.toDomain(eamplandtos);
for(EAMPlan domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamplanService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamplan" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamplanService.get(#eamplan_id),'iBizAssetManagement-EAMPlan-Update')")
@ApiOperation(value = "根据资产更新维护计划", tags = {"维护计划" }, notes = "根据资产更新维护计划")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}")
@Transactional
public ResponseEntity<EAMPlanDTO> updateByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanDTO eamplandto) {
EAMPlan domain = eamplanMapping.toDomain(eamplandto);
domain.setAssetid(eamasset_id);
domain.setEamplanid(eamplan_id);
eamplanService.update(domain);
EAMPlanDTO dto = eamplanMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanService.getEamplanByEntities(this.eamplanMapping.toDomain(#eamplandtos)),'iBizAssetManagement-EAMPlan-Update')")
@ApiOperation(value = "根据资产批量更新维护计划", tags = {"维护计划" }, notes = "根据资产批量更新维护计划")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamplans/batch")
public ResponseEntity<Boolean> updateBatchByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMPlanDTO> eamplandtos) {
List<EAMPlan> domainlist=eamplanMapping.toDomain(eamplandtos);
for(EAMPlan domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamplanService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamplanService.get(#eamplan_id),'iBizAssetManagement-EAMPlan-Remove')")
@ApiOperation(value = "根据资产删除维护计划", tags = {"维护计划" }, notes = "根据资产删除维护计划")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanService.remove(eamplan_id));
}
@PreAuthorize("hasPermission(this.eamplanService.getEamplanByIds(#ids),'iBizAssetManagement-EAMPlan-Remove')")
@ApiOperation(value = "根据资产批量删除维护计划", tags = {"维护计划" }, notes = "根据资产批量删除维护计划")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamplans/batch")
public ResponseEntity<Boolean> removeBatchByEAMAsset(@RequestBody List<String> ids) {
eamplanService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamplanMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMPlan-Get')")
@ApiOperation(value = "根据资产获取维护计划", tags = {"维护计划" }, notes = "根据资产获取维护计划")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}")
public ResponseEntity<EAMPlanDTO> getByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id) {
EAMPlan domain = eamplanService.get(eamplan_id);
EAMPlanDTO dto = eamplanMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据资产获取维护计划草稿", tags = {"维护计划" }, notes = "根据资产获取维护计划草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamplans/getdraft")
public ResponseEntity<EAMPlanDTO> getDraftByEAMAsset(@PathVariable("eamasset_id") String eamasset_id) {
EAMPlan domain = new EAMPlan();
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamplanMapping.toDto(eamplanService.getDraft(domain)));
}
@ApiOperation(value = "根据资产检查维护计划", tags = {"维护计划" }, notes = "根据资产检查维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMPlanDTO eamplandto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanService.checkKey(eamplanMapping.toDomain(eamplandto)));
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandto),'iBizAssetManagement-EAMPlan-Save')")
@ApiOperation(value = "根据资产保存维护计划", tags = {"维护计划" }, notes = "根据资产保存维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/save")
public ResponseEntity<Boolean> saveByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMPlanDTO eamplandto) {
EAMPlan domain = eamplanMapping.toDomain(eamplandto);
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamplanService.save(domain));
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandtos),'iBizAssetManagement-EAMPlan-Save')")
@ApiOperation(value = "根据资产批量保存维护计划", tags = {"维护计划" }, notes = "根据资产批量保存维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMPlanDTO> eamplandtos) {
List<EAMPlan> domainlist=eamplanMapping.toDomain(eamplandtos);
for(EAMPlan domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamplanService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlan-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlan-Get')")
@ApiOperation(value = "根据资产获取DEFAULT", tags = {"维护计划" } ,notes = "根据资产获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamassets/{eamasset_id}/eamplans/fetchdefault")
public ResponseEntity<List<EAMPlanDTO>> fetchEAMPlanDefaultByEAMAsset(@PathVariable("eamasset_id") String eamasset_id,EAMPlanSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMPlan> domains = eamplanService.searchDefault(context) ;
List<EAMPlanDTO> list = eamplanMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlan-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlan-Get')")
@ApiOperation(value = "根据资产查询DEFAULT", tags = {"维护计划" } ,notes = "根据资产查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamassets/{eamasset_id}/eamplans/searchdefault")
public ResponseEntity<Page<EAMPlanDTO>> searchEAMPlanDefaultByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMPlanSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMPlan> domains = eamplanService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamplanMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandto),'iBizAssetManagement-EAMPlan-Create')")
@ApiOperation(value = "根据功能位置资产建立维护计划", tags = {"维护计划" }, notes = "根据功能位置资产建立维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans")
@Transactional
public ResponseEntity<EAMPlanDTO> createByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMPlanDTO eamplandto) {
EAMPlan domain = eamplanMapping.toDomain(eamplandto);
domain.setAssetid(eamasset_id);
eamplanService.create(domain);
EAMPlanDTO dto = eamplanMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandtos),'iBizAssetManagement-EAMPlan-Create')")
@ApiOperation(value = "根据功能位置资产批量建立维护计划", tags = {"维护计划" }, notes = "根据功能位置资产批量建立维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/batch")
public ResponseEntity<Boolean> createBatchByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMPlanDTO> eamplandtos) {
List<EAMPlan> domainlist=eamplanMapping.toDomain(eamplandtos);
for(EAMPlan domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamplanService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamplan" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamplanService.get(#eamplan_id),'iBizAssetManagement-EAMPlan-Update')")
@ApiOperation(value = "根据功能位置资产更新维护计划", tags = {"维护计划" }, notes = "根据功能位置资产更新维护计划")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}")
@Transactional
public ResponseEntity<EAMPlanDTO> updateByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMPlanDTO eamplandto) {
EAMPlan domain = eamplanMapping.toDomain(eamplandto);
domain.setAssetid(eamasset_id);
domain.setEamplanid(eamplan_id);
eamplanService.update(domain);
EAMPlanDTO dto = eamplanMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamplanService.getEamplanByEntities(this.eamplanMapping.toDomain(#eamplandtos)),'iBizAssetManagement-EAMPlan-Update')")
@ApiOperation(value = "根据功能位置资产批量更新维护计划", tags = {"维护计划" }, notes = "根据功能位置资产批量更新维护计划")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/batch")
public ResponseEntity<Boolean> updateBatchByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMPlanDTO> eamplandtos) {
List<EAMPlan> domainlist=eamplanMapping.toDomain(eamplandtos);
for(EAMPlan domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamplanService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamplanService.get(#eamplan_id),'iBizAssetManagement-EAMPlan-Remove')")
@ApiOperation(value = "根据功能位置资产删除维护计划", tags = {"维护计划" }, notes = "根据功能位置资产删除维护计划")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanService.remove(eamplan_id));
}
@PreAuthorize("hasPermission(this.eamplanService.getEamplanByIds(#ids),'iBizAssetManagement-EAMPlan-Remove')")
@ApiOperation(value = "根据功能位置资产批量删除维护计划", tags = {"维护计划" }, notes = "根据功能位置资产批量删除维护计划")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/batch")
public ResponseEntity<Boolean> removeBatchByEAMLocationEAMAsset(@RequestBody List<String> ids) {
eamplanService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamplanMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMPlan-Get')")
@ApiOperation(value = "根据功能位置资产获取维护计划", tags = {"维护计划" }, notes = "根据功能位置资产获取维护计划")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}")
public ResponseEntity<EAMPlanDTO> getByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id) {
EAMPlan domain = eamplanService.get(eamplan_id);
EAMPlanDTO dto = eamplanMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据功能位置资产获取维护计划草稿", tags = {"维护计划" }, notes = "根据功能位置资产获取维护计划草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/getdraft")
public ResponseEntity<EAMPlanDTO> getDraftByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id) {
EAMPlan domain = new EAMPlan();
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamplanMapping.toDto(eamplanService.getDraft(domain)));
}
@ApiOperation(value = "根据功能位置资产检查维护计划", tags = {"维护计划" }, notes = "根据功能位置资产检查维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMPlanDTO eamplandto) {
return ResponseEntity.status(HttpStatus.OK).body(eamplanService.checkKey(eamplanMapping.toDomain(eamplandto)));
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandto),'iBizAssetManagement-EAMPlan-Save')")
@ApiOperation(value = "根据功能位置资产保存维护计划", tags = {"维护计划" }, notes = "根据功能位置资产保存维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/save")
public ResponseEntity<Boolean> saveByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMPlanDTO eamplandto) {
EAMPlan domain = eamplanMapping.toDomain(eamplandto);
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamplanService.save(domain));
}
@PreAuthorize("hasPermission(this.eamplanMapping.toDomain(#eamplandtos),'iBizAssetManagement-EAMPlan-Save')")
@ApiOperation(value = "根据功能位置资产批量保存维护计划", tags = {"维护计划" }, notes = "根据功能位置资产批量保存维护计划")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMPlanDTO> eamplandtos) {
List<EAMPlan> domainlist=eamplanMapping.toDomain(eamplandtos);
for(EAMPlan domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamplanService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlan-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlan-Get')")
@ApiOperation(value = "根据功能位置资产获取DEFAULT", tags = {"维护计划" } ,notes = "根据功能位置资产获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/fetchdefault")
public ResponseEntity<List<EAMPlanDTO>> fetchEAMPlanDefaultByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id,EAMPlanSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMPlan> domains = eamplanService.searchDefault(context) ;
List<EAMPlanDTO> list = eamplanMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMPlan-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMPlan-Get')")
@ApiOperation(value = "根据功能位置资产查询DEFAULT", tags = {"维护计划" } ,notes = "根据功能位置资产查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/searchdefault")
public ResponseEntity<Page<EAMPlanDTO>> searchEAMPlanDefaultByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMPlanSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMPlan> domains = eamplanService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamplanMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -338,6 +338,162 @@ public class EAMWorkOrderResource {
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据资产建立工单", tags = {"工单" }, notes = "根据资产建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamworkorders")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> createByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setAssetid(eamasset_id);
eamworkorderService.create(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据资产批量建立工单", tags = {"工单" }, notes = "根据资产批量建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamworkorders/batch")
public ResponseEntity<Boolean> createBatchByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamworkorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamworkorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据资产更新工单", tags = {"工单" }, notes = "根据资产更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> updateByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamworkorder_id") String eamworkorder_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setAssetid(eamasset_id);
domain.setWorkorderid(eamworkorder_id);
eamworkorderService.update(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByEntities(this.eamworkorderMapping.toDomain(#eamworkorderdtos)),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据资产批量更新工单", tags = {"工单" }, notes = "根据资产批量更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamworkorders/batch")
public ResponseEntity<Boolean> updateBatchByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamworkorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据资产删除工单", tags = {"工单" }, notes = "根据资产删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.remove(eamworkorder_id));
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByIds(#ids),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据资产批量删除工单", tags = {"工单" }, notes = "根据资产批量删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamworkorders/batch")
public ResponseEntity<Boolean> removeBatchByEAMAsset(@RequestBody List<String> ids) {
eamworkorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamworkorderMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产获取工单", tags = {"工单" }, notes = "根据资产获取工单")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamworkorders/{eamworkorder_id}")
public ResponseEntity<EAMWorkOrderDTO> getByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
EAMWorkOrder domain = eamworkorderService.get(eamworkorder_id);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据资产获取工单草稿", tags = {"工单" }, notes = "根据资产获取工单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamworkorders/getdraft")
public ResponseEntity<EAMWorkOrderDTO> getDraftByEAMAsset(@PathVariable("eamasset_id") String eamasset_id) {
EAMWorkOrder domain = new EAMWorkOrder();
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderMapping.toDto(eamworkorderService.getDraft(domain)));
}
@ApiOperation(value = "根据资产检查工单", tags = {"工单" }, notes = "根据资产检查工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamworkorders/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.checkKey(eamworkorderMapping.toDomain(eamworkorderdto)));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据资产保存工单", tags = {"工单" }, notes = "根据资产保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamworkorders/save")
public ResponseEntity<Boolean> saveByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.save(domain));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据资产批量保存工单", tags = {"工单" }, notes = "根据资产批量保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamworkorders/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamworkorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产获取下级工单", tags = {"工单" } ,notes = "根据资产获取下级工单")
@RequestMapping(method= RequestMethod.GET , value="/eamassets/{eamasset_id}/eamworkorders/fetchchildwo")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderChildWOByEAMAsset(@PathVariable("eamasset_id") String eamasset_id,EAMWorkOrderSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产查询下级工单", tags = {"工单" } ,notes = "根据资产查询下级工单")
@RequestMapping(method= RequestMethod.POST , value="/eamassets/{eamasset_id}/eamworkorders/searchchildwo")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderChildWOByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产获取DEFAULT", tags = {"工单" } ,notes = "根据资产获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamassets/{eamasset_id}/eamworkorders/fetchdefault")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderDefaultByEAMAsset(@PathVariable("eamasset_id") String eamasset_id,EAMWorkOrderSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产查询DEFAULT", tags = {"工单" } ,notes = "根据资产查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamassets/{eamasset_id}/eamworkorders/searchdefault")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderDefaultByEAMAsset(@PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据维护计划建立工单", tags = {"工单" }, notes = "根据维护计划建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamplans/{eamplan_id}/eamworkorders")
@Transactional
......@@ -493,5 +649,785 @@ public class EAMWorkOrderResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据资产维护申请建立工单", tags = {"工单" }, notes = "根据资产维护申请建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> createByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamapply_id);
eamworkorderService.create(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据资产维护申请批量建立工单", tags = {"工单" }, notes = "根据资产维护申请批量建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/batch")
public ResponseEntity<Boolean> createBatchByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamapply_id);
}
eamworkorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamworkorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据资产维护申请更新工单", tags = {"工单" }, notes = "根据资产维护申请更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> updateByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @PathVariable("eamworkorder_id") String eamworkorder_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamapply_id);
domain.setWorkorderid(eamworkorder_id);
eamworkorderService.update(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByEntities(this.eamworkorderMapping.toDomain(#eamworkorderdtos)),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据资产维护申请批量更新工单", tags = {"工单" }, notes = "根据资产维护申请批量更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/batch")
public ResponseEntity<Boolean> updateBatchByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamapply_id);
}
eamworkorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据资产维护申请删除工单", tags = {"工单" }, notes = "根据资产维护申请删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.remove(eamworkorder_id));
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByIds(#ids),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据资产维护申请批量删除工单", tags = {"工单" }, notes = "根据资产维护申请批量删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/batch")
public ResponseEntity<Boolean> removeBatchByEAMAssetEAMApply(@RequestBody List<String> ids) {
eamworkorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamworkorderMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护申请获取工单", tags = {"工单" }, notes = "根据资产维护申请获取工单")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/{eamworkorder_id}")
public ResponseEntity<EAMWorkOrderDTO> getByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
EAMWorkOrder domain = eamworkorderService.get(eamworkorder_id);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据资产维护申请获取工单草稿", tags = {"工单" }, notes = "根据资产维护申请获取工单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/getdraft")
public ResponseEntity<EAMWorkOrderDTO> getDraftByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id) {
EAMWorkOrder domain = new EAMWorkOrder();
domain.setWooriginid(eamapply_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderMapping.toDto(eamworkorderService.getDraft(domain)));
}
@ApiOperation(value = "根据资产维护申请检查工单", tags = {"工单" }, notes = "根据资产维护申请检查工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.checkKey(eamworkorderMapping.toDomain(eamworkorderdto)));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据资产维护申请保存工单", tags = {"工单" }, notes = "根据资产维护申请保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/save")
public ResponseEntity<Boolean> saveByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamapply_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.save(domain));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据资产维护申请批量保存工单", tags = {"工单" }, notes = "根据资产维护申请批量保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamapply_id);
}
eamworkorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护申请获取下级工单", tags = {"工单" } ,notes = "根据资产维护申请获取下级工单")
@RequestMapping(method= RequestMethod.GET , value="/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/fetchchildwo")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderChildWOByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id,EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamapply_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护申请查询下级工单", tags = {"工单" } ,notes = "根据资产维护申请查询下级工单")
@RequestMapping(method= RequestMethod.POST , value="/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/searchchildwo")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderChildWOByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamapply_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护申请获取DEFAULT", tags = {"工单" } ,notes = "根据资产维护申请获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/fetchdefault")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderDefaultByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id,EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamapply_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护申请查询DEFAULT", tags = {"工单" } ,notes = "根据资产维护申请查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/searchdefault")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderDefaultByEAMAssetEAMApply(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamapply_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据功能位置资产建立工单", tags = {"工单" }, notes = "根据功能位置资产建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> createByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setAssetid(eamasset_id);
eamworkorderService.create(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据功能位置资产批量建立工单", tags = {"工单" }, notes = "根据功能位置资产批量建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/batch")
public ResponseEntity<Boolean> createBatchByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamworkorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamworkorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据功能位置资产更新工单", tags = {"工单" }, notes = "根据功能位置资产更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> updateByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamworkorder_id") String eamworkorder_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setAssetid(eamasset_id);
domain.setWorkorderid(eamworkorder_id);
eamworkorderService.update(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByEntities(this.eamworkorderMapping.toDomain(#eamworkorderdtos)),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据功能位置资产批量更新工单", tags = {"工单" }, notes = "根据功能位置资产批量更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/batch")
public ResponseEntity<Boolean> updateBatchByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamworkorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据功能位置资产删除工单", tags = {"工单" }, notes = "根据功能位置资产删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.remove(eamworkorder_id));
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByIds(#ids),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据功能位置资产批量删除工单", tags = {"工单" }, notes = "根据功能位置资产批量删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/batch")
public ResponseEntity<Boolean> removeBatchByEAMLocationEAMAsset(@RequestBody List<String> ids) {
eamworkorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamworkorderMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产获取工单", tags = {"工单" }, notes = "根据功能位置资产获取工单")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/{eamworkorder_id}")
public ResponseEntity<EAMWorkOrderDTO> getByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
EAMWorkOrder domain = eamworkorderService.get(eamworkorder_id);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据功能位置资产获取工单草稿", tags = {"工单" }, notes = "根据功能位置资产获取工单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/getdraft")
public ResponseEntity<EAMWorkOrderDTO> getDraftByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id) {
EAMWorkOrder domain = new EAMWorkOrder();
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderMapping.toDto(eamworkorderService.getDraft(domain)));
}
@ApiOperation(value = "根据功能位置资产检查工单", tags = {"工单" }, notes = "根据功能位置资产检查工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.checkKey(eamworkorderMapping.toDomain(eamworkorderdto)));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据功能位置资产保存工单", tags = {"工单" }, notes = "根据功能位置资产保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/save")
public ResponseEntity<Boolean> saveByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setAssetid(eamasset_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.save(domain));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据功能位置资产批量保存工单", tags = {"工单" }, notes = "根据功能位置资产批量保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setAssetid(eamasset_id);
}
eamworkorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产获取下级工单", tags = {"工单" } ,notes = "根据功能位置资产获取下级工单")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/fetchchildwo")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderChildWOByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id,EAMWorkOrderSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产查询下级工单", tags = {"工单" } ,notes = "根据功能位置资产查询下级工单")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/searchchildwo")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderChildWOByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产获取DEFAULT", tags = {"工单" } ,notes = "根据功能位置资产获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/fetchdefault")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderDefaultByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id,EAMWorkOrderSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产查询DEFAULT", tags = {"工单" } ,notes = "根据功能位置资产查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamworkorders/searchdefault")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderDefaultByEAMLocationEAMAsset(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_assetid_eq(eamasset_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据资产维护计划建立工单", tags = {"工单" }, notes = "根据资产维护计划建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> createByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamplan_id);
eamworkorderService.create(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据资产维护计划批量建立工单", tags = {"工单" }, notes = "根据资产维护计划批量建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/batch")
public ResponseEntity<Boolean> createBatchByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamplan_id);
}
eamworkorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamworkorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据资产维护计划更新工单", tags = {"工单" }, notes = "根据资产维护计划更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> updateByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamworkorder_id") String eamworkorder_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamplan_id);
domain.setWorkorderid(eamworkorder_id);
eamworkorderService.update(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByEntities(this.eamworkorderMapping.toDomain(#eamworkorderdtos)),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据资产维护计划批量更新工单", tags = {"工单" }, notes = "根据资产维护计划批量更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/batch")
public ResponseEntity<Boolean> updateBatchByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamplan_id);
}
eamworkorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据资产维护计划删除工单", tags = {"工单" }, notes = "根据资产维护计划删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.remove(eamworkorder_id));
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByIds(#ids),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据资产维护计划批量删除工单", tags = {"工单" }, notes = "根据资产维护计划批量删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/batch")
public ResponseEntity<Boolean> removeBatchByEAMAssetEAMPlan(@RequestBody List<String> ids) {
eamworkorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamworkorderMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护计划获取工单", tags = {"工单" }, notes = "根据资产维护计划获取工单")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/{eamworkorder_id}")
public ResponseEntity<EAMWorkOrderDTO> getByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
EAMWorkOrder domain = eamworkorderService.get(eamworkorder_id);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据资产维护计划获取工单草稿", tags = {"工单" }, notes = "根据资产维护计划获取工单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/getdraft")
public ResponseEntity<EAMWorkOrderDTO> getDraftByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id) {
EAMWorkOrder domain = new EAMWorkOrder();
domain.setWooriginid(eamplan_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderMapping.toDto(eamworkorderService.getDraft(domain)));
}
@ApiOperation(value = "根据资产维护计划检查工单", tags = {"工单" }, notes = "根据资产维护计划检查工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.checkKey(eamworkorderMapping.toDomain(eamworkorderdto)));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据资产维护计划保存工单", tags = {"工单" }, notes = "根据资产维护计划保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/save")
public ResponseEntity<Boolean> saveByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamplan_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.save(domain));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据资产维护计划批量保存工单", tags = {"工单" }, notes = "根据资产维护计划批量保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamplan_id);
}
eamworkorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护计划获取下级工单", tags = {"工单" } ,notes = "根据资产维护计划获取下级工单")
@RequestMapping(method= RequestMethod.GET , value="/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/fetchchildwo")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderChildWOByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id,EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamplan_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护计划查询下级工单", tags = {"工单" } ,notes = "根据资产维护计划查询下级工单")
@RequestMapping(method= RequestMethod.POST , value="/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/searchchildwo")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderChildWOByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamplan_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护计划获取DEFAULT", tags = {"工单" } ,notes = "根据资产维护计划获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/fetchdefault")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderDefaultByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id,EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamplan_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据资产维护计划查询DEFAULT", tags = {"工单" } ,notes = "根据资产维护计划查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/searchdefault")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderDefaultByEAMAssetEAMPlan(@PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamplan_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据功能位置资产维护申请建立工单", tags = {"工单" }, notes = "根据功能位置资产维护申请建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> createByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamapply_id);
eamworkorderService.create(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据功能位置资产维护申请批量建立工单", tags = {"工单" }, notes = "根据功能位置资产维护申请批量建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/batch")
public ResponseEntity<Boolean> createBatchByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamapply_id);
}
eamworkorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamworkorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据功能位置资产维护申请更新工单", tags = {"工单" }, notes = "根据功能位置资产维护申请更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> updateByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @PathVariable("eamworkorder_id") String eamworkorder_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamapply_id);
domain.setWorkorderid(eamworkorder_id);
eamworkorderService.update(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByEntities(this.eamworkorderMapping.toDomain(#eamworkorderdtos)),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据功能位置资产维护申请批量更新工单", tags = {"工单" }, notes = "根据功能位置资产维护申请批量更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/batch")
public ResponseEntity<Boolean> updateBatchByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamapply_id);
}
eamworkorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据功能位置资产维护申请删除工单", tags = {"工单" }, notes = "根据功能位置资产维护申请删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.remove(eamworkorder_id));
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByIds(#ids),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据功能位置资产维护申请批量删除工单", tags = {"工单" }, notes = "根据功能位置资产维护申请批量删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/batch")
public ResponseEntity<Boolean> removeBatchByEAMLocationEAMAssetEAMApply(@RequestBody List<String> ids) {
eamworkorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamworkorderMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护申请获取工单", tags = {"工单" }, notes = "根据功能位置资产维护申请获取工单")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/{eamworkorder_id}")
public ResponseEntity<EAMWorkOrderDTO> getByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
EAMWorkOrder domain = eamworkorderService.get(eamworkorder_id);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据功能位置资产维护申请获取工单草稿", tags = {"工单" }, notes = "根据功能位置资产维护申请获取工单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/getdraft")
public ResponseEntity<EAMWorkOrderDTO> getDraftByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id) {
EAMWorkOrder domain = new EAMWorkOrder();
domain.setWooriginid(eamapply_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderMapping.toDto(eamworkorderService.getDraft(domain)));
}
@ApiOperation(value = "根据功能位置资产维护申请检查工单", tags = {"工单" }, notes = "根据功能位置资产维护申请检查工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.checkKey(eamworkorderMapping.toDomain(eamworkorderdto)));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据功能位置资产维护申请保存工单", tags = {"工单" }, notes = "根据功能位置资产维护申请保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/save")
public ResponseEntity<Boolean> saveByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamapply_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.save(domain));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据功能位置资产维护申请批量保存工单", tags = {"工单" }, notes = "根据功能位置资产维护申请批量保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamapply_id);
}
eamworkorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护申请获取下级工单", tags = {"工单" } ,notes = "根据功能位置资产维护申请获取下级工单")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/fetchchildwo")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderChildWOByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id,EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamapply_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护申请查询下级工单", tags = {"工单" } ,notes = "根据功能位置资产维护申请查询下级工单")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/searchchildwo")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderChildWOByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamapply_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护申请获取DEFAULT", tags = {"工单" } ,notes = "根据功能位置资产维护申请获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/fetchdefault")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderDefaultByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id,EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamapply_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护申请查询DEFAULT", tags = {"工单" } ,notes = "根据功能位置资产维护申请查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamapplies/{eamapply_id}/eamworkorders/searchdefault")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderDefaultByEAMLocationEAMAssetEAMApply(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamapply_id") String eamapply_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamapply_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据功能位置资产维护计划建立工单", tags = {"工单" }, notes = "根据功能位置资产维护计划建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> createByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamplan_id);
eamworkorderService.create(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Create')")
@ApiOperation(value = "根据功能位置资产维护计划批量建立工单", tags = {"工单" }, notes = "根据功能位置资产维护计划批量建立工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/batch")
public ResponseEntity<Boolean> createBatchByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamplan_id);
}
eamworkorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamworkorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据功能位置资产维护计划更新工单", tags = {"工单" }, notes = "根据功能位置资产维护计划更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<EAMWorkOrderDTO> updateByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamworkorder_id") String eamworkorder_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamplan_id);
domain.setWorkorderid(eamworkorder_id);
eamworkorderService.update(domain);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByEntities(this.eamworkorderMapping.toDomain(#eamworkorderdtos)),'iBizAssetManagement-EAMWorkOrder-Update')")
@ApiOperation(value = "根据功能位置资产维护计划批量更新工单", tags = {"工单" }, notes = "根据功能位置资产维护计划批量更新工单")
@RequestMapping(method = RequestMethod.PUT, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/batch")
public ResponseEntity<Boolean> updateBatchByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamplan_id);
}
eamworkorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamworkorderService.get(#eamworkorder_id),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据功能位置资产维护计划删除工单", tags = {"工单" }, notes = "根据功能位置资产维护计划删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/{eamworkorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.remove(eamworkorder_id));
}
@PreAuthorize("hasPermission(this.eamworkorderService.getEamworkorderByIds(#ids),'iBizAssetManagement-EAMWorkOrder-Remove')")
@ApiOperation(value = "根据功能位置资产维护计划批量删除工单", tags = {"工单" }, notes = "根据功能位置资产维护计划批量删除工单")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/batch")
public ResponseEntity<Boolean> removeBatchByEAMLocationEAMAssetEAMPlan(@RequestBody List<String> ids) {
eamworkorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamworkorderMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护计划获取工单", tags = {"工单" }, notes = "根据功能位置资产维护计划获取工单")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/{eamworkorder_id}")
public ResponseEntity<EAMWorkOrderDTO> getByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @PathVariable("eamworkorder_id") String eamworkorder_id) {
EAMWorkOrder domain = eamworkorderService.get(eamworkorder_id);
EAMWorkOrderDTO dto = eamworkorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据功能位置资产维护计划获取工单草稿", tags = {"工单" }, notes = "根据功能位置资产维护计划获取工单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/getdraft")
public ResponseEntity<EAMWorkOrderDTO> getDraftByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id) {
EAMWorkOrder domain = new EAMWorkOrder();
domain.setWooriginid(eamplan_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderMapping.toDto(eamworkorderService.getDraft(domain)));
}
@ApiOperation(value = "根据功能位置资产维护计划检查工单", tags = {"工单" }, notes = "根据功能位置资产维护计划检查工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.checkKey(eamworkorderMapping.toDomain(eamworkorderdto)));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdto),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据功能位置资产维护计划保存工单", tags = {"工单" }, notes = "根据功能位置资产维护计划保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/save")
public ResponseEntity<Boolean> saveByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderDTO eamworkorderdto) {
EAMWorkOrder domain = eamworkorderMapping.toDomain(eamworkorderdto);
domain.setWooriginid(eamplan_id);
return ResponseEntity.status(HttpStatus.OK).body(eamworkorderService.save(domain));
}
@PreAuthorize("hasPermission(this.eamworkorderMapping.toDomain(#eamworkorderdtos),'iBizAssetManagement-EAMWorkOrder-Save')")
@ApiOperation(value = "根据功能位置资产维护计划批量保存工单", tags = {"工单" }, notes = "根据功能位置资产维护计划批量保存工单")
@RequestMapping(method = RequestMethod.POST, value = "/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody List<EAMWorkOrderDTO> eamworkorderdtos) {
List<EAMWorkOrder> domainlist=eamworkorderMapping.toDomain(eamworkorderdtos);
for(EAMWorkOrder domain:domainlist){
domain.setWooriginid(eamplan_id);
}
eamworkorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护计划获取下级工单", tags = {"工单" } ,notes = "根据功能位置资产维护计划获取下级工单")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/fetchchildwo")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderChildWOByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id,EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamplan_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchChildWO-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护计划查询下级工单", tags = {"工单" } ,notes = "根据功能位置资产维护计划查询下级工单")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/searchchildwo")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderChildWOByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamplan_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchChildWO(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护计划获取DEFAULT", tags = {"工单" } ,notes = "根据功能位置资产维护计划获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/fetchdefault")
public ResponseEntity<List<EAMWorkOrderDTO>> fetchEAMWorkOrderDefaultByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id,EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamplan_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
List<EAMWorkOrderDTO> list = eamworkorderMapping.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-EAMWorkOrder-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMWorkOrder-Get')")
@ApiOperation(value = "根据功能位置资产维护计划查询DEFAULT", tags = {"工单" } ,notes = "根据功能位置资产维护计划查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamlocations/{eamlocation_id}/eamassets/{eamasset_id}/eamplans/{eamplan_id}/eamworkorders/searchdefault")
public ResponseEntity<Page<EAMWorkOrderDTO>> searchEAMWorkOrderDefaultByEAMLocationEAMAssetEAMPlan(@PathVariable("eamlocation_id") String eamlocation_id, @PathVariable("eamasset_id") String eamasset_id, @PathVariable("eamplan_id") String eamplan_id, @RequestBody EAMWorkOrderSearchContext context) {
context.setN_eamwooriginid_eq(eamplan_id);
Page<EAMWorkOrder> domains = eamworkorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamworkorderMapping.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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册