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

zhouweidong@lab.ibiz5.com 部署微服务接口

上级 ea9d02db
...@@ -37,6 +37,11 @@ ...@@ -37,6 +37,11 @@
git clone -b master $para2 ibzou/ git clone -b master $para2 ibzou/
export NODE_OPTIONS=--max-old-space-size=4096 export NODE_OPTIONS=--max-old-space-size=4096
cd ibzou/ cd ibzou/
mvn clean package -Papi
cd ibzou-provider/ibzou-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzou-provider-api.yaml ibzlab-rt --with-registry-auth
</command> </command>
</hudson.tasks.Shell> </hudson.tasks.Shell>
</builders> </builders>
......
...@@ -11,6 +11,7 @@ import java.math.BigInteger; ...@@ -11,6 +11,7 @@ import java.math.BigInteger;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
......
...@@ -11,6 +11,7 @@ import java.math.BigInteger; ...@@ -11,6 +11,7 @@ import java.math.BigInteger;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
......
...@@ -11,6 +11,7 @@ import java.math.BigInteger; ...@@ -11,6 +11,7 @@ import java.math.BigInteger;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
......
...@@ -11,6 +11,7 @@ import java.math.BigInteger; ...@@ -11,6 +11,7 @@ import java.math.BigInteger;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
......
...@@ -11,6 +11,7 @@ import java.math.BigInteger; ...@@ -11,6 +11,7 @@ import java.math.BigInteger;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
......
...@@ -11,6 +11,7 @@ import java.math.BigInteger; ...@@ -11,6 +11,7 @@ import java.math.BigInteger;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
......
...@@ -11,6 +11,7 @@ import java.math.BigInteger; ...@@ -11,6 +11,7 @@ import java.math.BigInteger;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
......
...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page; ...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.ou.domain.IBZDepartment; import cn.ibizlab.core.ou.domain.IBZDepartment;
......
...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page; ...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.ou.domain.IBZDeptMember; import cn.ibizlab.core.ou.domain.IBZDeptMember;
......
...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page; ...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.ou.domain.IBZEmployee; import cn.ibizlab.core.ou.domain.IBZEmployee;
......
...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page; ...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.ou.domain.IBZOrganization; import cn.ibizlab.core.ou.domain.IBZOrganization;
......
...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page; ...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.ou.domain.IBZPost; import cn.ibizlab.core.ou.domain.IBZPost;
......
...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page; ...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.ou.domain.IBZTeamMember; import cn.ibizlab.core.ou.domain.IBZTeamMember;
......
...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page; ...@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.ou.domain.IBZTeam; import cn.ibizlab.core.ou.domain.IBZTeam;
......
...@@ -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 /ibzou-provider-api.jar java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-provider-api.jar
EXPOSE 8081 EXPOSE 40001
ADD ibzou-provider-api.jar /ibzou-provider-api.jar ADD ibzou-provider-api.jar /ibzou-provider-api.jar
...@@ -3,9 +3,22 @@ services: ...@@ -3,9 +3,22 @@ services:
ibzou-provider-api: ibzou-provider-api:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-provider-api:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-provider-api:latest
ports: ports:
- "8081:8081" - "40001:40001"
networks: networks:
- agent_network - agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
- SERVER_PORT=40001
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
- SPRING_DATASOURCE_PASSWORD=@6dEfb3@
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
- NACOS=172.16.102.211:8848
deploy: deploy:
resources: resources:
limits: limits:
......
...@@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSONObject; ...@@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier; import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -50,7 +49,6 @@ public class IBZDepartmentResource { ...@@ -50,7 +49,6 @@ public class IBZDepartmentResource {
@PreAuthorize("hasPermission(this.ibzdepartmentMapping.toDomain(#ibzdepartmentdto),'ibzou-IBZDepartment-Create')") @PreAuthorize("hasPermission(this.ibzdepartmentMapping.toDomain(#ibzdepartmentdto),'ibzou-IBZDepartment-Create')")
@ApiOperation(value = "新建部门", tags = {"部门" }, notes = "新建部门") @ApiOperation(value = "新建部门", tags = {"部门" }, notes = "新建部门")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments") @RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments")
@Transactional
public ResponseEntity<IBZDepartmentDTO> create(@RequestBody IBZDepartmentDTO ibzdepartmentdto) { public ResponseEntity<IBZDepartmentDTO> create(@RequestBody IBZDepartmentDTO ibzdepartmentdto) {
IBZDepartment domain = ibzdepartmentMapping.toDomain(ibzdepartmentdto); IBZDepartment domain = ibzdepartmentMapping.toDomain(ibzdepartmentdto);
ibzdepartmentService.create(domain); ibzdepartmentService.create(domain);
...@@ -70,7 +68,6 @@ public class IBZDepartmentResource { ...@@ -70,7 +68,6 @@ public class IBZDepartmentResource {
@PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Update')") @PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Update')")
@ApiOperation(value = "更新部门", tags = {"部门" }, notes = "更新部门") @ApiOperation(value = "更新部门", tags = {"部门" }, notes = "更新部门")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{ibzdepartment_id}") @RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{ibzdepartment_id}")
@Transactional
public ResponseEntity<IBZDepartmentDTO> update(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZDepartmentDTO ibzdepartmentdto) { public ResponseEntity<IBZDepartmentDTO> update(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZDepartmentDTO ibzdepartmentdto) {
IBZDepartment domain = ibzdepartmentMapping.toDomain(ibzdepartmentdto); IBZDepartment domain = ibzdepartmentMapping.toDomain(ibzdepartmentdto);
domain .setDeptid(ibzdepartment_id); domain .setDeptid(ibzdepartment_id);
...@@ -90,7 +87,6 @@ public class IBZDepartmentResource { ...@@ -90,7 +87,6 @@ public class IBZDepartmentResource {
@PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Remove')") @PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Remove')")
@ApiOperation(value = "删除部门", tags = {"部门" }, notes = "删除部门") @ApiOperation(value = "删除部门", tags = {"部门" }, notes = "删除部门")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{ibzdepartment_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{ibzdepartment_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("ibzdepartment_id") String ibzdepartment_id) { public ResponseEntity<Boolean> remove(@PathVariable("ibzdepartment_id") String ibzdepartment_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibzdepartmentService.remove(ibzdepartment_id)); return ResponseEntity.status(HttpStatus.OK).body(ibzdepartmentService.remove(ibzdepartment_id));
} }
...@@ -163,7 +159,6 @@ public class IBZDepartmentResource { ...@@ -163,7 +159,6 @@ public class IBZDepartmentResource {
@PreAuthorize("hasPermission(this.ibzdepartmentMapping.toDomain(#ibzdepartmentdto),'ibzou-IBZDepartment-Create')") @PreAuthorize("hasPermission(this.ibzdepartmentMapping.toDomain(#ibzdepartmentdto),'ibzou-IBZDepartment-Create')")
@ApiOperation(value = "根据单位机构建立部门", tags = {"部门" }, notes = "根据单位机构建立部门") @ApiOperation(value = "根据单位机构建立部门", tags = {"部门" }, notes = "根据单位机构建立部门")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments")
@Transactional
public ResponseEntity<IBZDepartmentDTO> createByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZDepartmentDTO ibzdepartmentdto) { public ResponseEntity<IBZDepartmentDTO> createByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZDepartmentDTO ibzdepartmentdto) {
IBZDepartment domain = ibzdepartmentMapping.toDomain(ibzdepartmentdto); IBZDepartment domain = ibzdepartmentMapping.toDomain(ibzdepartmentdto);
domain.setOrgid(ibzorganization_id); domain.setOrgid(ibzorganization_id);
...@@ -188,7 +183,6 @@ public class IBZDepartmentResource { ...@@ -188,7 +183,6 @@ public class IBZDepartmentResource {
@PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Update')") @PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Update')")
@ApiOperation(value = "根据单位机构更新部门", tags = {"部门" }, notes = "根据单位机构更新部门") @ApiOperation(value = "根据单位机构更新部门", tags = {"部门" }, notes = "根据单位机构更新部门")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}") @RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}")
@Transactional
public ResponseEntity<IBZDepartmentDTO> updateByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZDepartmentDTO ibzdepartmentdto) { public ResponseEntity<IBZDepartmentDTO> updateByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZDepartmentDTO ibzdepartmentdto) {
IBZDepartment domain = ibzdepartmentMapping.toDomain(ibzdepartmentdto); IBZDepartment domain = ibzdepartmentMapping.toDomain(ibzdepartmentdto);
domain.setOrgid(ibzorganization_id); domain.setOrgid(ibzorganization_id);
...@@ -213,7 +207,6 @@ public class IBZDepartmentResource { ...@@ -213,7 +207,6 @@ public class IBZDepartmentResource {
@PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Remove')") @PreAuthorize("hasPermission(this.ibzdepartmentService.get(#ibzdepartment_id),'ibzou-IBZDepartment-Remove')")
@ApiOperation(value = "根据单位机构删除部门", tags = {"部门" }, notes = "根据单位机构删除部门") @ApiOperation(value = "根据单位机构删除部门", tags = {"部门" }, notes = "根据单位机构删除部门")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}")
@Transactional
public ResponseEntity<Boolean> removeByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id) { public ResponseEntity<Boolean> removeByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibzdepartmentService.remove(ibzdepartment_id)); return ResponseEntity.status(HttpStatus.OK).body(ibzdepartmentService.remove(ibzdepartment_id));
} }
......
...@@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSONObject; ...@@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier; import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -50,7 +49,6 @@ public class IBZOrganizationResource { ...@@ -50,7 +49,6 @@ public class IBZOrganizationResource {
@PreAuthorize("hasPermission(this.ibzorganizationMapping.toDomain(#ibzorganizationdto),'ibzou-IBZOrganization-Create')") @PreAuthorize("hasPermission(this.ibzorganizationMapping.toDomain(#ibzorganizationdto),'ibzou-IBZOrganization-Create')")
@ApiOperation(value = "新建单位机构", tags = {"单位机构" }, notes = "新建单位机构") @ApiOperation(value = "新建单位机构", tags = {"单位机构" }, notes = "新建单位机构")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations")
@Transactional
public ResponseEntity<IBZOrganizationDTO> create(@RequestBody IBZOrganizationDTO ibzorganizationdto) { public ResponseEntity<IBZOrganizationDTO> create(@RequestBody IBZOrganizationDTO ibzorganizationdto) {
IBZOrganization domain = ibzorganizationMapping.toDomain(ibzorganizationdto); IBZOrganization domain = ibzorganizationMapping.toDomain(ibzorganizationdto);
ibzorganizationService.create(domain); ibzorganizationService.create(domain);
...@@ -70,7 +68,6 @@ public class IBZOrganizationResource { ...@@ -70,7 +68,6 @@ public class IBZOrganizationResource {
@PreAuthorize("hasPermission(this.ibzorganizationService.get(#ibzorganization_id),'ibzou-IBZOrganization-Update')") @PreAuthorize("hasPermission(this.ibzorganizationService.get(#ibzorganization_id),'ibzou-IBZOrganization-Update')")
@ApiOperation(value = "更新单位机构", tags = {"单位机构" }, notes = "更新单位机构") @ApiOperation(value = "更新单位机构", tags = {"单位机构" }, notes = "更新单位机构")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}") @RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}")
@Transactional
public ResponseEntity<IBZOrganizationDTO> update(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZOrganizationDTO ibzorganizationdto) { public ResponseEntity<IBZOrganizationDTO> update(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZOrganizationDTO ibzorganizationdto) {
IBZOrganization domain = ibzorganizationMapping.toDomain(ibzorganizationdto); IBZOrganization domain = ibzorganizationMapping.toDomain(ibzorganizationdto);
domain .setOrgid(ibzorganization_id); domain .setOrgid(ibzorganization_id);
...@@ -90,7 +87,6 @@ public class IBZOrganizationResource { ...@@ -90,7 +87,6 @@ public class IBZOrganizationResource {
@PreAuthorize("hasPermission(this.ibzorganizationService.get(#ibzorganization_id),'ibzou-IBZOrganization-Remove')") @PreAuthorize("hasPermission(this.ibzorganizationService.get(#ibzorganization_id),'ibzou-IBZOrganization-Remove')")
@ApiOperation(value = "删除单位机构", tags = {"单位机构" }, notes = "删除单位机构") @ApiOperation(value = "删除单位机构", tags = {"单位机构" }, notes = "删除单位机构")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("ibzorganization_id") String ibzorganization_id) { public ResponseEntity<Boolean> remove(@PathVariable("ibzorganization_id") String ibzorganization_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibzorganizationService.remove(ibzorganization_id)); return ResponseEntity.status(HttpStatus.OK).body(ibzorganizationService.remove(ibzorganization_id));
} }
......
...@@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSONObject; ...@@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier; import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -50,7 +49,6 @@ public class IBZPostResource { ...@@ -50,7 +49,6 @@ public class IBZPostResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZPost-Create-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZPost-Create-all')")
@ApiOperation(value = "新建岗位", tags = {"岗位" }, notes = "新建岗位") @ApiOperation(value = "新建岗位", tags = {"岗位" }, notes = "新建岗位")
@RequestMapping(method = RequestMethod.POST, value = "/ibzposts") @RequestMapping(method = RequestMethod.POST, value = "/ibzposts")
@Transactional
public ResponseEntity<IBZPostDTO> create(@RequestBody IBZPostDTO ibzpostdto) { public ResponseEntity<IBZPostDTO> create(@RequestBody IBZPostDTO ibzpostdto) {
IBZPost domain = ibzpostMapping.toDomain(ibzpostdto); IBZPost domain = ibzpostMapping.toDomain(ibzpostdto);
ibzpostService.create(domain); ibzpostService.create(domain);
...@@ -69,7 +67,6 @@ public class IBZPostResource { ...@@ -69,7 +67,6 @@ public class IBZPostResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZPost-Update-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZPost-Update-all')")
@ApiOperation(value = "更新岗位", tags = {"岗位" }, notes = "更新岗位") @ApiOperation(value = "更新岗位", tags = {"岗位" }, notes = "更新岗位")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzposts/{ibzpost_id}") @RequestMapping(method = RequestMethod.PUT, value = "/ibzposts/{ibzpost_id}")
@Transactional
public ResponseEntity<IBZPostDTO> update(@PathVariable("ibzpost_id") String ibzpost_id, @RequestBody IBZPostDTO ibzpostdto) { public ResponseEntity<IBZPostDTO> update(@PathVariable("ibzpost_id") String ibzpost_id, @RequestBody IBZPostDTO ibzpostdto) {
IBZPost domain = ibzpostMapping.toDomain(ibzpostdto); IBZPost domain = ibzpostMapping.toDomain(ibzpostdto);
domain .setPostid(ibzpost_id); domain .setPostid(ibzpost_id);
...@@ -89,7 +86,6 @@ public class IBZPostResource { ...@@ -89,7 +86,6 @@ public class IBZPostResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZPost-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZPost-Remove-all')")
@ApiOperation(value = "删除岗位", tags = {"岗位" }, notes = "删除岗位") @ApiOperation(value = "删除岗位", tags = {"岗位" }, notes = "删除岗位")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzposts/{ibzpost_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzposts/{ibzpost_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("ibzpost_id") String ibzpost_id) { public ResponseEntity<Boolean> remove(@PathVariable("ibzpost_id") String ibzpost_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibzpostService.remove(ibzpost_id)); return ResponseEntity.status(HttpStatus.OK).body(ibzpostService.remove(ibzpost_id));
} }
......
...@@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSONObject; ...@@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier; import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -50,7 +49,6 @@ public class IBZTeamResource { ...@@ -50,7 +49,6 @@ public class IBZTeamResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZTeam-Create-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZTeam-Create-all')")
@ApiOperation(value = "新建组", tags = {"组" }, notes = "新建组") @ApiOperation(value = "新建组", tags = {"组" }, notes = "新建组")
@RequestMapping(method = RequestMethod.POST, value = "/ibzteams") @RequestMapping(method = RequestMethod.POST, value = "/ibzteams")
@Transactional
public ResponseEntity<IBZTeamDTO> create(@RequestBody IBZTeamDTO ibzteamdto) { public ResponseEntity<IBZTeamDTO> create(@RequestBody IBZTeamDTO ibzteamdto) {
IBZTeam domain = ibzteamMapping.toDomain(ibzteamdto); IBZTeam domain = ibzteamMapping.toDomain(ibzteamdto);
ibzteamService.create(domain); ibzteamService.create(domain);
...@@ -69,7 +67,6 @@ public class IBZTeamResource { ...@@ -69,7 +67,6 @@ public class IBZTeamResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZTeam-Update-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZTeam-Update-all')")
@ApiOperation(value = "更新组", tags = {"组" }, notes = "更新组") @ApiOperation(value = "更新组", tags = {"组" }, notes = "更新组")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzteams/{ibzteam_id}") @RequestMapping(method = RequestMethod.PUT, value = "/ibzteams/{ibzteam_id}")
@Transactional
public ResponseEntity<IBZTeamDTO> update(@PathVariable("ibzteam_id") String ibzteam_id, @RequestBody IBZTeamDTO ibzteamdto) { public ResponseEntity<IBZTeamDTO> update(@PathVariable("ibzteam_id") String ibzteam_id, @RequestBody IBZTeamDTO ibzteamdto) {
IBZTeam domain = ibzteamMapping.toDomain(ibzteamdto); IBZTeam domain = ibzteamMapping.toDomain(ibzteamdto);
domain .setTeamid(ibzteam_id); domain .setTeamid(ibzteam_id);
...@@ -89,7 +86,6 @@ public class IBZTeamResource { ...@@ -89,7 +86,6 @@ public class IBZTeamResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZTeam-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZTeam-Remove-all')")
@ApiOperation(value = "删除组", tags = {"组" }, notes = "删除组") @ApiOperation(value = "删除组", tags = {"组" }, notes = "删除组")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzteams/{ibzteam_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzteams/{ibzteam_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("ibzteam_id") String ibzteam_id) { public ResponseEntity<Boolean> remove(@PathVariable("ibzteam_id") String ibzteam_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibzteamService.remove(ibzteam_id)); return ResponseEntity.status(HttpStatus.OK).body(ibzteamService.remove(ibzteam_id));
} }
......
...@@ -60,7 +60,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter { ...@@ -60,7 +60,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
if (authTokenUtil.validateToken(authToken, userDetails)) { if (authTokenUtil.validateToken(authToken, userDetails)) {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities()); UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
log.info("authorizated user '{}', setting security context", username); // log.info("authorizated user '{}', setting security context", username);
SecurityContextHolder.getContext().setAuthentication(authentication); SecurityContextHolder.getContext().setAuthentication(authentication);
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册