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

jackwang 部署微服务接口

上级 4481665d
......@@ -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:
......
......@@ -24,7 +24,7 @@
<!--输出实体[HRDISTRIBUTION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrdistribution-20-2">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrdistribution-26-2">
<createTable tableName="T_HRDISTRIBUTION">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -72,7 +72,7 @@
<!--输出实体[HREMPLOYEE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-7-4">
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-9-4">
<createTable tableName="EMPLOYEE">
<column name="EMPLOYEENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -346,7 +346,7 @@
<!--输出实体[HRPOST]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpost-103-15">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpost-106-15">
<createTable tableName="T_HRPOST">
<column name="HRPOSTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRPOST_HRPOSTID"/>
......@@ -380,7 +380,7 @@
<!--输出实体[HRPOSTREL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpostrel-18-16">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpostrel-23-16">
<createTable tableName="T_HRPOSTREL">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -408,15 +408,15 @@
<!--输出实体[HRATTENDANCE]外键关系 -->
<!--输出实体[HRDISTRIBUTION]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-20-17">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-26-17">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRDISTRIBUTION" constraintName="DER1N_HRDISTRIBUTION_HREMPLOYE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-20-18">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-26-18">
<addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="T_HRDISTRIBUTION" constraintName="DER1N_HRDISTRIBUTION_HRPOST_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
<!--输出实体[HRDUTY]外键关系 -->
<!--输出实体[HREMPLOYEE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-7-19">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-9-19">
<addForeignKeyConstraint baseColumnNames="ORGANIZATIONID" baseTableName="EMPLOYEE" constraintName="DER1N_EMPLOYEE_ORGANIZATION_OR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRLEAVE]外键关系 -->
......@@ -448,17 +448,17 @@
</changeSet>
<!--输出实体[HRORGANIZATION]外键关系 -->
<!--输出实体[HRPOST]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-103-27">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-106-27">
<addForeignKeyConstraint baseColumnNames="HRDUTYID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRDUTY_HRDUTYID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRDUTYID" referencedTableName="T_HRDUTY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-103-28">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-106-28">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRORGANIZATION_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRPOSTREL]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-18-29">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-23-29">
<addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="T_HRPOSTREL" constraintName="DER1N_HRPOSTREL_HRPOST_HRPOSTI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-18-30">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-23-30">
<addForeignKeyConstraint baseColumnNames="PHRPOSTID" baseTableName="T_HRPOSTREL" constraintName="DER1N_HRPOSTREL_HRPOST_PHRPOST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
......
......@@ -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 HRPostRelResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrpostrelMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrpostrelMapping.toDomain(#hrpostreldto),'iBizHumanResources-HRPostRel-Create')")
@ApiOperation(value = "根据职位建立职位关系", tags = {"职位关系" }, notes = "根据职位建立职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels")
@Transactional
public ResponseEntity<HRPostRelDTO> createByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRPostRelDTO hrpostreldto) {
HRPostRel domain = hrpostrelMapping.toDomain(hrpostreldto);
domain.setHrpostid(hrpost_id);
hrpostrelService.create(domain);
HRPostRelDTO dto = hrpostrelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpostrelMapping.toDomain(#hrpostreldtos),'iBizHumanResources-HRPostRel-Create')")
@ApiOperation(value = "根据职位批量建立职位关系", tags = {"职位关系" }, notes = "根据职位批量建立职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels/batch")
public ResponseEntity<Boolean> createBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRPostRelDTO> hrpostreldtos) {
List<HRPostRel> domainlist=hrpostrelMapping.toDomain(hrpostreldtos);
for(HRPostRel domain:domainlist){
domain.setHrpostid(hrpost_id);
}
hrpostrelService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrpostrel" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrpostrelService.get(#hrpostrel_id),'iBizHumanResources-HRPostRel-Update')")
@ApiOperation(value = "根据职位更新职位关系", tags = {"职位关系" }, notes = "根据职位更新职位关系")
@RequestMapping(method = RequestMethod.PUT, value = "/hrposts/{hrpost_id}/hrpostrels/{hrpostrel_id}")
@Transactional
public ResponseEntity<HRPostRelDTO> updateByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrpostrel_id") String hrpostrel_id, @RequestBody HRPostRelDTO hrpostreldto) {
HRPostRel domain = hrpostrelMapping.toDomain(hrpostreldto);
domain.setHrpostid(hrpost_id);
domain.setHrpostrelid(hrpostrel_id);
hrpostrelService.update(domain);
HRPostRelDTO dto = hrpostrelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpostrelService.getHrpostrelByEntities(this.hrpostrelMapping.toDomain(#hrpostreldtos)),'iBizHumanResources-HRPostRel-Update')")
@ApiOperation(value = "根据职位批量更新职位关系", tags = {"职位关系" }, notes = "根据职位批量更新职位关系")
@RequestMapping(method = RequestMethod.PUT, value = "/hrposts/{hrpost_id}/hrpostrels/batch")
public ResponseEntity<Boolean> updateBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRPostRelDTO> hrpostreldtos) {
List<HRPostRel> domainlist=hrpostrelMapping.toDomain(hrpostreldtos);
for(HRPostRel domain:domainlist){
domain.setHrpostid(hrpost_id);
}
hrpostrelService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrpostrelService.get(#hrpostrel_id),'iBizHumanResources-HRPostRel-Remove')")
@ApiOperation(value = "根据职位删除职位关系", tags = {"职位关系" }, notes = "根据职位删除职位关系")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrposts/{hrpost_id}/hrpostrels/{hrpostrel_id}")
@Transactional
public ResponseEntity<Boolean> removeByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrpostrel_id") String hrpostrel_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrpostrelService.remove(hrpostrel_id));
}
@PreAuthorize("hasPermission(this.hrpostrelService.getHrpostrelByIds(#ids),'iBizHumanResources-HRPostRel-Remove')")
@ApiOperation(value = "根据职位批量删除职位关系", tags = {"职位关系" }, notes = "根据职位批量删除职位关系")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrposts/{hrpost_id}/hrpostrels/batch")
public ResponseEntity<Boolean> removeBatchByHRPost(@RequestBody List<String> ids) {
hrpostrelService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrpostrelMapping.toDomain(returnObject.body),'iBizHumanResources-HRPostRel-Get')")
@ApiOperation(value = "根据职位获取职位关系", tags = {"职位关系" }, notes = "根据职位获取职位关系")
@RequestMapping(method = RequestMethod.GET, value = "/hrposts/{hrpost_id}/hrpostrels/{hrpostrel_id}")
public ResponseEntity<HRPostRelDTO> getByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrpostrel_id") String hrpostrel_id) {
HRPostRel domain = hrpostrelService.get(hrpostrel_id);
HRPostRelDTO dto = hrpostrelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据职位获取职位关系草稿", tags = {"职位关系" }, notes = "根据职位获取职位关系草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrposts/{hrpost_id}/hrpostrels/getdraft")
public ResponseEntity<HRPostRelDTO> getDraftByHRPost(@PathVariable("hrpost_id") String hrpost_id) {
HRPostRel domain = new HRPostRel();
domain.setHrpostid(hrpost_id);
return ResponseEntity.status(HttpStatus.OK).body(hrpostrelMapping.toDto(hrpostrelService.getDraft(domain)));
}
@ApiOperation(value = "根据职位检查职位关系", tags = {"职位关系" }, notes = "根据职位检查职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels/checkkey")
public ResponseEntity<Boolean> checkKeyByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRPostRelDTO hrpostreldto) {
return ResponseEntity.status(HttpStatus.OK).body(hrpostrelService.checkKey(hrpostrelMapping.toDomain(hrpostreldto)));
}
@PreAuthorize("hasPermission(this.hrpostrelMapping.toDomain(#hrpostreldto),'iBizHumanResources-HRPostRel-Save')")
@ApiOperation(value = "根据职位保存职位关系", tags = {"职位关系" }, notes = "根据职位保存职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels/save")
public ResponseEntity<Boolean> saveByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRPostRelDTO hrpostreldto) {
HRPostRel domain = hrpostrelMapping.toDomain(hrpostreldto);
domain.setHrpostid(hrpost_id);
return ResponseEntity.status(HttpStatus.OK).body(hrpostrelService.save(domain));
}
@PreAuthorize("hasPermission(this.hrpostrelMapping.toDomain(#hrpostreldtos),'iBizHumanResources-HRPostRel-Save')")
@ApiOperation(value = "根据职位批量保存职位关系", tags = {"职位关系" }, notes = "根据职位批量保存职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels/savebatch")
public ResponseEntity<Boolean> saveBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRPostRelDTO> hrpostreldtos) {
List<HRPostRel> domainlist=hrpostrelMapping.toDomain(hrpostreldtos);
for(HRPostRel domain:domainlist){
domain.setHrpostid(hrpost_id);
}
hrpostrelService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRPostRel-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPostRel-Get')")
@ApiOperation(value = "根据职位获取DEFAULT", tags = {"职位关系" } ,notes = "根据职位获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrposts/{hrpost_id}/hrpostrels/fetchdefault")
public ResponseEntity<List<HRPostRelDTO>> fetchHRPostRelDefaultByHRPost(@PathVariable("hrpost_id") String hrpost_id,HRPostRelSearchContext context) {
context.setN_hrpostid_eq(hrpost_id);
Page<HRPostRel> domains = hrpostrelService.searchDefault(context) ;
List<HRPostRelDTO> list = hrpostrelMapping.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-HRPostRel-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPostRel-Get')")
@ApiOperation(value = "根据职位查询DEFAULT", tags = {"职位关系" } ,notes = "根据职位查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrposts/{hrpost_id}/hrpostrels/searchdefault")
public ResponseEntity<Page<HRPostRelDTO>> searchHRPostRelDefaultByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRPostRelSearchContext context) {
context.setN_hrpostid_eq(hrpost_id);
Page<HRPostRel> domains = hrpostrelService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrpostrelMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册