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

jackwang 部署微服务接口

上级 1f3279cc
......@@ -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:
......
......@@ -268,7 +268,7 @@
<!--输出实体[HREMPLOYEE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-217-12">
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-219-12">
<createTable tableName="EMPLOYEE">
<column name="EMPLOYEENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -897,10 +897,10 @@
</changeSet>
<!--输出实体[HREMPSTATE]外键关系 -->
<!--输出实体[HREMPLOYEE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-217-43">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-219-43">
<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>
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-217-44">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-219-44">
<addForeignKeyConstraint baseColumnNames="EMPSTATE" baseTableName="EMPLOYEE" constraintName="DER1N_HREMPLOYEE_HREMPSTATE_EM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HREMPSTATEID" referencedTableName="T_HREMPSTATE" validate="true"/>
</changeSet>
<!--输出实体[HRFAMILY]外键关系 -->
......
......@@ -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 HRPaperResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrpaperMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrpaperMapping.toDomain(#hrpaperdto),'iBizHumanResources-HRPaper-Create')")
@ApiOperation(value = "根据员工建立论文信息", tags = {"论文信息" }, notes = "根据员工建立论文信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpapers")
@Transactional
public ResponseEntity<HRPaperDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRPaperDTO hrpaperdto) {
HRPaper domain = hrpaperMapping.toDomain(hrpaperdto);
domain.setHremployeeid(hremployee_id);
hrpaperService.create(domain);
HRPaperDTO dto = hrpaperMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpaperMapping.toDomain(#hrpaperdtos),'iBizHumanResources-HRPaper-Create')")
@ApiOperation(value = "根据员工批量建立论文信息", tags = {"论文信息" }, notes = "根据员工批量建立论文信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpapers/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRPaperDTO> hrpaperdtos) {
List<HRPaper> domainlist=hrpaperMapping.toDomain(hrpaperdtos);
for(HRPaper domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrpaperService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrpaper" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrpaperService.get(#hrpaper_id),'iBizHumanResources-HRPaper-Update')")
@ApiOperation(value = "根据员工更新论文信息", tags = {"论文信息" }, notes = "根据员工更新论文信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrpapers/{hrpaper_id}")
@Transactional
public ResponseEntity<HRPaperDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrpaper_id") String hrpaper_id, @RequestBody HRPaperDTO hrpaperdto) {
HRPaper domain = hrpaperMapping.toDomain(hrpaperdto);
domain.setHremployeeid(hremployee_id);
domain.setHrpaperid(hrpaper_id);
hrpaperService.update(domain);
HRPaperDTO dto = hrpaperMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpaperService.getHrpaperByEntities(this.hrpaperMapping.toDomain(#hrpaperdtos)),'iBizHumanResources-HRPaper-Update')")
@ApiOperation(value = "根据员工批量更新论文信息", tags = {"论文信息" }, notes = "根据员工批量更新论文信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrpapers/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRPaperDTO> hrpaperdtos) {
List<HRPaper> domainlist=hrpaperMapping.toDomain(hrpaperdtos);
for(HRPaper domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrpaperService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrpaperService.get(#hrpaper_id),'iBizHumanResources-HRPaper-Remove')")
@ApiOperation(value = "根据员工删除论文信息", tags = {"论文信息" }, notes = "根据员工删除论文信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrpapers/{hrpaper_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrpaper_id") String hrpaper_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrpaperService.remove(hrpaper_id));
}
@PreAuthorize("hasPermission(this.hrpaperService.getHrpaperByIds(#ids),'iBizHumanResources-HRPaper-Remove')")
@ApiOperation(value = "根据员工批量删除论文信息", tags = {"论文信息" }, notes = "根据员工批量删除论文信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrpapers/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrpaperService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrpaperMapping.toDomain(returnObject.body),'iBizHumanResources-HRPaper-Get')")
@ApiOperation(value = "根据员工获取论文信息", tags = {"论文信息" }, notes = "根据员工获取论文信息")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrpapers/{hrpaper_id}")
public ResponseEntity<HRPaperDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrpaper_id") String hrpaper_id) {
HRPaper domain = hrpaperService.get(hrpaper_id);
HRPaperDTO dto = hrpaperMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取论文信息草稿", tags = {"论文信息" }, notes = "根据员工获取论文信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrpapers/getdraft")
public ResponseEntity<HRPaperDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRPaper domain = new HRPaper();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrpaperMapping.toDto(hrpaperService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查论文信息", tags = {"论文信息" }, notes = "根据员工检查论文信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpapers/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRPaperDTO hrpaperdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrpaperService.checkKey(hrpaperMapping.toDomain(hrpaperdto)));
}
@PreAuthorize("hasPermission(this.hrpaperMapping.toDomain(#hrpaperdto),'iBizHumanResources-HRPaper-Save')")
@ApiOperation(value = "根据员工保存论文信息", tags = {"论文信息" }, notes = "根据员工保存论文信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpapers/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRPaperDTO hrpaperdto) {
HRPaper domain = hrpaperMapping.toDomain(hrpaperdto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrpaperService.save(domain));
}
@PreAuthorize("hasPermission(this.hrpaperMapping.toDomain(#hrpaperdtos),'iBizHumanResources-HRPaper-Save')")
@ApiOperation(value = "根据员工批量保存论文信息", tags = {"论文信息" }, notes = "根据员工批量保存论文信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpapers/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRPaperDTO> hrpaperdtos) {
List<HRPaper> domainlist=hrpaperMapping.toDomain(hrpaperdtos);
for(HRPaper domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrpaperService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRPaper-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPaper-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"论文信息" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrpapers/fetchdefault")
public ResponseEntity<List<HRPaperDTO>> fetchHRPaperDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRPaperSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRPaper> domains = hrpaperService.searchDefault(context) ;
List<HRPaperDTO> list = hrpaperMapping.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-HRPaper-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPaper-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"论文信息" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrpapers/searchdefault")
public ResponseEntity<Page<HRPaperDTO>> searchHRPaperDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRPaperSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRPaper> domains = hrpaperService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrpaperMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册