From fd95fbe8bd3afb6ea9a676c07948a95a09503c1b Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 3 Apr 2025 18:04:36 +0800 Subject: [PATCH] TreeSelect --- .../houqin/constant/CustLoginTypeEnum.java | 96 ----- .../common/houqin/domain/CustCasual.java | 337 ------------------ .../common/houqin/domain/CustCasualModel.java | 18 - .../houqin/domain/CustInfoAppIdLoginDTO.java | 25 -- .../houqin/domain/CustInfoAppIdLoginVO.java | 42 --- .../houqin/oss/OssAutoConfiguration.java | 42 --- .../common/houqin/oss/OssProperties.java | 110 ------ .../common/houqin/oss/http/OssEndpoint.java | 120 ------- .../houqin/oss/service/OssTemplate.java | 142 -------- .../canteen/alloc/domain/TreeSelect.java | 16 - 10 files changed, 948 deletions(-) delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/CustLoginTypeEnum.java delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustCasual.java delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustCasualModel.java delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustInfoAppIdLoginDTO.java delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustInfoAppIdLoginVO.java delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/OssAutoConfiguration.java delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/OssProperties.java delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/http/OssEndpoint.java delete mode 100644 bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/service/OssTemplate.java diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/CustLoginTypeEnum.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/CustLoginTypeEnum.java deleted file mode 100644 index 43a8002..0000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/CustLoginTypeEnum.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.bonus.common.houqin.constant; - -import java.util.HashMap; -import java.util.Map; - -public enum CustLoginTypeEnum { - NAME_PWD(1, "姓名+密码"), - TEL_PWD(2, "手机号+密码"), - TEL_CODE(3, "手机号+验证码"), - NAME_CUST_NUM_PWD(4, "姓名+工号+密码"), - ID_CARD_PWD(5, "身份证号+密码"); - - private final Integer key; - private final String value; - - private CustLoginTypeEnum(Integer key, String value) { - this.key = key; - this.value = value; - } - - public static Integer getKey(String value) { - CustLoginTypeEnum[] enums = values(); - CustLoginTypeEnum[] var2 = enums; - int var3 = enums.length; - - for(int var4 = 0; var4 < var3; ++var4) { - CustLoginTypeEnum temp = var2[var4]; - if (temp.value().equals(value)) { - return temp.key(); - } - } - - return null; - } - - public static String getValue(Integer key) { - CustLoginTypeEnum[] enums = values(); - CustLoginTypeEnum[] var2 = enums; - int var3 = enums.length; - - for(int var4 = 0; var4 < var3; ++var4) { - CustLoginTypeEnum temp = var2[var4]; - if (temp.key().equals(key)) { - return temp.value(); - } - } - - return null; - } - - public static Map getLoginTypeToMap() { - Map map = new HashMap(); - CustLoginTypeEnum[] enums = values(); - CustLoginTypeEnum[] var2 = enums; - int var3 = enums.length; - - for(int var4 = 0; var4 < var3; ++var4) { - CustLoginTypeEnum temp = var2[var4]; - map.put(temp.key, temp.value); - } - - return map; - } - - public static Map getNeedPasswordLoginTypeToMap() { - HashMap map = new HashMap(); - map.put(TEL_PWD.key, TEL_PWD.value); - map.put(NAME_PWD.key, NAME_PWD.value); - map.put(NAME_CUST_NUM_PWD.key, NAME_CUST_NUM_PWD.value); - map.put(ID_CARD_PWD.key, ID_CARD_PWD.value); - return map; - } - - public static boolean contains(Integer loginType) { - CustLoginTypeEnum[] enums = values(); - CustLoginTypeEnum[] var2 = enums; - int var3 = enums.length; - - for(int var4 = 0; var4 < var3; ++var4) { - CustLoginTypeEnum temp = var2[var4]; - if (temp.key().equals(loginType)) { - return true; - } - } - - return false; - } - - public Integer key() { - return this.key; - } - - public String value() { - return this.value; - } -} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustCasual.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustCasual.java deleted file mode 100644 index ac1b65a..0000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustCasual.java +++ /dev/null @@ -1,337 +0,0 @@ -package com.bonus.common.houqin.domain; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.LocalDateTime; - -@ApiModel("临时人员表") -public class CustCasual { - private static final long serialVersionUID = 1L; - - @ApiModelProperty("主键自增") - private Long id; - @ApiModelProperty("临时人员id") - private Long casualId; - @ApiModelProperty("临时人员名称") - private String casualName; - @ApiModelProperty("人员id") - private Long custId; - @ApiModelProperty("手机号") - private String mobile; - @ApiModelProperty("邮箱") - private String email; - @ApiModelProperty("地址") - private String address; - @ApiModelProperty("openid") - private String openid; - @ApiModelProperty("来源类型 1-钉钉 2-微信 3-小程序") - private Integer sourceType; - @ApiModelProperty("是否删除") - private Integer ifDel; - @ApiModelProperty("乐观锁") - private Integer revision; - @ApiModelProperty("创建人") - private String crby; - @ApiModelProperty("创建时间") - private LocalDateTime crtime; - @ApiModelProperty("更新人") - private String upby; - @ApiModelProperty("更新时间") - private LocalDateTime uptime; - @ApiModelProperty("支付宝签约号") - private String alipayContractNum; - @ApiModelProperty("支付宝-企业码-员工id") - private String entCodeEmpId; - @ApiModelProperty("IOT开通刷脸支持唯一操作流水号") - private String uniqueId; - - public static CustCasualBuilder builder() { - return new CustCasualBuilder(); - } - - public Long getId() { - return this.id; - } - - public Long getCasualId() { - return this.casualId; - } - - public String getCasualName() { - return this.casualName; - } - - public Long getCustId() { - return this.custId; - } - - public String getMobile() { - return this.mobile; - } - - public String getEmail() { - return this.email; - } - - public String getAddress() { - return this.address; - } - - public String getOpenid() { - return this.openid; - } - - public Integer getSourceType() { - return this.sourceType; - } - - public Integer getIfDel() { - return this.ifDel; - } - - public Integer getRevision() { - return this.revision; - } - - public String getCrby() { - return this.crby; - } - - public LocalDateTime getCrtime() { - return this.crtime; - } - - public String getUpby() { - return this.upby; - } - - public LocalDateTime getUptime() { - return this.uptime; - } - - public String getAlipayContractNum() { - return this.alipayContractNum; - } - - public String getEntCodeEmpId() { - return this.entCodeEmpId; - } - - public String getUniqueId() { - return this.uniqueId; - } - - public void setId(final Long id) { - this.id = id; - } - - public void setCasualId(final Long casualId) { - this.casualId = casualId; - } - - public void setCasualName(final String casualName) { - this.casualName = casualName; - } - - public void setCustId(final Long custId) { - this.custId = custId; - } - - public void setMobile(final String mobile) { - this.mobile = mobile; - } - - public void setEmail(final String email) { - this.email = email; - } - - public void setAddress(final String address) { - this.address = address; - } - - public void setOpenid(final String openid) { - this.openid = openid; - } - - public void setSourceType(final Integer sourceType) { - this.sourceType = sourceType; - } - - public void setIfDel(final Integer ifDel) { - this.ifDel = ifDel; - } - - public void setRevision(final Integer revision) { - this.revision = revision; - } - - public void setCrby(final String crby) { - this.crby = crby; - } - - public void setCrtime(final LocalDateTime crtime) { - this.crtime = crtime; - } - - public void setUpby(final String upby) { - this.upby = upby; - } - - public void setUptime(final LocalDateTime uptime) { - this.uptime = uptime; - } - - public void setAlipayContractNum(final String alipayContractNum) { - this.alipayContractNum = alipayContractNum; - } - - public void setEntCodeEmpId(final String entCodeEmpId) { - this.entCodeEmpId = entCodeEmpId; - } - - public void setUniqueId(final String uniqueId) { - this.uniqueId = uniqueId; - } - - public CustCasual(final Long id, final Long casualId, final String casualName, final Long custId, final String mobile, final String email, final String address, final String openid, final Integer sourceType, final Integer ifDel, final Integer revision, final String crby, final LocalDateTime crtime, final String upby, final LocalDateTime uptime, final String alipayContractNum, final String entCodeEmpId, final String uniqueId) { - this.id = id; - this.casualId = casualId; - this.casualName = casualName; - this.custId = custId; - this.mobile = mobile; - this.email = email; - this.address = address; - this.openid = openid; - this.sourceType = sourceType; - this.ifDel = ifDel; - this.revision = revision; - this.crby = crby; - this.crtime = crtime; - this.upby = upby; - this.uptime = uptime; - this.alipayContractNum = alipayContractNum; - this.entCodeEmpId = entCodeEmpId; - this.uniqueId = uniqueId; - } - - public CustCasual() { - } - - public static class CustCasualBuilder { - private Long id; - private Long casualId; - private String casualName; - private Long custId; - private String mobile; - private String email; - private String address; - private String openid; - private Integer sourceType; - private Integer ifDel; - private Integer revision; - private String crby; - private LocalDateTime crtime; - private String upby; - private LocalDateTime uptime; - private String alipayContractNum; - private String entCodeEmpId; - private String uniqueId; - - CustCasualBuilder() { - } - - public CustCasualBuilder id(final Long id) { - this.id = id; - return this; - } - - public CustCasualBuilder casualId(final Long casualId) { - this.casualId = casualId; - return this; - } - - public CustCasualBuilder casualName(final String casualName) { - this.casualName = casualName; - return this; - } - - public CustCasualBuilder custId(final Long custId) { - this.custId = custId; - return this; - } - - public CustCasualBuilder mobile(final String mobile) { - this.mobile = mobile; - return this; - } - - public CustCasualBuilder email(final String email) { - this.email = email; - return this; - } - - public CustCasualBuilder address(final String address) { - this.address = address; - return this; - } - - public CustCasualBuilder openid(final String openid) { - this.openid = openid; - return this; - } - - public CustCasualBuilder sourceType(final Integer sourceType) { - this.sourceType = sourceType; - return this; - } - - public CustCasualBuilder ifDel(final Integer ifDel) { - this.ifDel = ifDel; - return this; - } - - public CustCasualBuilder revision(final Integer revision) { - this.revision = revision; - return this; - } - - public CustCasualBuilder crby(final String crby) { - this.crby = crby; - return this; - } - - public CustCasualBuilder crtime(final LocalDateTime crtime) { - this.crtime = crtime; - return this; - } - - public CustCasualBuilder upby(final String upby) { - this.upby = upby; - return this; - } - - public CustCasualBuilder uptime(final LocalDateTime uptime) { - this.uptime = uptime; - return this; - } - - public CustCasualBuilder alipayContractNum(final String alipayContractNum) { - this.alipayContractNum = alipayContractNum; - return this; - } - - public CustCasualBuilder entCodeEmpId(final String entCodeEmpId) { - this.entCodeEmpId = entCodeEmpId; - return this; - } - - public CustCasualBuilder uniqueId(final String uniqueId) { - this.uniqueId = uniqueId; - return this; - } - - public CustCasual build() { - return new CustCasual(this.id, this.casualId, this.casualName, this.custId, this.mobile, this.email, this.address, this.openid, this.sourceType, this.ifDel, this.revision, this.crby, this.crtime, this.upby, this.uptime, this.alipayContractNum, this.entCodeEmpId, this.uniqueId); - } - } -} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustCasualModel.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustCasualModel.java deleted file mode 100644 index 22f2600..0000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustCasualModel.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.bonus.common.houqin.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -public class CustCasualModel extends CustCasual { - private String custNum; - private String custName; - private Integer age; - @ApiModelProperty("身份证号") - private String idCard; - @ApiModelProperty("登录类型") - private Integer loginType; - private String password; - private String code; - private Long custId; -} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustInfoAppIdLoginDTO.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustInfoAppIdLoginDTO.java deleted file mode 100644 index d58b142..0000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustInfoAppIdLoginDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.bonus.common.houqin.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -@Data -public class CustInfoAppIdLoginDTO { - @ApiModelProperty("人员编号") - private String custNum; - @ApiModelProperty("人员姓名") - private String custName; - @ApiModelProperty("手机号") - private String mobile; - @ApiModelProperty("appId") - private String appId; - @ApiModelProperty("登录类型") - private Integer loginType; - @ApiModelProperty("登录密码") - private String password; - @ApiModelProperty("身份证号") - private String idCard; - @ApiModelProperty("验证码") - private String code; -} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustInfoAppIdLoginVO.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustInfoAppIdLoginVO.java deleted file mode 100644 index ecc95c6..0000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/domain/CustInfoAppIdLoginVO.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.bonus.common.houqin.domain; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; - -@ApiModel("人员资料表") -@Data -public class CustInfoAppIdLoginVO implements Serializable { - @ApiModelProperty("人员id") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long custId; - @ApiModelProperty("人员姓名") - private String custName; - @ApiModelProperty("人员编号") - private String custNum; - @ApiModelProperty("人脸照片地址") - private String custPhotoUrl; - @ApiModelProperty("电话号码") - private String mobile; - @ApiModelProperty("openid") - private String openid; - @ApiModelProperty("登录密码") - private String pwd; - @ApiModelProperty("用户唯一标识") - private String token; - @ApiModelProperty("登录IP地址") - private String ipaddr; - @ApiModelProperty("登录时间") - private Long loginTime; - @ApiModelProperty("过期时间") - private Long expireTime; - @ApiModelProperty("") - private Long expireIn; - @ApiModelProperty("是否登录") - private boolean isLogin; - @ApiModelProperty("人员id") - private String custIdStr; -} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/OssAutoConfiguration.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/OssAutoConfiguration.java deleted file mode 100644 index ab3b682..0000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/OssAutoConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.bonus.common.houqin.oss; - -import com.bonus.common.houqin.oss.http.OssEndpoint; -import com.bonus.common.houqin.oss.service.OssTemplate; -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@EnableConfigurationProperties({OssProperties.class}) -//@AutoConfiguration -@Configuration -public class OssAutoConfiguration { - private final OssProperties properties; - - @Bean - @ConditionalOnMissingBean({OssTemplate.class}) - @ConditionalOnProperty( - name = {"oss.enable"}, - havingValue = "true", - matchIfMissing = true - ) - public OssTemplate ossTemplate() { - return new OssTemplate(this.properties); - } - - @Bean - @ConditionalOnProperty( - name = {"oss.info"}, - havingValue = "true" - ) - public OssEndpoint ossEndpoint(OssTemplate template) { - return new OssEndpoint(template); - } - - public OssAutoConfiguration(final OssProperties properties) { - this.properties = properties; - } -} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/OssProperties.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/OssProperties.java deleted file mode 100644 index 070480a..0000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/OssProperties.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.bonus.common.houqin.oss; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -@Component -@ConfigurationProperties( - prefix = "oss" -) -public class OssProperties { - private String endpoint; - private String customDomain; - private Boolean pathStyleAccess = true; - private String appId; - private String region; - private String accessKey; - private String secretKey; - private String bucketName = "lnyst"; - private Boolean useHttp = false; - private Integer expiresTime = 604800; - private Boolean useToken = false; - - public String getEndpoint() { - return this.endpoint; - } - - public String getCustomDomain() { - return this.customDomain; - } - - public Boolean getPathStyleAccess() { - return this.pathStyleAccess; - } - - public String getAppId() { - return this.appId; - } - - public String getRegion() { - return this.region; - } - - public String getAccessKey() { - return this.accessKey; - } - - public String getSecretKey() { - return this.secretKey; - } - - public String getBucketName() { - return this.bucketName; - } - - public Boolean getUseHttp() { - return this.useHttp; - } - - public Integer getExpiresTime() { - return this.expiresTime; - } - - public Boolean getUseToken() { - return this.useToken; - } - - public void setEndpoint(final String endpoint) { - this.endpoint = endpoint; - } - - public void setCustomDomain(final String customDomain) { - this.customDomain = customDomain; - } - - public void setPathStyleAccess(final Boolean pathStyleAccess) { - this.pathStyleAccess = pathStyleAccess; - } - - public void setAppId(final String appId) { - this.appId = appId; - } - - public void setRegion(final String region) { - this.region = region; - } - - public void setAccessKey(final String accessKey) { - this.accessKey = accessKey; - } - - public void setSecretKey(final String secretKey) { - this.secretKey = secretKey; - } - - public void setBucketName(final String bucketName) { - this.bucketName = bucketName; - } - - public void setUseHttp(final Boolean useHttp) { - this.useHttp = useHttp; - } - - public void setExpiresTime(final Integer expiresTime) { - this.expiresTime = expiresTime; - } - - public void setUseToken(final Boolean useToken) { - this.useToken = useToken; - } -} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/http/OssEndpoint.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/http/OssEndpoint.java deleted file mode 100644 index 4b99322..0000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/http/OssEndpoint.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.bonus.common.houqin.oss.http; - -import com.amazonaws.services.s3.model.Bucket; -import com.amazonaws.services.s3.model.S3Object; -import com.amazonaws.services.s3.model.S3ObjectSummary; -import com.bonus.common.houqin.oss.service.OssTemplate; -import lombok.SneakyThrows; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@RestController -@RequestMapping({"/oss"}) -public class OssEndpoint { - private final OssTemplate template; - - @PostMapping({"/bucket/{bucketName}"}) - public Bucket createBucker(@PathVariable String bucketName) { - try { - this.template.createBucket(bucketName); - return (Bucket)this.template.getBucket(bucketName).get(); - } catch (Throwable var3) { - throw var3; - } - } - @GetMapping({"/bucket"}) - public List getBuckets() { - try { - return this.template.getAllBuckets(); - } catch (Throwable var2) { - throw var2; - } - } - - @GetMapping({"/bucket/{bucketName}"}) - public Bucket getBucket(@PathVariable String bucketName) { - try { - return (Bucket)this.template.getBucket(bucketName).orElseThrow(() -> { - return new IllegalArgumentException("Bucket Name not found!"); - }); - } catch (Throwable var3) { - throw var3; - } - } - - @DeleteMapping({"/bucket/{bucketName}"}) - @ResponseStatus(HttpStatus.ACCEPTED) - public void deleteBucket(@PathVariable String bucketName) { - try { - this.template.removeBucket(bucketName); - } catch (Throwable var3) { - throw var3; - } - } - - @SneakyThrows - @PostMapping({"/object/{bucketName}"}) - public S3Object createObject(@RequestBody MultipartFile object, @PathVariable String bucketName) { - try { - String name = object.getOriginalFilename(); - this.template.putObject(bucketName, name, object.getInputStream(), object.getSize(), object.getContentType()); - return this.template.getObjectInfo(bucketName, name); - } catch (Throwable var4) { - throw var4; - } - } - - @SneakyThrows - @PostMapping({"/object/{bucketName}/{objectName}"}) - public S3Object createObject(@RequestBody MultipartFile object, @PathVariable String bucketName, @PathVariable String objectName) { - try { - this.template.putObject(bucketName, objectName, object.getInputStream(), object.getSize(), object.getContentType()); - return this.template.getObjectInfo(bucketName, objectName); - } catch (Throwable var5) { - throw var5; - } - } - - @GetMapping({"/object/{bucketName}/{objectName}"}) - public List filterObject(@PathVariable String bucketName, @PathVariable String objectName) { - try { - return this.template.getAllObjectsByPrefix(bucketName, objectName, true); - } catch (Throwable var4) { - throw var4; - } - } - - @GetMapping({"/object/{bucketName}/{objectName}/{expires}"}) - public Map getObject(@PathVariable String bucketName, @PathVariable String objectName, @PathVariable Integer expires) { - try { - Map responseBody = new HashMap(8); - responseBody.put("bucket", bucketName); - responseBody.put("object", objectName); - responseBody.put("url", this.template.getObjectURL(bucketName, objectName, expires)); - responseBody.put("expires", expires); - return responseBody; - } catch (Throwable var5) { - throw var5; - } - } - - @SneakyThrows - @ResponseStatus(HttpStatus.ACCEPTED) - @DeleteMapping({"/object/{bucketName}/{objectName}/"}) - public void deleteObject(@PathVariable String bucketName, @PathVariable String objectName) { - try { - this.template.removeObject(bucketName, objectName); - } catch (Throwable var4) { - throw var4; - } - } - - public OssEndpoint(final OssTemplate template) { - this.template = template; - } -} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/service/OssTemplate.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/service/OssTemplate.java deleted file mode 100644 index 81576bf..0000000 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/oss/service/OssTemplate.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.bonus.common.houqin.oss.service; - -import com.amazonaws.ClientConfiguration; -import com.amazonaws.auth.AWSCredentials; -import com.amazonaws.auth.AWSCredentialsProvider; -import com.amazonaws.auth.AWSStaticCredentialsProvider; -import com.amazonaws.auth.BasicAWSCredentials; -import com.amazonaws.client.builder.AwsClientBuilder; -import com.amazonaws.services.s3.AmazonS3; -import com.amazonaws.services.s3.AmazonS3Client; -import com.amazonaws.services.s3.AmazonS3ClientBuilder; -import com.amazonaws.services.s3.model.*; -import com.amazonaws.util.IOUtils; -import com.bonus.common.houqin.oss.OssProperties; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.stereotype.Service; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.net.URL; -import java.util.*; - - -public class OssTemplate implements InitializingBean { - private final OssProperties ossProperties; - private AmazonS3 amazonS3; - - public void createBucket(String bucketName) { - try { - if (!this.amazonS3.doesBucketExistV2(bucketName)) { - this.amazonS3.createBucket(bucketName); - } - - } catch (Throwable var3) { - throw var3; - } - } - - public List getAllBuckets() { - try { - return this.amazonS3.listBuckets(); - } catch (Throwable var2) { - throw var2; - } - } - - public Optional getBucket(String bucketName) { - try { - return this.amazonS3.listBuckets().stream().filter((b) -> { - return b.getName().equals(bucketName); - }).findFirst(); - } catch (Throwable var3) { - throw var3; - } - } - - public void removeBucket(String bucketName) { - try { - this.amazonS3.deleteBucket(bucketName); - } catch (Throwable var3) { - throw var3; - } - } - - public List getAllObjectsByPrefix(String bucketName, String prefix, boolean recursive) { - try { - ObjectListing objectListing = this.amazonS3.listObjects(bucketName, prefix); - return new ArrayList(objectListing.getObjectSummaries()); - } catch (Throwable var5) { - throw var5; - } - } - - public CopyObjectResult copyObject(String bucketName, String objectName, String destbucketName, String destobjectName) { - try { - CopyObjectResult copyObjectResult = this.amazonS3.copyObject(bucketName, objectName, destbucketName, destobjectName); - return copyObjectResult; - } catch (Throwable var6) { - throw var6; - } - } - - public String getObjectURL(String bucketName, String objectName, Integer expires) { - try { - Date date = new Date(); - Calendar calendar = new GregorianCalendar(); - calendar.setTime(date); - calendar.add(13, expires); - URL url = this.amazonS3.generatePresignedUrl(bucketName, objectName, calendar.getTime()); - return url.toString(); - } catch (Throwable var7) { - throw var7; - } - } - - public InputStream getObject(String bucketName, String objectName) { - try { - return this.amazonS3.getObject(bucketName, objectName).getObjectContent(); - } catch (Throwable var4) { - throw var4; - } - } - - public void putObject(String bucketName, String objectName, InputStream stream) throws Exception { - this.putObject(bucketName, objectName, stream, (long) stream.available(), "application/octet-stream"); - } - - public PutObjectResult putObject(String bucketName, String objectName, InputStream stream, long size, String contextType) throws Exception { - byte[] bytes = IOUtils.toByteArray(stream); - ObjectMetadata objectMetadata = new ObjectMetadata(); - objectMetadata.setContentLength(size); - objectMetadata.setContentType(contextType); - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return this.amazonS3.putObject(bucketName, objectName, byteArrayInputStream, objectMetadata); - } - - public S3Object getObjectInfo(String bucketName, String objectName) throws Exception { - return this.amazonS3.getObject(bucketName, objectName); - } - - public void removeObject(String bucketName, String objectName) throws Exception { - this.amazonS3.deleteObject(bucketName, objectName); - } - - @Override - public void afterPropertiesSet() throws Exception { - ClientConfiguration clientConfiguration = new ClientConfiguration(); - AwsClientBuilder.EndpointConfiguration endpointConfiguration = new AwsClientBuilder.EndpointConfiguration(this.ossProperties.getEndpoint(), this.ossProperties.getRegion()); - AWSCredentials awsCredentials = new BasicAWSCredentials(this.ossProperties.getAccessKey(), this.ossProperties.getSecretKey()); - AWSCredentialsProvider awsCredentialsProvider = new AWSStaticCredentialsProvider(awsCredentials); - if (this.ossProperties.getUseHttp()) { - System.setProperty("com.amazonaws.sdk.disableCertChecking", "true"); - } - - this.amazonS3 = (AmazonS3) ((AmazonS3ClientBuilder) ((AmazonS3ClientBuilder) ((AmazonS3ClientBuilder) ((AmazonS3ClientBuilder) ((AmazonS3ClientBuilder) AmazonS3Client.builder().withEndpointConfiguration(endpointConfiguration)).withClientConfiguration(clientConfiguration)).withCredentials(awsCredentialsProvider)).disableChunkedEncoding()).withPathStyleAccessEnabled(this.ossProperties.getPathStyleAccess())).build(); - } - - public OssTemplate(final OssProperties ossProperties) { - this.ossProperties = ossProperties; - } - -} \ No newline at end of file diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/alloc/domain/TreeSelect.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/alloc/domain/TreeSelect.java index b239a51..9dc2a92 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/alloc/domain/TreeSelect.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/alloc/domain/TreeSelect.java @@ -44,22 +44,6 @@ public class TreeSelect implements Serializable { } - public TreeSelect(SysDept dept) { - this.id = dept.getDeptId(); - this.parentId = dept.getParentId(); - this.status = dept.getStatus(); - this.label = dept.getDeptName(); - this.level = dept.getLevel(); - this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); - } - - public TreeSelect(SysMenu menu) { - this.id = menu.getMenuId(); - this.label = menu.getMenuName(); - this.status = menu.getStatus(); - this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); - } - public TreeSelect(AllocArea area) { this.id = area.getAreaId(); this.label = area.getAreaName();