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

jackwang 部署微服务接口

上级 4481665d
...@@ -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:
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<!--输出实体[HRDISTRIBUTION]数据结构 --> <!--输出实体[HRDISTRIBUTION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrdistribution-20-2"> <changeSet author="a_LAB01_e85d8801c" id="tab-hrdistribution-26-2">
<createTable tableName="T_HRDISTRIBUTION"> <createTable tableName="T_HRDISTRIBUTION">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)"> <column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column> </column>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<!--输出实体[HREMPLOYEE]数据结构 --> <!--输出实体[HREMPLOYEE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-7-4"> <changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-9-4">
<createTable tableName="EMPLOYEE"> <createTable tableName="EMPLOYEE">
<column name="EMPLOYEENAME" remarks="" type="VARCHAR(200)"> <column name="EMPLOYEENAME" remarks="" type="VARCHAR(200)">
</column> </column>
...@@ -346,7 +346,7 @@ ...@@ -346,7 +346,7 @@
<!--输出实体[HRPOST]数据结构 --> <!--输出实体[HRPOST]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpost-103-15"> <changeSet author="a_LAB01_e85d8801c" id="tab-hrpost-106-15">
<createTable tableName="T_HRPOST"> <createTable tableName="T_HRPOST">
<column name="HRPOSTID" remarks="" type="VARCHAR(100)"> <column name="HRPOSTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRPOST_HRPOSTID"/> <constraints primaryKey="true" primaryKeyName="PK_HRPOST_HRPOSTID"/>
...@@ -380,7 +380,7 @@ ...@@ -380,7 +380,7 @@
<!--输出实体[HRPOSTREL]数据结构 --> <!--输出实体[HRPOSTREL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpostrel-18-16"> <changeSet author="a_LAB01_e85d8801c" id="tab-hrpostrel-23-16">
<createTable tableName="T_HRPOSTREL"> <createTable tableName="T_HRPOSTREL">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)"> <column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column> </column>
...@@ -408,15 +408,15 @@ ...@@ -408,15 +408,15 @@
<!--输出实体[HRATTENDANCE]外键关系 --> <!--输出实体[HRATTENDANCE]外键关系 -->
<!--输出实体[HRDISTRIBUTION]外键关系 --> <!--输出实体[HRDISTRIBUTION]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-20-17"> <changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-26-17">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRDISTRIBUTION" constraintName="DER1N_HRDISTRIBUTION_HREMPLOYE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/> <addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRDISTRIBUTION" constraintName="DER1N_HRDISTRIBUTION_HREMPLOYE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-20-18"> <changeSet author="a_LAB01_e85d8801c" id="fk-hrdistribution-26-18">
<addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="T_HRDISTRIBUTION" constraintName="DER1N_HRDISTRIBUTION_HRPOST_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/> <addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="T_HRDISTRIBUTION" constraintName="DER1N_HRDISTRIBUTION_HRPOST_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[HRDUTY]外键关系 --> <!--输出实体[HRDUTY]外键关系 -->
<!--输出实体[HREMPLOYEE]外键关系 --> <!--输出实体[HREMPLOYEE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-7-19"> <changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-9-19">
<addForeignKeyConstraint baseColumnNames="ORGANIZATIONID" baseTableName="EMPLOYEE" constraintName="DER1N_EMPLOYEE_ORGANIZATION_OR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/> <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>
<!--输出实体[HRLEAVE]外键关系 --> <!--输出实体[HRLEAVE]外键关系 -->
...@@ -448,17 +448,17 @@ ...@@ -448,17 +448,17 @@
</changeSet> </changeSet>
<!--输出实体[HRORGANIZATION]外键关系 --> <!--输出实体[HRORGANIZATION]外键关系 -->
<!--输出实体[HRPOST]外键关系 --> <!--输出实体[HRPOST]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-103-27"> <changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-106-27">
<addForeignKeyConstraint baseColumnNames="HRDUTYID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRDUTY_HRDUTYID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRDUTYID" referencedTableName="T_HRDUTY" validate="true"/> <addForeignKeyConstraint baseColumnNames="HRDUTYID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRDUTY_HRDUTYID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRDUTYID" referencedTableName="T_HRDUTY" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-103-28"> <changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-106-28">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRORGANIZATION_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/> <addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRPOST" constraintName="DER1N_HRPOST_HRORGANIZATION_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[HRPOSTREL]外键关系 --> <!--输出实体[HRPOSTREL]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-18-29"> <changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-23-29">
<addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="T_HRPOSTREL" constraintName="DER1N_HRPOSTREL_HRPOST_HRPOSTI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/> <addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="T_HRPOSTREL" constraintName="DER1N_HRPOSTREL_HRPOST_HRPOSTI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-18-30"> <changeSet author="a_LAB01_e85d8801c" id="fk-hrpostrel-23-30">
<addForeignKeyConstraint baseColumnNames="PHRPOSTID" baseTableName="T_HRPOSTREL" constraintName="DER1N_HRPOSTREL_HRPOST_PHRPOST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/> <addForeignKeyConstraint baseColumnNames="PHRPOSTID" baseTableName="T_HRPOSTREL" constraintName="DER1N_HRPOSTREL_HRPOST_PHRPOST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet> </changeSet>
......
...@@ -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 HRDistributionResource { ...@@ -160,5 +160,138 @@ public class HRDistributionResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdistributionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .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
public ResponseEntity<HRDistributionDTO> createByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRDistributionDTO hrdistributiondto) {
HRDistribution domain = hrdistributionMapping.toDomain(hrdistributiondto);
domain.setHrpostid(hrpost_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 = "/hrposts/{hrpost_id}/hrdistributions/batch")
public ResponseEntity<Boolean> createBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRDistributionDTO> hrdistributiondtos) {
List<HRDistribution> domainlist=hrdistributionMapping.toDomain(hrdistributiondtos);
for(HRDistribution domain:domainlist){
domain.setHrpostid(hrpost_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 = "/hrposts/{hrpost_id}/hrdistributions/{hrdistribution_id}")
@Transactional
public ResponseEntity<HRDistributionDTO> updateByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrdistribution_id") String hrdistribution_id, @RequestBody HRDistributionDTO hrdistributiondto) {
HRDistribution domain = hrdistributionMapping.toDomain(hrdistributiondto);
domain.setHrpostid(hrpost_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 = "/hrposts/{hrpost_id}/hrdistributions/batch")
public ResponseEntity<Boolean> updateBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRDistributionDTO> hrdistributiondtos) {
List<HRDistribution> domainlist=hrdistributionMapping.toDomain(hrdistributiondtos);
for(HRDistribution domain:domainlist){
domain.setHrpostid(hrpost_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 = "/hrposts/{hrpost_id}/hrdistributions/{hrdistribution_id}")
@Transactional
public ResponseEntity<Boolean> removeByHRPost(@PathVariable("hrpost_id") String hrpost_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 = "/hrposts/{hrpost_id}/hrdistributions/batch")
public ResponseEntity<Boolean> removeBatchByHRPost(@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 = "/hrposts/{hrpost_id}/hrdistributions/{hrdistribution_id}")
public ResponseEntity<HRDistributionDTO> getByHRPost(@PathVariable("hrpost_id") String hrpost_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 = "/hrposts/{hrpost_id}/hrdistributions/getdraft")
public ResponseEntity<HRDistributionDTO> getDraftByHRPost(@PathVariable("hrpost_id") String hrpost_id) {
HRDistribution domain = new HRDistribution();
domain.setHrpostid(hrpost_id);
return ResponseEntity.status(HttpStatus.OK).body(hrdistributionMapping.toDto(hrdistributionService.getDraft(domain)));
}
@ApiOperation(value = "根据职位检查工作人员分配", tags = {"工作人员分配" }, notes = "根据职位检查工作人员分配")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrdistributions/checkkey")
public ResponseEntity<Boolean> checkKeyByHRPost(@PathVariable("hrpost_id") String hrpost_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 = "/hrposts/{hrpost_id}/hrdistributions/save")
public ResponseEntity<Boolean> saveByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRDistributionDTO hrdistributiondto) {
HRDistribution domain = hrdistributionMapping.toDomain(hrdistributiondto);
domain.setHrpostid(hrpost_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 = "/hrposts/{hrpost_id}/hrdistributions/savebatch")
public ResponseEntity<Boolean> saveBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRDistributionDTO> hrdistributiondtos) {
List<HRDistribution> domainlist=hrdistributionMapping.toDomain(hrdistributiondtos);
for(HRDistribution domain:domainlist){
domain.setHrpostid(hrpost_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="/hrposts/{hrpost_id}/hrdistributions/fetchdefault")
public ResponseEntity<List<HRDistributionDTO>> fetchHRDistributionDefaultByHRPost(@PathVariable("hrpost_id") String hrpost_id,HRDistributionSearchContext context) {
context.setN_hrpostid_eq(hrpost_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="/hrposts/{hrpost_id}/hrdistributions/searchdefault")
public ResponseEntity<Page<HRDistributionDTO>> searchHRDistributionDefaultByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRDistributionSearchContext context) {
context.setN_hrpostid_eq(hrpost_id);
Page<HRDistribution> domains = hrdistributionService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrdistributionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
...@@ -160,5 +160,138 @@ public class HRPostRelResource { ...@@ -160,5 +160,138 @@ public class HRPostRelResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrpostrelMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(hrpostrelMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasPermission(this.hrpostrelMapping.toDomain(#hrpostreldto),'iBizHumanResources-HRPostRel-Create')")
@ApiOperation(value = "根据职位建立职位关系", tags = {"职位关系" }, notes = "根据职位建立职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels")
@Transactional
public ResponseEntity<HRPostRelDTO> createByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRPostRelDTO hrpostreldto) {
HRPostRel domain = hrpostrelMapping.toDomain(hrpostreldto);
domain.setHrpostid(hrpost_id);
hrpostrelService.create(domain);
HRPostRelDTO dto = hrpostrelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpostrelMapping.toDomain(#hrpostreldtos),'iBizHumanResources-HRPostRel-Create')")
@ApiOperation(value = "根据职位批量建立职位关系", tags = {"职位关系" }, notes = "根据职位批量建立职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels/batch")
public ResponseEntity<Boolean> createBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRPostRelDTO> hrpostreldtos) {
List<HRPostRel> domainlist=hrpostrelMapping.toDomain(hrpostreldtos);
for(HRPostRel domain:domainlist){
domain.setHrpostid(hrpost_id);
}
hrpostrelService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrpostrel" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrpostrelService.get(#hrpostrel_id),'iBizHumanResources-HRPostRel-Update')")
@ApiOperation(value = "根据职位更新职位关系", tags = {"职位关系" }, notes = "根据职位更新职位关系")
@RequestMapping(method = RequestMethod.PUT, value = "/hrposts/{hrpost_id}/hrpostrels/{hrpostrel_id}")
@Transactional
public ResponseEntity<HRPostRelDTO> updateByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrpostrel_id") String hrpostrel_id, @RequestBody HRPostRelDTO hrpostreldto) {
HRPostRel domain = hrpostrelMapping.toDomain(hrpostreldto);
domain.setHrpostid(hrpost_id);
domain.setHrpostrelid(hrpostrel_id);
hrpostrelService.update(domain);
HRPostRelDTO dto = hrpostrelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrpostrelService.getHrpostrelByEntities(this.hrpostrelMapping.toDomain(#hrpostreldtos)),'iBizHumanResources-HRPostRel-Update')")
@ApiOperation(value = "根据职位批量更新职位关系", tags = {"职位关系" }, notes = "根据职位批量更新职位关系")
@RequestMapping(method = RequestMethod.PUT, value = "/hrposts/{hrpost_id}/hrpostrels/batch")
public ResponseEntity<Boolean> updateBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRPostRelDTO> hrpostreldtos) {
List<HRPostRel> domainlist=hrpostrelMapping.toDomain(hrpostreldtos);
for(HRPostRel domain:domainlist){
domain.setHrpostid(hrpost_id);
}
hrpostrelService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrpostrelService.get(#hrpostrel_id),'iBizHumanResources-HRPostRel-Remove')")
@ApiOperation(value = "根据职位删除职位关系", tags = {"职位关系" }, notes = "根据职位删除职位关系")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrposts/{hrpost_id}/hrpostrels/{hrpostrel_id}")
@Transactional
public ResponseEntity<Boolean> removeByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrpostrel_id") String hrpostrel_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrpostrelService.remove(hrpostrel_id));
}
@PreAuthorize("hasPermission(this.hrpostrelService.getHrpostrelByIds(#ids),'iBizHumanResources-HRPostRel-Remove')")
@ApiOperation(value = "根据职位批量删除职位关系", tags = {"职位关系" }, notes = "根据职位批量删除职位关系")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrposts/{hrpost_id}/hrpostrels/batch")
public ResponseEntity<Boolean> removeBatchByHRPost(@RequestBody List<String> ids) {
hrpostrelService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrpostrelMapping.toDomain(returnObject.body),'iBizHumanResources-HRPostRel-Get')")
@ApiOperation(value = "根据职位获取职位关系", tags = {"职位关系" }, notes = "根据职位获取职位关系")
@RequestMapping(method = RequestMethod.GET, value = "/hrposts/{hrpost_id}/hrpostrels/{hrpostrel_id}")
public ResponseEntity<HRPostRelDTO> getByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrpostrel_id") String hrpostrel_id) {
HRPostRel domain = hrpostrelService.get(hrpostrel_id);
HRPostRelDTO dto = hrpostrelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据职位获取职位关系草稿", tags = {"职位关系" }, notes = "根据职位获取职位关系草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrposts/{hrpost_id}/hrpostrels/getdraft")
public ResponseEntity<HRPostRelDTO> getDraftByHRPost(@PathVariable("hrpost_id") String hrpost_id) {
HRPostRel domain = new HRPostRel();
domain.setHrpostid(hrpost_id);
return ResponseEntity.status(HttpStatus.OK).body(hrpostrelMapping.toDto(hrpostrelService.getDraft(domain)));
}
@ApiOperation(value = "根据职位检查职位关系", tags = {"职位关系" }, notes = "根据职位检查职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels/checkkey")
public ResponseEntity<Boolean> checkKeyByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRPostRelDTO hrpostreldto) {
return ResponseEntity.status(HttpStatus.OK).body(hrpostrelService.checkKey(hrpostrelMapping.toDomain(hrpostreldto)));
}
@PreAuthorize("hasPermission(this.hrpostrelMapping.toDomain(#hrpostreldto),'iBizHumanResources-HRPostRel-Save')")
@ApiOperation(value = "根据职位保存职位关系", tags = {"职位关系" }, notes = "根据职位保存职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels/save")
public ResponseEntity<Boolean> saveByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRPostRelDTO hrpostreldto) {
HRPostRel domain = hrpostrelMapping.toDomain(hrpostreldto);
domain.setHrpostid(hrpost_id);
return ResponseEntity.status(HttpStatus.OK).body(hrpostrelService.save(domain));
}
@PreAuthorize("hasPermission(this.hrpostrelMapping.toDomain(#hrpostreldtos),'iBizHumanResources-HRPostRel-Save')")
@ApiOperation(value = "根据职位批量保存职位关系", tags = {"职位关系" }, notes = "根据职位批量保存职位关系")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrpostrels/savebatch")
public ResponseEntity<Boolean> saveBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRPostRelDTO> hrpostreldtos) {
List<HRPostRel> domainlist=hrpostrelMapping.toDomain(hrpostreldtos);
for(HRPostRel domain:domainlist){
domain.setHrpostid(hrpost_id);
}
hrpostrelService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRPostRel-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPostRel-Get')")
@ApiOperation(value = "根据职位获取DEFAULT", tags = {"职位关系" } ,notes = "根据职位获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrposts/{hrpost_id}/hrpostrels/fetchdefault")
public ResponseEntity<List<HRPostRelDTO>> fetchHRPostRelDefaultByHRPost(@PathVariable("hrpost_id") String hrpost_id,HRPostRelSearchContext context) {
context.setN_hrpostid_eq(hrpost_id);
Page<HRPostRel> domains = hrpostrelService.searchDefault(context) ;
List<HRPostRelDTO> list = hrpostrelMapping.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-HRPostRel-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRPostRel-Get')")
@ApiOperation(value = "根据职位查询DEFAULT", tags = {"职位关系" } ,notes = "根据职位查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrposts/{hrpost_id}/hrpostrels/searchdefault")
public ResponseEntity<Page<HRPostRelDTO>> searchHRPostRelDefaultByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRPostRelSearchContext context) {
context.setN_hrpostid_eq(hrpost_id);
Page<HRPostRel> domains = hrpostrelService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrpostrelMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册