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

ibizdev提交

上级 c098367a
*target
.settings
*node_modules
*bin
*.project
*.classpath
......
# 系统概览
<?xml version='1.1' encoding='UTF-8'?>
<project>
<actions/>
<description>ps</description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>para1</name>
<description></description>
<defaultValue>para1</defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>para2</name>
<description></description>
<defaultValue>para2</defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.Shell>
<command>
BUILD_ID=DONTKILLME
source /etc/profile
rm -rf ps
git clone -b master $para2 ps/
export NODE_OPTIONS=--max-old-space-size=4096
cd ps/ps-dependencies
mvn install
cd ..
mvn install
cd ps-boot
mvn clean package
echo &apos;echo &quot;$para1&quot;&apos; &gt; apppasswd.sh
chmod -R 777 *
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh root@172.16.102.61 &quot;mkdir -p /ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; scp -r ./target/ps.jar root@172.16.102.61:/ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh root@172.16.102.61 &quot;ps -ef | grep &apos;/ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5&apos;| tr -s &apos; &apos;|cut -d&apos; &apos; -f2,8,9 | grep -v grep | grep &apos;jar&apos; | cut -d&apos; &apos; -f1|xargs --no-run-if-empty kill -9&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh root@172.16.102.61 &quot;source /etc/profile;source ~/.bash_profile; nohup java -jar -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=128m /ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5/ps.jar &gt;&gt;/ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5/ps_apips 服务-`date --date=&apos;0 days ago&apos; +%Y-%m-%d`.log 2&gt;&amp;1 &amp;&quot;
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup@0.34">
<patterns class="empty-list"/>
<deleteDirs>false</deleteDirs>
<skipWhenFailed>false</skipWhenFailed>
<cleanWhenSuccess>true</cleanWhenSuccess>
<cleanWhenUnstable>true</cleanWhenUnstable>
<cleanWhenFailure>true</cleanWhenFailure>
<cleanWhenNotBuilt>true</cleanWhenNotBuilt>
<cleanWhenAborted>true</cleanWhenAborted>
<notFailBuild>false</notFailBuild>
<cleanupMatrixParent>false</cleanupMatrixParent>
<externalDelete></externalDelete>
</hudson.plugins.ws__cleanup.WsCleanup>
</publishers>
<buildWrappers/>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>ps</artifactId>
<groupId>com.ibiz</groupId>
<version>1.0.0.0</version>
<name>SpringBoot</name>
<description></description>
<packaging>pom</packaging>
<parent>
<groupId>com.ibiz</groupId>
<artifactId>ps-dependencies</artifactId>
<version>1.0.0.0</version>
</parent>
<modules>
<!-- dependencies -->
<module>ps-dependencies</module>
<!-- utils -->
<module>ps-util</module>
<!-- comenpents -->
<module>ps-mybatis</module>
<module>ps-mongodb</module>
<module>ps-workflow-engine</module>
<module>ps-workflow</module>
<!-- clients -->
<module>ps-client</module>
<!-- cores -->
<module>ps-core</module>
<!-- docs -->
<module>ps-docs</module>
<!-- services -->
<module>ps-service</module>
<!-- apps -->
<module>ps-app</module>
<!-- user cores -->
<module>ps-usr</module>
<module>ps-app-usr</module>
<module>ps-service-usr</module>
<!-- boot -->
<module>ps-boot</module>
</modules>
<repositories>
<repository>
<id>aliyunmaven</id>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ps</artifactId>
<groupId>com.ibiz</groupId>
<version>1.0.0.0</version>
</parent>
<artifactId>ps-app-usr</artifactId>
<name>Ps User Code</name>
<description>Ps user code</description>
<packaging>pom</packaging>
<modules>
<module>ps-app-usr-web</module>
</modules>
<dependencies>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ps-app-usr</artifactId>
<groupId>com.ibiz</groupId>
<version>1.0.0.0</version>
</parent>
<artifactId>ps-app-usr-web</artifactId>
<name>Ps User Code Web</name>
<description>Ps User Code Web</description>
<dependencies>
<dependency>
<groupId>com.ibiz</groupId>
<artifactId>ps-app-web</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ps</artifactId>
<groupId>com.ibiz</groupId>
<version>1.0.0.0</version>
</parent>
<artifactId>ps-app</artifactId>
<name>Ps Application</name>
<description>Ps Application</description>
<packaging>pom</packaging>
<modules>
<module>ps-app-web</module>
</modules>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-security</artifactId>
<version>2.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-cas</artifactId>
</dependency>
<dependency>
<groupId>com.ibiz</groupId>
<artifactId>ps-util</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ps-app</artifactId>
<groupId>com.ibiz</groupId>
<version>1.0.0.0</version>
</parent>
<artifactId>ps-app-web</artifactId>
<name>Ps Web</name>
<description>Ps Web</description>
<dependencies>
</dependencies>
<profiles>
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>exec-yarn-run-install</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<workingDirectory>../../app_Web</workingDirectory>
</configuration>
</execution>
<execution>
<id>exec-yarn-run-build</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument>build</argument>
</arguments>
<workingDirectory>../../app_Web</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/webapp</directory>
<!--注意此次必须要放在此目录下才能被访问到 -->
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>ps-app-web</finalName>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<mainClass>com.ibiz.web.WebApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
package com.ibiz.web;
import java.util.List;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ibiz.util.web.SearchContextHandlerMethodArgumentResolver;
import com.ibiz.util.serialize.DomainSerializerProvider;
import lombok.Data;
@SpringBootApplication(exclude = {
})
@Import({
FeignClientsConfiguration.class
})
@ComponentScans({
@ComponentScan(basePackages = {"com.ibiz.util", "com.ibiz.web"})
})
@EnableDiscoveryClient
@Configuration
@EnableFeignClients
@EnableConfigurationProperties(com.ibiz.web.WebApplication.WebClientProperties.class)
public class WebApplication extends WebMvcConfigurerAdapter{
public static void main(String[] args) {
SpringApplicationBuilder builder=new SpringApplicationBuilder(WebApplication.class);
builder.run(args);
}
@Bean
public MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter(ObjectMapper objectMapper) {
objectMapper.setSerializerProvider(new DomainSerializerProvider()) ;
final MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(objectMapper);
return converter;
}
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new SearchContextHandlerMethodArgumentResolver());
}
@ConfigurationProperties(prefix = "app.service.web")
@Data
public class WebClientProperties {
private String tokenUrl ;
private String clientId ;
private String clientSecret ;
private String serviceUrl ;
private String serviceId ;
}
}
package com.ibiz.web.app;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.ibiz.util.helper.SpringContextHolder;
import com.ibiz.util.security.userdetail.LoginUser;
import com.ibiz.util.web.SessionConstants;
import com.ibiz.util.web.AppContextConstants;
@RestController
@RequestMapping(value = "")
public class WebAppController {
@RequestMapping(method = RequestMethod.GET, value = "/appdata")
public ResponseEntity<JSONObject> getAppData() {
JSONObject appData = new JSONObject() ;
JSONObject context = new JSONObject() ;
List<Map> orgDepts = new ArrayList<Map>();
LoginUser loginUser = SpringContextHolder.getCurLoginUser();
if (loginUser != null) {
context.put(AppContextConstants.CONTEXT_USERID, loginUser.getPersonId());
context.put(AppContextConstants.CONTEXT_USERNAME, loginUser.getOrgUserName());
context.put(AppContextConstants.CONTEXT_USERICONPATH, loginUser.getUserIconPath());
context.put(AppContextConstants.CONTEXT_USERMODE, loginUser.getUserMode());
context.put(AppContextConstants.CONTEXT_LOGINNAME, loginUser.getUsername());
context.put(AppContextConstants.CONTEXT_LOCALE, loginUser.getLocale());
context.put(AppContextConstants.CONTEXT_TIMEZONE, loginUser.getTimeZone());
context.put(AppContextConstants.CONTEXT_ORGID, loginUser.getOrgId());
context.put(AppContextConstants.CONTEXT_ORGNAME, loginUser.getOrgName());
context.put(AppContextConstants.CONTEXT_ORGSECTORID, loginUser.getOrgDeptId());
context.put(AppContextConstants.CONTEXT_ORGSECTORNAME, loginUser.getOrgDeptName());
orgDepts = loginUser.getOrgDepts() ;
}
appData.put(AppContextConstants.CONTEXT_ORGSECTORS, orgDepts) ;
appData.put("context", context);
return ResponseEntity.status(HttpStatus.OK).body(appData);
}
}
\ No newline at end of file
package com.ibiz.web.module.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.PageRequest;
import com.ibiz.web.module.service.PSService;
import com.ibiz.web.module.domain.PS;
import com.ibiz.web.module.filter.*;
@RestController
@RequestMapping(value = "")
public class PSController {
@Autowired
PSService psservice;
@RequestMapping(method = RequestMethod.DELETE, value = "/ps/{ps_id}")
@PreAuthorize("@ps_pms.check(#ps_id,'DELETE')")
public ResponseEntity<Boolean> remove(@PathVariable("ps_id") String ps_id) {
boolean b = psservice.remove( ps_id);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method = RequestMethod.POST, value = "/ps")
@PreAuthorize("@ps_pms.check('CREATE')")
public ResponseEntity<PS> create(@RequestBody PS ps) {
PS ps2 = psservice.create(ps);
return ResponseEntity.status(HttpStatus.OK).body(ps2);
}
@RequestMapping(method = RequestMethod.GET, value = "/ps/{ps_id}")
@PreAuthorize("@ps_pms.check(#ps_id,'READ')")
public ResponseEntity<PS> get(@PathVariable("ps_id") String ps_id) {
PS ps = psservice.get( ps_id);
return ResponseEntity.status(HttpStatus.OK).body(ps);
}
@RequestMapping(method = RequestMethod.POST, value = "/ps/{ps_id}/xd")
@PreAuthorize("@ps_pms.check(#ps_id,'')")
public ResponseEntity<PS> xD(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) {
PS ps2 = psservice.xD(ps_id, ps);
return ResponseEntity.status(HttpStatus.OK).body(ps2);
}
@RequestMapping(method = RequestMethod.GET, value = "/ps/getdraft")
@PreAuthorize("@ps_pms.check('CREATE')")
public ResponseEntity<PS> getDraft() {
//PS ps = psservice.getDraft( ps_id);
return ResponseEntity.status(HttpStatus.OK).body(new PS());
}
@RequestMapping(method = RequestMethod.POST, value = "/ps/{ps_id}/save")
@PreAuthorize("@ps_pms.check(#ps_id,'')")
public ResponseEntity<PS> save(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) {
PS ps2 = psservice.save(ps_id, ps);
return ResponseEntity.status(HttpStatus.OK).body(ps2);
}
@RequestMapping(method = RequestMethod.PUT, value = "/ps/{ps_id}")
@PreAuthorize("@ps_pms.check(#ps_id,'UPDATE')")
public ResponseEntity<PS> update(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) {
PS ps2 = psservice.update(ps_id, ps);
return ResponseEntity.status(HttpStatus.OK).body(ps2);
}
@RequestMapping(method = RequestMethod.PUT, value = "/api/ps/{ps_id}")
@PreAuthorize("@ps_pms.check(#ps_id,'UPDATE')")
public ResponseEntity<PS> api_update(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) {
PS ps2 = psservice.update(ps_id, ps);
return ResponseEntity.status(HttpStatus.OK).body(ps2);
}
@RequestMapping(method = RequestMethod.POST, value = "/ps/{ps_id}/createandstartim")
@PreAuthorize("@ps_pms.check(#ps_id,'CREATE')")
public ResponseEntity<PS> createAndStartIM(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) {
PS ps2 = psservice.createAndStartIM(ps_id, ps);
return ResponseEntity.status(HttpStatus.OK).body(ps2);
}
@RequestMapping(method = RequestMethod.POST, value = "/ps/checkkey")
@PreAuthorize("@ps_pms.check('')")
public ResponseEntity<Boolean> checkKey(@RequestBody PS ps) {
boolean b = psservice.checkKey(ps);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method= RequestMethod.GET , value="/ps/fetchdefault")
@PreAuthorize("@ps_pms.check('READ')")
public ResponseEntity<List<PS>> fetchDefault(PSSearchContext searchContext,Pageable pageable) {
Page<PS> page = psservice.fetchDefault(searchContext);
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(pageable.getPageNumber()))
.header("x-per-page", String.valueOf(pageable.getPageSize()))
.header("x-total", String.valueOf(page.getTotalElements()))
.body(page.getContent());
}
}
package com.ibiz.web.module.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 应用实体[采购单]
*/
public class PS implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 更新时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
private Timestamp updateDate;
@JsonIgnore
private boolean updateDateDirtyFlag;
/**
* 更新人
*/
private String updateMan;
@JsonIgnore
private boolean updateManDirtyFlag;
/**
* 备注
*/
private String bz;
@JsonIgnore
private boolean bzDirtyFlag;
/**
* 建立时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
private Timestamp createDate;
@JsonIgnore
private boolean createDateDirtyFlag;
/**
* 采购单名称
*/
private String pSName;
@JsonIgnore
private boolean pSNameDirtyFlag;
/**
* 建立人
*/
private String createMan;
@JsonIgnore
private boolean createManDirtyFlag;
/**
* 采购单标识
*/
private String pSId;
@JsonIgnore
private boolean pSIdDirtyFlag;
/**
* NGRID
*/
private String ngrid;
@JsonIgnore
private boolean ngridDirtyFlag;
/**
* 获取 [更新时间]
*/
@JsonProperty("updatedate")
public Timestamp getUpdateDate(){
return this.updateDate ;
}
/**
* 设置 [更新时间]
*/
@JsonProperty("updatedate")
public void setUpdateDate(Timestamp updateDate){
this.updateDate = updateDate ;
this.updateDateDirtyFlag = true ;
}
/**
* 获取 [更新时间]脏标记
*/
@JsonIgnore
public boolean getUpdateDateDirtyFlag(){
return this.updateDateDirtyFlag ;
}
/**
* 获取 [更新人]
*/
@JsonProperty("updateman")
public String getUpdateMan(){
return this.updateMan ;
}
/**
* 设置 [更新人]
*/
@JsonProperty("updateman")
public void setUpdateMan(String updateMan){
this.updateMan = updateMan ;
this.updateManDirtyFlag = true ;
}
/**
* 获取 [更新人]脏标记
*/
@JsonIgnore
public boolean getUpdateManDirtyFlag(){
return this.updateManDirtyFlag ;
}
/**
* 获取 [备注]
*/
@JsonProperty("bz")
public String getBz(){
return this.bz ;
}
/**
* 设置 [备注]
*/
@JsonProperty("bz")
public void setBz(String bz){
this.bz = bz ;
this.bzDirtyFlag = true ;
}
/**
* 获取 [备注]脏标记
*/
@JsonIgnore
public boolean getBzDirtyFlag(){
return this.bzDirtyFlag ;
}
/**
* 获取 [建立时间]
*/
@JsonProperty("createdate")
public Timestamp getCreateDate(){
return this.createDate ;
}
/**
* 设置 [建立时间]
*/
@JsonProperty("createdate")
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.createDateDirtyFlag = true ;
}
/**
* 获取 [建立时间]脏标记
*/
@JsonIgnore
public boolean getCreateDateDirtyFlag(){
return this.createDateDirtyFlag ;
}
/**
* 获取 [采购单名称]
*/
@JsonProperty("psname")
public String getPSName(){
return this.pSName ;
}
/**
* 设置 [采购单名称]
*/
@JsonProperty("psname")
public void setPSName(String pSName){
this.pSName = pSName ;
this.pSNameDirtyFlag = true ;
}
/**
* 获取 [采购单名称]脏标记
*/
@JsonIgnore
public boolean getPSNameDirtyFlag(){
return this.pSNameDirtyFlag ;
}
/**
* 获取 [建立人]
*/
@JsonProperty("createman")
public String getCreateMan(){
return this.createMan ;
}
/**
* 设置 [建立人]
*/
@JsonProperty("createman")
public void setCreateMan(String createMan){
this.createMan = createMan ;
this.createManDirtyFlag = true ;
}
/**
* 获取 [建立人]脏标记
*/
@JsonIgnore
public boolean getCreateManDirtyFlag(){
return this.createManDirtyFlag ;
}
/**
* 获取 [采购单标识]
*/
@JsonProperty("psid")
public String getPSId(){
return this.pSId ;
}
/**
* 设置 [采购单标识]
*/
@JsonProperty("psid")
public void setPSId(String pSId){
this.pSId = pSId ;
this.pSIdDirtyFlag = true ;
}
/**
* 获取 [采购单标识]脏标记
*/
@JsonIgnore
public boolean getPSIdDirtyFlag(){
return this.pSIdDirtyFlag ;
}
/**
* 获取 [NGRID]
*/
@JsonProperty("ngrid")
public String getNgrid(){
return this.ngrid ;
}
/**
* 设置 [NGRID]
*/
@JsonProperty("ngrid")
public void setNgrid(String ngrid){
this.ngrid = ngrid ;
this.ngridDirtyFlag = true ;
}
/**
* 获取 [NGRID]脏标记
*/
@JsonIgnore
public boolean getNgridDirtyFlag(){
return this.ngridDirtyFlag ;
}
}
package com.ibiz.web.module.feign;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.ibiz.web.module.domain.PS;
import com.ibiz.web.module.filter.*;
public interface PSFeignClient {
@RequestMapping(method = RequestMethod.DELETE, value = "/web/ps/{ps_id}")
public Boolean remove(@PathVariable("ps_id") String ps_id) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/ps")
public PS create(@RequestBody PS ps) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/ps/{ps_id}")
public PS get(@PathVariable("ps_id") String ps_id) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/ps/{ps_id}/xd")
public PS xD(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/ps/{ps_id}/getdraft")
public PS getDraft(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/ps/{ps_id}/save")
public PS save(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) ;
@RequestMapping(method = RequestMethod.PUT, value = "/web/ps/{ps_id}")
public PS update(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/ps/{ps_id}/createandstartim")
public PS createAndStartIM(@PathVariable("ps_id") String ps_id, @RequestBody PS ps) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/ps/checkkey")
public Boolean checkKey(@RequestBody PS ps) ;
@RequestMapping(method= RequestMethod.GET , value="/web/ps/fetchdefault")
public Page<PS> fetchDefault(PSSearchContext searchContext) ;
}
package com.ibiz.web.module.filter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ibiz.util.SearchContext;
@Data
public class PSSearchContext extends SearchContext implements Serializable {
public String n_psname_like;//[采购单名称]
}
\ No newline at end of file
package com.ibiz.web.module.service;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
import org.springframework.stereotype.Service;
import feign.Client;
import feign.Contract;
import feign.Feign;
import feign.codec.Decoder;
import feign.codec.Encoder;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.DigestUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import com.ibiz.util.feign.suport.SearchContextFeignEncode;
import com.ibiz.web.module.domain.PS;
import com.ibiz.web.module.filter.*;
import com.ibiz.web.module.feign.PSFeignClient;
import com.ibiz.web.WebApplication.WebClientProperties;
import com.ibiz.util.feign.FeignRequestInterceptor;
@Service
public class PSService {
PSFeignClient client;
@Autowired
public PSService(Decoder decoder, Encoder encoder, Client client, Contract contract, FeignRequestInterceptor feignRequestInterceptor,
WebClientProperties webClientProperties) {
if (webClientProperties.getServiceId()!=null) {
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(PSFeignClient.class,"http://" + webClientProperties.getServiceId() + "/") ;
} else if (webClientProperties.getServiceUrl()!=null) {
if (client instanceof LoadBalancerFeignClient) {
client = ((LoadBalancerFeignClient) client).getDelegate();
}
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(PSFeignClient.class, "http://" + webClientProperties.getServiceUrl() + "/") ;
}
}
public boolean remove( String ps_id) {
return client.remove( ps_id);
}
public PS create(PS ps) {
return client.create(ps);
}
public PS get( String ps_id) {
return client.get( ps_id);
}
public PS xD(String ps_id, PS ps) {
return client.xD(ps_id, ps);
}
public PS getDraft(String ps_id, PS ps) {
return client.getDraft(ps_id, ps);
}
public PS save(String ps_id, PS ps) {
return client.save(ps_id, ps);
}
public PS update(String ps_id, PS ps) {
return client.update(ps_id, ps);
}
public PS createAndStartIM(String ps_id, PS ps) {
return client.createAndStartIM(ps_id, ps);
}
public boolean checkKey(PS ps) {
return client.checkKey(ps);
}
public Page<PS> fetchDefault(PSSearchContext searchContext) {
return client.fetchDefault(searchContext);
}
}
package com.ibiz.web.r7rt_org.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.PageRequest;
import com.ibiz.web.r7rt_org.service.OrgService;
import com.ibiz.web.r7rt_org.domain.Org;
import com.ibiz.web.r7rt_org.filter.*;
@RestController
@RequestMapping(value = "")
public class OrgController {
@Autowired
OrgService orgservice;
@RequestMapping(method = RequestMethod.GET, value = "/orgs/getdraft")
@PreAuthorize("@org_pms.check('CREATE')")
public ResponseEntity<Org> getDraft() {
//Org org = orgservice.getDraft( org_id);
return ResponseEntity.status(HttpStatus.OK).body(new Org());
}
@RequestMapping(method = RequestMethod.GET, value = "/orgs/{org_id}/getorgprent")
@PreAuthorize("@org_pms.check(#org_id,'READ')")
public ResponseEntity<Org> getOrgPrent(@PathVariable("org_id") String org_id, @RequestBody Org org) {
Org org2 = orgservice.getOrgPrent(org_id, org);
return ResponseEntity.status(HttpStatus.OK).body(org2);
}
@RequestMapping(method = RequestMethod.DELETE, value = "/orgs/{org_id}")
@PreAuthorize("@org_pms.check(#org_id,'DELETE')")
public ResponseEntity<Boolean> remove(@PathVariable("org_id") String org_id) {
boolean b = orgservice.remove( org_id);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method = RequestMethod.PUT, value = "/orgs/{org_id}")
@PreAuthorize("@org_pms.check(#org_id,'UPDATE')")
public ResponseEntity<Org> update(@PathVariable("org_id") String org_id, @RequestBody Org org) {
Org org2 = orgservice.update(org_id, org);
return ResponseEntity.status(HttpStatus.OK).body(org2);
}
@RequestMapping(method = RequestMethod.PUT, value = "/api/orgs/{org_id}")
@PreAuthorize("@org_pms.check(#org_id,'UPDATE')")
public ResponseEntity<Org> api_update(@PathVariable("org_id") String org_id, @RequestBody Org org) {
Org org2 = orgservice.update(org_id, org);
return ResponseEntity.status(HttpStatus.OK).body(org2);
}
@RequestMapping(method = RequestMethod.GET, value = "/orgs/{org_id}")
@PreAuthorize("@org_pms.check(#org_id,'READ')")
public ResponseEntity<Org> get(@PathVariable("org_id") String org_id) {
Org org = orgservice.get( org_id);
return ResponseEntity.status(HttpStatus.OK).body(org);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgs")
@PreAuthorize("@org_pms.check('CREATE')")
public ResponseEntity<Org> create(@RequestBody Org org) {
Org org2 = orgservice.create(org);
return ResponseEntity.status(HttpStatus.OK).body(org2);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgs/{org_id}/save")
@PreAuthorize("@org_pms.check(#org_id,'')")
public ResponseEntity<Org> save(@PathVariable("org_id") String org_id, @RequestBody Org org) {
Org org2 = orgservice.save(org_id, org);
return ResponseEntity.status(HttpStatus.OK).body(org2);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgs/{org_id}/synctousergroup")
@PreAuthorize("@org_pms.check(#org_id,'')")
public ResponseEntity<Org> syncToUserGroup(@PathVariable("org_id") String org_id, @RequestBody Org org) {
Org org2 = orgservice.syncToUserGroup(org_id, org);
return ResponseEntity.status(HttpStatus.OK).body(org2);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgs/checkkey")
@PreAuthorize("@org_pms.check('')")
public ResponseEntity<Boolean> checkKey(@RequestBody Org org) {
boolean b = orgservice.checkKey(org);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method = RequestMethod.GET, value = "/orgs/{org_id}/getorgchild")
@PreAuthorize("@org_pms.check(#org_id,'READ')")
public ResponseEntity<Org> getOrgChild(@PathVariable("org_id") String org_id, @RequestBody Org org) {
Org org2 = orgservice.getOrgChild(org_id, org);
return ResponseEntity.status(HttpStatus.OK).body(org2);
}
@RequestMapping(method= RequestMethod.GET , value="/orgs/fetchdefault")
@PreAuthorize("@org_pms.check('READ')")
public ResponseEntity<List<Org>> fetchDefault(OrgSearchContext searchContext,Pageable pageable) {
Page<Org> page = orgservice.fetchDefault(searchContext);
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(pageable.getPageNumber()))
.header("x-per-page", String.valueOf(pageable.getPageSize()))
.header("x-total", String.valueOf(page.getTotalElements()))
.body(page.getContent());
}
}
package com.ibiz.web.r7rt_org.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.PageRequest;
import com.ibiz.web.r7rt_org.service.OrgDeptService;
import com.ibiz.web.r7rt_org.domain.OrgDept;
import com.ibiz.web.r7rt_org.filter.*;
@RestController
@RequestMapping(value = "")
public class OrgDeptController {
@Autowired
OrgDeptService orgdeptservice;
@RequestMapping(method = RequestMethod.POST, value = "/orgdepts/{orgdept_id}/save")
@PreAuthorize("@orgdept_pms.check(#orgdept_id,'')")
public ResponseEntity<OrgDept> save(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) {
OrgDept orgdept2 = orgdeptservice.save(orgdept_id, orgdept);
return ResponseEntity.status(HttpStatus.OK).body(orgdept2);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgdepts/{orgdept_id}/synctousergroup")
@PreAuthorize("@orgdept_pms.check(#orgdept_id,'')")
public ResponseEntity<OrgDept> syncToUserGroup(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) {
OrgDept orgdept2 = orgdeptservice.syncToUserGroup(orgdept_id, orgdept);
return ResponseEntity.status(HttpStatus.OK).body(orgdept2);
}
@RequestMapping(method = RequestMethod.GET, value = "/orgdepts/{orgdept_id}/getorgdeptchild")
@PreAuthorize("@orgdept_pms.check(#orgdept_id,'READ')")
public ResponseEntity<OrgDept> getOrgDeptChild(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) {
OrgDept orgdept2 = orgdeptservice.getOrgDeptChild(orgdept_id, orgdept);
return ResponseEntity.status(HttpStatus.OK).body(orgdept2);
}
@RequestMapping(method = RequestMethod.DELETE, value = "/orgdepts/{orgdept_id}")
@PreAuthorize("@orgdept_pms.check(#orgdept_id,'DELETE')")
public ResponseEntity<Boolean> remove(@PathVariable("orgdept_id") String orgdept_id) {
boolean b = orgdeptservice.remove( orgdept_id);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method = RequestMethod.GET, value = "/orgdepts/{orgdept_id}")
@PreAuthorize("@orgdept_pms.check(#orgdept_id,'READ')")
public ResponseEntity<OrgDept> get(@PathVariable("orgdept_id") String orgdept_id) {
OrgDept orgdept = orgdeptservice.get( orgdept_id);
return ResponseEntity.status(HttpStatus.OK).body(orgdept);
}
@RequestMapping(method = RequestMethod.PUT, value = "/orgdepts/{orgdept_id}")
@PreAuthorize("@orgdept_pms.check(#orgdept_id,'UPDATE')")
public ResponseEntity<OrgDept> update(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) {
OrgDept orgdept2 = orgdeptservice.update(orgdept_id, orgdept);
return ResponseEntity.status(HttpStatus.OK).body(orgdept2);
}
@RequestMapping(method = RequestMethod.PUT, value = "/api/orgdepts/{orgdept_id}")
@PreAuthorize("@orgdept_pms.check(#orgdept_id,'UPDATE')")
public ResponseEntity<OrgDept> api_update(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) {
OrgDept orgdept2 = orgdeptservice.update(orgdept_id, orgdept);
return ResponseEntity.status(HttpStatus.OK).body(orgdept2);
}
@RequestMapping(method = RequestMethod.GET, value = "/orgdepts/getdraft")
@PreAuthorize("@orgdept_pms.check('CREATE')")
public ResponseEntity<OrgDept> getDraft() {
//OrgDept orgdept = orgdeptservice.getDraft( orgdept_id);
return ResponseEntity.status(HttpStatus.OK).body(new OrgDept());
}
@RequestMapping(method = RequestMethod.POST, value = "/orgdepts")
@PreAuthorize("@orgdept_pms.check('CREATE')")
public ResponseEntity<OrgDept> create(@RequestBody OrgDept orgdept) {
OrgDept orgdept2 = orgdeptservice.create(orgdept);
return ResponseEntity.status(HttpStatus.OK).body(orgdept2);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgdepts/checkkey")
@PreAuthorize("@orgdept_pms.check('')")
public ResponseEntity<Boolean> checkKey(@RequestBody OrgDept orgdept) {
boolean b = orgdeptservice.checkKey(orgdept);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method = RequestMethod.GET, value = "/orgdepts/{orgdept_id}/getorgdeptprent")
@PreAuthorize("@orgdept_pms.check(#orgdept_id,'READ')")
public ResponseEntity<OrgDept> getOrgDeptPrent(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) {
OrgDept orgdept2 = orgdeptservice.getOrgDeptPrent(orgdept_id, orgdept);
return ResponseEntity.status(HttpStatus.OK).body(orgdept2);
}
@RequestMapping(method= RequestMethod.GET , value="/orgdepts/fetchdefault")
@PreAuthorize("@orgdept_pms.check('READ')")
public ResponseEntity<List<OrgDept>> fetchDefault(OrgDeptSearchContext searchContext,Pageable pageable) {
Page<OrgDept> page = orgdeptservice.fetchDefault(searchContext);
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(pageable.getPageNumber()))
.header("x-per-page", String.valueOf(pageable.getPageSize()))
.header("x-total", String.valueOf(page.getTotalElements()))
.body(page.getContent());
}
@RequestMapping(method= RequestMethod.GET , value="/orgdepts/fetchcur_org")
@PreAuthorize("@orgdept_pms.check('READ')")
public ResponseEntity<List<OrgDept>> fetchCUR_ORG(OrgDeptSearchContext searchContext,Pageable pageable) {
Page<OrgDept> page = orgdeptservice.fetchCUR_ORG(searchContext);
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(pageable.getPageNumber()))
.header("x-per-page", String.valueOf(pageable.getPageSize()))
.header("x-total", String.valueOf(page.getTotalElements()))
.body(page.getContent());
}
}
package com.ibiz.web.r7rt_org.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.PageRequest;
import com.ibiz.web.r7rt_org.service.OrgDeptUserService;
import com.ibiz.web.r7rt_org.domain.OrgDeptUser;
import com.ibiz.web.r7rt_org.filter.*;
@RestController
@RequestMapping(value = "")
public class OrgDeptUserController {
@Autowired
OrgDeptUserService orgdeptuserservice;
@RequestMapping(method = RequestMethod.GET, value = "/orgdeptusers/getdraft")
@PreAuthorize("@orgdeptuser_pms.check('CREATE')")
public ResponseEntity<OrgDeptUser> getDraft() {
//OrgDeptUser orgdeptuser = orgdeptuserservice.getDraft( orgdeptuser_id);
return ResponseEntity.status(HttpStatus.OK).body(new OrgDeptUser());
}
@RequestMapping(method = RequestMethod.GET, value = "/orgdeptusers/{orgdeptuser_id}")
@PreAuthorize("@orgdeptuser_pms.check(#orgdeptuser_id,'READ')")
public ResponseEntity<OrgDeptUser> get(@PathVariable("orgdeptuser_id") String orgdeptuser_id) {
OrgDeptUser orgdeptuser = orgdeptuserservice.get( orgdeptuser_id);
return ResponseEntity.status(HttpStatus.OK).body(orgdeptuser);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgdeptusers/{orgdeptuser_id}/save")
@PreAuthorize("@orgdeptuser_pms.check(#orgdeptuser_id,'')")
public ResponseEntity<OrgDeptUser> save(@PathVariable("orgdeptuser_id") String orgdeptuser_id, @RequestBody OrgDeptUser orgdeptuser) {
OrgDeptUser orgdeptuser2 = orgdeptuserservice.save(orgdeptuser_id, orgdeptuser);
return ResponseEntity.status(HttpStatus.OK).body(orgdeptuser2);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgdeptusers")
@PreAuthorize("@orgdeptuser_pms.check('CREATE')")
public ResponseEntity<OrgDeptUser> create(@RequestBody OrgDeptUser orgdeptuser) {
OrgDeptUser orgdeptuser2 = orgdeptuserservice.create(orgdeptuser);
return ResponseEntity.status(HttpStatus.OK).body(orgdeptuser2);
}
@RequestMapping(method = RequestMethod.DELETE, value = "/orgdeptusers/{orgdeptuser_id}")
@PreAuthorize("@orgdeptuser_pms.check(#orgdeptuser_id,'DELETE')")
public ResponseEntity<Boolean> remove(@PathVariable("orgdeptuser_id") String orgdeptuser_id) {
boolean b = orgdeptuserservice.remove( orgdeptuser_id);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method = RequestMethod.PUT, value = "/orgdeptusers/{orgdeptuser_id}")
@PreAuthorize("@orgdeptuser_pms.check(#orgdeptuser_id,'UPDATE')")
public ResponseEntity<OrgDeptUser> update(@PathVariable("orgdeptuser_id") String orgdeptuser_id, @RequestBody OrgDeptUser orgdeptuser) {
OrgDeptUser orgdeptuser2 = orgdeptuserservice.update(orgdeptuser_id, orgdeptuser);
return ResponseEntity.status(HttpStatus.OK).body(orgdeptuser2);
}
@RequestMapping(method = RequestMethod.PUT, value = "/api/orgdeptusers/{orgdeptuser_id}")
@PreAuthorize("@orgdeptuser_pms.check(#orgdeptuser_id,'UPDATE')")
public ResponseEntity<OrgDeptUser> api_update(@PathVariable("orgdeptuser_id") String orgdeptuser_id, @RequestBody OrgDeptUser orgdeptuser) {
OrgDeptUser orgdeptuser2 = orgdeptuserservice.update(orgdeptuser_id, orgdeptuser);
return ResponseEntity.status(HttpStatus.OK).body(orgdeptuser2);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgdeptusers/checkkey")
@PreAuthorize("@orgdeptuser_pms.check('')")
public ResponseEntity<Boolean> checkKey(@RequestBody OrgDeptUser orgdeptuser) {
boolean b = orgdeptuserservice.checkKey(orgdeptuser);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method= RequestMethod.GET , value="/orgdeptusers/fetchgetorgdeptuser")
@PreAuthorize("@orgdeptuser_pms.check('READ')")
public ResponseEntity<List<OrgDeptUser>> fetchGetorgdeptuser(OrgDeptUserSearchContext searchContext,Pageable pageable) {
Page<OrgDeptUser> page = orgdeptuserservice.fetchGetorgdeptuser(searchContext);
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(pageable.getPageNumber()))
.header("x-per-page", String.valueOf(pageable.getPageSize()))
.header("x-total", String.valueOf(page.getTotalElements()))
.body(page.getContent());
}
@RequestMapping(method= RequestMethod.GET , value="/orgdeptusers/fetchdefault")
@PreAuthorize("@orgdeptuser_pms.check('READ')")
public ResponseEntity<List<OrgDeptUser>> fetchDefault(OrgDeptUserSearchContext searchContext,Pageable pageable) {
Page<OrgDeptUser> page = orgdeptuserservice.fetchDefault(searchContext);
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(pageable.getPageNumber()))
.header("x-per-page", String.valueOf(pageable.getPageSize()))
.header("x-total", String.valueOf(page.getTotalElements()))
.body(page.getContent());
}
}
package com.ibiz.web.r7rt_org.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.PageRequest;
import com.ibiz.web.r7rt_org.service.OrgUserService;
import com.ibiz.web.r7rt_org.domain.OrgUser;
import com.ibiz.web.r7rt_org.filter.*;
@RestController
@RequestMapping(value = "")
public class OrgUserController {
@Autowired
OrgUserService orguserservice;
@RequestMapping(method = RequestMethod.DELETE, value = "/orgusers/{orguser_id}")
@PreAuthorize("@orguser_pms.check(#orguser_id,'DELETE')")
public ResponseEntity<Boolean> remove(@PathVariable("orguser_id") String orguser_id) {
boolean b = orguserservice.remove( orguser_id);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgusers/{orguser_id}/save")
@PreAuthorize("@orguser_pms.check(#orguser_id,'')")
public ResponseEntity<OrgUser> save(@PathVariable("orguser_id") String orguser_id, @RequestBody OrgUser orguser) {
OrgUser orguser2 = orguserservice.save(orguser_id, orguser);
return ResponseEntity.status(HttpStatus.OK).body(orguser2);
}
@RequestMapping(method = RequestMethod.PUT, value = "/orgusers/{orguser_id}")
@PreAuthorize("@orguser_pms.check(#orguser_id,'UPDATE')")
public ResponseEntity<OrgUser> update(@PathVariable("orguser_id") String orguser_id, @RequestBody OrgUser orguser) {
OrgUser orguser2 = orguserservice.update(orguser_id, orguser);
return ResponseEntity.status(HttpStatus.OK).body(orguser2);
}
@RequestMapping(method = RequestMethod.PUT, value = "/api/orgusers/{orguser_id}")
@PreAuthorize("@orguser_pms.check(#orguser_id,'UPDATE')")
public ResponseEntity<OrgUser> api_update(@PathVariable("orguser_id") String orguser_id, @RequestBody OrgUser orguser) {
OrgUser orguser2 = orguserservice.update(orguser_id, orguser);
return ResponseEntity.status(HttpStatus.OK).body(orguser2);
}
@RequestMapping(method = RequestMethod.POST, value = "/orgusers/checkkey")
@PreAuthorize("@orguser_pms.check('')")
public ResponseEntity<Boolean> checkKey(@RequestBody OrgUser orguser) {
boolean b = orguserservice.checkKey(orguser);
return ResponseEntity.status(HttpStatus.OK).body(b);
}
@RequestMapping(method = RequestMethod.GET, value = "/orgusers/getdraft")
@PreAuthorize("@orguser_pms.check('CREATE')")
public ResponseEntity<OrgUser> getDraft() {
//OrgUser orguser = orguserservice.getDraft( orguser_id);
return ResponseEntity.status(HttpStatus.OK).body(new OrgUser());
}
@RequestMapping(method = RequestMethod.POST, value = "/orgusers")
@PreAuthorize("@orguser_pms.check('CREATE')")
public ResponseEntity<OrgUser> create(@RequestBody OrgUser orguser) {
OrgUser orguser2 = orguserservice.create(orguser);
return ResponseEntity.status(HttpStatus.OK).body(orguser2);
}
@RequestMapping(method = RequestMethod.GET, value = "/orgusers/{orguser_id}")
@PreAuthorize("@orguser_pms.check(#orguser_id,'READ')")
public ResponseEntity<OrgUser> get(@PathVariable("orguser_id") String orguser_id) {
OrgUser orguser = orguserservice.get( orguser_id);
return ResponseEntity.status(HttpStatus.OK).body(orguser);
}
@RequestMapping(method= RequestMethod.GET , value="/orgusers/fetchdefault")
@PreAuthorize("@orguser_pms.check('READ')")
public ResponseEntity<List<OrgUser>> fetchDefault(OrgUserSearchContext searchContext,Pageable pageable) {
Page<OrgUser> page = orguserservice.fetchDefault(searchContext);
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(pageable.getPageNumber()))
.header("x-per-page", String.valueOf(pageable.getPageSize()))
.header("x-total", String.valueOf(page.getTotalElements()))
.body(page.getContent());
}
}
package com.ibiz.web.r7rt_org.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 应用实体[组织]
*/
public class Org implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 是否启用
*/
private Integer enable;
@JsonIgnore
private boolean enableDirtyFlag;
/**
* 更新人
*/
private String updateMan;
@JsonIgnore
private boolean updateManDirtyFlag;
/**
* 组织名称
*/
private String orgName;
@JsonIgnore
private boolean orgNameDirtyFlag;
/**
* 建立人
*/
private String createMan;
@JsonIgnore
private boolean createManDirtyFlag;
/**
* 组织编码
*/
private String orgCode;
@JsonIgnore
private boolean orgCodeDirtyFlag;
/**
* 更新时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
private Timestamp updateDate;
@JsonIgnore
private boolean updateDateDirtyFlag;
/**
* 级别编码
*/
private String levelCode;
@JsonIgnore
private boolean levelCodeDirtyFlag;
/**
* 组织标识
*/
private String orgId;
@JsonIgnore
private boolean orgIdDirtyFlag;
/**
* 建立时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
private Timestamp createDate;
@JsonIgnore
private boolean createDateDirtyFlag;
/**
* 上级组织
*/
private String pOrgName;
@JsonIgnore
private boolean pOrgNameDirtyFlag;
/**
* 上级组织标识
*/
private String pOrgId;
@JsonIgnore
private boolean pOrgIdDirtyFlag;
/**
* 获取 [是否启用]
*/
@JsonProperty("enable")
public Integer getEnable(){
return this.enable ;
}
/**
* 设置 [是否启用]
*/
@JsonProperty("enable")
public void setEnable(Integer enable){
this.enable = enable ;
this.enableDirtyFlag = true ;
}
/**
* 获取 [是否启用]脏标记
*/
@JsonIgnore
public boolean getEnableDirtyFlag(){
return this.enableDirtyFlag ;
}
/**
* 获取 [更新人]
*/
@JsonProperty("updateman")
public String getUpdateMan(){
return this.updateMan ;
}
/**
* 设置 [更新人]
*/
@JsonProperty("updateman")
public void setUpdateMan(String updateMan){
this.updateMan = updateMan ;
this.updateManDirtyFlag = true ;
}
/**
* 获取 [更新人]脏标记
*/
@JsonIgnore
public boolean getUpdateManDirtyFlag(){
return this.updateManDirtyFlag ;
}
/**
* 获取 [组织名称]
*/
@JsonProperty("orgname")
public String getOrgName(){
return this.orgName ;
}
/**
* 设置 [组织名称]
*/
@JsonProperty("orgname")
public void setOrgName(String orgName){
this.orgName = orgName ;
this.orgNameDirtyFlag = true ;
}
/**
* 获取 [组织名称]脏标记
*/
@JsonIgnore
public boolean getOrgNameDirtyFlag(){
return this.orgNameDirtyFlag ;
}
/**
* 获取 [建立人]
*/
@JsonProperty("createman")
public String getCreateMan(){
return this.createMan ;
}
/**
* 设置 [建立人]
*/
@JsonProperty("createman")
public void setCreateMan(String createMan){
this.createMan = createMan ;
this.createManDirtyFlag = true ;
}
/**
* 获取 [建立人]脏标记
*/
@JsonIgnore
public boolean getCreateManDirtyFlag(){
return this.createManDirtyFlag ;
}
/**
* 获取 [组织编码]
*/
@JsonProperty("orgcode")
public String getOrgCode(){
return this.orgCode ;
}
/**
* 设置 [组织编码]
*/
@JsonProperty("orgcode")
public void setOrgCode(String orgCode){
this.orgCode = orgCode ;
this.orgCodeDirtyFlag = true ;
}
/**
* 获取 [组织编码]脏标记
*/
@JsonIgnore
public boolean getOrgCodeDirtyFlag(){
return this.orgCodeDirtyFlag ;
}
/**
* 获取 [更新时间]
*/
@JsonProperty("updatedate")
public Timestamp getUpdateDate(){
return this.updateDate ;
}
/**
* 设置 [更新时间]
*/
@JsonProperty("updatedate")
public void setUpdateDate(Timestamp updateDate){
this.updateDate = updateDate ;
this.updateDateDirtyFlag = true ;
}
/**
* 获取 [更新时间]脏标记
*/
@JsonIgnore
public boolean getUpdateDateDirtyFlag(){
return this.updateDateDirtyFlag ;
}
/**
* 获取 [级别编码]
*/
@JsonProperty("levelcode")
public String getLevelCode(){
return this.levelCode ;
}
/**
* 设置 [级别编码]
*/
@JsonProperty("levelcode")
public void setLevelCode(String levelCode){
this.levelCode = levelCode ;
this.levelCodeDirtyFlag = true ;
}
/**
* 获取 [级别编码]脏标记
*/
@JsonIgnore
public boolean getLevelCodeDirtyFlag(){
return this.levelCodeDirtyFlag ;
}
/**
* 获取 [组织标识]
*/
@JsonProperty("orgid")
public String getOrgId(){
return this.orgId ;
}
/**
* 设置 [组织标识]
*/
@JsonProperty("orgid")
public void setOrgId(String orgId){
this.orgId = orgId ;
this.orgIdDirtyFlag = true ;
}
/**
* 获取 [组织标识]脏标记
*/
@JsonIgnore
public boolean getOrgIdDirtyFlag(){
return this.orgIdDirtyFlag ;
}
/**
* 获取 [建立时间]
*/
@JsonProperty("createdate")
public Timestamp getCreateDate(){
return this.createDate ;
}
/**
* 设置 [建立时间]
*/
@JsonProperty("createdate")
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.createDateDirtyFlag = true ;
}
/**
* 获取 [建立时间]脏标记
*/
@JsonIgnore
public boolean getCreateDateDirtyFlag(){
return this.createDateDirtyFlag ;
}
/**
* 获取 [上级组织]
*/
@JsonProperty("porgname")
public String getPOrgName(){
return this.pOrgName ;
}
/**
* 设置 [上级组织]
*/
@JsonProperty("porgname")
public void setPOrgName(String pOrgName){
this.pOrgName = pOrgName ;
this.pOrgNameDirtyFlag = true ;
}
/**
* 获取 [上级组织]脏标记
*/
@JsonIgnore
public boolean getPOrgNameDirtyFlag(){
return this.pOrgNameDirtyFlag ;
}
/**
* 获取 [上级组织标识]
*/
@JsonProperty("porgid")
public String getPOrgId(){
return this.pOrgId ;
}
/**
* 设置 [上级组织标识]
*/
@JsonProperty("porgid")
public void setPOrgId(String pOrgId){
this.pOrgId = pOrgId ;
this.pOrgIdDirtyFlag = true ;
}
/**
* 获取 [上级组织标识]脏标记
*/
@JsonIgnore
public boolean getPOrgIdDirtyFlag(){
return this.pOrgIdDirtyFlag ;
}
}
package com.ibiz.web.r7rt_org.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 应用实体[部门]
*/
public class OrgDept implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 部门编码
*/
private String deptCode;
@JsonIgnore
private boolean deptCodeDirtyFlag;
/**
* 是否启用
*/
private Integer enable;
@JsonIgnore
private boolean enableDirtyFlag;
/**
* 部门名称
*/
private String orgDeptName;
@JsonIgnore
private boolean orgDeptNameDirtyFlag;
/**
* 建立时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
private Timestamp createDate;
@JsonIgnore
private boolean createDateDirtyFlag;
/**
* 更新人
*/
private String updateMan;
@JsonIgnore
private boolean updateManDirtyFlag;
/**
* 建立人
*/
private String createMan;
@JsonIgnore
private boolean createManDirtyFlag;
/**
* 更新时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
private Timestamp updateDate;
@JsonIgnore
private boolean updateDateDirtyFlag;
/**
* 部门标识
*/
private String orgDeptId;
@JsonIgnore
private boolean orgDeptIdDirtyFlag;
/**
* 级别编码
*/
private String levelCode;
@JsonIgnore
private boolean levelCodeDirtyFlag;
/**
* 组织名称
*/
private String orgName;
@JsonIgnore
private boolean orgNameDirtyFlag;
/**
* 部门名称
*/
private String pOrgDeptName;
@JsonIgnore
private boolean pOrgDeptNameDirtyFlag;
/**
* 组织标识
*/
private String orgId;
@JsonIgnore
private boolean orgIdDirtyFlag;
/**
* 部门标识
*/
private String pOrgDeptId;
@JsonIgnore
private boolean pOrgDeptIdDirtyFlag;
/**
* 获取 [部门编码]
*/
@JsonProperty("deptcode")
public String getDeptCode(){
return this.deptCode ;
}
/**
* 设置 [部门编码]
*/
@JsonProperty("deptcode")
public void setDeptCode(String deptCode){
this.deptCode = deptCode ;
this.deptCodeDirtyFlag = true ;
}
/**
* 获取 [部门编码]脏标记
*/
@JsonIgnore
public boolean getDeptCodeDirtyFlag(){
return this.deptCodeDirtyFlag ;
}
/**
* 获取 [是否启用]
*/
@JsonProperty("enable")
public Integer getEnable(){
return this.enable ;
}
/**
* 设置 [是否启用]
*/
@JsonProperty("enable")
public void setEnable(Integer enable){
this.enable = enable ;
this.enableDirtyFlag = true ;
}
/**
* 获取 [是否启用]脏标记
*/
@JsonIgnore
public boolean getEnableDirtyFlag(){
return this.enableDirtyFlag ;
}
/**
* 获取 [部门名称]
*/
@JsonProperty("orgdeptname")
public String getOrgDeptName(){
return this.orgDeptName ;
}
/**
* 设置 [部门名称]
*/
@JsonProperty("orgdeptname")
public void setOrgDeptName(String orgDeptName){
this.orgDeptName = orgDeptName ;
this.orgDeptNameDirtyFlag = true ;
}
/**
* 获取 [部门名称]脏标记
*/
@JsonIgnore
public boolean getOrgDeptNameDirtyFlag(){
return this.orgDeptNameDirtyFlag ;
}
/**
* 获取 [建立时间]
*/
@JsonProperty("createdate")
public Timestamp getCreateDate(){
return this.createDate ;
}
/**
* 设置 [建立时间]
*/
@JsonProperty("createdate")
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.createDateDirtyFlag = true ;
}
/**
* 获取 [建立时间]脏标记
*/
@JsonIgnore
public boolean getCreateDateDirtyFlag(){
return this.createDateDirtyFlag ;
}
/**
* 获取 [更新人]
*/
@JsonProperty("updateman")
public String getUpdateMan(){
return this.updateMan ;
}
/**
* 设置 [更新人]
*/
@JsonProperty("updateman")
public void setUpdateMan(String updateMan){
this.updateMan = updateMan ;
this.updateManDirtyFlag = true ;
}
/**
* 获取 [更新人]脏标记
*/
@JsonIgnore
public boolean getUpdateManDirtyFlag(){
return this.updateManDirtyFlag ;
}
/**
* 获取 [建立人]
*/
@JsonProperty("createman")
public String getCreateMan(){
return this.createMan ;
}
/**
* 设置 [建立人]
*/
@JsonProperty("createman")
public void setCreateMan(String createMan){
this.createMan = createMan ;
this.createManDirtyFlag = true ;
}
/**
* 获取 [建立人]脏标记
*/
@JsonIgnore
public boolean getCreateManDirtyFlag(){
return this.createManDirtyFlag ;
}
/**
* 获取 [更新时间]
*/
@JsonProperty("updatedate")
public Timestamp getUpdateDate(){
return this.updateDate ;
}
/**
* 设置 [更新时间]
*/
@JsonProperty("updatedate")
public void setUpdateDate(Timestamp updateDate){
this.updateDate = updateDate ;
this.updateDateDirtyFlag = true ;
}
/**
* 获取 [更新时间]脏标记
*/
@JsonIgnore
public boolean getUpdateDateDirtyFlag(){
return this.updateDateDirtyFlag ;
}
/**
* 获取 [部门标识]
*/
@JsonProperty("orgdeptid")
public String getOrgDeptId(){
return this.orgDeptId ;
}
/**
* 设置 [部门标识]
*/
@JsonProperty("orgdeptid")
public void setOrgDeptId(String orgDeptId){
this.orgDeptId = orgDeptId ;
this.orgDeptIdDirtyFlag = true ;
}
/**
* 获取 [部门标识]脏标记
*/
@JsonIgnore
public boolean getOrgDeptIdDirtyFlag(){
return this.orgDeptIdDirtyFlag ;
}
/**
* 获取 [级别编码]
*/
@JsonProperty("levelcode")
public String getLevelCode(){
return this.levelCode ;
}
/**
* 设置 [级别编码]
*/
@JsonProperty("levelcode")
public void setLevelCode(String levelCode){
this.levelCode = levelCode ;
this.levelCodeDirtyFlag = true ;
}
/**
* 获取 [级别编码]脏标记
*/
@JsonIgnore
public boolean getLevelCodeDirtyFlag(){
return this.levelCodeDirtyFlag ;
}
/**
* 获取 [组织名称]
*/
@JsonProperty("orgname")
public String getOrgName(){
return this.orgName ;
}
/**
* 设置 [组织名称]
*/
@JsonProperty("orgname")
public void setOrgName(String orgName){
this.orgName = orgName ;
this.orgNameDirtyFlag = true ;
}
/**
* 获取 [组织名称]脏标记
*/
@JsonIgnore
public boolean getOrgNameDirtyFlag(){
return this.orgNameDirtyFlag ;
}
/**
* 获取 [部门名称]
*/
@JsonProperty("porgdeptname")
public String getPOrgDeptName(){
return this.pOrgDeptName ;
}
/**
* 设置 [部门名称]
*/
@JsonProperty("porgdeptname")
public void setPOrgDeptName(String pOrgDeptName){
this.pOrgDeptName = pOrgDeptName ;
this.pOrgDeptNameDirtyFlag = true ;
}
/**
* 获取 [部门名称]脏标记
*/
@JsonIgnore
public boolean getPOrgDeptNameDirtyFlag(){
return this.pOrgDeptNameDirtyFlag ;
}
/**
* 获取 [组织标识]
*/
@JsonProperty("orgid")
public String getOrgId(){
return this.orgId ;
}
/**
* 设置 [组织标识]
*/
@JsonProperty("orgid")
public void setOrgId(String orgId){
this.orgId = orgId ;
this.orgIdDirtyFlag = true ;
}
/**
* 获取 [组织标识]脏标记
*/
@JsonIgnore
public boolean getOrgIdDirtyFlag(){
return this.orgIdDirtyFlag ;
}
/**
* 获取 [部门标识]
*/
@JsonProperty("porgdeptid")
public String getPOrgDeptId(){
return this.pOrgDeptId ;
}
/**
* 设置 [部门标识]
*/
@JsonProperty("porgdeptid")
public void setPOrgDeptId(String pOrgDeptId){
this.pOrgDeptId = pOrgDeptId ;
this.pOrgDeptIdDirtyFlag = true ;
}
/**
* 获取 [部门标识]脏标记
*/
@JsonIgnore
public boolean getPOrgDeptIdDirtyFlag(){
return this.pOrgDeptIdDirtyFlag ;
}
}
package com.ibiz.web.r7rt_org.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 应用实体[部门用户]
*/
public class OrgDeptUser implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 更新人
*/
private String updateMan;
@JsonIgnore
private boolean updateManDirtyFlag;
/**
* 部门用户标识
*/
private String orgDeptUserId;
@JsonIgnore
private boolean orgDeptUserIdDirtyFlag;
/**
* 建立时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
private Timestamp createDate;
@JsonIgnore
private boolean createDateDirtyFlag;
/**
* 建立人
*/
private String createMan;
@JsonIgnore
private boolean createManDirtyFlag;
/**
* 是否启用
*/
private Integer enable;
@JsonIgnore
private boolean enableDirtyFlag;
/**
* 部门用户名称
*/
private String orgDeptUserName;
@JsonIgnore
private boolean orgDeptUserNameDirtyFlag;
/**
* 更新时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
private Timestamp updateDate;
@JsonIgnore
private boolean updateDateDirtyFlag;
/**
* 组织名称
*/
private String orgName;
@JsonIgnore
private boolean orgNameDirtyFlag;
/**
* 部门名称
*/
private String orgDeptName;
@JsonIgnore
private boolean orgDeptNameDirtyFlag;
/**
* 组织用户名称
*/
private String orgUserName;
@JsonIgnore
private boolean orgUserNameDirtyFlag;
/**
* 组织用户标识
*/
private String orgUserId;
@JsonIgnore
private boolean orgUserIdDirtyFlag;
/**
* 组织标识
*/
private String orgId;
@JsonIgnore
private boolean orgIdDirtyFlag;
/**
* 部门标识
*/
private String orgDeptId;
@JsonIgnore
private boolean orgDeptIdDirtyFlag;
/**
* 获取 [更新人]
*/
@JsonProperty("updateman")
public String getUpdateMan(){
return this.updateMan ;
}
/**
* 设置 [更新人]
*/
@JsonProperty("updateman")
public void setUpdateMan(String updateMan){
this.updateMan = updateMan ;
this.updateManDirtyFlag = true ;
}
/**
* 获取 [更新人]脏标记
*/
@JsonIgnore
public boolean getUpdateManDirtyFlag(){
return this.updateManDirtyFlag ;
}
/**
* 获取 [部门用户标识]
*/
@JsonProperty("orgdeptuserid")
public String getOrgDeptUserId(){
return this.orgDeptUserId ;
}
/**
* 设置 [部门用户标识]
*/
@JsonProperty("orgdeptuserid")
public void setOrgDeptUserId(String orgDeptUserId){
this.orgDeptUserId = orgDeptUserId ;
this.orgDeptUserIdDirtyFlag = true ;
}
/**
* 获取 [部门用户标识]脏标记
*/
@JsonIgnore
public boolean getOrgDeptUserIdDirtyFlag(){
return this.orgDeptUserIdDirtyFlag ;
}
/**
* 获取 [建立时间]
*/
@JsonProperty("createdate")
public Timestamp getCreateDate(){
return this.createDate ;
}
/**
* 设置 [建立时间]
*/
@JsonProperty("createdate")
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.createDateDirtyFlag = true ;
}
/**
* 获取 [建立时间]脏标记
*/
@JsonIgnore
public boolean getCreateDateDirtyFlag(){
return this.createDateDirtyFlag ;
}
/**
* 获取 [建立人]
*/
@JsonProperty("createman")
public String getCreateMan(){
return this.createMan ;
}
/**
* 设置 [建立人]
*/
@JsonProperty("createman")
public void setCreateMan(String createMan){
this.createMan = createMan ;
this.createManDirtyFlag = true ;
}
/**
* 获取 [建立人]脏标记
*/
@JsonIgnore
public boolean getCreateManDirtyFlag(){
return this.createManDirtyFlag ;
}
/**
* 获取 [是否启用]
*/
@JsonProperty("enable")
public Integer getEnable(){
return this.enable ;
}
/**
* 设置 [是否启用]
*/
@JsonProperty("enable")
public void setEnable(Integer enable){
this.enable = enable ;
this.enableDirtyFlag = true ;
}
/**
* 获取 [是否启用]脏标记
*/
@JsonIgnore
public boolean getEnableDirtyFlag(){
return this.enableDirtyFlag ;
}
/**
* 获取 [部门用户名称]
*/
@JsonProperty("orgdeptusername")
public String getOrgDeptUserName(){
return this.orgDeptUserName ;
}
/**
* 设置 [部门用户名称]
*/
@JsonProperty("orgdeptusername")
public void setOrgDeptUserName(String orgDeptUserName){
this.orgDeptUserName = orgDeptUserName ;
this.orgDeptUserNameDirtyFlag = true ;
}
/**
* 获取 [部门用户名称]脏标记
*/
@JsonIgnore
public boolean getOrgDeptUserNameDirtyFlag(){
return this.orgDeptUserNameDirtyFlag ;
}
/**
* 获取 [更新时间]
*/
@JsonProperty("updatedate")
public Timestamp getUpdateDate(){
return this.updateDate ;
}
/**
* 设置 [更新时间]
*/
@JsonProperty("updatedate")
public void setUpdateDate(Timestamp updateDate){
this.updateDate = updateDate ;
this.updateDateDirtyFlag = true ;
}
/**
* 获取 [更新时间]脏标记
*/
@JsonIgnore
public boolean getUpdateDateDirtyFlag(){
return this.updateDateDirtyFlag ;
}
/**
* 获取 [组织名称]
*/
@JsonProperty("orgname")
public String getOrgName(){
return this.orgName ;
}
/**
* 设置 [组织名称]
*/
@JsonProperty("orgname")
public void setOrgName(String orgName){
this.orgName = orgName ;
this.orgNameDirtyFlag = true ;
}
/**
* 获取 [组织名称]脏标记
*/
@JsonIgnore
public boolean getOrgNameDirtyFlag(){
return this.orgNameDirtyFlag ;
}
/**
* 获取 [部门名称]
*/
@JsonProperty("orgdeptname")
public String getOrgDeptName(){
return this.orgDeptName ;
}
/**
* 设置 [部门名称]
*/
@JsonProperty("orgdeptname")
public void setOrgDeptName(String orgDeptName){
this.orgDeptName = orgDeptName ;
this.orgDeptNameDirtyFlag = true ;
}
/**
* 获取 [部门名称]脏标记
*/
@JsonIgnore
public boolean getOrgDeptNameDirtyFlag(){
return this.orgDeptNameDirtyFlag ;
}
/**
* 获取 [组织用户名称]
*/
@JsonProperty("orgusername")
public String getOrgUserName(){
return this.orgUserName ;
}
/**
* 设置 [组织用户名称]
*/
@JsonProperty("orgusername")
public void setOrgUserName(String orgUserName){
this.orgUserName = orgUserName ;
this.orgUserNameDirtyFlag = true ;
}
/**
* 获取 [组织用户名称]脏标记
*/
@JsonIgnore
public boolean getOrgUserNameDirtyFlag(){
return this.orgUserNameDirtyFlag ;
}
/**
* 获取 [组织用户标识]
*/
@JsonProperty("orguserid")
public String getOrgUserId(){
return this.orgUserId ;
}
/**
* 设置 [组织用户标识]
*/
@JsonProperty("orguserid")
public void setOrgUserId(String orgUserId){
this.orgUserId = orgUserId ;
this.orgUserIdDirtyFlag = true ;
}
/**
* 获取 [组织用户标识]脏标记
*/
@JsonIgnore
public boolean getOrgUserIdDirtyFlag(){
return this.orgUserIdDirtyFlag ;
}
/**
* 获取 [组织标识]
*/
@JsonProperty("orgid")
public String getOrgId(){
return this.orgId ;
}
/**
* 设置 [组织标识]
*/
@JsonProperty("orgid")
public void setOrgId(String orgId){
this.orgId = orgId ;
this.orgIdDirtyFlag = true ;
}
/**
* 获取 [组织标识]脏标记
*/
@JsonIgnore
public boolean getOrgIdDirtyFlag(){
return this.orgIdDirtyFlag ;
}
/**
* 获取 [部门标识]
*/
@JsonProperty("orgdeptid")
public String getOrgDeptId(){
return this.orgDeptId ;
}
/**
* 设置 [部门标识]
*/
@JsonProperty("orgdeptid")
public void setOrgDeptId(String orgDeptId){
this.orgDeptId = orgDeptId ;
this.orgDeptIdDirtyFlag = true ;
}
/**
* 获取 [部门标识]脏标记
*/
@JsonIgnore
public boolean getOrgDeptIdDirtyFlag(){
return this.orgDeptIdDirtyFlag ;
}
}
package com.ibiz.web.r7rt_org.feign;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.ibiz.web.r7rt_org.domain.OrgDept;
import com.ibiz.web.r7rt_org.filter.*;
public interface OrgDeptFeignClient {
@RequestMapping(method = RequestMethod.POST, value = "/web/orgdepts/{orgdept_id}/save")
public OrgDept save(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgdepts/{orgdept_id}/synctousergroup")
public OrgDept syncToUserGroup(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgdepts/{orgdept_id}/getorgdeptchild")
public OrgDept getOrgDeptChild(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) ;
@RequestMapping(method = RequestMethod.DELETE, value = "/web/orgdepts/{orgdept_id}")
public Boolean remove(@PathVariable("orgdept_id") String orgdept_id) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgdepts/{orgdept_id}")
public OrgDept get(@PathVariable("orgdept_id") String orgdept_id) ;
@RequestMapping(method = RequestMethod.PUT, value = "/web/orgdepts/{orgdept_id}")
public OrgDept update(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgdepts/{orgdept_id}/getdraft")
public OrgDept getDraft(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgdepts")
public OrgDept create(@RequestBody OrgDept orgdept) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgdepts/checkkey")
public Boolean checkKey(@RequestBody OrgDept orgdept) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgdepts/{orgdept_id}/getorgdeptprent")
public OrgDept getOrgDeptPrent(@PathVariable("orgdept_id") String orgdept_id, @RequestBody OrgDept orgdept) ;
@RequestMapping(method= RequestMethod.GET , value="/web/orgdepts/fetchdefault")
public Page<OrgDept> fetchDefault(OrgDeptSearchContext searchContext) ;
@RequestMapping(method= RequestMethod.GET , value="/web/orgdepts/fetchcur_org")
public Page<OrgDept> fetchCUR_ORG(OrgDeptSearchContext searchContext) ;
}
package com.ibiz.web.r7rt_org.feign;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.ibiz.web.r7rt_org.domain.OrgDeptUser;
import com.ibiz.web.r7rt_org.filter.*;
public interface OrgDeptUserFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/web/orgdeptusers/{orgdeptuser_id}/getdraft")
public OrgDeptUser getDraft(@PathVariable("orgdeptuser_id") String orgdeptuser_id, @RequestBody OrgDeptUser orgdeptuser) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgdeptusers/{orgdeptuser_id}")
public OrgDeptUser get(@PathVariable("orgdeptuser_id") String orgdeptuser_id) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgdeptusers/{orgdeptuser_id}/save")
public OrgDeptUser save(@PathVariable("orgdeptuser_id") String orgdeptuser_id, @RequestBody OrgDeptUser orgdeptuser) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgdeptusers")
public OrgDeptUser create(@RequestBody OrgDeptUser orgdeptuser) ;
@RequestMapping(method = RequestMethod.DELETE, value = "/web/orgdeptusers/{orgdeptuser_id}")
public Boolean remove(@PathVariable("orgdeptuser_id") String orgdeptuser_id) ;
@RequestMapping(method = RequestMethod.PUT, value = "/web/orgdeptusers/{orgdeptuser_id}")
public OrgDeptUser update(@PathVariable("orgdeptuser_id") String orgdeptuser_id, @RequestBody OrgDeptUser orgdeptuser) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgdeptusers/checkkey")
public Boolean checkKey(@RequestBody OrgDeptUser orgdeptuser) ;
@RequestMapping(method= RequestMethod.GET , value="/web/orgdeptusers/fetchgetorgdeptuser")
public Page<OrgDeptUser> fetchGetorgdeptuser(OrgDeptUserSearchContext searchContext) ;
@RequestMapping(method= RequestMethod.GET , value="/web/orgdeptusers/fetchdefault")
public Page<OrgDeptUser> fetchDefault(OrgDeptUserSearchContext searchContext) ;
}
package com.ibiz.web.r7rt_org.feign;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.ibiz.web.r7rt_org.domain.Org;
import com.ibiz.web.r7rt_org.filter.*;
public interface OrgFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/web/orgs/{org_id}/getdraft")
public Org getDraft(@PathVariable("org_id") String org_id, @RequestBody Org org) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgs/{org_id}/getorgprent")
public Org getOrgPrent(@PathVariable("org_id") String org_id, @RequestBody Org org) ;
@RequestMapping(method = RequestMethod.DELETE, value = "/web/orgs/{org_id}")
public Boolean remove(@PathVariable("org_id") String org_id) ;
@RequestMapping(method = RequestMethod.PUT, value = "/web/orgs/{org_id}")
public Org update(@PathVariable("org_id") String org_id, @RequestBody Org org) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgs/{org_id}")
public Org get(@PathVariable("org_id") String org_id) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgs")
public Org create(@RequestBody Org org) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgs/{org_id}/save")
public Org save(@PathVariable("org_id") String org_id, @RequestBody Org org) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgs/{org_id}/synctousergroup")
public Org syncToUserGroup(@PathVariable("org_id") String org_id, @RequestBody Org org) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgs/checkkey")
public Boolean checkKey(@RequestBody Org org) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgs/{org_id}/getorgchild")
public Org getOrgChild(@PathVariable("org_id") String org_id, @RequestBody Org org) ;
@RequestMapping(method= RequestMethod.GET , value="/web/orgs/fetchdefault")
public Page<Org> fetchDefault(OrgSearchContext searchContext) ;
}
package com.ibiz.web.r7rt_org.feign;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.ibiz.web.r7rt_org.domain.OrgUser;
import com.ibiz.web.r7rt_org.filter.*;
public interface OrgUserFeignClient {
@RequestMapping(method = RequestMethod.DELETE, value = "/web/orgusers/{orguser_id}")
public Boolean remove(@PathVariable("orguser_id") String orguser_id) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgusers/{orguser_id}/save")
public OrgUser save(@PathVariable("orguser_id") String orguser_id, @RequestBody OrgUser orguser) ;
@RequestMapping(method = RequestMethod.PUT, value = "/web/orgusers/{orguser_id}")
public OrgUser update(@PathVariable("orguser_id") String orguser_id, @RequestBody OrgUser orguser) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgusers/checkkey")
public Boolean checkKey(@RequestBody OrgUser orguser) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgusers/{orguser_id}/getdraft")
public OrgUser getDraft(@PathVariable("orguser_id") String orguser_id, @RequestBody OrgUser orguser) ;
@RequestMapping(method = RequestMethod.POST, value = "/web/orgusers")
public OrgUser create(@RequestBody OrgUser orguser) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/orgusers/{orguser_id}")
public OrgUser get(@PathVariable("orguser_id") String orguser_id) ;
@RequestMapping(method= RequestMethod.GET , value="/web/orgusers/fetchdefault")
public Page<OrgUser> fetchDefault(OrgUserSearchContext searchContext) ;
}
package com.ibiz.web.r7rt_org.filter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ibiz.util.SearchContext;
@Data
public class OrgDeptSearchContext extends SearchContext implements Serializable {
public String n_orgdeptname_like;//[部门名称]
public String n_orgname_eq;//[组织名称]
public String n_orgname_like;//[组织名称]
public String n_porgdeptname_eq;//[部门名称]
public String n_porgdeptname_like;//[部门名称]
public String n_orgid_eq;//[组织标识]
public String n_porgdeptid_eq;//[部门标识]
}
\ No newline at end of file
package com.ibiz.web.r7rt_org.filter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ibiz.util.SearchContext;
@Data
public class OrgDeptUserSearchContext extends SearchContext implements Serializable {
public String n_orgdeptusername_like;//[部门用户名称]
public String n_orgname_eq;//[组织名称]
public String n_orgname_like;//[组织名称]
public String n_orgdeptname_eq;//[部门名称]
public String n_orgdeptname_like;//[部门名称]
public String n_orgusername_eq;//[组织用户名称]
public String n_orgusername_like;//[组织用户名称]
public String n_orguserid_eq;//[组织用户标识]
public String n_orgid_eq;//[组织标识]
public String n_orgdeptid_eq;//[部门标识]
}
\ No newline at end of file
package com.ibiz.web.r7rt_org.filter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ibiz.util.SearchContext;
@Data
public class OrgSearchContext extends SearchContext implements Serializable {
public String n_orgname_like;//[组织名称]
public String n_porgname_eq;//[上级组织]
public String n_porgname_like;//[上级组织]
public String n_porgid_eq;//[上级组织标识]
}
\ No newline at end of file
package com.ibiz.web.r7rt_org.filter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ibiz.util.SearchContext;
@Data
public class OrgUserSearchContext extends SearchContext implements Serializable {
public String n_orgusername_like;//[组织用户名称]
public String n_orgname_eq;//[组织名称]
public String n_orgname_like;//[组织名称]
public String n_orgid_eq;//[组织标识]
}
\ No newline at end of file
package com.ibiz.web.r7rt_org.service;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
import org.springframework.stereotype.Service;
import feign.Client;
import feign.Contract;
import feign.Feign;
import feign.codec.Decoder;
import feign.codec.Encoder;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.DigestUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import com.ibiz.util.feign.suport.SearchContextFeignEncode;
import com.ibiz.web.r7rt_org.domain.OrgDept;
import com.ibiz.web.r7rt_org.filter.*;
import com.ibiz.web.r7rt_org.feign.OrgDeptFeignClient;
import com.ibiz.web.WebApplication.WebClientProperties;
import com.ibiz.util.feign.FeignRequestInterceptor;
@Service
public class OrgDeptService {
OrgDeptFeignClient client;
@Autowired
public OrgDeptService(Decoder decoder, Encoder encoder, Client client, Contract contract, FeignRequestInterceptor feignRequestInterceptor,
WebClientProperties webClientProperties) {
if (webClientProperties.getServiceId()!=null) {
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(OrgDeptFeignClient.class,"http://" + webClientProperties.getServiceId() + "/") ;
} else if (webClientProperties.getServiceUrl()!=null) {
if (client instanceof LoadBalancerFeignClient) {
client = ((LoadBalancerFeignClient) client).getDelegate();
}
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(OrgDeptFeignClient.class, "http://" + webClientProperties.getServiceUrl() + "/") ;
}
}
public OrgDept save(String orgdept_id, OrgDept orgdept) {
return client.save(orgdept_id, orgdept);
}
public OrgDept syncToUserGroup(String orgdept_id, OrgDept orgdept) {
return client.syncToUserGroup(orgdept_id, orgdept);
}
public OrgDept getOrgDeptChild(String orgdept_id, OrgDept orgdept) {
return client.getOrgDeptChild(orgdept_id, orgdept);
}
public boolean remove( String orgdept_id) {
return client.remove( orgdept_id);
}
public OrgDept get( String orgdept_id) {
return client.get( orgdept_id);
}
public OrgDept update(String orgdept_id, OrgDept orgdept) {
return client.update(orgdept_id, orgdept);
}
public OrgDept getDraft(String orgdept_id, OrgDept orgdept) {
return client.getDraft(orgdept_id, orgdept);
}
public OrgDept create(OrgDept orgdept) {
return client.create(orgdept);
}
public boolean checkKey(OrgDept orgdept) {
return client.checkKey(orgdept);
}
public OrgDept getOrgDeptPrent(String orgdept_id, OrgDept orgdept) {
return client.getOrgDeptPrent(orgdept_id, orgdept);
}
public Page<OrgDept> fetchDefault(OrgDeptSearchContext searchContext) {
return client.fetchDefault(searchContext);
}
public Page<OrgDept> fetchCUR_ORG(OrgDeptSearchContext searchContext) {
return client.fetchCUR_ORG(searchContext);
}
}
package com.ibiz.web.r7rt_org.service;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
import org.springframework.stereotype.Service;
import feign.Client;
import feign.Contract;
import feign.Feign;
import feign.codec.Decoder;
import feign.codec.Encoder;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.DigestUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import com.ibiz.util.feign.suport.SearchContextFeignEncode;
import com.ibiz.web.r7rt_org.domain.OrgDeptUser;
import com.ibiz.web.r7rt_org.filter.*;
import com.ibiz.web.r7rt_org.feign.OrgDeptUserFeignClient;
import com.ibiz.web.WebApplication.WebClientProperties;
import com.ibiz.util.feign.FeignRequestInterceptor;
@Service
public class OrgDeptUserService {
OrgDeptUserFeignClient client;
@Autowired
public OrgDeptUserService(Decoder decoder, Encoder encoder, Client client, Contract contract, FeignRequestInterceptor feignRequestInterceptor,
WebClientProperties webClientProperties) {
if (webClientProperties.getServiceId()!=null) {
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(OrgDeptUserFeignClient.class,"http://" + webClientProperties.getServiceId() + "/") ;
} else if (webClientProperties.getServiceUrl()!=null) {
if (client instanceof LoadBalancerFeignClient) {
client = ((LoadBalancerFeignClient) client).getDelegate();
}
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(OrgDeptUserFeignClient.class, "http://" + webClientProperties.getServiceUrl() + "/") ;
}
}
public OrgDeptUser getDraft(String orgdeptuser_id, OrgDeptUser orgdeptuser) {
return client.getDraft(orgdeptuser_id, orgdeptuser);
}
public OrgDeptUser get( String orgdeptuser_id) {
return client.get( orgdeptuser_id);
}
public OrgDeptUser save(String orgdeptuser_id, OrgDeptUser orgdeptuser) {
return client.save(orgdeptuser_id, orgdeptuser);
}
public OrgDeptUser create(OrgDeptUser orgdeptuser) {
return client.create(orgdeptuser);
}
public boolean remove( String orgdeptuser_id) {
return client.remove( orgdeptuser_id);
}
public OrgDeptUser update(String orgdeptuser_id, OrgDeptUser orgdeptuser) {
return client.update(orgdeptuser_id, orgdeptuser);
}
public boolean checkKey(OrgDeptUser orgdeptuser) {
return client.checkKey(orgdeptuser);
}
public Page<OrgDeptUser> fetchGetorgdeptuser(OrgDeptUserSearchContext searchContext) {
return client.fetchGetorgdeptuser(searchContext);
}
public Page<OrgDeptUser> fetchDefault(OrgDeptUserSearchContext searchContext) {
return client.fetchDefault(searchContext);
}
}
package com.ibiz.web.r7rt_org.service;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
import org.springframework.stereotype.Service;
import feign.Client;
import feign.Contract;
import feign.Feign;
import feign.codec.Decoder;
import feign.codec.Encoder;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.DigestUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import com.ibiz.util.feign.suport.SearchContextFeignEncode;
import com.ibiz.web.r7rt_org.domain.Org;
import com.ibiz.web.r7rt_org.filter.*;
import com.ibiz.web.r7rt_org.feign.OrgFeignClient;
import com.ibiz.web.WebApplication.WebClientProperties;
import com.ibiz.util.feign.FeignRequestInterceptor;
@Service
public class OrgService {
OrgFeignClient client;
@Autowired
public OrgService(Decoder decoder, Encoder encoder, Client client, Contract contract, FeignRequestInterceptor feignRequestInterceptor,
WebClientProperties webClientProperties) {
if (webClientProperties.getServiceId()!=null) {
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(OrgFeignClient.class,"http://" + webClientProperties.getServiceId() + "/") ;
} else if (webClientProperties.getServiceUrl()!=null) {
if (client instanceof LoadBalancerFeignClient) {
client = ((LoadBalancerFeignClient) client).getDelegate();
}
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(OrgFeignClient.class, "http://" + webClientProperties.getServiceUrl() + "/") ;
}
}
public Org getDraft(String org_id, Org org) {
return client.getDraft(org_id, org);
}
public Org getOrgPrent(String org_id, Org org) {
return client.getOrgPrent(org_id, org);
}
public boolean remove( String org_id) {
return client.remove( org_id);
}
public Org update(String org_id, Org org) {
return client.update(org_id, org);
}
public Org get( String org_id) {
return client.get( org_id);
}
public Org create(Org org) {
return client.create(org);
}
public Org save(String org_id, Org org) {
return client.save(org_id, org);
}
public Org syncToUserGroup(String org_id, Org org) {
return client.syncToUserGroup(org_id, org);
}
public boolean checkKey(Org org) {
return client.checkKey(org);
}
public Org getOrgChild(String org_id, Org org) {
return client.getOrgChild(org_id, org);
}
public Page<Org> fetchDefault(OrgSearchContext searchContext) {
return client.fetchDefault(searchContext);
}
}
package com.ibiz.web.r7rt_org.service;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
import org.springframework.stereotype.Service;
import feign.Client;
import feign.Contract;
import feign.Feign;
import feign.codec.Decoder;
import feign.codec.Encoder;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.DigestUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import com.ibiz.util.feign.suport.SearchContextFeignEncode;
import com.ibiz.web.r7rt_org.domain.OrgUser;
import com.ibiz.web.r7rt_org.filter.*;
import com.ibiz.web.r7rt_org.feign.OrgUserFeignClient;
import com.ibiz.web.WebApplication.WebClientProperties;
import com.ibiz.util.feign.FeignRequestInterceptor;
@Service
public class OrgUserService {
OrgUserFeignClient client;
@Autowired
public OrgUserService(Decoder decoder, Encoder encoder, Client client, Contract contract, FeignRequestInterceptor feignRequestInterceptor,
WebClientProperties webClientProperties) {
if (webClientProperties.getServiceId()!=null) {
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(OrgUserFeignClient.class,"http://" + webClientProperties.getServiceId() + "/") ;
} else if (webClientProperties.getServiceUrl()!=null) {
if (client instanceof LoadBalancerFeignClient) {
client = ((LoadBalancerFeignClient) client).getDelegate();
}
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(OrgUserFeignClient.class, "http://" + webClientProperties.getServiceUrl() + "/") ;
}
}
public boolean remove( String orguser_id) {
return client.remove( orguser_id);
}
public OrgUser save(String orguser_id, OrgUser orguser) {
return client.save(orguser_id, orguser);
}
public OrgUser update(String orguser_id, OrgUser orguser) {
return client.update(orguser_id, orguser);
}
public boolean checkKey(OrgUser orguser) {
return client.checkKey(orguser);
}
public OrgUser getDraft(String orguser_id, OrgUser orguser) {
return client.getDraft(orguser_id, orguser);
}
public OrgUser create(OrgUser orguser) {
return client.create(orguser);
}
public OrgUser get( String orguser_id) {
return client.get( orguser_id);
}
public Page<OrgUser> fetchDefault(OrgUserSearchContext searchContext) {
return client.fetchDefault(searchContext);
}
}
package com.ibiz.web.rt.controller;
import com.ibiz.web.rt.domain.SRFFILE;
import com.ibiz.web.rt.domain.SRFFILEItem;
import com.ibiz.web.rt.service.SRFFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.UUID;
/**
* 文件上传下载
*/
@RestController
@RequestMapping("/")
public class SRFFileController
{
@Autowired
private SRFFileService srfFileService;
//文件存在目录
@Value("${ibiz.filepath:/app/file/}")
private String FILEPATH;
//文件上传URL
private final String defaultuploadpath="ibizutil/upload";
//文件下载URL
private final String defaultdownloadpath="ibizutil/download/{id}";
/**
* 文件上传
* @param multipartFile
* @return
* @throws Exception
*/
@PostMapping(value = "${ibiz.file.uploadpath:"+defaultuploadpath+"}")
public ResponseEntity<SRFFILEItem> upload(@RequestParam("file") MultipartFile multipartFile) throws Exception {
// 获取文件名
String fileName = multipartFile.getOriginalFilename();
// 获取文件后缀
String extname="."+getExtensionName(fileName);
// 用uuid作为文件名,防止生成的临时文件重复
String fileid= UUID.randomUUID().toString();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String filepath=dateFormat.format(new java.util.Date())+ File.separator+fileid+ File.separator;
SRFFILE ibzfile=new SRFFILE();
ibzfile.setSRFFILEId(fileid);
ibzfile.setSRFFILEName(fileName);
ibzfile.setFileext(extname);
ibzfile.setFilesize((int)multipartFile.getSize());
ibzfile.setFilepath(filepath+fileName);
boolean flag = srfFileService.save(fileid,ibzfile);
if(!flag){
throw new Exception("文件上传发生异常,存储文件记录失败!");
}
String dirPath=FILEPATH+filepath;
File dir=new File(dirPath);
if(!dir.exists()){
dir.mkdirs();
}
File file = new File(dir,fileName);
FileCopyUtils.copy(multipartFile.getInputStream(), Files.newOutputStream(file.toPath()));
SRFFILEItem fileItem=new SRFFILEItem(fileid,fileName,file.length(),extname);
return ResponseEntity.ok().body(fileItem);
}
/**
* 文件下载
* @param id
* @param response
* @throws Exception
*/
@GetMapping(value = "${ibiz.file.downloadpath:"+defaultdownloadpath+"}")
@ResponseStatus(HttpStatus.OK)
public void download(@PathVariable String id, HttpServletResponse response) throws Exception {
File file= getFile(id);
String fileName=file.getName();
try {
fileName=new String(fileName.getBytes("utf-8"),"iso8859-1");//防止中文乱码
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
response.setHeader("Content-Disposition", "attachment;filename="+fileName);
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
try {
bis = new BufferedInputStream(new FileInputStream(file));
bos = new BufferedOutputStream(response.getOutputStream());
byte[] buff = new byte[2048];
int bytesRead;
while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
bos.write(buff, 0, bytesRead);
}
}
catch (Exception e) {
//throw e;
}
finally {
if (bis != null) {
try {
bis.close();
}
catch (IOException e) {
}
}
if (bos != null) {
try {
bos.close();
}
catch (IOException e) {
}
}
}
}
/**
* 获取file
* @param id
* @return
* @throws Exception
*/
private File getFile(String id) throws Exception {
SRFFILE ibzfile=srfFileService.get(id);
if(ibzfile==null)
throw new Exception("获取文件失败");
String filepath=ibzfile.getFilepath();
filepath=filepath.replace("\\",File.separator);
filepath=filepath.replace("/",File.separator);
File file=new File(FILEPATH+filepath);
if(!file.exists())
throw new Exception("获取文件失败");
return file;
}
/**
* 获取文件扩展名
* @param filename
* @return
*/
private String getExtensionName(String filename) {
if ((filename != null) && (filename.length() > 0)) {
int dot = filename.lastIndexOf('.');
if ((dot >-1) && (dot < (filename.length() - 1))) {
return filename.substring(dot + 1);
}
}
return filename;
}
}
\ No newline at end of file
package com.ibiz.web.rt.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* 上传文件对象
*/
@Data
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@AllArgsConstructor
public class SRFFILEItem
{
private String fileid;
private String filename;
private long filesize;
private String extname;
}
package com.ibiz.web.rt.feign;
import com.ibiz.web.rt.domain.SRFFILE;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
public interface SRFFileFeignClient {
@RequestMapping(method = RequestMethod.POST, value = "/web/srffiles/{srffile_id}/save")
boolean save(@PathVariable("srffile_id") String fileId, @RequestBody SRFFILE srffile) ;
@RequestMapping(method = RequestMethod.GET, value = "/web/srffiles/{srffile_id}")
SRFFILE get(@PathVariable("srffile_id") String fileId) ;
}
package com.ibiz.web.rt.service;
import com.ibiz.util.feign.FeignRequestInterceptor;
import com.ibiz.util.feign.suport.SearchContextFeignEncode;
import com.ibiz.web.WebApplication;
import com.ibiz.web.rt.domain.SRFFILE;
import com.ibiz.web.rt.feign.SRFFileFeignClient;
import feign.Client;
import feign.Contract;
import feign.Feign;
import feign.codec.Decoder;
import feign.codec.Encoder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
import org.springframework.stereotype.Component;
/**
* 文件上传
*/
@Component
public class SRFFileService {
SRFFileFeignClient client;
@Autowired
public SRFFileService(Decoder decoder, Encoder encoder, Client client, Contract contract, FeignRequestInterceptor feignRequestInterceptor,
WebApplication.WebClientProperties webClientProperties) {
if (webClientProperties.getServiceId()!=null) {
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(SRFFileFeignClient.class,"http://" + webClientProperties.getServiceId() + "/") ;
} else if (webClientProperties.getServiceUrl()!=null) {
if (client instanceof LoadBalancerFeignClient) {
client = ((LoadBalancerFeignClient) client).getDelegate();
}
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.client = nameBuilder.target(SRFFileFeignClient.class, "http://" + webClientProperties.getServiceUrl() + "/") ;
}
}
/**
* 保存file记录
* @param fileId
* @param ibzfile
* @return
*/
public boolean save(String fileId, SRFFILE ibzfile) {
return client.save(fileId, ibzfile);
}
/**
* 获取file记录
* @param fileId
* @return
*/
public SRFFILE get(String fileId) {
return client.get(fileId);
}
}
package com.ibiz.web.security.cas;
import org.jasig.cas.client.validation.Cas20ServiceTicketValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.cas.ServiceProperties;
import org.springframework.security.cas.authentication.CasAssertionAuthenticationToken;
import org.springframework.security.cas.authentication.CasAuthenticationProvider;
import org.springframework.security.cas.web.CasAuthenticationEntryPoint;
import org.springframework.security.cas.web.CasAuthenticationFilter;
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
import org.springframework.security.web.authentication.logout.LogoutFilter;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
@Configuration
@EnableConfigurationProperties({CasServerConfig.class, CasServiceConfig.class})
public class CasConfiguration {
@Autowired
private CasServerConfig casServerConfig;
@Autowired
private CasServiceConfig casServiceConfig;
@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setService(this.casServiceConfig.getHost() + this.casServiceConfig.getLogin());
serviceProperties.setSendRenew(this.casServiceConfig.getSendRenew());
return serviceProperties;
}
@Bean
public CasAuthenticationFilter casAuthenticationFilter(AuthenticationManager authenticationManager ,ServiceProperties serviceProperties) {
CasAuthenticationFilter casAuthenticationFilter = new CasAuthenticationFilter();
casAuthenticationFilter.setAuthenticationManager(authenticationManager);
casAuthenticationFilter.setServiceProperties(serviceProperties);
casAuthenticationFilter.setFilterProcessesUrl(this.casServiceConfig.getLogin());
casAuthenticationFilter.setContinueChainBeforeSuccessfulAuthentication(false);
casAuthenticationFilter.setAuthenticationSuccessHandler(
new SimpleUrlAuthenticationSuccessHandler("/")
);
return casAuthenticationFilter;
}
@Bean
public CasAuthenticationEntryPoint casAuthenticationEntryPoint(ServiceProperties serviceProperties) {
CasAuthenticationEntryPoint entryPoint = new CasAuthenticationEntryPoint();
entryPoint.setLoginUrl(this.casServerConfig.getLogin());
entryPoint.setServiceProperties(serviceProperties);
return entryPoint;
}
@Bean
public Cas20ServiceTicketValidator cas20ServiceTicketValidator() {
return new Cas20ServiceTicketValidator(this.casServerConfig.getHost());
}
/**用户自定义的AuthenticationUserDetailsService*/
@Bean
public AuthenticationUserDetailsService<CasAssertionAuthenticationToken> casUserDetailsService(){
return new CasUserDetailsService();
}
@Bean
public CasAuthenticationProvider casAuthenticationProvider(
ServiceProperties serviceProperties, Cas20ServiceTicketValidator ticketValidator) {
CasAuthenticationProvider provider = new CasAuthenticationProvider();
provider.setKey("casProvider");
provider.setServiceProperties(serviceProperties);
provider.setTicketValidator(ticketValidator);
provider.setAuthenticationUserDetailsService(casUserDetailsService());
return provider;
}
@Bean
public LogoutFilter logoutFilter() {
String logoutRedirectPath = this.casServerConfig.getLogout() + "?service=" +
this.casServiceConfig.getHost();
LogoutFilter logoutFilter = new LogoutFilter(logoutRedirectPath, new SecurityContextLogoutHandler());
logoutFilter.setFilterProcessesUrl(this.casServiceConfig.getLogout());
return logoutFilter;
}
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册