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

jackwang 部署微服务接口

上级 fd955cdc
......@@ -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 HRArchivesResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrarchivesMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrarchivesMapping.toDomain(#hrarchivesdto),'iBizHumanResources-HRArchives-Create')")
@ApiOperation(value = "根据员工建立档案信息", tags = {"档案信息" }, notes = "根据员工建立档案信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrarchives")
@Transactional
public ResponseEntity<HRArchivesDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRArchivesDTO hrarchivesdto) {
HRArchives domain = hrarchivesMapping.toDomain(hrarchivesdto);
domain.setHremployeeid(hremployee_id);
hrarchivesService.create(domain);
HRArchivesDTO dto = hrarchivesMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrarchivesMapping.toDomain(#hrarchivesdtos),'iBizHumanResources-HRArchives-Create')")
@ApiOperation(value = "根据员工批量建立档案信息", tags = {"档案信息" }, notes = "根据员工批量建立档案信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrarchives/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRArchivesDTO> hrarchivesdtos) {
List<HRArchives> domainlist=hrarchivesMapping.toDomain(hrarchivesdtos);
for(HRArchives domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrarchivesService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrarchives" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrarchivesService.get(#hrarchives_id),'iBizHumanResources-HRArchives-Update')")
@ApiOperation(value = "根据员工更新档案信息", tags = {"档案信息" }, notes = "根据员工更新档案信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrarchives/{hrarchives_id}")
@Transactional
public ResponseEntity<HRArchivesDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrarchives_id") String hrarchives_id, @RequestBody HRArchivesDTO hrarchivesdto) {
HRArchives domain = hrarchivesMapping.toDomain(hrarchivesdto);
domain.setHremployeeid(hremployee_id);
domain.setHrarchivesid(hrarchives_id);
hrarchivesService.update(domain);
HRArchivesDTO dto = hrarchivesMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrarchivesService.getHrarchivesByEntities(this.hrarchivesMapping.toDomain(#hrarchivesdtos)),'iBizHumanResources-HRArchives-Update')")
@ApiOperation(value = "根据员工批量更新档案信息", tags = {"档案信息" }, notes = "根据员工批量更新档案信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrarchives/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRArchivesDTO> hrarchivesdtos) {
List<HRArchives> domainlist=hrarchivesMapping.toDomain(hrarchivesdtos);
for(HRArchives domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrarchivesService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrarchivesService.get(#hrarchives_id),'iBizHumanResources-HRArchives-Remove')")
@ApiOperation(value = "根据员工删除档案信息", tags = {"档案信息" }, notes = "根据员工删除档案信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrarchives/{hrarchives_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrarchives_id") String hrarchives_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrarchivesService.remove(hrarchives_id));
}
@PreAuthorize("hasPermission(this.hrarchivesService.getHrarchivesByIds(#ids),'iBizHumanResources-HRArchives-Remove')")
@ApiOperation(value = "根据员工批量删除档案信息", tags = {"档案信息" }, notes = "根据员工批量删除档案信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrarchives/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrarchivesService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrarchivesMapping.toDomain(returnObject.body),'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "根据员工获取档案信息", tags = {"档案信息" }, notes = "根据员工获取档案信息")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrarchives/{hrarchives_id}")
public ResponseEntity<HRArchivesDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrarchives_id") String hrarchives_id) {
HRArchives domain = hrarchivesService.get(hrarchives_id);
HRArchivesDTO dto = hrarchivesMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取档案信息草稿", tags = {"档案信息" }, notes = "根据员工获取档案信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrarchives/getdraft")
public ResponseEntity<HRArchivesDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRArchives domain = new HRArchives();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrarchivesMapping.toDto(hrarchivesService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查档案信息", tags = {"档案信息" }, notes = "根据员工检查档案信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrarchives/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRArchivesDTO hrarchivesdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrarchivesService.checkKey(hrarchivesMapping.toDomain(hrarchivesdto)));
}
@PreAuthorize("hasPermission(this.hrarchivesMapping.toDomain(#hrarchivesdto),'iBizHumanResources-HRArchives-Save')")
@ApiOperation(value = "根据员工保存档案信息", tags = {"档案信息" }, notes = "根据员工保存档案信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrarchives/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRArchivesDTO hrarchivesdto) {
HRArchives domain = hrarchivesMapping.toDomain(hrarchivesdto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrarchivesService.save(domain));
}
@PreAuthorize("hasPermission(this.hrarchivesMapping.toDomain(#hrarchivesdtos),'iBizHumanResources-HRArchives-Save')")
@ApiOperation(value = "根据员工批量保存档案信息", tags = {"档案信息" }, notes = "根据员工批量保存档案信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrarchives/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRArchivesDTO> hrarchivesdtos) {
List<HRArchives> domainlist=hrarchivesMapping.toDomain(hrarchivesdtos);
for(HRArchives domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrarchivesService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRArchives-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"档案信息" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrarchives/fetchdefault")
public ResponseEntity<List<HRArchivesDTO>> fetchHRArchivesDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRArchivesSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRArchives> domains = hrarchivesService.searchDefault(context) ;
List<HRArchivesDTO> list = hrarchivesMapping.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-HRArchives-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRArchives-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"档案信息" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrarchives/searchdefault")
public ResponseEntity<Page<HRArchivesDTO>> searchHRArchivesDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRArchivesSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRArchives> domains = hrarchivesService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrarchivesMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -160,5 +160,138 @@ public class HRFamilyResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrfamilyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrfamilyMapping.toDomain(#hrfamilydto),'iBizHumanResources-HRFamily-Create')")
@ApiOperation(value = "根据员工建立家庭情况", tags = {"家庭情况" }, notes = "根据员工建立家庭情况")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrfamilies")
@Transactional
public ResponseEntity<HRFamilyDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRFamilyDTO hrfamilydto) {
HRFamily domain = hrfamilyMapping.toDomain(hrfamilydto);
domain.setHremployeeid(hremployee_id);
hrfamilyService.create(domain);
HRFamilyDTO dto = hrfamilyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrfamilyMapping.toDomain(#hrfamilydtos),'iBizHumanResources-HRFamily-Create')")
@ApiOperation(value = "根据员工批量建立家庭情况", tags = {"家庭情况" }, notes = "根据员工批量建立家庭情况")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrfamilies/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRFamilyDTO> hrfamilydtos) {
List<HRFamily> domainlist=hrfamilyMapping.toDomain(hrfamilydtos);
for(HRFamily domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrfamilyService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrfamily" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrfamilyService.get(#hrfamily_id),'iBizHumanResources-HRFamily-Update')")
@ApiOperation(value = "根据员工更新家庭情况", tags = {"家庭情况" }, notes = "根据员工更新家庭情况")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrfamilies/{hrfamily_id}")
@Transactional
public ResponseEntity<HRFamilyDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrfamily_id") String hrfamily_id, @RequestBody HRFamilyDTO hrfamilydto) {
HRFamily domain = hrfamilyMapping.toDomain(hrfamilydto);
domain.setHremployeeid(hremployee_id);
domain.setHrfamilyid(hrfamily_id);
hrfamilyService.update(domain);
HRFamilyDTO dto = hrfamilyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrfamilyService.getHrfamilyByEntities(this.hrfamilyMapping.toDomain(#hrfamilydtos)),'iBizHumanResources-HRFamily-Update')")
@ApiOperation(value = "根据员工批量更新家庭情况", tags = {"家庭情况" }, notes = "根据员工批量更新家庭情况")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrfamilies/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRFamilyDTO> hrfamilydtos) {
List<HRFamily> domainlist=hrfamilyMapping.toDomain(hrfamilydtos);
for(HRFamily domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrfamilyService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrfamilyService.get(#hrfamily_id),'iBizHumanResources-HRFamily-Remove')")
@ApiOperation(value = "根据员工删除家庭情况", tags = {"家庭情况" }, notes = "根据员工删除家庭情况")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrfamilies/{hrfamily_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrfamily_id") String hrfamily_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrfamilyService.remove(hrfamily_id));
}
@PreAuthorize("hasPermission(this.hrfamilyService.getHrfamilyByIds(#ids),'iBizHumanResources-HRFamily-Remove')")
@ApiOperation(value = "根据员工批量删除家庭情况", tags = {"家庭情况" }, notes = "根据员工批量删除家庭情况")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrfamilies/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrfamilyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrfamilyMapping.toDomain(returnObject.body),'iBizHumanResources-HRFamily-Get')")
@ApiOperation(value = "根据员工获取家庭情况", tags = {"家庭情况" }, notes = "根据员工获取家庭情况")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrfamilies/{hrfamily_id}")
public ResponseEntity<HRFamilyDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrfamily_id") String hrfamily_id) {
HRFamily domain = hrfamilyService.get(hrfamily_id);
HRFamilyDTO dto = hrfamilyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取家庭情况草稿", tags = {"家庭情况" }, notes = "根据员工获取家庭情况草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrfamilies/getdraft")
public ResponseEntity<HRFamilyDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRFamily domain = new HRFamily();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrfamilyMapping.toDto(hrfamilyService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查家庭情况", tags = {"家庭情况" }, notes = "根据员工检查家庭情况")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrfamilies/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRFamilyDTO hrfamilydto) {
return ResponseEntity.status(HttpStatus.OK).body(hrfamilyService.checkKey(hrfamilyMapping.toDomain(hrfamilydto)));
}
@PreAuthorize("hasPermission(this.hrfamilyMapping.toDomain(#hrfamilydto),'iBizHumanResources-HRFamily-Save')")
@ApiOperation(value = "根据员工保存家庭情况", tags = {"家庭情况" }, notes = "根据员工保存家庭情况")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrfamilies/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRFamilyDTO hrfamilydto) {
HRFamily domain = hrfamilyMapping.toDomain(hrfamilydto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrfamilyService.save(domain));
}
@PreAuthorize("hasPermission(this.hrfamilyMapping.toDomain(#hrfamilydtos),'iBizHumanResources-HRFamily-Save')")
@ApiOperation(value = "根据员工批量保存家庭情况", tags = {"家庭情况" }, notes = "根据员工批量保存家庭情况")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrfamilies/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRFamilyDTO> hrfamilydtos) {
List<HRFamily> domainlist=hrfamilyMapping.toDomain(hrfamilydtos);
for(HRFamily domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrfamilyService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRFamily-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRFamily-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"家庭情况" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrfamilies/fetchdefault")
public ResponseEntity<List<HRFamilyDTO>> fetchHRFamilyDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRFamilySearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRFamily> domains = hrfamilyService.searchDefault(context) ;
List<HRFamilyDTO> list = hrfamilyMapping.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-HRFamily-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRFamily-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"家庭情况" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrfamilies/searchdefault")
public ResponseEntity<Page<HRFamilyDTO>> searchHRFamilyDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRFamilySearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRFamily> domains = hrfamilyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrfamilyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册