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

Miracle 部署微服务接口

上级 23642e72
......@@ -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:
......
......@@ -86,7 +86,7 @@
<!--输出实体[HRCONTRACT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrcontract-61-4">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrcontract-67-4">
<createTable tableName="T_HRCONTRACT">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -338,7 +338,7 @@
<!--输出实体[HREMPLOYEE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-280-12">
<changeSet author="a_LAB01_e85d8801c" id="tab-hremployee-284-12">
<createTable tableName="EMPLOYEE">
<column name="EMPLOYEENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -808,7 +808,7 @@
<!--输出实体[HRPOST]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpost-108-27">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrpost-109-27">
<createTable tableName="T_HRPOST">
<column name="HRPOSTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRPOST_HRPOSTID"/>
......@@ -994,7 +994,7 @@
<!--输出实体[HRTRANSFERAPPLY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hrtransferapply-46-33">
<changeSet author="a_LAB01_e85d8801c" id="tab-hrtransferapply-139-33">
<createTable tableName="T_HRTRANSFERAPPLY">
<column name="HRTRANSFERAPPLYID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_HRTRANSFERAPPLY_HRTRANSFERA"/>
......@@ -1087,10 +1087,10 @@
<addForeignKeyConstraint baseColumnNames="REGISTERORGANIZATIONID" baseTableName="T_HRCERTIFICATE" constraintName="DER1N_HRCERTIFICATE_HRORGANIZA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRCONTRACT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrcontract-61-38">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrcontract-67-38">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRCONTRACT" constraintName="DER1N_HRCONTRACT_HREMPLOYEE_HR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrcontract-61-39">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrcontract-67-39">
<addForeignKeyConstraint baseColumnNames="MGRORGANIZATIONID" baseTableName="T_HRCONTRACT" constraintName="DER1N_HRCONTRACT_HRORGANIZATIO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRDISTRIBUTION]外键关系 -->
......@@ -1119,13 +1119,13 @@
</changeSet>
<!--输出实体[HREMPSTATE]外键关系 -->
<!--输出实体[HREMPLOYEE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-280-47">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-284-47">
<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-280-48">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-284-48">
<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>
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-280-49">
<changeSet author="a_LAB01_e85d8801c" id="fk-hremployee-284-49">
<addForeignKeyConstraint baseColumnNames="HRPOSTID" baseTableName="EMPLOYEE" constraintName="DER1N_HREMPLOYEE_HRPOST_HRPOST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
<!--输出实体[HRFAMILY]外键关系 -->
......@@ -1173,10 +1173,10 @@
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRPATENT" constraintName="DER1N_HRPATENT_HREMPLOYEE_HREM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRPOST]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-108-61">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-109-61">
<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 author="a_LAB01_e85d8801c" id="fk-hrpost-108-62">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrpost-109-62">
<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>
<!--输出实体[HRPOSTREL]外键关系 -->
......@@ -1203,13 +1203,13 @@
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRTRAININGRECORD" constraintName="DER1N_HRTRAININGRECORD_HREMPLO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<!--输出实体[HRTRANSFERAPPLY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtransferapply-46-69">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtransferapply-139-69">
<addForeignKeyConstraint baseColumnNames="HREMPLOYEEID" baseTableName="T_HRTRANSFERAPPLY" constraintName="DER1N_HRTRANSFERAPPLY_HREMPLOY" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EMPLOYEEID" referencedTableName="EMPLOYEE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtransferapply-46-70">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtransferapply-139-70">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID2" baseTableName="T_HRTRANSFERAPPLY" constraintName="DER1N_HRTRANSFERAPPLY_HRORGANI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtransferapply-46-71">
<changeSet author="a_LAB01_e85d8801c" id="fk-hrtransferapply-139-71">
<addForeignKeyConstraint baseColumnNames="HRPOSTID2" baseTableName="T_HRTRANSFERAPPLY" constraintName="DER1N_HRTRANSFERAPPLY_HRPOST_H" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="HRPOSTID" referencedTableName="T_HRPOST" validate="true"/>
</changeSet>
<!--输出实体[HRWORKRECORD]外键关系 -->
......
......@@ -121,6 +121,7 @@
<sql id="NoContract" databaseId="mysql">
<![CDATA[ SELECT (TIMESTAMPDIFF(YEAR, t1.`BIRTHDAY`, CURDATE())) AS `AGE`, t1.`BIRTHADDRESS`, t1.`BIRTHDAY`, t1.`BLOODTYPE`, t1.`CERTIFICATES`, t1.`CERTNUM`, t1.`CERTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EMAIL`, t1.`EMPLOYEECODE`, t1.`EMPLOYEEID`, t1.`EMPLOYEENAME`, t1.`EMPSTATE`, t1.`ENTRYTYPE`, t1.`FIRSTDEGREE`, t1.`HEALTH`, t1.`HIGHESTDEGREE`, t1.`HOBBY`, t41.`HRDUTYNAME`, t1.`HRPOSTID`, t31.`HRPOSTNAME`, t21.`JOBSTATE`, t1.`MARRIAGE`, t1.`MOBILE`, t1.`NATION`, t1.`NATIVEADDRESS`, t1.`NATIVEPLACE`, t1.`NATIVETYPE`, t1.`ORGANIZATIONID`, t11.`ORGANIZATIONNAME`, t1.`PHOTO`, t1.`POLITICAL`, t1.`POLITICALTIME`, t1.`POSTALADDRESS`, t1.`PROBATIONTIME`, t1.`SEX`, t1.`STARTORGTIME`, t1.`STARTWORKTIME`, t1.`TECHNICALTITLE`, t1.`TELEPHONE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EMPLOYEE` t1 LEFT JOIN ORGANIZATION t11 ON t1.ORGANIZATIONID = t11.ORGANIZATIONID LEFT JOIN T_HREMPSTATE t21 ON t1.EMPSTATE = t21.HREMPSTATEID LEFT JOIN T_HRPOST t31 ON t1.HRPOSTID = t31.HRPOSTID LEFT JOIN T_HRDUTY t41 ON t31.HRDUTYID = t41.HRDUTYID
WHERE NOT(EXISTS(SELECT * FROM T_HRCONTRACT t51 WHERE t1.EMPLOYEEID = t51.HREMPLOYEEID ))
AND ( t21.`JOBSTATE` = 'ONDUTY' )
]]>
</sql>
<!--数据查询[OnDuty]-->
......
......@@ -265,7 +265,7 @@
{
"appid":"PIM",
"appname":"基础管理",
"appmenu":[{"menuid":"PIM", "menuname":"PIM", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" , "items":[{ "id":"menuitem3" , "name":"设置" }]},{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem1" , "name":"-" }]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem5" , "name":"人员" , "items":[{ "id":"menuitem15" , "name":"员工" },{ "id":"menuitem8" , "name":"合同" }]},{ "id":"menuitem2" , "name":"组织" , "items":[{ "id":"menuitem4" , "name":"法人" },{ "id":"menuitem6" , "name":"运营单位" },{ "id":"menuitem7" , "name":"组织层次结构" },{ "id":"menuitem9" , "name":"所有组织" }]},{ "id":"menuitem10" , "name":"职位" , "items":[{ "id":"menuitem11" , "name":"职位" },{ "id":"menuitem12" , "name":"职务" }]}]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] }]
"appmenu":[{"menuid":"PIM", "menuname":"PIM", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" , "items":[{ "id":"menuitem3" , "name":"设置" }]},{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem1" , "name":"-" }]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem5" , "name":"人员" , "items":[{ "id":"menuitem15" , "name":"员工" },{ "id":"menuitem8" , "name":"合同" }]},{ "id":"menuitem2" , "name":"组织" , "items":[{ "id":"menuitem4" , "name":"法人" },{ "id":"menuitem6" , "name":"运营单位" },{ "id":"menuitem7" , "name":"组织层次结构" },{ "id":"menuitem9" , "name":"所有组织" }]},{ "id":"menuitem10" , "name":"职位" , "items":[{ "id":"menuitem11" , "name":"职位" },{ "id":"menuitem12" , "name":"职务" }]},{ "id":"menuitem13" , "name":"调动" , "items":[{ "id":"menuitem14" , "name":"调动申请" },{ "id":"menuitem16" , "name":"调动管理" }]}]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] }]
}
]
}
......@@ -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,404 @@ public class HRTransferApplyResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrtransferapplyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydto),'iBizHumanResources-HRTransferApply-Create')")
@ApiOperation(value = "根据组织建立调动申请", tags = {"调动申请" }, notes = "根据组织建立调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies")
@Transactional
public ResponseEntity<HRTransferApplyDTO> createByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain.setHrorganizationid2(hrorganization_id);
hrtransferapplyService.create(domain);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos),'iBizHumanResources-HRTransferApply-Create')")
@ApiOperation(value = "根据组织批量建立调动申请", tags = {"调动申请" }, notes = "根据组织批量建立调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/batch")
public ResponseEntity<Boolean> createBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
List<HRTransferApply> domainlist=hrtransferapplyMapping.toDomain(hrtransferapplydtos);
for(HRTransferApply domain:domainlist){
domain.setHrorganizationid2(hrorganization_id);
}
hrtransferapplyService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrtransferapply" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrtransferapplyService.get(#hrtransferapply_id),'iBizHumanResources-HRTransferApply-Update')")
@ApiOperation(value = "根据组织更新调动申请", tags = {"调动申请" }, notes = "根据组织更新调动申请")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/{hrtransferapply_id}")
@Transactional
public ResponseEntity<HRTransferApplyDTO> updateByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrtransferapply_id") String hrtransferapply_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain.setHrorganizationid2(hrorganization_id);
domain.setHrtransferapplyid(hrtransferapply_id);
hrtransferapplyService.update(domain);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.getHrtransferapplyByEntities(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos)),'iBizHumanResources-HRTransferApply-Update')")
@ApiOperation(value = "根据组织批量更新调动申请", tags = {"调动申请" }, notes = "根据组织批量更新调动申请")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/batch")
public ResponseEntity<Boolean> updateBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
List<HRTransferApply> domainlist=hrtransferapplyMapping.toDomain(hrtransferapplydtos);
for(HRTransferApply domain:domainlist){
domain.setHrorganizationid2(hrorganization_id);
}
hrtransferapplyService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.get(#hrtransferapply_id),'iBizHumanResources-HRTransferApply-Remove')")
@ApiOperation(value = "根据组织删除调动申请", tags = {"调动申请" }, notes = "根据组织删除调动申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/{hrtransferapply_id}")
@Transactional
public ResponseEntity<Boolean> removeByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrtransferapply_id") String hrtransferapply_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.remove(hrtransferapply_id));
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.getHrtransferapplyByIds(#ids),'iBizHumanResources-HRTransferApply-Remove')")
@ApiOperation(value = "根据组织批量删除调动申请", tags = {"调动申请" }, notes = "根据组织批量删除调动申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/batch")
public ResponseEntity<Boolean> removeBatchByHROrganization(@RequestBody List<String> ids) {
hrtransferapplyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(returnObject.body),'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "根据组织获取调动申请", tags = {"调动申请" }, notes = "根据组织获取调动申请")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/{hrtransferapply_id}")
public ResponseEntity<HRTransferApplyDTO> getByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrtransferapply_id") String hrtransferapply_id) {
HRTransferApply domain = hrtransferapplyService.get(hrtransferapply_id);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据组织获取调动申请草稿", tags = {"调动申请" }, notes = "根据组织获取调动申请草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/getdraft")
public ResponseEntity<HRTransferApplyDTO> getDraftByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id) {
HRTransferApply domain = new HRTransferApply();
domain.setHrorganizationid2(hrorganization_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyMapping.toDto(hrtransferapplyService.getDraft(domain)));
}
@ApiOperation(value = "根据组织检查调动申请", tags = {"调动申请" }, notes = "根据组织检查调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/checkkey")
public ResponseEntity<Boolean> checkKeyByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.checkKey(hrtransferapplyMapping.toDomain(hrtransferapplydto)));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydto),'iBizHumanResources-HRTransferApply-Save')")
@ApiOperation(value = "根据组织保存调动申请", tags = {"调动申请" }, notes = "根据组织保存调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/save")
public ResponseEntity<Boolean> saveByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain.setHrorganizationid2(hrorganization_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.save(domain));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos),'iBizHumanResources-HRTransferApply-Save')")
@ApiOperation(value = "根据组织批量保存调动申请", tags = {"调动申请" }, notes = "根据组织批量保存调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrtransferapplies/savebatch")
public ResponseEntity<Boolean> saveBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
List<HRTransferApply> domainlist=hrtransferapplyMapping.toDomain(hrtransferapplydtos);
for(HRTransferApply domain:domainlist){
domain.setHrorganizationid2(hrorganization_id);
}
hrtransferapplyService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRTransferApply-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "根据组织获取DEFAULT", tags = {"调动申请" } ,notes = "根据组织获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrorganizations/{hrorganization_id}/hrtransferapplies/fetchdefault")
public ResponseEntity<List<HRTransferApplyDTO>> fetchHRTransferApplyDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id,HRTransferApplySearchContext context) {
context.setN_hrorganizationid2_eq(hrorganization_id);
Page<HRTransferApply> domains = hrtransferapplyService.searchDefault(context) ;
List<HRTransferApplyDTO> list = hrtransferapplyMapping.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-HRTransferApply-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "根据组织查询DEFAULT", tags = {"调动申请" } ,notes = "根据组织查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrorganizations/{hrorganization_id}/hrtransferapplies/searchdefault")
public ResponseEntity<Page<HRTransferApplyDTO>> searchHRTransferApplyDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HRTransferApplySearchContext context) {
context.setN_hrorganizationid2_eq(hrorganization_id);
Page<HRTransferApply> domains = hrtransferapplyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrtransferapplyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydto),'iBizHumanResources-HRTransferApply-Create')")
@ApiOperation(value = "根据员工建立调动申请", tags = {"调动申请" }, notes = "根据员工建立调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtransferapplies")
@Transactional
public ResponseEntity<HRTransferApplyDTO> createByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain.setHremployeeid(hremployee_id);
hrtransferapplyService.create(domain);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos),'iBizHumanResources-HRTransferApply-Create')")
@ApiOperation(value = "根据员工批量建立调动申请", tags = {"调动申请" }, notes = "根据员工批量建立调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtransferapplies/batch")
public ResponseEntity<Boolean> createBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
List<HRTransferApply> domainlist=hrtransferapplyMapping.toDomain(hrtransferapplydtos);
for(HRTransferApply domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrtransferapplyService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrtransferapply" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrtransferapplyService.get(#hrtransferapply_id),'iBizHumanResources-HRTransferApply-Update')")
@ApiOperation(value = "根据员工更新调动申请", tags = {"调动申请" }, notes = "根据员工更新调动申请")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrtransferapplies/{hrtransferapply_id}")
@Transactional
public ResponseEntity<HRTransferApplyDTO> updateByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrtransferapply_id") String hrtransferapply_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain.setHremployeeid(hremployee_id);
domain.setHrtransferapplyid(hrtransferapply_id);
hrtransferapplyService.update(domain);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.getHrtransferapplyByEntities(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos)),'iBizHumanResources-HRTransferApply-Update')")
@ApiOperation(value = "根据员工批量更新调动申请", tags = {"调动申请" }, notes = "根据员工批量更新调动申请")
@RequestMapping(method = RequestMethod.PUT, value = "/hremployees/{hremployee_id}/hrtransferapplies/batch")
public ResponseEntity<Boolean> updateBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
List<HRTransferApply> domainlist=hrtransferapplyMapping.toDomain(hrtransferapplydtos);
for(HRTransferApply domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrtransferapplyService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.get(#hrtransferapply_id),'iBizHumanResources-HRTransferApply-Remove')")
@ApiOperation(value = "根据员工删除调动申请", tags = {"调动申请" }, notes = "根据员工删除调动申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrtransferapplies/{hrtransferapply_id}")
@Transactional
public ResponseEntity<Boolean> removeByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrtransferapply_id") String hrtransferapply_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.remove(hrtransferapply_id));
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.getHrtransferapplyByIds(#ids),'iBizHumanResources-HRTransferApply-Remove')")
@ApiOperation(value = "根据员工批量删除调动申请", tags = {"调动申请" }, notes = "根据员工批量删除调动申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/hremployees/{hremployee_id}/hrtransferapplies/batch")
public ResponseEntity<Boolean> removeBatchByHREmployee(@RequestBody List<String> ids) {
hrtransferapplyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(returnObject.body),'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "根据员工获取调动申请", tags = {"调动申请" }, notes = "根据员工获取调动申请")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrtransferapplies/{hrtransferapply_id}")
public ResponseEntity<HRTransferApplyDTO> getByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @PathVariable("hrtransferapply_id") String hrtransferapply_id) {
HRTransferApply domain = hrtransferapplyService.get(hrtransferapply_id);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据员工获取调动申请草稿", tags = {"调动申请" }, notes = "根据员工获取调动申请草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hremployees/{hremployee_id}/hrtransferapplies/getdraft")
public ResponseEntity<HRTransferApplyDTO> getDraftByHREmployee(@PathVariable("hremployee_id") String hremployee_id) {
HRTransferApply domain = new HRTransferApply();
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyMapping.toDto(hrtransferapplyService.getDraft(domain)));
}
@ApiOperation(value = "根据员工检查调动申请", tags = {"调动申请" }, notes = "根据员工检查调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtransferapplies/checkkey")
public ResponseEntity<Boolean> checkKeyByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.checkKey(hrtransferapplyMapping.toDomain(hrtransferapplydto)));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydto),'iBizHumanResources-HRTransferApply-Save')")
@ApiOperation(value = "根据员工保存调动申请", tags = {"调动申请" }, notes = "根据员工保存调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtransferapplies/save")
public ResponseEntity<Boolean> saveByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain.setHremployeeid(hremployee_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.save(domain));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos),'iBizHumanResources-HRTransferApply-Save')")
@ApiOperation(value = "根据员工批量保存调动申请", tags = {"调动申请" }, notes = "根据员工批量保存调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hremployees/{hremployee_id}/hrtransferapplies/savebatch")
public ResponseEntity<Boolean> saveBatchByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
List<HRTransferApply> domainlist=hrtransferapplyMapping.toDomain(hrtransferapplydtos);
for(HRTransferApply domain:domainlist){
domain.setHremployeeid(hremployee_id);
}
hrtransferapplyService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRTransferApply-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "根据员工获取DEFAULT", tags = {"调动申请" } ,notes = "根据员工获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hremployees/{hremployee_id}/hrtransferapplies/fetchdefault")
public ResponseEntity<List<HRTransferApplyDTO>> fetchHRTransferApplyDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id,HRTransferApplySearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRTransferApply> domains = hrtransferapplyService.searchDefault(context) ;
List<HRTransferApplyDTO> list = hrtransferapplyMapping.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-HRTransferApply-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "根据员工查询DEFAULT", tags = {"调动申请" } ,notes = "根据员工查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hremployees/{hremployee_id}/hrtransferapplies/searchdefault")
public ResponseEntity<Page<HRTransferApplyDTO>> searchHRTransferApplyDefaultByHREmployee(@PathVariable("hremployee_id") String hremployee_id, @RequestBody HRTransferApplySearchContext context) {
context.setN_hremployeeid_eq(hremployee_id);
Page<HRTransferApply> domains = hrtransferapplyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrtransferapplyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydto),'iBizHumanResources-HRTransferApply-Create')")
@ApiOperation(value = "根据职位建立调动申请", tags = {"调动申请" }, notes = "根据职位建立调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrtransferapplies")
@Transactional
public ResponseEntity<HRTransferApplyDTO> createByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain.setHrpostid2(hrpost_id);
hrtransferapplyService.create(domain);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos),'iBizHumanResources-HRTransferApply-Create')")
@ApiOperation(value = "根据职位批量建立调动申请", tags = {"调动申请" }, notes = "根据职位批量建立调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrtransferapplies/batch")
public ResponseEntity<Boolean> createBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
List<HRTransferApply> domainlist=hrtransferapplyMapping.toDomain(hrtransferapplydtos);
for(HRTransferApply domain:domainlist){
domain.setHrpostid2(hrpost_id);
}
hrtransferapplyService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrtransferapply" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrtransferapplyService.get(#hrtransferapply_id),'iBizHumanResources-HRTransferApply-Update')")
@ApiOperation(value = "根据职位更新调动申请", tags = {"调动申请" }, notes = "根据职位更新调动申请")
@RequestMapping(method = RequestMethod.PUT, value = "/hrposts/{hrpost_id}/hrtransferapplies/{hrtransferapply_id}")
@Transactional
public ResponseEntity<HRTransferApplyDTO> updateByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrtransferapply_id") String hrtransferapply_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain.setHrpostid2(hrpost_id);
domain.setHrtransferapplyid(hrtransferapply_id);
hrtransferapplyService.update(domain);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.getHrtransferapplyByEntities(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos)),'iBizHumanResources-HRTransferApply-Update')")
@ApiOperation(value = "根据职位批量更新调动申请", tags = {"调动申请" }, notes = "根据职位批量更新调动申请")
@RequestMapping(method = RequestMethod.PUT, value = "/hrposts/{hrpost_id}/hrtransferapplies/batch")
public ResponseEntity<Boolean> updateBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
List<HRTransferApply> domainlist=hrtransferapplyMapping.toDomain(hrtransferapplydtos);
for(HRTransferApply domain:domainlist){
domain.setHrpostid2(hrpost_id);
}
hrtransferapplyService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.get(#hrtransferapply_id),'iBizHumanResources-HRTransferApply-Remove')")
@ApiOperation(value = "根据职位删除调动申请", tags = {"调动申请" }, notes = "根据职位删除调动申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrposts/{hrpost_id}/hrtransferapplies/{hrtransferapply_id}")
@Transactional
public ResponseEntity<Boolean> removeByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrtransferapply_id") String hrtransferapply_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.remove(hrtransferapply_id));
}
@PreAuthorize("hasPermission(this.hrtransferapplyService.getHrtransferapplyByIds(#ids),'iBizHumanResources-HRTransferApply-Remove')")
@ApiOperation(value = "根据职位批量删除调动申请", tags = {"调动申请" }, notes = "根据职位批量删除调动申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrposts/{hrpost_id}/hrtransferapplies/batch")
public ResponseEntity<Boolean> removeBatchByHRPost(@RequestBody List<String> ids) {
hrtransferapplyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(returnObject.body),'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "根据职位获取调动申请", tags = {"调动申请" }, notes = "根据职位获取调动申请")
@RequestMapping(method = RequestMethod.GET, value = "/hrposts/{hrpost_id}/hrtransferapplies/{hrtransferapply_id}")
public ResponseEntity<HRTransferApplyDTO> getByHRPost(@PathVariable("hrpost_id") String hrpost_id, @PathVariable("hrtransferapply_id") String hrtransferapply_id) {
HRTransferApply domain = hrtransferapplyService.get(hrtransferapply_id);
HRTransferApplyDTO dto = hrtransferapplyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据职位获取调动申请草稿", tags = {"调动申请" }, notes = "根据职位获取调动申请草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrposts/{hrpost_id}/hrtransferapplies/getdraft")
public ResponseEntity<HRTransferApplyDTO> getDraftByHRPost(@PathVariable("hrpost_id") String hrpost_id) {
HRTransferApply domain = new HRTransferApply();
domain.setHrpostid2(hrpost_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyMapping.toDto(hrtransferapplyService.getDraft(domain)));
}
@ApiOperation(value = "根据职位检查调动申请", tags = {"调动申请" }, notes = "根据职位检查调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrtransferapplies/checkkey")
public ResponseEntity<Boolean> checkKeyByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.checkKey(hrtransferapplyMapping.toDomain(hrtransferapplydto)));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydto),'iBizHumanResources-HRTransferApply-Save')")
@ApiOperation(value = "根据职位保存调动申请", tags = {"调动申请" }, notes = "根据职位保存调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrtransferapplies/save")
public ResponseEntity<Boolean> saveByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRTransferApplyDTO hrtransferapplydto) {
HRTransferApply domain = hrtransferapplyMapping.toDomain(hrtransferapplydto);
domain.setHrpostid2(hrpost_id);
return ResponseEntity.status(HttpStatus.OK).body(hrtransferapplyService.save(domain));
}
@PreAuthorize("hasPermission(this.hrtransferapplyMapping.toDomain(#hrtransferapplydtos),'iBizHumanResources-HRTransferApply-Save')")
@ApiOperation(value = "根据职位批量保存调动申请", tags = {"调动申请" }, notes = "根据职位批量保存调动申请")
@RequestMapping(method = RequestMethod.POST, value = "/hrposts/{hrpost_id}/hrtransferapplies/savebatch")
public ResponseEntity<Boolean> saveBatchByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody List<HRTransferApplyDTO> hrtransferapplydtos) {
List<HRTransferApply> domainlist=hrtransferapplyMapping.toDomain(hrtransferapplydtos);
for(HRTransferApply domain:domainlist){
domain.setHrpostid2(hrpost_id);
}
hrtransferapplyService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HRTransferApply-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "根据职位获取DEFAULT", tags = {"调动申请" } ,notes = "根据职位获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrposts/{hrpost_id}/hrtransferapplies/fetchdefault")
public ResponseEntity<List<HRTransferApplyDTO>> fetchHRTransferApplyDefaultByHRPost(@PathVariable("hrpost_id") String hrpost_id,HRTransferApplySearchContext context) {
context.setN_hrpostid2_eq(hrpost_id);
Page<HRTransferApply> domains = hrtransferapplyService.searchDefault(context) ;
List<HRTransferApplyDTO> list = hrtransferapplyMapping.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-HRTransferApply-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HRTransferApply-Get')")
@ApiOperation(value = "根据职位查询DEFAULT", tags = {"调动申请" } ,notes = "根据职位查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrposts/{hrpost_id}/hrtransferapplies/searchdefault")
public ResponseEntity<Page<HRTransferApplyDTO>> searchHRTransferApplyDefaultByHRPost(@PathVariable("hrpost_id") String hrpost_id, @RequestBody HRTransferApplySearchContext context) {
context.setN_hrpostid2_eq(hrpost_id);
Page<HRTransferApply> domains = hrtransferapplyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrtransferapplyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册