提交 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 HRContractResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrcontractMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrcontractMapping.toDomain(#hrcontractdto),'iBizHumanResources-HRContract-Create')")
@ApiOperation(value = "根据员工建立合同信息", tags = {"合同信息" }, notes = "根据员工建立合同信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrcontracts")
@Transactional
public ResponseEntity<HRContractDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRContractDTO hrcontractdto) {
HRContract domain = hrcontractMapping.toDomain(hrcontractdto);
domain.setHremployeeid(hremployee_id);
hrcontractService.create(domain);
HRContractDTO dto = hrcontractMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrcontractMapping.toDomain(#hrcontractdtos),'iBizHumanResources-HRContract-Create')")
@ApiOperation(value = "根据员工批量建立合同信息", tags = {"合同信息" }, notes = "根据员工批量建立合同信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrcontracts/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRContractDTO> hrcontractdtos) {
List<HRContract> domainlist=hrcontractMapping.toDomain(hrcontractdtos);
for(HRContract domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrcontractService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrcontract" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrcontractService.get(#hrcontract_id),'iBizHumanResources-HRContract-Update')")
@ApiOperation(value = "根据员工更新合同信息", tags = {"合同信息" }, notes = "根据员工更新合同信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrcontracts/{hrcontract_id}")
@Transactional
public ResponseEntity<HRContractDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrcontract_id") String hrcontract_id, @RequestBody HRContractDTO hrcontractdto) {
HRContract domain = hrcontractMapping.toDomain(hrcontractdto);
domain.setHremployeeid(hremployee_id);
domain.setHrcontractid(hrcontract_id);
hrcontractService.update(domain);
HRContractDTO dto = hrcontractMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrcontractService.getHrcontractByEntities(this.hrcontractMapping.toDomain(#hrcontractdtos)),'iBizHumanResources-HRContract-Update')")
@ApiOperation(value = "根据员工批量更新合同信息", tags = {"合同信息" }, notes = "根据员工批量更新合同信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrcontracts/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRContractDTO> hrcontractdtos) {
List<HRContract> domainlist=hrcontractMapping.toDomain(hrcontractdtos);
for(HRContract domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrcontractService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrcontractService.get(#hrcontract_id),'iBizHumanResources-HRContract-Remove')")
@ApiOperation(value = "根据员工删除合同信息", tags = {"合同信息" }, notes = "根据员工删除合同信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrcontracts/{hrcontract_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrcontract_id") String hrcontract_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrcontractService.remove(hrcontract_id));
}
@PreAuthorize("hasPermission(this.hrcontractService.getHrcontractByIds(#ids),'iBizHumanResources-HRContract-Remove')")
@ApiOperation(value = "根据员工批量删除合同信息", tags = {"合同信息" }, notes = "根据员工批量删除合同信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrcontracts/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrcontractService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrcontractMapping.toDomain(returnObject.body),'iBizHumanResources-HRContract-Get')")
@ApiOperation(value = "根据员工获取合同信息", tags = {"合同信息" }, notes = "根据员工获取合同信息")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrcontracts/{hrcontract_id}")
public ResponseEntity<HRContractDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrcontract_id") String hrcontract_id) {
HRContract domain = hrcontractService.get(hrcontract_id);
HRContractDTO dto = hrcontractMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取合同信息草稿", tags = {"合同信息" }, notes = "根据员工获取合同信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrcontracts/getdraft")
public ResponseEntity<HRContractDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRContract domain = new HRContract();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrcontractMapping.toDto(hrcontractService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查合同信息", tags = {"合同信息" }, notes = "根据员工检查合同信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrcontracts/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRContractDTO hrcontractdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrcontractService.checkKey(hrcontractMapping.toDomain(hrcontractdto)));
}
@PreAuthorize("hasPermission(this.hrcontractMapping.toDomain(#hrcontractdto),'iBizHumanResources-HRContract-Save')")
@ApiOperation(value = "根据员工保存合同信息", tags = {"合同信息" }, notes = "根据员工保存合同信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrcontracts/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRContractDTO hrcontractdto) {
HRContract domain = hrcontractMapping.toDomain(hrcontractdto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrcontractService.save(domain));
}
@PreAuthorize("hasPermission(this.hrcontractMapping.toDomain(#hrcontractdtos),'iBizHumanResources-HRContract-Save')")
@ApiOperation(value = "根据员工批量保存合同信息", tags = {"合同信息" }, notes = "根据员工批量保存合同信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrcontracts/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRContractDTO> hrcontractdtos) {
List<HRContract> domainlist=hrcontractMapping.toDomain(hrcontractdtos);
for(HRContract domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrcontractService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRContract-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRContract-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"合同信息" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrcontracts/fetchdefault")
public ResponseEntity<List<HRContractDTO>> fetchHRContractDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRContractSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRContract> domains = hrcontractService.searchDefault(context) ;
List<HRContractDTO> list = hrcontractMapping.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-HRContract-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRContract-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"合同信息" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrcontracts/searchdefault")
public ResponseEntity<Page<HRContractDTO>> searchHRContractDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRContractSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRContract> domains = hrcontractService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrcontractMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -161,6 +161,139 @@ public class HRDistributionResource {
.body(new PageImpl(hrdistributionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrdistributionMapping.toDomain(#hrdistributiondto),'iBizHumanResources-HRDistribution-Create')")
@ApiOperation(value = "根据员工建立工作人员分配", tags = {"工作人员分配" }, notes = "根据员工建立工作人员分配")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrdistributions")
@Transactional
public ResponseEntity<HRDistributionDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRDistributionDTO hrdistributiondto) {
HRDistribution domain = hrdistributionMapping.toDomain(hrdistributiondto);
domain.setHremployeeid(hremployee_id);
hrdistributionService.create(domain);
HRDistributionDTO dto = hrdistributionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdistributionMapping.toDomain(#hrdistributiondtos),'iBizHumanResources-HRDistribution-Create')")
@ApiOperation(value = "根据员工批量建立工作人员分配", tags = {"工作人员分配" }, notes = "根据员工批量建立工作人员分配")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrdistributions/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRDistributionDTO> hrdistributiondtos) {
List<HRDistribution> domainlist=hrdistributionMapping.toDomain(hrdistributiondtos);
for(HRDistribution domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrdistributionService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrdistribution" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrdistributionService.get(#hrdistribution_id),'iBizHumanResources-HRDistribution-Update')")
@ApiOperation(value = "根据员工更新工作人员分配", tags = {"工作人员分配" }, notes = "根据员工更新工作人员分配")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrdistributions/{hrdistribution_id}")
@Transactional
public ResponseEntity<HRDistributionDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrdistribution_id") String hrdistribution_id, @RequestBody HRDistributionDTO hrdistributiondto) {
HRDistribution domain = hrdistributionMapping.toDomain(hrdistributiondto);
domain.setHremployeeid(hremployee_id);
domain.setHrdistributionid(hrdistribution_id);
hrdistributionService.update(domain);
HRDistributionDTO dto = hrdistributionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdistributionService.getHrdistributionByEntities(this.hrdistributionMapping.toDomain(#hrdistributiondtos)),'iBizHumanResources-HRDistribution-Update')")
@ApiOperation(value = "根据员工批量更新工作人员分配", tags = {"工作人员分配" }, notes = "根据员工批量更新工作人员分配")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrdistributions/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRDistributionDTO> hrdistributiondtos) {
List<HRDistribution> domainlist=hrdistributionMapping.toDomain(hrdistributiondtos);
for(HRDistribution domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrdistributionService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrdistributionService.get(#hrdistribution_id),'iBizHumanResources-HRDistribution-Remove')")
@ApiOperation(value = "根据员工删除工作人员分配", tags = {"工作人员分配" }, notes = "根据员工删除工作人员分配")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrdistributions/{hrdistribution_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrdistribution_id") String hrdistribution_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrdistributionService.remove(hrdistribution_id));
}
@PreAuthorize("hasPermission(this.hrdistributionService.getHrdistributionByIds(#ids),'iBizHumanResources-HRDistribution-Remove')")
@ApiOperation(value = "根据员工批量删除工作人员分配", tags = {"工作人员分配" }, notes = "根据员工批量删除工作人员分配")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrdistributions/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrdistributionService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrdistributionMapping.toDomain(returnObject.body),'iBizHumanResources-HRDistribution-Get')")
@ApiOperation(value = "根据员工获取工作人员分配", tags = {"工作人员分配" }, notes = "根据员工获取工作人员分配")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrdistributions/{hrdistribution_id}")
public ResponseEntity<HRDistributionDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrdistribution_id") String hrdistribution_id) {
HRDistribution domain = hrdistributionService.get(hrdistribution_id);
HRDistributionDTO dto = hrdistributionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取工作人员分配草稿", tags = {"工作人员分配" }, notes = "根据员工获取工作人员分配草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrdistributions/getdraft")
public ResponseEntity<HRDistributionDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRDistribution domain = new HRDistribution();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrdistributionMapping.toDto(hrdistributionService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查工作人员分配", tags = {"工作人员分配" }, notes = "根据员工检查工作人员分配")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrdistributions/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRDistributionDTO hrdistributiondto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdistributionService.checkKey(hrdistributionMapping.toDomain(hrdistributiondto)));
}
@PreAuthorize("hasPermission(this.hrdistributionMapping.toDomain(#hrdistributiondto),'iBizHumanResources-HRDistribution-Save')")
@ApiOperation(value = "根据员工保存工作人员分配", tags = {"工作人员分配" }, notes = "根据员工保存工作人员分配")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrdistributions/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRDistributionDTO hrdistributiondto) {
HRDistribution domain = hrdistributionMapping.toDomain(hrdistributiondto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrdistributionService.save(domain));
}
@PreAuthorize("hasPermission(this.hrdistributionMapping.toDomain(#hrdistributiondtos),'iBizHumanResources-HRDistribution-Save')")
@ApiOperation(value = "根据员工批量保存工作人员分配", tags = {"工作人员分配" }, notes = "根据员工批量保存工作人员分配")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrdistributions/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRDistributionDTO> hrdistributiondtos) {
List<HRDistribution> domainlist=hrdistributionMapping.toDomain(hrdistributiondtos);
for(HRDistribution domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrdistributionService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRDistribution-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDistribution-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"工作人员分配" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrdistributions/fetchdefault")
public ResponseEntity<List<HRDistributionDTO>> fetchHRDistributionDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRDistributionSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRDistribution> domains = hrdistributionService.searchDefault(context) ;
List<HRDistributionDTO> list = hrdistributionMapping.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-HRDistribution-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDistribution-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"工作人员分配" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrdistributions/searchdefault")
public ResponseEntity<Page<HRDistributionDTO>> searchHRDistributionDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRDistributionSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRDistribution> domains = hrdistributionService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdistributionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrdistributionMapping.toDomain(#hrdistributiondto),'iBizHumanResources-HRDistribution-Create')")
@ApiOperation(value = "根据职位建立工作人员分配", tags = {"工作人员分配" }, notes = "根据职位建立工作人员分配")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrdistributions")
@Transactional
......
......@@ -160,5 +160,138 @@ public class HREducationResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hreducationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hreducationMapping.toDomain(#hreducationdto),'iBizHumanResources-HREducation-Create')")
@ApiOperation(value = "根据员工建立教育信息", tags = {"教育信息" }, notes = "根据员工建立教育信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hreducations")
@Transactional
public ResponseEntity<HREducationDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HREducationDTO hreducationdto) {
HREducation domain = hreducationMapping.toDomain(hreducationdto);
domain.setHremployeeid(hremployee_id);
hreducationService.create(domain);
HREducationDTO dto = hreducationMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hreducationMapping.toDomain(#hreducationdtos),'iBizHumanResources-HREducation-Create')")
@ApiOperation(value = "根据员工批量建立教育信息", tags = {"教育信息" }, notes = "根据员工批量建立教育信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hreducations/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HREducationDTO> hreducationdtos) {
List<HREducation> domainlist=hreducationMapping.toDomain(hreducationdtos);
for(HREducation domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hreducationService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hreducation" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hreducationService.get(#hreducation_id),'iBizHumanResources-HREducation-Update')")
@ApiOperation(value = "根据员工更新教育信息", tags = {"教育信息" }, notes = "根据员工更新教育信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hreducations/{hreducation_id}")
@Transactional
public ResponseEntity<HREducationDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hreducation_id") String hreducation_id, @RequestBody HREducationDTO hreducationdto) {
HREducation domain = hreducationMapping.toDomain(hreducationdto);
domain.setHremployeeid(hremployee_id);
domain.setHreducationid(hreducation_id);
hreducationService.update(domain);
HREducationDTO dto = hreducationMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hreducationService.getHreducationByEntities(this.hreducationMapping.toDomain(#hreducationdtos)),'iBizHumanResources-HREducation-Update')")
@ApiOperation(value = "根据员工批量更新教育信息", tags = {"教育信息" }, notes = "根据员工批量更新教育信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hreducations/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HREducationDTO> hreducationdtos) {
List<HREducation> domainlist=hreducationMapping.toDomain(hreducationdtos);
for(HREducation domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hreducationService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hreducationService.get(#hreducation_id),'iBizHumanResources-HREducation-Remove')")
@ApiOperation(value = "根据员工删除教育信息", tags = {"教育信息" }, notes = "根据员工删除教育信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hreducations/{hreducation_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hreducation_id") String hreducation_id) {
return ResponseEntity.status(HttpStatus.OK).body(hreducationService.remove(hreducation_id));
}
@PreAuthorize("hasPermission(this.hreducationService.getHreducationByIds(#ids),'iBizHumanResources-HREducation-Remove')")
@ApiOperation(value = "根据员工批量删除教育信息", tags = {"教育信息" }, notes = "根据员工批量删除教育信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hreducations/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hreducationService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hreducationMapping.toDomain(returnObject.body),'iBizHumanResources-HREducation-Get')")
@ApiOperation(value = "根据员工获取教育信息", tags = {"教育信息" }, notes = "根据员工获取教育信息")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hreducations/{hreducation_id}")
public ResponseEntity<HREducationDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hreducation_id") String hreducation_id) {
HREducation domain = hreducationService.get(hreducation_id);
HREducationDTO dto = hreducationMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取教育信息草稿", tags = {"教育信息" }, notes = "根据员工获取教育信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hreducations/getdraft")
public ResponseEntity<HREducationDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HREducation domain = new HREducation();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hreducationMapping.toDto(hreducationService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查教育信息", tags = {"教育信息" }, notes = "根据员工检查教育信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hreducations/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HREducationDTO hreducationdto) {
return ResponseEntity.status(HttpStatus.OK).body(hreducationService.checkKey(hreducationMapping.toDomain(hreducationdto)));
}
@PreAuthorize("hasPermission(this.hreducationMapping.toDomain(#hreducationdto),'iBizHumanResources-HREducation-Save')")
@ApiOperation(value = "根据员工保存教育信息", tags = {"教育信息" }, notes = "根据员工保存教育信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hreducations/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HREducationDTO hreducationdto) {
HREducation domain = hreducationMapping.toDomain(hreducationdto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hreducationService.save(domain));
}
@PreAuthorize("hasPermission(this.hreducationMapping.toDomain(#hreducationdtos),'iBizHumanResources-HREducation-Save')")
@ApiOperation(value = "根据员工批量保存教育信息", tags = {"教育信息" }, notes = "根据员工批量保存教育信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hreducations/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HREducationDTO> hreducationdtos) {
List<HREducation> domainlist=hreducationMapping.toDomain(hreducationdtos);
for(HREducation domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hreducationService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HREducation-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HREducation-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"教育信息" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hreducations/fetchdefault")
public ResponseEntity<List<HREducationDTO>> fetchHREducationDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HREducationSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HREducation> domains = hreducationService.searchDefault(context) ;
List<HREducationDTO> list = hreducationMapping.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-HREducation-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HREducation-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"教育信息" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hreducations/searchdefault")
public ResponseEntity<Page<HREducationDTO>> searchHREducationDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HREducationSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HREducation> domains = hreducationService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hreducationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -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()));
}
}
......@@ -160,5 +160,138 @@ public class HRPatentResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrpatentMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrpatentMapping.toDomain(#hrpatentdto),'iBizHumanResources-HRPatent-Create')")
@ApiOperation(value = "根据员工建立专利信息", tags = {"专利信息" }, notes = "根据员工建立专利信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpatents")
@Transactional
public ResponseEntity<HRPatentDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRPatentDTO hrpatentdto) {
HRPatent domain = hrpatentMapping.toDomain(hrpatentdto);
domain.setHremployeeid(hremployee_id);
hrpatentService.create(domain);
HRPatentDTO dto = hrpatentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpatentMapping.toDomain(#hrpatentdtos),'iBizHumanResources-HRPatent-Create')")
@ApiOperation(value = "根据员工批量建立专利信息", tags = {"专利信息" }, notes = "根据员工批量建立专利信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpatents/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRPatentDTO> hrpatentdtos) {
List<HRPatent> domainlist=hrpatentMapping.toDomain(hrpatentdtos);
for(HRPatent domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrpatentService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrpatent" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrpatentService.get(#hrpatent_id),'iBizHumanResources-HRPatent-Update')")
@ApiOperation(value = "根据员工更新专利信息", tags = {"专利信息" }, notes = "根据员工更新专利信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrpatents/{hrpatent_id}")
@Transactional
public ResponseEntity<HRPatentDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrpatent_id") String hrpatent_id, @RequestBody HRPatentDTO hrpatentdto) {
HRPatent domain = hrpatentMapping.toDomain(hrpatentdto);
domain.setHremployeeid(hremployee_id);
domain.setHrpatentid(hrpatent_id);
hrpatentService.update(domain);
HRPatentDTO dto = hrpatentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpatentService.getHrpatentByEntities(this.hrpatentMapping.toDomain(#hrpatentdtos)),'iBizHumanResources-HRPatent-Update')")
@ApiOperation(value = "根据员工批量更新专利信息", tags = {"专利信息" }, notes = "根据员工批量更新专利信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrpatents/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRPatentDTO> hrpatentdtos) {
List<HRPatent> domainlist=hrpatentMapping.toDomain(hrpatentdtos);
for(HRPatent domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrpatentService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrpatentService.get(#hrpatent_id),'iBizHumanResources-HRPatent-Remove')")
@ApiOperation(value = "根据员工删除专利信息", tags = {"专利信息" }, notes = "根据员工删除专利信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrpatents/{hrpatent_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrpatent_id") String hrpatent_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrpatentService.remove(hrpatent_id));
}
@PreAuthorize("hasPermission(this.hrpatentService.getHrpatentByIds(#ids),'iBizHumanResources-HRPatent-Remove')")
@ApiOperation(value = "根据员工批量删除专利信息", tags = {"专利信息" }, notes = "根据员工批量删除专利信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrpatents/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrpatentService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrpatentMapping.toDomain(returnObject.body),'iBizHumanResources-HRPatent-Get')")
@ApiOperation(value = "根据员工获取专利信息", tags = {"专利信息" }, notes = "根据员工获取专利信息")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrpatents/{hrpatent_id}")
public ResponseEntity<HRPatentDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrpatent_id") String hrpatent_id) {
HRPatent domain = hrpatentService.get(hrpatent_id);
HRPatentDTO dto = hrpatentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取专利信息草稿", tags = {"专利信息" }, notes = "根据员工获取专利信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrpatents/getdraft")
public ResponseEntity<HRPatentDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRPatent domain = new HRPatent();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrpatentMapping.toDto(hrpatentService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查专利信息", tags = {"专利信息" }, notes = "根据员工检查专利信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpatents/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRPatentDTO hrpatentdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrpatentService.checkKey(hrpatentMapping.toDomain(hrpatentdto)));
}
@PreAuthorize("hasPermission(this.hrpatentMapping.toDomain(#hrpatentdto),'iBizHumanResources-HRPatent-Save')")
@ApiOperation(value = "根据员工保存专利信息", tags = {"专利信息" }, notes = "根据员工保存专利信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpatents/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRPatentDTO hrpatentdto) {
HRPatent domain = hrpatentMapping.toDomain(hrpatentdto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrpatentService.save(domain));
}
@PreAuthorize("hasPermission(this.hrpatentMapping.toDomain(#hrpatentdtos),'iBizHumanResources-HRPatent-Save')")
@ApiOperation(value = "根据员工批量保存专利信息", tags = {"专利信息" }, notes = "根据员工批量保存专利信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrpatents/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRPatentDTO> hrpatentdtos) {
List<HRPatent> domainlist=hrpatentMapping.toDomain(hrpatentdtos);
for(HRPatent domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrpatentService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRPatent-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPatent-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"专利信息" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrpatents/fetchdefault")
public ResponseEntity<List<HRPatentDTO>> fetchHRPatentDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRPatentSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRPatent> domains = hrpatentService.searchDefault(context) ;
List<HRPatentDTO> list = hrpatentMapping.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-HRPatent-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPatent-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"专利信息" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrpatents/searchdefault")
public ResponseEntity<Page<HRPatentDTO>> searchHRPatentDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRPatentSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRPatent> domains = hrpatentService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrpatentMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -160,5 +160,138 @@ public class HRResearchResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrresearchMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrresearchMapping.toDomain(#hrresearchdto),'iBizHumanResources-HRResearch-Create')")
@ApiOperation(value = "根据员工建立科研成果", tags = {"科研成果" }, notes = "根据员工建立科研成果")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrresearches")
@Transactional
public ResponseEntity<HRResearchDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRResearchDTO hrresearchdto) {
HRResearch domain = hrresearchMapping.toDomain(hrresearchdto);
domain.setHremployeeid(hremployee_id);
hrresearchService.create(domain);
HRResearchDTO dto = hrresearchMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrresearchMapping.toDomain(#hrresearchdtos),'iBizHumanResources-HRResearch-Create')")
@ApiOperation(value = "根据员工批量建立科研成果", tags = {"科研成果" }, notes = "根据员工批量建立科研成果")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrresearches/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRResearchDTO> hrresearchdtos) {
List<HRResearch> domainlist=hrresearchMapping.toDomain(hrresearchdtos);
for(HRResearch domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrresearchService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrresearch" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrresearchService.get(#hrresearch_id),'iBizHumanResources-HRResearch-Update')")
@ApiOperation(value = "根据员工更新科研成果", tags = {"科研成果" }, notes = "根据员工更新科研成果")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrresearches/{hrresearch_id}")
@Transactional
public ResponseEntity<HRResearchDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrresearch_id") String hrresearch_id, @RequestBody HRResearchDTO hrresearchdto) {
HRResearch domain = hrresearchMapping.toDomain(hrresearchdto);
domain.setHremployeeid(hremployee_id);
domain.setHrresearchid(hrresearch_id);
hrresearchService.update(domain);
HRResearchDTO dto = hrresearchMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrresearchService.getHrresearchByEntities(this.hrresearchMapping.toDomain(#hrresearchdtos)),'iBizHumanResources-HRResearch-Update')")
@ApiOperation(value = "根据员工批量更新科研成果", tags = {"科研成果" }, notes = "根据员工批量更新科研成果")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrresearches/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRResearchDTO> hrresearchdtos) {
List<HRResearch> domainlist=hrresearchMapping.toDomain(hrresearchdtos);
for(HRResearch domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrresearchService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrresearchService.get(#hrresearch_id),'iBizHumanResources-HRResearch-Remove')")
@ApiOperation(value = "根据员工删除科研成果", tags = {"科研成果" }, notes = "根据员工删除科研成果")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrresearches/{hrresearch_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrresearch_id") String hrresearch_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrresearchService.remove(hrresearch_id));
}
@PreAuthorize("hasPermission(this.hrresearchService.getHrresearchByIds(#ids),'iBizHumanResources-HRResearch-Remove')")
@ApiOperation(value = "根据员工批量删除科研成果", tags = {"科研成果" }, notes = "根据员工批量删除科研成果")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrresearches/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrresearchService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrresearchMapping.toDomain(returnObject.body),'iBizHumanResources-HRResearch-Get')")
@ApiOperation(value = "根据员工获取科研成果", tags = {"科研成果" }, notes = "根据员工获取科研成果")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrresearches/{hrresearch_id}")
public ResponseEntity<HRResearchDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrresearch_id") String hrresearch_id) {
HRResearch domain = hrresearchService.get(hrresearch_id);
HRResearchDTO dto = hrresearchMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取科研成果草稿", tags = {"科研成果" }, notes = "根据员工获取科研成果草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrresearches/getdraft")
public ResponseEntity<HRResearchDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRResearch domain = new HRResearch();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrresearchMapping.toDto(hrresearchService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查科研成果", tags = {"科研成果" }, notes = "根据员工检查科研成果")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrresearches/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRResearchDTO hrresearchdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrresearchService.checkKey(hrresearchMapping.toDomain(hrresearchdto)));
}
@PreAuthorize("hasPermission(this.hrresearchMapping.toDomain(#hrresearchdto),'iBizHumanResources-HRResearch-Save')")
@ApiOperation(value = "根据员工保存科研成果", tags = {"科研成果" }, notes = "根据员工保存科研成果")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrresearches/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRResearchDTO hrresearchdto) {
HRResearch domain = hrresearchMapping.toDomain(hrresearchdto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrresearchService.save(domain));
}
@PreAuthorize("hasPermission(this.hrresearchMapping.toDomain(#hrresearchdtos),'iBizHumanResources-HRResearch-Save')")
@ApiOperation(value = "根据员工批量保存科研成果", tags = {"科研成果" }, notes = "根据员工批量保存科研成果")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrresearches/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRResearchDTO> hrresearchdtos) {
List<HRResearch> domainlist=hrresearchMapping.toDomain(hrresearchdtos);
for(HRResearch domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrresearchService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRResearch-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRResearch-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"科研成果" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrresearches/fetchdefault")
public ResponseEntity<List<HRResearchDTO>> fetchHRResearchDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRResearchSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRResearch> domains = hrresearchService.searchDefault(context) ;
List<HRResearchDTO> list = hrresearchMapping.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-HRResearch-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRResearch-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"科研成果" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrresearches/searchdefault")
public ResponseEntity<Page<HRResearchDTO>> searchHRResearchDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRResearchSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRResearch> domains = hrresearchService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrresearchMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -160,5 +160,138 @@ public class HRRewardResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrrewardMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrrewardMapping.toDomain(#hrrewarddto),'iBizHumanResources-HRReward-Create')")
@ApiOperation(value = "根据员工建立奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工建立奖励惩罚")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrrewards")
@Transactional
public ResponseEntity<HRRewardDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRRewardDTO hrrewarddto) {
HRReward domain = hrrewardMapping.toDomain(hrrewarddto);
domain.setHremployeeid(hremployee_id);
hrrewardService.create(domain);
HRRewardDTO dto = hrrewardMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrrewardMapping.toDomain(#hrrewarddtos),'iBizHumanResources-HRReward-Create')")
@ApiOperation(value = "根据员工批量建立奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工批量建立奖励惩罚")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrrewards/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRRewardDTO> hrrewarddtos) {
List<HRReward> domainlist=hrrewardMapping.toDomain(hrrewarddtos);
for(HRReward domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrrewardService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrreward" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrrewardService.get(#hrreward_id),'iBizHumanResources-HRReward-Update')")
@ApiOperation(value = "根据员工更新奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工更新奖励惩罚")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrrewards/{hrreward_id}")
@Transactional
public ResponseEntity<HRRewardDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrreward_id") String hrreward_id, @RequestBody HRRewardDTO hrrewarddto) {
HRReward domain = hrrewardMapping.toDomain(hrrewarddto);
domain.setHremployeeid(hremployee_id);
domain.setHrrewardid(hrreward_id);
hrrewardService.update(domain);
HRRewardDTO dto = hrrewardMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrrewardService.getHrrewardByEntities(this.hrrewardMapping.toDomain(#hrrewarddtos)),'iBizHumanResources-HRReward-Update')")
@ApiOperation(value = "根据员工批量更新奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工批量更新奖励惩罚")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrrewards/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRRewardDTO> hrrewarddtos) {
List<HRReward> domainlist=hrrewardMapping.toDomain(hrrewarddtos);
for(HRReward domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrrewardService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrrewardService.get(#hrreward_id),'iBizHumanResources-HRReward-Remove')")
@ApiOperation(value = "根据员工删除奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工删除奖励惩罚")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrrewards/{hrreward_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrreward_id") String hrreward_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrrewardService.remove(hrreward_id));
}
@PreAuthorize("hasPermission(this.hrrewardService.getHrrewardByIds(#ids),'iBizHumanResources-HRReward-Remove')")
@ApiOperation(value = "根据员工批量删除奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工批量删除奖励惩罚")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrrewards/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrrewardService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrrewardMapping.toDomain(returnObject.body),'iBizHumanResources-HRReward-Get')")
@ApiOperation(value = "根据员工获取奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工获取奖励惩罚")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrrewards/{hrreward_id}")
public ResponseEntity<HRRewardDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrreward_id") String hrreward_id) {
HRReward domain = hrrewardService.get(hrreward_id);
HRRewardDTO dto = hrrewardMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取奖励惩罚草稿", tags = {"奖励惩罚" }, notes = "根据员工获取奖励惩罚草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrrewards/getdraft")
public ResponseEntity<HRRewardDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRReward domain = new HRReward();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrrewardMapping.toDto(hrrewardService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工检查奖励惩罚")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrrewards/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRRewardDTO hrrewarddto) {
return ResponseEntity.status(HttpStatus.OK).body(hrrewardService.checkKey(hrrewardMapping.toDomain(hrrewarddto)));
}
@PreAuthorize("hasPermission(this.hrrewardMapping.toDomain(#hrrewarddto),'iBizHumanResources-HRReward-Save')")
@ApiOperation(value = "根据员工保存奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工保存奖励惩罚")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrrewards/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRRewardDTO hrrewarddto) {
HRReward domain = hrrewardMapping.toDomain(hrrewarddto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrrewardService.save(domain));
}
@PreAuthorize("hasPermission(this.hrrewardMapping.toDomain(#hrrewarddtos),'iBizHumanResources-HRReward-Save')")
@ApiOperation(value = "根据员工批量保存奖励惩罚", tags = {"奖励惩罚" }, notes = "根据员工批量保存奖励惩罚")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrrewards/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRRewardDTO> hrrewarddtos) {
List<HRReward> domainlist=hrrewardMapping.toDomain(hrrewarddtos);
for(HRReward domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrrewardService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRReward-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRReward-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"奖励惩罚" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrrewards/fetchdefault")
public ResponseEntity<List<HRRewardDTO>> fetchHRRewardDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRRewardSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRReward> domains = hrrewardService.searchDefault(context) ;
List<HRRewardDTO> list = hrrewardMapping.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-HRReward-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRReward-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"奖励惩罚" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrrewards/searchdefault")
public ResponseEntity<Page<HRRewardDTO>> searchHRRewardDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRRewardSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRReward> domains = hrrewardService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrrewardMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -160,5 +160,138 @@ public class HRTechnicalTitleResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrtechnicaltitleMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrtechnicaltitleMapping.toDomain(#hrtechnicaltitledto),'iBizHumanResources-HRTechnicalTitle-Create')")
@ApiOperation(value = "根据员工建立职称信息", tags = {"职称信息" }, notes = "根据员工建立职称信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtechnicaltitles")
@Transactional
public ResponseEntity<HRTechnicalTitleDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTechnicalTitleDTO hrtechnicaltitledto) {
HRTechnicalTitle domain = hrtechnicaltitleMapping.toDomain(hrtechnicaltitledto);
domain.setHremployeeid(hremployee_id);
hrtechnicaltitleService.create(domain);
HRTechnicalTitleDTO dto = hrtechnicaltitleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtechnicaltitleMapping.toDomain(#hrtechnicaltitledtos),'iBizHumanResources-HRTechnicalTitle-Create')")
@ApiOperation(value = "根据员工批量建立职称信息", tags = {"职称信息" }, notes = "根据员工批量建立职称信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRTechnicalTitleDTO> hrtechnicaltitledtos) {
List<HRTechnicalTitle> domainlist=hrtechnicaltitleMapping.toDomain(hrtechnicaltitledtos);
for(HRTechnicalTitle domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrtechnicaltitleService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrtechnicaltitle" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrtechnicaltitleService.get(#hrtechnicaltitle_id),'iBizHumanResources-HRTechnicalTitle-Update')")
@ApiOperation(value = "根据员工更新职称信息", tags = {"职称信息" }, notes = "根据员工更新职称信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/{hrtechnicaltitle_id}")
@Transactional
public ResponseEntity<HRTechnicalTitleDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrtechnicaltitle_id") String hrtechnicaltitle_id, @RequestBody HRTechnicalTitleDTO hrtechnicaltitledto) {
HRTechnicalTitle domain = hrtechnicaltitleMapping.toDomain(hrtechnicaltitledto);
domain.setHremployeeid(hremployee_id);
domain.setHrtechnicaltitleid(hrtechnicaltitle_id);
hrtechnicaltitleService.update(domain);
HRTechnicalTitleDTO dto = hrtechnicaltitleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtechnicaltitleService.getHrtechnicaltitleByEntities(this.hrtechnicaltitleMapping.toDomain(#hrtechnicaltitledtos)),'iBizHumanResources-HRTechnicalTitle-Update')")
@ApiOperation(value = "根据员工批量更新职称信息", tags = {"职称信息" }, notes = "根据员工批量更新职称信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRTechnicalTitleDTO> hrtechnicaltitledtos) {
List<HRTechnicalTitle> domainlist=hrtechnicaltitleMapping.toDomain(hrtechnicaltitledtos);
for(HRTechnicalTitle domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrtechnicaltitleService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrtechnicaltitleService.get(#hrtechnicaltitle_id),'iBizHumanResources-HRTechnicalTitle-Remove')")
@ApiOperation(value = "根据员工删除职称信息", tags = {"职称信息" }, notes = "根据员工删除职称信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/{hrtechnicaltitle_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrtechnicaltitle_id") String hrtechnicaltitle_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrtechnicaltitleService.remove(hrtechnicaltitle_id));
}
@PreAuthorize("hasPermission(this.hrtechnicaltitleService.getHrtechnicaltitleByIds(#ids),'iBizHumanResources-HRTechnicalTitle-Remove')")
@ApiOperation(value = "根据员工批量删除职称信息", tags = {"职称信息" }, notes = "根据员工批量删除职称信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrtechnicaltitleService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrtechnicaltitleMapping.toDomain(returnObject.body),'iBizHumanResources-HRTechnicalTitle-Get')")
@ApiOperation(value = "根据员工获取职称信息", tags = {"职称信息" }, notes = "根据员工获取职称信息")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/{hrtechnicaltitle_id}")
public ResponseEntity<HRTechnicalTitleDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrtechnicaltitle_id") String hrtechnicaltitle_id) {
HRTechnicalTitle domain = hrtechnicaltitleService.get(hrtechnicaltitle_id);
HRTechnicalTitleDTO dto = hrtechnicaltitleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取职称信息草稿", tags = {"职称信息" }, notes = "根据员工获取职称信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/getdraft")
public ResponseEntity<HRTechnicalTitleDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRTechnicalTitle domain = new HRTechnicalTitle();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtechnicaltitleMapping.toDto(hrtechnicaltitleService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查职称信息", tags = {"职称信息" }, notes = "根据员工检查职称信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTechnicalTitleDTO hrtechnicaltitledto) {
return ResponseEntity.status(HttpStatus.OK).body(hrtechnicaltitleService.checkKey(hrtechnicaltitleMapping.toDomain(hrtechnicaltitledto)));
}
@PreAuthorize("hasPermission(this.hrtechnicaltitleMapping.toDomain(#hrtechnicaltitledto),'iBizHumanResources-HRTechnicalTitle-Save')")
@ApiOperation(value = "根据员工保存职称信息", tags = {"职称信息" }, notes = "根据员工保存职称信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTechnicalTitleDTO hrtechnicaltitledto) {
HRTechnicalTitle domain = hrtechnicaltitleMapping.toDomain(hrtechnicaltitledto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtechnicaltitleService.save(domain));
}
@PreAuthorize("hasPermission(this.hrtechnicaltitleMapping.toDomain(#hrtechnicaltitledtos),'iBizHumanResources-HRTechnicalTitle-Save')")
@ApiOperation(value = "根据员工批量保存职称信息", tags = {"职称信息" }, notes = "根据员工批量保存职称信息")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtechnicaltitles/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRTechnicalTitleDTO> hrtechnicaltitledtos) {
List<HRTechnicalTitle> domainlist=hrtechnicaltitleMapping.toDomain(hrtechnicaltitledtos);
for(HRTechnicalTitle domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrtechnicaltitleService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRTechnicalTitle-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTechnicalTitle-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"职称信息" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrtechnicaltitles/fetchdefault")
public ResponseEntity<List<HRTechnicalTitleDTO>> fetchHRTechnicalTitleDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRTechnicalTitleSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRTechnicalTitle> domains = hrtechnicaltitleService.searchDefault(context) ;
List<HRTechnicalTitleDTO> list = hrtechnicaltitleMapping.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-HRTechnicalTitle-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTechnicalTitle-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"职称信息" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrtechnicaltitles/searchdefault")
public ResponseEntity<Page<HRTechnicalTitleDTO>> searchHRTechnicalTitleDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTechnicalTitleSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRTechnicalTitle> domains = hrtechnicaltitleService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrtechnicaltitleMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -160,5 +160,138 @@ public class HRTrainingRecordResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrtrainingrecordMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrtrainingrecordMapping.toDomain(#hrtrainingrecorddto),'iBizHumanResources-HRTrainingRecord-Create')")
@ApiOperation(value = "根据员工建立培训记录", tags = {"培训记录" }, notes = "根据员工建立培训记录")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtrainingrecords")
@Transactional
public ResponseEntity<HRTrainingRecordDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTrainingRecordDTO hrtrainingrecorddto) {
HRTrainingRecord domain = hrtrainingrecordMapping.toDomain(hrtrainingrecorddto);
domain.setHremployeeid(hremployee_id);
hrtrainingrecordService.create(domain);
HRTrainingRecordDTO dto = hrtrainingrecordMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtrainingrecordMapping.toDomain(#hrtrainingrecorddtos),'iBizHumanResources-HRTrainingRecord-Create')")
@ApiOperation(value = "根据员工批量建立培训记录", tags = {"培训记录" }, notes = "根据员工批量建立培训记录")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtrainingrecords/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRTrainingRecordDTO> hrtrainingrecorddtos) {
List<HRTrainingRecord> domainlist=hrtrainingrecordMapping.toDomain(hrtrainingrecorddtos);
for(HRTrainingRecord domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrtrainingrecordService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrtrainingrecord" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrtrainingrecordService.get(#hrtrainingrecord_id),'iBizHumanResources-HRTrainingRecord-Update')")
@ApiOperation(value = "根据员工更新培训记录", tags = {"培训记录" }, notes = "根据员工更新培训记录")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrtrainingrecords/{hrtrainingrecord_id}")
@Transactional
public ResponseEntity<HRTrainingRecordDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrtrainingrecord_id") String hrtrainingrecord_id, @RequestBody HRTrainingRecordDTO hrtrainingrecorddto) {
HRTrainingRecord domain = hrtrainingrecordMapping.toDomain(hrtrainingrecorddto);
domain.setHremployeeid(hremployee_id);
domain.setHrtrainingrecordid(hrtrainingrecord_id);
hrtrainingrecordService.update(domain);
HRTrainingRecordDTO dto = hrtrainingrecordMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtrainingrecordService.getHrtrainingrecordByEntities(this.hrtrainingrecordMapping.toDomain(#hrtrainingrecorddtos)),'iBizHumanResources-HRTrainingRecord-Update')")
@ApiOperation(value = "根据员工批量更新培训记录", tags = {"培训记录" }, notes = "根据员工批量更新培训记录")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrtrainingrecords/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRTrainingRecordDTO> hrtrainingrecorddtos) {
List<HRTrainingRecord> domainlist=hrtrainingrecordMapping.toDomain(hrtrainingrecorddtos);
for(HRTrainingRecord domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrtrainingrecordService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrtrainingrecordService.get(#hrtrainingrecord_id),'iBizHumanResources-HRTrainingRecord-Remove')")
@ApiOperation(value = "根据员工删除培训记录", tags = {"培训记录" }, notes = "根据员工删除培训记录")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrtrainingrecords/{hrtrainingrecord_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrtrainingrecord_id") String hrtrainingrecord_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrtrainingrecordService.remove(hrtrainingrecord_id));
}
@PreAuthorize("hasPermission(this.hrtrainingrecordService.getHrtrainingrecordByIds(#ids),'iBizHumanResources-HRTrainingRecord-Remove')")
@ApiOperation(value = "根据员工批量删除培训记录", tags = {"培训记录" }, notes = "根据员工批量删除培训记录")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrtrainingrecords/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrtrainingrecordService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrtrainingrecordMapping.toDomain(returnObject.body),'iBizHumanResources-HRTrainingRecord-Get')")
@ApiOperation(value = "根据员工获取培训记录", tags = {"培训记录" }, notes = "根据员工获取培训记录")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrtrainingrecords/{hrtrainingrecord_id}")
public ResponseEntity<HRTrainingRecordDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrtrainingrecord_id") String hrtrainingrecord_id) {
HRTrainingRecord domain = hrtrainingrecordService.get(hrtrainingrecord_id);
HRTrainingRecordDTO dto = hrtrainingrecordMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取培训记录草稿", tags = {"培训记录" }, notes = "根据员工获取培训记录草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrtrainingrecords/getdraft")
public ResponseEntity<HRTrainingRecordDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRTrainingRecord domain = new HRTrainingRecord();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtrainingrecordMapping.toDto(hrtrainingrecordService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查培训记录", tags = {"培训记录" }, notes = "根据员工检查培训记录")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtrainingrecords/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTrainingRecordDTO hrtrainingrecorddto) {
return ResponseEntity.status(HttpStatus.OK).body(hrtrainingrecordService.checkKey(hrtrainingrecordMapping.toDomain(hrtrainingrecorddto)));
}
@PreAuthorize("hasPermission(this.hrtrainingrecordMapping.toDomain(#hrtrainingrecorddto),'iBizHumanResources-HRTrainingRecord-Save')")
@ApiOperation(value = "根据员工保存培训记录", tags = {"培训记录" }, notes = "根据员工保存培训记录")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtrainingrecords/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTrainingRecordDTO hrtrainingrecorddto) {
HRTrainingRecord domain = hrtrainingrecordMapping.toDomain(hrtrainingrecorddto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtrainingrecordService.save(domain));
}
@PreAuthorize("hasPermission(this.hrtrainingrecordMapping.toDomain(#hrtrainingrecorddtos),'iBizHumanResources-HRTrainingRecord-Save')")
@ApiOperation(value = "根据员工批量保存培训记录", tags = {"培训记录" }, notes = "根据员工批量保存培训记录")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtrainingrecords/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRTrainingRecordDTO> hrtrainingrecorddtos) {
List<HRTrainingRecord> domainlist=hrtrainingrecordMapping.toDomain(hrtrainingrecorddtos);
for(HRTrainingRecord domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrtrainingrecordService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRTrainingRecord-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTrainingRecord-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"培训记录" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrtrainingrecords/fetchdefault")
public ResponseEntity<List<HRTrainingRecordDTO>> fetchHRTrainingRecordDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRTrainingRecordSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRTrainingRecord> domains = hrtrainingrecordService.searchDefault(context) ;
List<HRTrainingRecordDTO> list = hrtrainingrecordMapping.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-HRTrainingRecord-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTrainingRecord-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"培训记录" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrtrainingrecords/searchdefault")
public ResponseEntity<Page<HRTrainingRecordDTO>> searchHRTrainingRecordDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTrainingRecordSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRTrainingRecord> domains = hrtrainingrecordService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrtrainingrecordMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -160,5 +160,138 @@ public class HRWorkRecordResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrworkrecordMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrworkrecordMapping.toDomain(#hrworkrecorddto),'iBizHumanResources-HRWorkRecord-Create')")
@ApiOperation(value = "根据员工建立工作履历", tags = {"工作履历" }, notes = "根据员工建立工作履历")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrworkrecords")
@Transactional
public ResponseEntity<HRWorkRecordDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRWorkRecordDTO hrworkrecorddto) {
HRWorkRecord domain = hrworkrecordMapping.toDomain(hrworkrecorddto);
domain.setHremployeeid(hremployee_id);
hrworkrecordService.create(domain);
HRWorkRecordDTO dto = hrworkrecordMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrworkrecordMapping.toDomain(#hrworkrecorddtos),'iBizHumanResources-HRWorkRecord-Create')")
@ApiOperation(value = "根据员工批量建立工作履历", tags = {"工作履历" }, notes = "根据员工批量建立工作履历")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrworkrecords/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRWorkRecordDTO> hrworkrecorddtos) {
List<HRWorkRecord> domainlist=hrworkrecordMapping.toDomain(hrworkrecorddtos);
for(HRWorkRecord domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrworkrecordService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrworkrecord" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrworkrecordService.get(#hrworkrecord_id),'iBizHumanResources-HRWorkRecord-Update')")
@ApiOperation(value = "根据员工更新工作履历", tags = {"工作履历" }, notes = "根据员工更新工作履历")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrworkrecords/{hrworkrecord_id}")
@Transactional
public ResponseEntity<HRWorkRecordDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrworkrecord_id") String hrworkrecord_id, @RequestBody HRWorkRecordDTO hrworkrecorddto) {
HRWorkRecord domain = hrworkrecordMapping.toDomain(hrworkrecorddto);
domain.setHremployeeid(hremployee_id);
domain.setHrworkrecordid(hrworkrecord_id);
hrworkrecordService.update(domain);
HRWorkRecordDTO dto = hrworkrecordMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrworkrecordService.getHrworkrecordByEntities(this.hrworkrecordMapping.toDomain(#hrworkrecorddtos)),'iBizHumanResources-HRWorkRecord-Update')")
@ApiOperation(value = "根据员工批量更新工作履历", tags = {"工作履历" }, notes = "根据员工批量更新工作履历")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrworkrecords/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRWorkRecordDTO> hrworkrecorddtos) {
List<HRWorkRecord> domainlist=hrworkrecordMapping.toDomain(hrworkrecorddtos);
for(HRWorkRecord domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrworkrecordService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrworkrecordService.get(#hrworkrecord_id),'iBizHumanResources-HRWorkRecord-Remove')")
@ApiOperation(value = "根据员工删除工作履历", tags = {"工作履历" }, notes = "根据员工删除工作履历")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrworkrecords/{hrworkrecord_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrworkrecord_id") String hrworkrecord_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrworkrecordService.remove(hrworkrecord_id));
}
@PreAuthorize("hasPermission(this.hrworkrecordService.getHrworkrecordByIds(#ids),'iBizHumanResources-HRWorkRecord-Remove')")
@ApiOperation(value = "根据员工批量删除工作履历", tags = {"工作履历" }, notes = "根据员工批量删除工作履历")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrworkrecords/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrworkrecordService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrworkrecordMapping.toDomain(returnObject.body),'iBizHumanResources-HRWorkRecord-Get')")
@ApiOperation(value = "根据员工获取工作履历", tags = {"工作履历" }, notes = "根据员工获取工作履历")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrworkrecords/{hrworkrecord_id}")
public ResponseEntity<HRWorkRecordDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrworkrecord_id") String hrworkrecord_id) {
HRWorkRecord domain = hrworkrecordService.get(hrworkrecord_id);
HRWorkRecordDTO dto = hrworkrecordMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取工作履历草稿", tags = {"工作履历" }, notes = "根据员工获取工作履历草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrworkrecords/getdraft")
public ResponseEntity<HRWorkRecordDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRWorkRecord domain = new HRWorkRecord();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrworkrecordMapping.toDto(hrworkrecordService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查工作履历", tags = {"工作履历" }, notes = "根据员工检查工作履历")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrworkrecords/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRWorkRecordDTO hrworkrecorddto) {
return ResponseEntity.status(HttpStatus.OK).body(hrworkrecordService.checkKey(hrworkrecordMapping.toDomain(hrworkrecorddto)));
}
@PreAuthorize("hasPermission(this.hrworkrecordMapping.toDomain(#hrworkrecorddto),'iBizHumanResources-HRWorkRecord-Save')")
@ApiOperation(value = "根据员工保存工作履历", tags = {"工作履历" }, notes = "根据员工保存工作履历")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrworkrecords/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRWorkRecordDTO hrworkrecorddto) {
HRWorkRecord domain = hrworkrecordMapping.toDomain(hrworkrecorddto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrworkrecordService.save(domain));
}
@PreAuthorize("hasPermission(this.hrworkrecordMapping.toDomain(#hrworkrecorddtos),'iBizHumanResources-HRWorkRecord-Save')")
@ApiOperation(value = "根据员工批量保存工作履历", tags = {"工作履历" }, notes = "根据员工批量保存工作履历")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrworkrecords/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRWorkRecordDTO> hrworkrecorddtos) {
List<HRWorkRecord> domainlist=hrworkrecordMapping.toDomain(hrworkrecorddtos);
for(HRWorkRecord domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrworkrecordService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRWorkRecord-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRWorkRecord-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"工作履历" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrworkrecords/fetchdefault")
public ResponseEntity<List<HRWorkRecordDTO>> fetchHRWorkRecordDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRWorkRecordSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRWorkRecord> domains = hrworkrecordService.searchDefault(context) ;
List<HRWorkRecordDTO> list = hrworkrecordMapping.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-HRWorkRecord-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRWorkRecord-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"工作履历" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrworkrecords/searchdefault")
public ResponseEntity<Page<HRWorkRecordDTO>> searchHRWorkRecordDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRWorkRecordSearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRWorkRecord> domains = hrworkrecordService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrworkrecordMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册