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

jackwang 部署微服务接口

上级 42f2d1a1
......@@ -37,11 +37,11 @@
git clone -b master $para2 ibizhumanresources/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizhumanresources/
mvn clean package -Ppim
cd humanresource-app/humanresource-app-pim
mvn -Ppim docker:build
mvn -Ppim docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-app-pim.yaml iBizEE --with-registry-auth
mvn clean package -Phrapi
cd humanresource-provider/humanresource-provider-hrapi
mvn -Phrapi docker:build
mvn -Phrapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-provider-hrapi.yaml iBizEE --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -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 /humanresource-app-pim.jar
EXPOSE 10327
EXPOSE 8080
ADD humanresource-app-pim.jar /humanresource-app-pim.jar
......@@ -3,25 +3,9 @@ services:
humanresource-app-pim:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-app-pim:latest
ports:
- "10327:10327"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10327
- 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:
......
......@@ -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 /humanresource-provider-hrapi.jar
EXPOSE 8081
EXPOSE 10317
ADD humanresource-provider-hrapi.jar /humanresource-provider-hrapi.jar
......@@ -3,9 +3,25 @@ services:
humanresource-provider-hrapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-provider-hrapi:latest
ports:
- "8081:8081"
- "10317:10317"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10317
- 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,138 @@ public class HROMHierarchyResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hromhierarchyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(#hromhierarchydto),'iBizHumanResources-HROMHierarchy-Create')")
@ApiOperation(value = "根据结构层次类别建立组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别建立组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies")
@Transactional
public ResponseEntity<HROMHierarchyDTO> createByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @RequestBody HROMHierarchyDTO hromhierarchydto) {
HROMHierarchy domain = hromhierarchyMapping.toDomain(hromhierarchydto);
domain.setHromhierarchycatid(hromhierarchycat_id);
hromhierarchyService.create(domain);
HROMHierarchyDTO dto = hromhierarchyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(#hromhierarchydtos),'iBizHumanResources-HROMHierarchy-Create')")
@ApiOperation(value = "根据结构层次类别批量建立组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别批量建立组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/batch")
public ResponseEntity<Boolean> createBatchByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @RequestBody List<HROMHierarchyDTO> hromhierarchydtos) {
List<HROMHierarchy> domainlist=hromhierarchyMapping.toDomain(hromhierarchydtos);
for(HROMHierarchy domain:domainlist){
domain.setHromhierarchycatid(hromhierarchycat_id);
}
hromhierarchyService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hromhierarchy" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hromhierarchyService.get(#hromhierarchy_id),'iBizHumanResources-HROMHierarchy-Update')")
@ApiOperation(value = "根据结构层次类别更新组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别更新组织层次结构")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/{hromhierarchy_id}")
@Transactional
public ResponseEntity<HROMHierarchyDTO> updateByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @PathVariable("hromhierarchy_id") String hromhierarchy_id, @RequestBody HROMHierarchyDTO hromhierarchydto) {
HROMHierarchy domain = hromhierarchyMapping.toDomain(hromhierarchydto);
domain.setHromhierarchycatid(hromhierarchycat_id);
domain.setOmhierarchyid(hromhierarchy_id);
hromhierarchyService.update(domain);
HROMHierarchyDTO dto = hromhierarchyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchyService.getHromhierarchyByEntities(this.hromhierarchyMapping.toDomain(#hromhierarchydtos)),'iBizHumanResources-HROMHierarchy-Update')")
@ApiOperation(value = "根据结构层次类别批量更新组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别批量更新组织层次结构")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/batch")
public ResponseEntity<Boolean> updateBatchByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @RequestBody List<HROMHierarchyDTO> hromhierarchydtos) {
List<HROMHierarchy> domainlist=hromhierarchyMapping.toDomain(hromhierarchydtos);
for(HROMHierarchy domain:domainlist){
domain.setHromhierarchycatid(hromhierarchycat_id);
}
hromhierarchyService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hromhierarchyService.get(#hromhierarchy_id),'iBizHumanResources-HROMHierarchy-Remove')")
@ApiOperation(value = "根据结构层次类别删除组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别删除组织层次结构")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/{hromhierarchy_id}")
@Transactional
public ResponseEntity<Boolean> removeByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @PathVariable("hromhierarchy_id") String hromhierarchy_id) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchyService.remove(hromhierarchy_id));
}
@PreAuthorize("hasPermission(this.hromhierarchyService.getHromhierarchyByIds(#ids),'iBizHumanResources-HROMHierarchy-Remove')")
@ApiOperation(value = "根据结构层次类别批量删除组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别批量删除组织层次结构")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/batch")
public ResponseEntity<Boolean> removeBatchByHROMHierarchyCat(@RequestBody List<String> ids) {
hromhierarchyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(returnObject.body),'iBizHumanResources-HROMHierarchy-Get')")
@ApiOperation(value = "根据结构层次类别获取组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别获取组织层次结构")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/{hromhierarchy_id}")
public ResponseEntity<HROMHierarchyDTO> getByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @PathVariable("hromhierarchy_id") String hromhierarchy_id) {
HROMHierarchy domain = hromhierarchyService.get(hromhierarchy_id);
HROMHierarchyDTO dto = hromhierarchyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据结构层次类别获取组织层次结构草稿", tags = {"组织层次结构" }, notes = "根据结构层次类别获取组织层次结构草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/getdraft")
public ResponseEntity<HROMHierarchyDTO> getDraftByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id) {
HROMHierarchy domain = new HROMHierarchy();
domain.setHromhierarchycatid(hromhierarchycat_id);
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchyMapping.toDto(hromhierarchyService.getDraft(domain)));
}
@ApiOperation(value = "根据结构层次类别检查组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别检查组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/checkkey")
public ResponseEntity<Boolean> checkKeyByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @RequestBody HROMHierarchyDTO hromhierarchydto) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchyService.checkKey(hromhierarchyMapping.toDomain(hromhierarchydto)));
}
@PreAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(#hromhierarchydto),'iBizHumanResources-HROMHierarchy-Save')")
@ApiOperation(value = "根据结构层次类别保存组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别保存组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/save")
public ResponseEntity<Boolean> saveByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @RequestBody HROMHierarchyDTO hromhierarchydto) {
HROMHierarchy domain = hromhierarchyMapping.toDomain(hromhierarchydto);
domain.setHromhierarchycatid(hromhierarchycat_id);
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchyService.save(domain));
}
@PreAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(#hromhierarchydtos),'iBizHumanResources-HROMHierarchy-Save')")
@ApiOperation(value = "根据结构层次类别批量保存组织层次结构", tags = {"组织层次结构" }, notes = "根据结构层次类别批量保存组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/savebatch")
public ResponseEntity<Boolean> saveBatchByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @RequestBody List<HROMHierarchyDTO> hromhierarchydtos) {
List<HROMHierarchy> domainlist=hromhierarchyMapping.toDomain(hromhierarchydtos);
for(HROMHierarchy domain:domainlist){
domain.setHromhierarchycatid(hromhierarchycat_id);
}
hromhierarchyService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROMHierarchy-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHierarchy-Get')")
@ApiOperation(value = "根据结构层次类别获取DEFAULT", tags = {"组织层次结构" } ,notes = "根据结构层次类别获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/fetchdefault")
public ResponseEntity<List<HROMHierarchyDTO>> fetchHROMHierarchyDefaultByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id,HROMHierarchySearchContext context) {
context.setN_hromhierarchycatid_eq(hromhierarchycat_id);
Page<HROMHierarchy> domains = hromhierarchyService.searchDefault(context) ;
List<HROMHierarchyDTO> list = hromhierarchyMapping.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','iBizHumanResources-HROMHierarchy-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHierarchy-Get')")
@ApiOperation(value = "根据结构层次类别查询DEFAULT", tags = {"组织层次结构" } ,notes = "根据结构层次类别查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hromhierarchycats/{hromhierarchycat_id}/hromhierarchies/searchdefault")
public ResponseEntity<Page<HROMHierarchyDTO>> searchHROMHierarchyDefaultByHROMHierarchyCat(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @RequestBody HROMHierarchySearchContext context) {
context.setN_hromhierarchycatid_eq(hromhierarchycat_id);
Page<HROMHierarchy> domains = hromhierarchyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hromhierarchyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册