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

jackwang 部署微服务接口

上级 8a5d2cfa
......@@ -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:
......
......@@ -161,24 +161,24 @@ public class HROrgAddressResource {
.body(new PageImpl(hrorgaddressMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdto),'iBizHumanResources-HROrgAddress-Create')")
@ApiOperation(value = "根据组织建立组织地址", tags = {"组织地址" }, notes = "根据组织建立组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses")
@ApiOperation(value = "根据法人建立组织地址", tags = {"组织地址" }, notes = "根据法人建立组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgaddresses")
@Transactional
public ResponseEntity<HROrgAddressDTO> createByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
public ResponseEntity<HROrgAddressDTO> createByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
hrorgaddressService.create(domain);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos),'iBizHumanResources-HROrgAddress-Create')")
@ApiOperation(value = "根据组织批量建立组织地址", tags = {"组织地址" }, notes = "根据组织批量建立组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> createBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
@ApiOperation(value = "根据法人批量建立组织地址", tags = {"组织地址" }, notes = "根据法人批量建立组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> createBatchByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
List<HROrgAddress> domainlist=hrorgaddressMapping.toDomain(hrorgaddressdtos);
for(HROrgAddress domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
}
hrorgaddressService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
......@@ -186,12 +186,12 @@ public class HROrgAddressResource {
@VersionCheck(entity = "hrorgaddress" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrorgaddressService.get(#hrorgaddress_id),'iBizHumanResources-HROrgAddress-Update')")
@ApiOperation(value = "根据组织更新组织地址", tags = {"组织地址" }, notes = "根据组织更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/{hrorgaddress_id}")
@ApiOperation(value = "根据法人更新组织地址", tags = {"组织地址" }, notes = "根据法人更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/{hrorgaddress_id}")
@Transactional
public ResponseEntity<HROrgAddressDTO> updateByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
public ResponseEntity<HROrgAddressDTO> updateByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
domain.setHrorgaddressid(hrorgaddress_id);
hrorgaddressService.update(domain);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
......@@ -199,82 +199,82 @@ public class HROrgAddressResource {
}
@PreAuthorize("hasPermission(this.hrorgaddressService.getHrorgaddressByEntities(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos)),'iBizHumanResources-HROrgAddress-Update')")
@ApiOperation(value = "根据组织批量更新组织地址", tags = {"组织地址" }, notes = "根据组织批量更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> updateBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
@ApiOperation(value = "根据法人批量更新组织地址", tags = {"组织地址" }, notes = "根据法人批量更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> updateBatchByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
List<HROrgAddress> domainlist=hrorgaddressMapping.toDomain(hrorgaddressdtos);
for(HROrgAddress domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
}
hrorgaddressService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrorgaddressService.get(#hrorgaddress_id),'iBizHumanResources-HROrgAddress-Remove')")
@ApiOperation(value = "根据组织删除组织地址", tags = {"组织地址" }, notes = "根据组织删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/{hrorgaddress_id}")
@ApiOperation(value = "根据法人删除组织地址", tags = {"组织地址" }, notes = "根据法人删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/{hrorgaddress_id}")
@Transactional
public ResponseEntity<Boolean> removeByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id) {
public ResponseEntity<Boolean> removeByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.remove(hrorgaddress_id));
}
@PreAuthorize("hasPermission(this.hrorgaddressService.getHrorgaddressByIds(#ids),'iBizHumanResources-HROrgAddress-Remove')")
@ApiOperation(value = "根据组织批量删除组织地址", tags = {"组织地址" }, notes = "根据组织批量删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> removeBatchByHROrganization(@RequestBody List<String> ids) {
@ApiOperation(value = "根据法人批量删除组织地址", tags = {"组织地址" }, notes = "根据法人批量删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> removeBatchByHRLegal(@RequestBody List<String> ids) {
hrorgaddressService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(returnObject.body),'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "根据组织获取组织地址", tags = {"组织地址" }, notes = "根据组织获取组织地址")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/{hrorgaddress_id}")
public ResponseEntity<HROrgAddressDTO> getByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id) {
@ApiOperation(value = "根据法人获取组织地址", tags = {"组织地址" }, notes = "根据法人获取组织地址")
@RequestMapping(method = RequestMethod.GET, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/{hrorgaddress_id}")
public ResponseEntity<HROrgAddressDTO> getByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id) {
HROrgAddress domain = hrorgaddressService.get(hrorgaddress_id);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据组织获取组织地址草稿", tags = {"组织地址" }, notes = "根据组织获取组织地址草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/getdraft")
public ResponseEntity<HROrgAddressDTO> getDraftByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id) {
@ApiOperation(value = "根据法人获取组织地址草稿", tags = {"组织地址" }, notes = "根据法人获取组织地址草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/getdraft")
public ResponseEntity<HROrgAddressDTO> getDraftByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id) {
HROrgAddress domain = new HROrgAddress();
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressMapping.toDto(hrorgaddressService.getDraft(domain)));
}
@ApiOperation(value = "根据组织检查组织地址", tags = {"组织地址" }, notes = "根据组织检查组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/checkkey")
public ResponseEntity<Boolean> checkKeyByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
@ApiOperation(value = "根据法人检查组织地址", tags = {"组织地址" }, notes = "根据法人检查组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/checkkey")
public ResponseEntity<Boolean> checkKeyByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.checkKey(hrorgaddressMapping.toDomain(hrorgaddressdto)));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdto),'iBizHumanResources-HROrgAddress-Save')")
@ApiOperation(value = "根据组织保存组织地址", tags = {"组织地址" }, notes = "根据组织保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/save")
public ResponseEntity<Boolean> saveByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
@ApiOperation(value = "根据法人保存组织地址", tags = {"组织地址" }, notes = "根据法人保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/save")
public ResponseEntity<Boolean> saveByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.save(domain));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos),'iBizHumanResources-HROrgAddress-Save')")
@ApiOperation(value = "根据组织批量保存组织地址", tags = {"组织地址" }, notes = "根据组织批量保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/savebatch")
public ResponseEntity<Boolean> saveBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
@ApiOperation(value = "根据法人批量保存组织地址", tags = {"组织地址" }, notes = "根据法人批量保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgaddresses/savebatch")
public ResponseEntity<Boolean> saveBatchByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
List<HROrgAddress> domainlist=hrorgaddressMapping.toDomain(hrorgaddressdtos);
for(HROrgAddress domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
}
hrorgaddressService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgAddress-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "根据组织获取DEFAULT", tags = {"组织地址" } ,notes = "根据组织获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrorganizations/{hrorganization_id}/hrorgaddresses/fetchdefault")
public ResponseEntity<List<HROrgAddressDTO>> fetchHROrgAddressDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id,HROrgAddressSearchContext context) {
context.setN_hrorganizationid_eq(hrorganization_id);
@ApiOperation(value = "根据法人获取DEFAULT", tags = {"组织地址" } ,notes = "根据法人获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrlegals/{hrlegal_id}/hrorgaddresses/fetchdefault")
public ResponseEntity<List<HROrgAddressDTO>> fetchHROrgAddressDefaultByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id,HROrgAddressSearchContext context) {
context.setN_hrorganizationid_eq(hrlegal_id);
Page<HROrgAddress> domains = hrorgaddressService.searchDefault(context) ;
List<HROrgAddressDTO> list = hrorgaddressMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
......@@ -285,10 +285,143 @@ public class HROrgAddressResource {
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgAddress-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "根据组织查询DEFAULT", tags = {"组织地址" } ,notes = "根据组织查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrorganizations/{hrorganization_id}/hrorgaddresses/searchdefault")
public ResponseEntity<Page<HROrgAddressDTO>> searchHROrgAddressDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgAddressSearchContext context) {
context.setN_hrorganizationid_eq(hrorganization_id);
@ApiOperation(value = "根据法人查询DEFAULT", tags = {"组织地址" } ,notes = "根据法人查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrlegals/{hrlegal_id}/hrorgaddresses/searchdefault")
public ResponseEntity<Page<HROrgAddressDTO>> searchHROrgAddressDefaultByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody HROrgAddressSearchContext context) {
context.setN_hrorganizationid_eq(hrlegal_id);
Page<HROrgAddress> domains = hrorgaddressService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgaddressMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdto),'iBizHumanResources-HROrgAddress-Create')")
@ApiOperation(value = "根据运营单位建立组织地址", tags = {"组织地址" }, notes = "根据运营单位建立组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses")
@Transactional
public ResponseEntity<HROrgAddressDTO> createByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain.setHrorganizationid(hroperationunit_id);
hrorgaddressService.create(domain);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos),'iBizHumanResources-HROrgAddress-Create')")
@ApiOperation(value = "根据运营单位批量建立组织地址", tags = {"组织地址" }, notes = "根据运营单位批量建立组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> createBatchByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
List<HROrgAddress> domainlist=hrorgaddressMapping.toDomain(hrorgaddressdtos);
for(HROrgAddress domain:domainlist){
domain.setHrorganizationid(hroperationunit_id);
}
hrorgaddressService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrorgaddress" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrorgaddressService.get(#hrorgaddress_id),'iBizHumanResources-HROrgAddress-Update')")
@ApiOperation(value = "根据运营单位更新组织地址", tags = {"组织地址" }, notes = "根据运营单位更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/{hrorgaddress_id}")
@Transactional
public ResponseEntity<HROrgAddressDTO> updateByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain.setHrorganizationid(hroperationunit_id);
domain.setHrorgaddressid(hrorgaddress_id);
hrorgaddressService.update(domain);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgaddressService.getHrorgaddressByEntities(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos)),'iBizHumanResources-HROrgAddress-Update')")
@ApiOperation(value = "根据运营单位批量更新组织地址", tags = {"组织地址" }, notes = "根据运营单位批量更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> updateBatchByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
List<HROrgAddress> domainlist=hrorgaddressMapping.toDomain(hrorgaddressdtos);
for(HROrgAddress domain:domainlist){
domain.setHrorganizationid(hroperationunit_id);
}
hrorgaddressService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrorgaddressService.get(#hrorgaddress_id),'iBizHumanResources-HROrgAddress-Remove')")
@ApiOperation(value = "根据运营单位删除组织地址", tags = {"组织地址" }, notes = "根据运营单位删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/{hrorgaddress_id}")
@Transactional
public ResponseEntity<Boolean> removeByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.remove(hrorgaddress_id));
}
@PreAuthorize("hasPermission(this.hrorgaddressService.getHrorgaddressByIds(#ids),'iBizHumanResources-HROrgAddress-Remove')")
@ApiOperation(value = "根据运营单位批量删除组织地址", tags = {"组织地址" }, notes = "根据运营单位批量删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> removeBatchByHROperationUnit(@RequestBody List<String> ids) {
hrorgaddressService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(returnObject.body),'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "根据运营单位获取组织地址", tags = {"组织地址" }, notes = "根据运营单位获取组织地址")
@RequestMapping(method = RequestMethod.GET, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/{hrorgaddress_id}")
public ResponseEntity<HROrgAddressDTO> getByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id) {
HROrgAddress domain = hrorgaddressService.get(hrorgaddress_id);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据运营单位获取组织地址草稿", tags = {"组织地址" }, notes = "根据运营单位获取组织地址草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/getdraft")
public ResponseEntity<HROrgAddressDTO> getDraftByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id) {
HROrgAddress domain = new HROrgAddress();
domain.setHrorganizationid(hroperationunit_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressMapping.toDto(hrorgaddressService.getDraft(domain)));
}
@ApiOperation(value = "根据运营单位检查组织地址", tags = {"组织地址" }, notes = "根据运营单位检查组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/checkkey")
public ResponseEntity<Boolean> checkKeyByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.checkKey(hrorgaddressMapping.toDomain(hrorgaddressdto)));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdto),'iBizHumanResources-HROrgAddress-Save')")
@ApiOperation(value = "根据运营单位保存组织地址", tags = {"组织地址" }, notes = "根据运营单位保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/save")
public ResponseEntity<Boolean> saveByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain.setHrorganizationid(hroperationunit_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.save(domain));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos),'iBizHumanResources-HROrgAddress-Save')")
@ApiOperation(value = "根据运营单位批量保存组织地址", tags = {"组织地址" }, notes = "根据运营单位批量保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgaddresses/savebatch")
public ResponseEntity<Boolean> saveBatchByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
List<HROrgAddress> domainlist=hrorgaddressMapping.toDomain(hrorgaddressdtos);
for(HROrgAddress domain:domainlist){
domain.setHrorganizationid(hroperationunit_id);
}
hrorgaddressService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgAddress-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "根据运营单位获取DEFAULT", tags = {"组织地址" } ,notes = "根据运营单位获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hroperationunits/{hroperationunit_id}/hrorgaddresses/fetchdefault")
public ResponseEntity<List<HROrgAddressDTO>> fetchHROrgAddressDefaultByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id,HROrgAddressSearchContext context) {
context.setN_hrorganizationid_eq(hroperationunit_id);
Page<HROrgAddress> domains = hrorgaddressService.searchDefault(context) ;
List<HROrgAddressDTO> list = hrorgaddressMapping.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-HROrgAddress-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "根据运营单位查询DEFAULT", tags = {"组织地址" } ,notes = "根据运营单位查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hroperationunits/{hroperationunit_id}/hrorgaddresses/searchdefault")
public ResponseEntity<Page<HROrgAddressDTO>> searchHROrgAddressDefaultByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody HROrgAddressSearchContext context) {
context.setN_hrorganizationid_eq(hroperationunit_id);
Page<HROrgAddress> domains = hrorgaddressService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgaddressMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
......
......@@ -161,24 +161,24 @@ public class HROrgContactResource {
.body(new PageImpl(hrorgcontactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdto),'iBizHumanResources-HROrgContact-Create')")
@ApiOperation(value = "根据组织建立组织联系信息", tags = {"组织联系信息" }, notes = "根据组织建立组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts")
@ApiOperation(value = "根据法人建立组织联系信息", tags = {"组织联系信息" }, notes = "根据法人建立组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgcontacts")
@Transactional
public ResponseEntity<HROrgContactDTO> createByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
public ResponseEntity<HROrgContactDTO> createByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
hrorgcontactService.create(domain);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos),'iBizHumanResources-HROrgContact-Create')")
@ApiOperation(value = "根据组织批量建立组织联系信息", tags = {"组织联系信息" }, notes = "根据组织批量建立组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> createBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
@ApiOperation(value = "根据法人批量建立组织联系信息", tags = {"组织联系信息" }, notes = "根据法人批量建立组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> createBatchByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
List<HROrgContact> domainlist=hrorgcontactMapping.toDomain(hrorgcontactdtos);
for(HROrgContact domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
}
hrorgcontactService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
......@@ -186,12 +186,12 @@ public class HROrgContactResource {
@VersionCheck(entity = "hrorgcontact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrorgcontactService.get(#hrorgcontact_id),'iBizHumanResources-HROrgContact-Update')")
@ApiOperation(value = "根据组织更新组织联系信息", tags = {"组织联系信息" }, notes = "根据组织更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/{hrorgcontact_id}")
@ApiOperation(value = "根据法人更新组织联系信息", tags = {"组织联系信息" }, notes = "根据法人更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/{hrorgcontact_id}")
@Transactional
public ResponseEntity<HROrgContactDTO> updateByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
public ResponseEntity<HROrgContactDTO> updateByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
domain.setHrorgcontactid(hrorgcontact_id);
hrorgcontactService.update(domain);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
......@@ -199,82 +199,82 @@ public class HROrgContactResource {
}
@PreAuthorize("hasPermission(this.hrorgcontactService.getHrorgcontactByEntities(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos)),'iBizHumanResources-HROrgContact-Update')")
@ApiOperation(value = "根据组织批量更新组织联系信息", tags = {"组织联系信息" }, notes = "根据组织批量更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> updateBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
@ApiOperation(value = "根据法人批量更新组织联系信息", tags = {"组织联系信息" }, notes = "根据法人批量更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> updateBatchByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
List<HROrgContact> domainlist=hrorgcontactMapping.toDomain(hrorgcontactdtos);
for(HROrgContact domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
}
hrorgcontactService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrorgcontactService.get(#hrorgcontact_id),'iBizHumanResources-HROrgContact-Remove')")
@ApiOperation(value = "根据组织删除组织联系信息", tags = {"组织联系信息" }, notes = "根据组织删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/{hrorgcontact_id}")
@ApiOperation(value = "根据法人删除组织联系信息", tags = {"组织联系信息" }, notes = "根据法人删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/{hrorgcontact_id}")
@Transactional
public ResponseEntity<Boolean> removeByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id) {
public ResponseEntity<Boolean> removeByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.remove(hrorgcontact_id));
}
@PreAuthorize("hasPermission(this.hrorgcontactService.getHrorgcontactByIds(#ids),'iBizHumanResources-HROrgContact-Remove')")
@ApiOperation(value = "根据组织批量删除组织联系信息", tags = {"组织联系信息" }, notes = "根据组织批量删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> removeBatchByHROrganization(@RequestBody List<String> ids) {
@ApiOperation(value = "根据法人批量删除组织联系信息", tags = {"组织联系信息" }, notes = "根据法人批量删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> removeBatchByHRLegal(@RequestBody List<String> ids) {
hrorgcontactService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(returnObject.body),'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "根据组织获取组织联系信息", tags = {"组织联系信息" }, notes = "根据组织获取组织联系信息")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/{hrorgcontact_id}")
public ResponseEntity<HROrgContactDTO> getByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id) {
@ApiOperation(value = "根据法人获取组织联系信息", tags = {"组织联系信息" }, notes = "根据法人获取组织联系信息")
@RequestMapping(method = RequestMethod.GET, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/{hrorgcontact_id}")
public ResponseEntity<HROrgContactDTO> getByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id) {
HROrgContact domain = hrorgcontactService.get(hrorgcontact_id);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据组织获取组织联系信息草稿", tags = {"组织联系信息" }, notes = "根据组织获取组织联系信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/getdraft")
public ResponseEntity<HROrgContactDTO> getDraftByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id) {
@ApiOperation(value = "根据法人获取组织联系信息草稿", tags = {"组织联系信息" }, notes = "根据法人获取组织联系信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/getdraft")
public ResponseEntity<HROrgContactDTO> getDraftByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id) {
HROrgContact domain = new HROrgContact();
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactMapping.toDto(hrorgcontactService.getDraft(domain)));
}
@ApiOperation(value = "根据组织检查组织联系信息", tags = {"组织联系信息" }, notes = "根据组织检查组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/checkkey")
public ResponseEntity<Boolean> checkKeyByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
@ApiOperation(value = "根据法人检查组织联系信息", tags = {"组织联系信息" }, notes = "根据法人检查组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/checkkey")
public ResponseEntity<Boolean> checkKeyByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.checkKey(hrorgcontactMapping.toDomain(hrorgcontactdto)));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdto),'iBizHumanResources-HROrgContact-Save')")
@ApiOperation(value = "根据组织保存组织联系信息", tags = {"组织联系信息" }, notes = "根据组织保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/save")
public ResponseEntity<Boolean> saveByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
@ApiOperation(value = "根据法人保存组织联系信息", tags = {"组织联系信息" }, notes = "根据法人保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/save")
public ResponseEntity<Boolean> saveByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.save(domain));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos),'iBizHumanResources-HROrgContact-Save')")
@ApiOperation(value = "根据组织批量保存组织联系信息", tags = {"组织联系信息" }, notes = "根据组织批量保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/savebatch")
public ResponseEntity<Boolean> saveBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
@ApiOperation(value = "根据法人批量保存组织联系信息", tags = {"组织联系信息" }, notes = "根据法人批量保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrlegals/{hrlegal_id}/hrorgcontacts/savebatch")
public ResponseEntity<Boolean> saveBatchByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
List<HROrgContact> domainlist=hrorgcontactMapping.toDomain(hrorgcontactdtos);
for(HROrgContact domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
domain.setHrorganizationid(hrlegal_id);
}
hrorgcontactService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgContact-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "根据组织获取DEFAULT", tags = {"组织联系信息" } ,notes = "根据组织获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrorganizations/{hrorganization_id}/hrorgcontacts/fetchdefault")
public ResponseEntity<List<HROrgContactDTO>> fetchHROrgContactDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id,HROrgContactSearchContext context) {
context.setN_hrorganizationid_eq(hrorganization_id);
@ApiOperation(value = "根据法人获取DEFAULT", tags = {"组织联系信息" } ,notes = "根据法人获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrlegals/{hrlegal_id}/hrorgcontacts/fetchdefault")
public ResponseEntity<List<HROrgContactDTO>> fetchHROrgContactDefaultByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id,HROrgContactSearchContext context) {
context.setN_hrorganizationid_eq(hrlegal_id);
Page<HROrgContact> domains = hrorgcontactService.searchDefault(context) ;
List<HROrgContactDTO> list = hrorgcontactMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
......@@ -285,10 +285,143 @@ public class HROrgContactResource {
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgContact-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "根据组织查询DEFAULT", tags = {"组织联系信息" } ,notes = "根据组织查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrorganizations/{hrorganization_id}/hrorgcontacts/searchdefault")
public ResponseEntity<Page<HROrgContactDTO>> searchHROrgContactDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgContactSearchContext context) {
context.setN_hrorganizationid_eq(hrorganization_id);
@ApiOperation(value = "根据法人查询DEFAULT", tags = {"组织联系信息" } ,notes = "根据法人查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrlegals/{hrlegal_id}/hrorgcontacts/searchdefault")
public ResponseEntity<Page<HROrgContactDTO>> searchHROrgContactDefaultByHRLegal(@PathVariable("hrlegal_id") String hrlegal_id, @RequestBody HROrgContactSearchContext context) {
context.setN_hrorganizationid_eq(hrlegal_id);
Page<HROrgContact> domains = hrorgcontactService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgcontactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdto),'iBizHumanResources-HROrgContact-Create')")
@ApiOperation(value = "根据运营单位建立组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位建立组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts")
@Transactional
public ResponseEntity<HROrgContactDTO> createByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain.setHrorganizationid(hroperationunit_id);
hrorgcontactService.create(domain);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos),'iBizHumanResources-HROrgContact-Create')")
@ApiOperation(value = "根据运营单位批量建立组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位批量建立组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> createBatchByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
List<HROrgContact> domainlist=hrorgcontactMapping.toDomain(hrorgcontactdtos);
for(HROrgContact domain:domainlist){
domain.setHrorganizationid(hroperationunit_id);
}
hrorgcontactService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrorgcontact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrorgcontactService.get(#hrorgcontact_id),'iBizHumanResources-HROrgContact-Update')")
@ApiOperation(value = "根据运营单位更新组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/{hrorgcontact_id}")
@Transactional
public ResponseEntity<HROrgContactDTO> updateByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain.setHrorganizationid(hroperationunit_id);
domain.setHrorgcontactid(hrorgcontact_id);
hrorgcontactService.update(domain);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgcontactService.getHrorgcontactByEntities(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos)),'iBizHumanResources-HROrgContact-Update')")
@ApiOperation(value = "根据运营单位批量更新组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位批量更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> updateBatchByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
List<HROrgContact> domainlist=hrorgcontactMapping.toDomain(hrorgcontactdtos);
for(HROrgContact domain:domainlist){
domain.setHrorganizationid(hroperationunit_id);
}
hrorgcontactService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrorgcontactService.get(#hrorgcontact_id),'iBizHumanResources-HROrgContact-Remove')")
@ApiOperation(value = "根据运营单位删除组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/{hrorgcontact_id}")
@Transactional
public ResponseEntity<Boolean> removeByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.remove(hrorgcontact_id));
}
@PreAuthorize("hasPermission(this.hrorgcontactService.getHrorgcontactByIds(#ids),'iBizHumanResources-HROrgContact-Remove')")
@ApiOperation(value = "根据运营单位批量删除组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位批量删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> removeBatchByHROperationUnit(@RequestBody List<String> ids) {
hrorgcontactService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(returnObject.body),'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "根据运营单位获取组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位获取组织联系信息")
@RequestMapping(method = RequestMethod.GET, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/{hrorgcontact_id}")
public ResponseEntity<HROrgContactDTO> getByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id) {
HROrgContact domain = hrorgcontactService.get(hrorgcontact_id);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据运营单位获取组织联系信息草稿", tags = {"组织联系信息" }, notes = "根据运营单位获取组织联系信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/getdraft")
public ResponseEntity<HROrgContactDTO> getDraftByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id) {
HROrgContact domain = new HROrgContact();
domain.setHrorganizationid(hroperationunit_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactMapping.toDto(hrorgcontactService.getDraft(domain)));
}
@ApiOperation(value = "根据运营单位检查组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位检查组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/checkkey")
public ResponseEntity<Boolean> checkKeyByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.checkKey(hrorgcontactMapping.toDomain(hrorgcontactdto)));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdto),'iBizHumanResources-HROrgContact-Save')")
@ApiOperation(value = "根据运营单位保存组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/save")
public ResponseEntity<Boolean> saveByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain.setHrorganizationid(hroperationunit_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.save(domain));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos),'iBizHumanResources-HROrgContact-Save')")
@ApiOperation(value = "根据运营单位批量保存组织联系信息", tags = {"组织联系信息" }, notes = "根据运营单位批量保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/{hroperationunit_id}/hrorgcontacts/savebatch")
public ResponseEntity<Boolean> saveBatchByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
List<HROrgContact> domainlist=hrorgcontactMapping.toDomain(hrorgcontactdtos);
for(HROrgContact domain:domainlist){
domain.setHrorganizationid(hroperationunit_id);
}
hrorgcontactService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgContact-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "根据运营单位获取DEFAULT", tags = {"组织联系信息" } ,notes = "根据运营单位获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hroperationunits/{hroperationunit_id}/hrorgcontacts/fetchdefault")
public ResponseEntity<List<HROrgContactDTO>> fetchHROrgContactDefaultByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id,HROrgContactSearchContext context) {
context.setN_hrorganizationid_eq(hroperationunit_id);
Page<HROrgContact> domains = hrorgcontactService.searchDefault(context) ;
List<HROrgContactDTO> list = hrorgcontactMapping.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-HROrgContact-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "根据运营单位查询DEFAULT", tags = {"组织联系信息" } ,notes = "根据运营单位查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hroperationunits/{hroperationunit_id}/hrorgcontacts/searchdefault")
public ResponseEntity<Page<HROrgContactDTO>> searchHROrgContactDefaultByHROperationUnit(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody HROrgContactSearchContext context) {
context.setN_hrorganizationid_eq(hroperationunit_id);
Page<HROrgContact> domains = hrorgcontactService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgcontactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册