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

jackwang 部署微服务接口

上级 a64c3b43
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
git clone -b master $para2 ibizhumanresources/ git clone -b master $para2 ibizhumanresources/
export NODE_OPTIONS=--max-old-space-size=4096 export NODE_OPTIONS=--max-old-space-size=4096
cd ibizhumanresources/ cd ibizhumanresources/
mvn clean package -Ppim mvn clean package -Phrapi
cd humanresource-app/humanresource-app-pim cd humanresource-provider/humanresource-provider-hrapi
mvn -Ppim docker:build mvn -Phrapi docker:build
mvn -Ppim docker:push mvn -Phrapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-app-pim.yaml iBizEE --with-registry-auth docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-provider-hrapi.yaml iBizEE --with-registry-auth
</command> </command>
</hudson.tasks.Shell> </hudson.tasks.Shell>
</builders> </builders>
......
...@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \ ...@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \ sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /humanresource-app-pim.jar 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 ADD humanresource-app-pim.jar /humanresource-app-pim.jar
...@@ -3,25 +3,9 @@ services: ...@@ -3,25 +3,9 @@ services:
humanresource-app-pim: humanresource-app-pim:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-app-pim:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-app-pim:latest
ports: ports:
- "10327:10327" - "8080:8080"
networks: networks:
- agent_network - 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: deploy:
resources: resources:
limits: limits:
......
...@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \ ...@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \ sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /humanresource-provider-hrapi.jar 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 ADD humanresource-provider-hrapi.jar /humanresource-provider-hrapi.jar
...@@ -3,9 +3,25 @@ services: ...@@ -3,9 +3,25 @@ services:
humanresource-provider-hrapi: humanresource-provider-hrapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-provider-hrapi:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-provider-hrapi:latest
ports: ports:
- "8081:8081" - "10317:10317"
networks: networks:
- agent_network - 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: deploy:
resources: resources:
limits: limits:
......
...@@ -160,5 +160,138 @@ public class HRDutyCertResource { ...@@ -160,5 +160,138 @@ public class HRDutyCertResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdutycertMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(hrdutycertMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasPermission(this.hrdutycertMapping.toDomain(#hrdutycertdto),'iBizHumanResources-HRDutyCert-Create')")
@ApiOperation(value = "根据职务建立职务证书", tags = {"职务证书" }, notes = "根据职务建立职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutycerts")
@Transactional
public ResponseEntity<HRDutyCertDTO> createByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody HRDutyCertDTO hrdutycertdto) {
HRDutyCert domain = hrdutycertMapping.toDomain(hrdutycertdto);
domain.setHrdutyid(hrduty_id);
hrdutycertService.create(domain);
HRDutyCertDTO dto = hrdutycertMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutycertMapping.toDomain(#hrdutycertdtos),'iBizHumanResources-HRDutyCert-Create')")
@ApiOperation(value = "根据职务批量建立职务证书", tags = {"职务证书" }, notes = "根据职务批量建立职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutycerts/batch")
public ResponseEntity<Boolean> createBatchByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody List<HRDutyCertDTO> hrdutycertdtos) {
List<HRDutyCert> domainlist=hrdutycertMapping.toDomain(hrdutycertdtos);
for(HRDutyCert domain:domainlist){
domain.setHrdutyid(hrduty_id);
}
hrdutycertService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrdutycert" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrdutycertService.get(#hrdutycert_id),'iBizHumanResources-HRDutyCert-Update')")
@ApiOperation(value = "根据职务更新职务证书", tags = {"职务证书" }, notes = "根据职务更新职务证书")
@RequestMapping(method = RequestMethod.PUT, value = "/hrduties/{hrduty_id}/hrdutycerts/{hrdutycert_id}")
@Transactional
public ResponseEntity<HRDutyCertDTO> updateByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @PathVariable("hrdutycert_id") String hrdutycert_id, @RequestBody HRDutyCertDTO hrdutycertdto) {
HRDutyCert domain = hrdutycertMapping.toDomain(hrdutycertdto);
domain.setHrdutyid(hrduty_id);
domain.setHrdutycertid(hrdutycert_id);
hrdutycertService.update(domain);
HRDutyCertDTO dto = hrdutycertMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutycertService.getHrdutycertByEntities(this.hrdutycertMapping.toDomain(#hrdutycertdtos)),'iBizHumanResources-HRDutyCert-Update')")
@ApiOperation(value = "根据职务批量更新职务证书", tags = {"职务证书" }, notes = "根据职务批量更新职务证书")
@RequestMapping(method = RequestMethod.PUT, value = "/hrduties/{hrduty_id}/hrdutycerts/batch")
public ResponseEntity<Boolean> updateBatchByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody List<HRDutyCertDTO> hrdutycertdtos) {
List<HRDutyCert> domainlist=hrdutycertMapping.toDomain(hrdutycertdtos);
for(HRDutyCert domain:domainlist){
domain.setHrdutyid(hrduty_id);
}
hrdutycertService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrdutycertService.get(#hrdutycert_id),'iBizHumanResources-HRDutyCert-Remove')")
@ApiOperation(value = "根据职务删除职务证书", tags = {"职务证书" }, notes = "根据职务删除职务证书")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrduties/{hrduty_id}/hrdutycerts/{hrdutycert_id}")
@Transactional
public ResponseEntity<Boolean> removeByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @PathVariable("hrdutycert_id") String hrdutycert_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutycertService.remove(hrdutycert_id));
}
@PreAuthorize("hasPermission(this.hrdutycertService.getHrdutycertByIds(#ids),'iBizHumanResources-HRDutyCert-Remove')")
@ApiOperation(value = "根据职务批量删除职务证书", tags = {"职务证书" }, notes = "根据职务批量删除职务证书")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrduties/{hrduty_id}/hrdutycerts/batch")
public ResponseEntity<Boolean> removeBatchByHRDuty(@RequestBody List<String> ids) {
hrdutycertService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrdutycertMapping.toDomain(returnObject.body),'iBizHumanResources-HRDutyCert-Get')")
@ApiOperation(value = "根据职务获取职务证书", tags = {"职务证书" }, notes = "根据职务获取职务证书")
@RequestMapping(method = RequestMethod.GET, value = "/hrduties/{hrduty_id}/hrdutycerts/{hrdutycert_id}")
public ResponseEntity<HRDutyCertDTO> getByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @PathVariable("hrdutycert_id") String hrdutycert_id) {
HRDutyCert domain = hrdutycertService.get(hrdutycert_id);
HRDutyCertDTO dto = hrdutycertMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据职务获取职务证书草稿", tags = {"职务证书" }, notes = "根据职务获取职务证书草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrduties/{hrduty_id}/hrdutycerts/getdraft")
public ResponseEntity<HRDutyCertDTO> getDraftByHRDuty(@PathVariable("hrduty_id") String hrduty_id) {
HRDutyCert domain = new HRDutyCert();
domain.setHrdutyid(hrduty_id);
return ResponseEntity.status(HttpStatus.OK).body(hrdutycertMapping.toDto(hrdutycertService.getDraft(domain)));
}
@ApiOperation(value = "根据职务检查职务证书", tags = {"职务证书" }, notes = "根据职务检查职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutycerts/checkkey")
public ResponseEntity<Boolean> checkKeyByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody HRDutyCertDTO hrdutycertdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutycertService.checkKey(hrdutycertMapping.toDomain(hrdutycertdto)));
}
@PreAuthorize("hasPermission(this.hrdutycertMapping.toDomain(#hrdutycertdto),'iBizHumanResources-HRDutyCert-Save')")
@ApiOperation(value = "根据职务保存职务证书", tags = {"职务证书" }, notes = "根据职务保存职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutycerts/save")
public ResponseEntity<Boolean> saveByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody HRDutyCertDTO hrdutycertdto) {
HRDutyCert domain = hrdutycertMapping.toDomain(hrdutycertdto);
domain.setHrdutyid(hrduty_id);
return ResponseEntity.status(HttpStatus.OK).body(hrdutycertService.save(domain));
}
@PreAuthorize("hasPermission(this.hrdutycertMapping.toDomain(#hrdutycertdtos),'iBizHumanResources-HRDutyCert-Save')")
@ApiOperation(value = "根据职务批量保存职务证书", tags = {"职务证书" }, notes = "根据职务批量保存职务证书")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutycerts/savebatch")
public ResponseEntity<Boolean> saveBatchByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody List<HRDutyCertDTO> hrdutycertdtos) {
List<HRDutyCert> domainlist=hrdutycertMapping.toDomain(hrdutycertdtos);
for(HRDutyCert domain:domainlist){
domain.setHrdutyid(hrduty_id);
}
hrdutycertService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRDutyCert-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutyCert-Get')")
@ApiOperation(value = "根据职务获取DEFAULT", tags = {"职务证书" } ,notes = "根据职务获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrduties/{hrduty_id}/hrdutycerts/fetchdefault")
public ResponseEntity<List<HRDutyCertDTO>> fetchHRDutyCertDefaultByHRDuty(@PathVariable("hrduty_id") String hrduty_id,HRDutyCertSearchContext context) {
context.setN_hrdutyid_eq(hrduty_id);
Page<HRDutyCert> domains = hrdutycertService.searchDefault(context) ;
List<HRDutyCertDTO> list = hrdutycertMapping.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-HRDutyCert-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutyCert-Get')")
@ApiOperation(value = "根据职务查询DEFAULT", tags = {"职务证书" } ,notes = "根据职务查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrduties/{hrduty_id}/hrdutycerts/searchdefault")
public ResponseEntity<Page<HRDutyCertDTO>> searchHRDutyCertDefaultByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody HRDutyCertSearchContext context) {
context.setN_hrdutyid_eq(hrduty_id);
Page<HRDutyCert> domains = hrdutycertService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdutycertMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
...@@ -160,5 +160,138 @@ public class HRDutyEduResource { ...@@ -160,5 +160,138 @@ public class HRDutyEduResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdutyeduMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(hrdutyeduMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(#hrdutyedudto),'iBizHumanResources-HRDutyEdu-Create')")
@ApiOperation(value = "根据职务建立职务教育", tags = {"职务教育" }, notes = "根据职务建立职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutyedus")
@Transactional
public ResponseEntity<HRDutyEduDTO> createByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody HRDutyEduDTO hrdutyedudto) {
HRDutyEdu domain = hrdutyeduMapping.toDomain(hrdutyedudto);
domain.setHrdutyid(hrduty_id);
hrdutyeduService.create(domain);
HRDutyEduDTO dto = hrdutyeduMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(#hrdutyedudtos),'iBizHumanResources-HRDutyEdu-Create')")
@ApiOperation(value = "根据职务批量建立职务教育", tags = {"职务教育" }, notes = "根据职务批量建立职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutyedus/batch")
public ResponseEntity<Boolean> createBatchByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody List<HRDutyEduDTO> hrdutyedudtos) {
List<HRDutyEdu> domainlist=hrdutyeduMapping.toDomain(hrdutyedudtos);
for(HRDutyEdu domain:domainlist){
domain.setHrdutyid(hrduty_id);
}
hrdutyeduService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrdutyedu" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrdutyeduService.get(#hrdutyedu_id),'iBizHumanResources-HRDutyEdu-Update')")
@ApiOperation(value = "根据职务更新职务教育", tags = {"职务教育" }, notes = "根据职务更新职务教育")
@RequestMapping(method = RequestMethod.PUT, value = "/hrduties/{hrduty_id}/hrdutyedus/{hrdutyedu_id}")
@Transactional
public ResponseEntity<HRDutyEduDTO> updateByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @PathVariable("hrdutyedu_id") String hrdutyedu_id, @RequestBody HRDutyEduDTO hrdutyedudto) {
HRDutyEdu domain = hrdutyeduMapping.toDomain(hrdutyedudto);
domain.setHrdutyid(hrduty_id);
domain.setHrdutyeduid(hrdutyedu_id);
hrdutyeduService.update(domain);
HRDutyEduDTO dto = hrdutyeduMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrdutyeduService.getHrdutyeduByEntities(this.hrdutyeduMapping.toDomain(#hrdutyedudtos)),'iBizHumanResources-HRDutyEdu-Update')")
@ApiOperation(value = "根据职务批量更新职务教育", tags = {"职务教育" }, notes = "根据职务批量更新职务教育")
@RequestMapping(method = RequestMethod.PUT, value = "/hrduties/{hrduty_id}/hrdutyedus/batch")
public ResponseEntity<Boolean> updateBatchByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody List<HRDutyEduDTO> hrdutyedudtos) {
List<HRDutyEdu> domainlist=hrdutyeduMapping.toDomain(hrdutyedudtos);
for(HRDutyEdu domain:domainlist){
domain.setHrdutyid(hrduty_id);
}
hrdutyeduService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrdutyeduService.get(#hrdutyedu_id),'iBizHumanResources-HRDutyEdu-Remove')")
@ApiOperation(value = "根据职务删除职务教育", tags = {"职务教育" }, notes = "根据职务删除职务教育")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrduties/{hrduty_id}/hrdutyedus/{hrdutyedu_id}")
@Transactional
public ResponseEntity<Boolean> removeByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @PathVariable("hrdutyedu_id") String hrdutyedu_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyeduService.remove(hrdutyedu_id));
}
@PreAuthorize("hasPermission(this.hrdutyeduService.getHrdutyeduByIds(#ids),'iBizHumanResources-HRDutyEdu-Remove')")
@ApiOperation(value = "根据职务批量删除职务教育", tags = {"职务教育" }, notes = "根据职务批量删除职务教育")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrduties/{hrduty_id}/hrdutyedus/batch")
public ResponseEntity<Boolean> removeBatchByHRDuty(@RequestBody List<String> ids) {
hrdutyeduService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(returnObject.body),'iBizHumanResources-HRDutyEdu-Get')")
@ApiOperation(value = "根据职务获取职务教育", tags = {"职务教育" }, notes = "根据职务获取职务教育")
@RequestMapping(method = RequestMethod.GET, value = "/hrduties/{hrduty_id}/hrdutyedus/{hrdutyedu_id}")
public ResponseEntity<HRDutyEduDTO> getByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @PathVariable("hrdutyedu_id") String hrdutyedu_id) {
HRDutyEdu domain = hrdutyeduService.get(hrdutyedu_id);
HRDutyEduDTO dto = hrdutyeduMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据职务获取职务教育草稿", tags = {"职务教育" }, notes = "根据职务获取职务教育草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrduties/{hrduty_id}/hrdutyedus/getdraft")
public ResponseEntity<HRDutyEduDTO> getDraftByHRDuty(@PathVariable("hrduty_id") String hrduty_id) {
HRDutyEdu domain = new HRDutyEdu();
domain.setHrdutyid(hrduty_id);
return ResponseEntity.status(HttpStatus.OK).body(hrdutyeduMapping.toDto(hrdutyeduService.getDraft(domain)));
}
@ApiOperation(value = "根据职务检查职务教育", tags = {"职务教育" }, notes = "根据职务检查职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutyedus/checkkey")
public ResponseEntity<Boolean> checkKeyByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody HRDutyEduDTO hrdutyedudto) {
return ResponseEntity.status(HttpStatus.OK).body(hrdutyeduService.checkKey(hrdutyeduMapping.toDomain(hrdutyedudto)));
}
@PreAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(#hrdutyedudto),'iBizHumanResources-HRDutyEdu-Save')")
@ApiOperation(value = "根据职务保存职务教育", tags = {"职务教育" }, notes = "根据职务保存职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutyedus/save")
public ResponseEntity<Boolean> saveByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody HRDutyEduDTO hrdutyedudto) {
HRDutyEdu domain = hrdutyeduMapping.toDomain(hrdutyedudto);
domain.setHrdutyid(hrduty_id);
return ResponseEntity.status(HttpStatus.OK).body(hrdutyeduService.save(domain));
}
@PreAuthorize("hasPermission(this.hrdutyeduMapping.toDomain(#hrdutyedudtos),'iBizHumanResources-HRDutyEdu-Save')")
@ApiOperation(value = "根据职务批量保存职务教育", tags = {"职务教育" }, notes = "根据职务批量保存职务教育")
@RequestMapping(method = RequestMethod.POST, value = "/hrduties/{hrduty_id}/hrdutyedus/savebatch")
public ResponseEntity<Boolean> saveBatchByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody List<HRDutyEduDTO> hrdutyedudtos) {
List<HRDutyEdu> domainlist=hrdutyeduMapping.toDomain(hrdutyedudtos);
for(HRDutyEdu domain:domainlist){
domain.setHrdutyid(hrduty_id);
}
hrdutyeduService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRDutyEdu-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutyEdu-Get')")
@ApiOperation(value = "根据职务获取DEFAULT", tags = {"职务教育" } ,notes = "根据职务获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrduties/{hrduty_id}/hrdutyedus/fetchdefault")
public ResponseEntity<List<HRDutyEduDTO>> fetchHRDutyEduDefaultByHRDuty(@PathVariable("hrduty_id") String hrduty_id,HRDutyEduSearchContext context) {
context.setN_hrdutyid_eq(hrduty_id);
Page<HRDutyEdu> domains = hrdutyeduService.searchDefault(context) ;
List<HRDutyEduDTO> list = hrdutyeduMapping.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-HRDutyEdu-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRDutyEdu-Get')")
@ApiOperation(value = "根据职务查询DEFAULT", tags = {"职务教育" } ,notes = "根据职务查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrduties/{hrduty_id}/hrdutyedus/searchdefault")
public ResponseEntity<Page<HRDutyEduDTO>> searchHRDutyEduDefaultByHRDuty(@PathVariable("hrduty_id") String hrduty_id, @RequestBody HRDutyEduSearchContext context) {
context.setN_hrdutyid_eq(hrduty_id);
Page<HRDutyEdu> domains = hrdutyeduService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdutyeduMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册