commit 19f671613a5e635d697c79d87f02283f5642e51a Author: wangpengfei <1928057482@qq.com> Date: Mon May 6 15:13:35 2024 +0800 初始化 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a70b169 --- /dev/null +++ b/.gitignore @@ -0,0 +1,116 @@ +# ---> Java +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# ---> Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +# ---> JetBrains +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +**/.idea/ +**/logs/ \ No newline at end of file diff --git a/docs/HELP.md b/docs/HELP.md new file mode 100644 index 0000000..e69de29 diff --git a/gateway/pom.xml b/gateway/pom.xml new file mode 100644 index 0000000..0f6e47f --- /dev/null +++ b/gateway/pom.xml @@ -0,0 +1,92 @@ + + + + share-store + com.yxt + 1.0-SNAPSHOT + + 4.0.0 + + com.yxt.gateway + gateway + + + 8 + 8 + UTF-8 + + + + io.jsonwebtoken + jjwt + 0.9.0 + + + org.springframework.cloud + spring-cloud-starter-gateway + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + org.projectlombok + lombok + 1.18.24 + true + + + org.springframework + spring-webmvc + + + + org.springframework.boot + spring-boot-starter-data-redis + + + io.lettuce + lettuce-core + + + + + redis.clients + jedis + + + com.alibaba + fastjson + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.5.6 + + + + repackage + + + + + + + + src/main/resources + + **/*.yml + + false + + + + \ No newline at end of file diff --git a/gateway/src/main/java/com/yxt/wms/AuthFilter.java b/gateway/src/main/java/com/yxt/wms/AuthFilter.java new file mode 100644 index 0000000..efe69bb --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/AuthFilter.java @@ -0,0 +1,124 @@ +package com.yxt.wms; + +import com.alibaba.fastjson.JSON; +import com.yxt.wms.utils.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.gateway.filter.GatewayFilterChain; +import org.springframework.cloud.gateway.filter.GlobalFilter; +import org.springframework.core.Ordered; +import org.springframework.core.io.buffer.DataBufferFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.http.server.reactive.ServerHttpResponse; +import org.springframework.stereotype.Component; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; + +import static com.yxt.wms.utils.HttpStatus.OVERDUE; + +/** + * @author dimengzhe + * @date 2020/12/2 9:52 + * @description 网关鉴权 + * 1.某些接口不需要不进行登录验证,如登录,注册,获取验证码等接口。(uri白名单) + * 2.某些接口需要登录验证,但是不需要刷新token有效时间,如客户端轮询请求的接口。 + * 3.特定场景下IP黑、白名单。 + * 4.处于安全考虑的接口流量控制。 + */ +@Component +public class AuthFilter implements GlobalFilter, Ordered { + + private static final Logger log = LoggerFactory.getLogger(AuthFilter.class); + //过期时间设置为4小时 + private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 60; + private final static long EXPIRE_TIME_APP = Constants.TOKEN_EXPIRE_APP * 60; + + // 排除过滤的 uri 地址,nacos自行添加 + @Autowired + private IgnoreWhiteProperties ignoreWhite; + @Autowired + private RedisUtil redisUtil; + /* + redis中数据存储结构为两个键值对 + 键为用户ID,值为用户token,可以通过用户ID查询用户token,实现立刻失效用户token功能。 + 键为用户token,值为用户数据,实现token有效性,用户数据缓存功能。 + */ + + @Override + public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { + String url = exchange.getRequest().getURI().getPath(); + //1.uri白名单。 跳过不需要验证的路径 + if (StringUtils.matches(url, ignoreWhite.getWhites())) { + return chain.filter(exchange); + } else if (StringUtils.matchesTwo(url, ignoreWhite.getWhitesTwo())) { + return chain.filter(exchange); + } + //2.验证有无令牌。 从请求的header中获取token + String token = getToken(exchange.getRequest()); + if (StringUtils.isBlank(token)) { + return setUnauthorizedResponse(exchange, "令牌不能为空"); + } + //3.验证token是否有效。(a.验证token是否合法 b.验证token是否过期) + //从redis缓存中获取key对应的内容 + String userName = redisUtil.get(token); + + if (StringUtils.isBlank(userName)) { + + return setUnauthorizedResponse(exchange, "登录状态已过期"); + } + //验签:需要验证token中的签名是否与用户sid一致,后台用密钥+userSid+token除签名以外的内容,重新生成签名,与token中的签名进行比较 + + //刷新token过期日期 + if (token.contains("App")) { + redisUtil.expire(token, EXPIRE_TIME_APP); + } else { + redisUtil.expire(token, EXPIRE_TIME); + } + + // 在请求中增加用户信息 + ServerHttpRequest mutableReq = exchange.getRequest().mutate() + .header(CacheConstants.DETAILS_USERNAME, userName).build(); + ServerWebExchange mutableExchange = exchange.mutate().request(mutableReq).build(); + return chain.filter(mutableExchange); + } + + /** + * 鉴权异常处理 + * + * @param exchange + * @param msg + * @return + */ + private Mono setUnauthorizedResponse(ServerWebExchange exchange, String msg) { + ServerHttpResponse response = exchange.getResponse(); + response.getHeaders().setContentType(MediaType.APPLICATION_JSON); + response.setStatusCode(HttpStatus.OK); + + log.error("[鉴权异常处理]请求路径:{}", exchange.getRequest().getPath()); + + return response.writeWith(Mono.fromSupplier(() -> { + DataBufferFactory bufferFactory = response.bufferFactory(); +// return bufferFactory.wrap(JSON.toJSONBytes(com.yxt.anrui.utils.HttpStatus.OVERDUE)); + return bufferFactory.wrap(JSON.toJSONBytes(ResultBean.fireFail().setCode(OVERDUE).setMsg(msg))); + })); + } + + /** + * 获取请求token + */ + private String getToken(ServerHttpRequest request) { + String token = request.getHeaders().getFirst(CacheConstants.HEADER); +// if (StringUtils.isNotEmpty(token) && token.startsWith(CacheConstants.TOKEN_PREFIX)) { +// token = token.replace(CacheConstants.TOKEN_PREFIX, ""); +// } + return token; + } + + @Override + public int getOrder() { + return 0; + } +} diff --git a/gateway/src/main/java/com/yxt/wms/GatewayApplication.java b/gateway/src/main/java/com/yxt/wms/GatewayApplication.java new file mode 100644 index 0000000..97cb509 --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/GatewayApplication.java @@ -0,0 +1,18 @@ +package com.yxt.wms; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +/** + * @author wangpengfei + * @date ${DATE} ${TIME} + */ + +@EnableDiscoveryClient +@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) +public class GatewayApplication { + public static void main(String[] args) { + SpringApplication.run(GatewayApplication.class, args); + }} \ No newline at end of file diff --git a/gateway/src/main/java/com/yxt/wms/RedisUtil.java b/gateway/src/main/java/com/yxt/wms/RedisUtil.java new file mode 100644 index 0000000..5572564 --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/RedisUtil.java @@ -0,0 +1,300 @@ +package com.yxt.wms; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisStringCommands; +import org.springframework.data.redis.core.*; +import org.springframework.data.redis.core.types.Expiration; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.stereotype.Service; + +import java.io.Serializable; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * @author dimengzhe + * @date 2020/9/9 17:35 + * @description redis工具类 + */ +@Service +public class RedisUtil { + + @Autowired + private RedisTemplate redisTemplate; + + + /** + * 字符串类型:根据key设置value值,如果key中的value存在,那么返回false + * + * @param key + * @param value + * @return + */ + public Boolean setnx(final String key, final String value, final long expration, final TimeUnit timeUnit) { + return (Boolean) redisTemplate.execute(new RedisCallback() { + @Override + public Boolean doInRedis(RedisConnection redisConnection) throws DataAccessException { + RedisSerializer redisSerializer = redisTemplate.getStringSerializer(); + byte keys[] = redisSerializer.serialize(key); + byte values[] = redisSerializer.serialize(value); + return redisConnection.set(keys, values, Expiration.from(expration, timeUnit), RedisStringCommands.SetOption.SET_IF_ABSENT); + } + }); + } + + /** + * 写入缓存 + * + * @param key + * @param value + * @return + */ + public boolean set(final String key, final String value) { + + boolean result = (boolean) redisTemplate.execute(new RedisCallback() { + @Override + public Boolean doInRedis(RedisConnection connection) throws DataAccessException { + RedisSerializer serializer = redisTemplate.getStringSerializer(); + connection.set(serializer.serialize(key), serializer.serialize(value)); + return true; + } + }); + return result; + } + + /** + * 写入缓存设置时效时间 + * + * @param key + * @param value + * @return + */ + public boolean set(final String key, Object value, Long expireTime) { + boolean result = false; + try { + ValueOperations operations = redisTemplate.opsForValue(); + operations.set(key, value); + redisTemplate.expire(key, expireTime, TimeUnit.SECONDS); + result = true; + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + /** + * 刷新缓存到期时间 + * @param key + * @param expire + * @return + */ + public boolean expire(String key, long expire) { + return redisTemplate.expire(key, expire, TimeUnit.SECONDS); + } + + /** + * 读取缓存 + * + * @param key + * @return + */ + public String get(final String key) { + String result = (String) redisTemplate.execute(new RedisCallback() { + @Override + public String doInRedis(RedisConnection connection) throws DataAccessException { + RedisSerializer serializer = redisTemplate.getStringSerializer(); + byte[] value = connection.get(serializer.serialize(key)); + return serializer.deserialize(value); + } + }); + return result; + } + + /** + * 正则获取key集合 + * + * @param pattern + * @return + */ + public Set keys(String pattern) { + Set keys = redisTemplate.keys(pattern); + return keys; + } + + + /** + * 批量删除对应的value + * + * @param keys + */ + public void remove(final String... keys) { + for (String key : keys) { + remove(key); + } + } + + /** + * 批量删除key + * + * @param pattern + */ + public void removePattern(final String pattern) { + Set keys = redisTemplate.keys(pattern); + if (keys.size() > 0) { + redisTemplate.delete(keys); + } + + } + + + public Long remove(final String key) { + return (Long) redisTemplate.execute(new RedisCallback() { + @Override + public Long doInRedis(RedisConnection redisConnection) throws DataAccessException { + RedisSerializer serializer = redisTemplate.getStringSerializer(); + byte keys[] = serializer.serialize(key); + return redisConnection.del(keys); + } + }); + } + + + /** + * 判断缓存中是否有对应的value + * + * @param key + * @return + */ + public boolean exists(final String key) { + return redisTemplate.hasKey(key); + } + + + /** + * 哈希 添加 + * + * @param key + * @param hashKey + * @param value + */ + public void hmSet(String key, Object hashKey, Object value) { + HashOperations hash = redisTemplate.opsForHash(); + hash.put(key, hashKey, value); + } + + /** + * 哈希获取数据 + * + * @param key + * @param hashKey + * @return + */ + public String hmGet(String key, Object hashKey) { + HashOperations hash = redisTemplate.opsForHash(); + return hash.get(key, hashKey); + } + + /** + * 获取哈希 keys + * + * @param key + * @return + */ + public Set hmGetKeys(String key) { + HashOperations hash = redisTemplate.opsForHash(); + return hash.keys(key); + } + + /** + * 删除集合中的key + * + * @param key + * @param hashKey + */ + public void hmDelete(String key, Object hashKey) { + HashOperations hash = redisTemplate.opsForHash(); + hash.delete(key, hashKey); + } + + /** + * 列表添加 + * + * @param k + * @param v + */ + public void lPush(String k, Object v) { + ListOperations list = redisTemplate.opsForList(); + list.rightPush(k, v); + } + + /** + * 列表获取 + * + * @param k + * @param l + * @param l1 + * @return + */ + public List lRange(String k, long l, long l1) { + ListOperations list = redisTemplate.opsForList(); + return list.range(k, l, l1); + } + + /** + * 集合添加 + * + * @param key + * @param value + */ + public void add(String key, Object value) { + SetOperations set = redisTemplate.opsForSet(); + set.add(key, value); + } + + /** + * 集合获取 + * + * @param key + * @return + */ + public Set setMembers(String key) { + SetOperations set = redisTemplate.opsForSet(); + return set.members(key); + } + + /** + * 有序集合添加 + * + * @param key + * @param value + * @param scoure + */ + public void zAdd(String key, Object value, double scoure) { + ZSetOperations zset = redisTemplate.opsForZSet(); + zset.add(key, value, scoure); + } + + /** + * 有序集合获取 + * + * @param key + * @param scoure + * @param scoure1 + * @return + */ + public Set rangeByScore(String key, double scoure, double scoure1) { + ZSetOperations zset = redisTemplate.opsForZSet(); + return zset.rangeByScore(key, scoure, scoure1); + } + + /** + * 实现命令:TTL key 以秒为单位,返回给定key的剩余生存时间 + * @param key + * @return + */ + public long ttl(String key) { + return redisTemplate.getExpire(key); + } +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/CacheConstants.java b/gateway/src/main/java/com/yxt/wms/utils/CacheConstants.java new file mode 100644 index 0000000..4a8dcbb --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/CacheConstants.java @@ -0,0 +1,25 @@ +package com.yxt.wms.utils; + +/** + * @author dimengzhe + * @date 2020/12/2 9:58 + * @description 缓存的key 常量 + */ + +public class CacheConstants { + + /** + * 令牌自定义标识 + */ + public static final String HEADER = "token"; + + /** + * 令牌前缀 + */ + public static final String TOKEN_PREFIX = "Bearer "; + + /** + * 用户名字段 + */ + public static final String DETAILS_USERNAME = "userName"; +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/CharsetKit.java b/gateway/src/main/java/com/yxt/wms/utils/CharsetKit.java new file mode 100644 index 0000000..d97f8e4 --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/CharsetKit.java @@ -0,0 +1,86 @@ +package com.yxt.wms.utils; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +/** + * @author dimengzhe + * @date 2020/12/2 10:02 + * @description + */ + +public class CharsetKit { + + /** ISO-8859-1 */ + public static final String ISO_8859_1 = "ISO-8859-1"; + /** UTF-8 */ + public static final String UTF_8 = "UTF-8"; + /** GBK */ + public static final String GBK = "GBK"; + + /** ISO-8859-1 */ + public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); + /** UTF-8 */ + public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); + /** GBK */ + public static final Charset CHARSET_GBK = Charset.forName(GBK); + + /** + * 转换为Charset对象 + * + * @param charset 字符集,为空则返回默认字符集 + * @return Charset + */ + public static Charset charset(String charset) + { + return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, String srcCharset, String destCharset) + { + return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, Charset srcCharset, Charset destCharset) + { + if (null == srcCharset) + { + srcCharset = StandardCharsets.ISO_8859_1; + } + + if (null == destCharset) + { + destCharset = StandardCharsets.UTF_8; + } + + if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) + { + return source; + } + return new String(source.getBytes(srcCharset), destCharset); + } + + /** + * @return 系统字符集编码 + */ + public static String systemCharset() + { + return Charset.defaultCharset().name(); + } +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/Constants.java b/gateway/src/main/java/com/yxt/wms/utils/Constants.java new file mode 100644 index 0000000..757f66a --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/Constants.java @@ -0,0 +1,29 @@ +package com.yxt.wms.utils; + +/** + * @author dimengzhe + * @date 2020/12/2 9:56 + * @description 通用常量信息 + */ + +public class Constants { + + /** + * 成功标记 + */ + public static final Integer SUCCESS = 200; + + /** + * 失败标记 + */ + public static final Integer FAIL = 5000; + + public static final boolean fail = false; + public static final boolean success = true; + + /** + * 令牌有效期(分钟) + */ + public final static long TOKEN_EXPIRE = 4*60; + public final static long TOKEN_EXPIRE_APP = 15*24*60; +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/Convert.java b/gateway/src/main/java/com/yxt/wms/utils/Convert.java new file mode 100644 index 0000000..c047ec0 --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/Convert.java @@ -0,0 +1,999 @@ +package com.yxt.wms.utils; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.text.NumberFormat; +import java.util.Set; + +/** + * @author dimengzhe + * @date 2020/12/2 10:01 + * @description + */ + +public class Convert { + + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static String toStr(Object value, String defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof String) + { + return (String) value; + } + return value.toString(); + } + + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static String toStr(Object value) + { + return toStr(value, null); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Character toChar(Object value, Character defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof Character) + { + return (Character) value; + } + + final String valueStr = toStr(value, null); + return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Character toChar(Object value) + { + return toChar(value, null); + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Byte toByte(Object value, Byte defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Byte) + { + return (Byte) value; + } + if (value instanceof Number) + { + return ((Number) value).byteValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Byte.parseByte(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Byte toByte(Object value) + { + return toByte(value, null); + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Short toShort(Object value, Short defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Short) + { + return (Short) value; + } + if (value instanceof Number) + { + return ((Number) value).shortValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Short.parseShort(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Short toShort(Object value) + { + return toShort(value, null); + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Number toNumber(Object value, Number defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Number) + { + return (Number) value; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return NumberFormat.getInstance().parse(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Number toNumber(Object value) + { + return toNumber(value, null); + } + + /** + * 转换为int
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Integer toInt(Object value, Integer defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Integer) + { + return (Integer) value; + } + if (value instanceof Number) + { + return ((Number) value).intValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Integer.parseInt(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为int
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Integer toInt(Object value) + { + return toInt(value, null); + } + + /** + * 转换为Integer数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String str) + { + return toIntArray(",", str); + } + + /** + * 转换为Long数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String str) + { + return toLongArray(",", str); + } + + /** + * 转换为Integer数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Integer[] {}; + } + String[] arr = str.split(split); + final Integer[] ints = new Integer[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Integer v = toInt(arr[i], 0); + ints[i] = v; + } + return ints; + } + + /** + * 转换为Long数组
+ * + * @param split 分隔符 + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Long[] {}; + } + String[] arr = str.split(split); + final Long[] longs = new Long[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Long v = toLong(arr[i], null); + longs[i] = v; + } + return longs; + } + + /** + * 转换为String数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String str) + { + return toStrArray(",", str); + } + + /** + * 转换为String数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String split, String str) + { + return str.split(split); + } + + /** + * 转换为long
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Long toLong(Object value, Long defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Long) + { + return (Long) value; + } + if (value instanceof Number) + { + return ((Number) value).longValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).longValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为long
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Long toLong(Object value) + { + return toLong(value, null); + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Double toDouble(Object value, Double defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Double) + { + return (Double) value; + } + if (value instanceof Number) + { + return ((Number) value).doubleValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).doubleValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Double toDouble(Object value) + { + return toDouble(value, null); + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Float toFloat(Object value, Float defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Float) + { + return (Float) value; + } + if (value instanceof Number) + { + return ((Number) value).floatValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Float.parseFloat(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Float toFloat(Object value) + { + return toFloat(value, null); + } + + /** + * 转换为boolean
+ * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Boolean toBool(Object value, Boolean defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Boolean) + { + return (Boolean) value; + } + String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + valueStr = valueStr.trim().toLowerCase(); + switch (valueStr) + { + case "true": + return true; + case "false": + return false; + case "yes": + return true; + case "ok": + return true; + case "no": + return false; + case "1": + return true; + case "0": + return false; + default: + return defaultValue; + } + } + + /** + * 转换为boolean
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Boolean toBool(Object value) + { + return toBool(value, null); + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * + * @param clazz Enum的Class + * @param value 值 + * @param defaultValue 默认值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value, E defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (clazz.isAssignableFrom(value.getClass())) + { + @SuppressWarnings("unchecked") + E myE = (E) value; + return myE; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Enum.valueOf(clazz, valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * + * @param clazz Enum的Class + * @param value 值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value) + { + return toEnum(clazz, value, null); + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value, BigInteger defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigInteger) + { + return (BigInteger) value; + } + if (value instanceof Long) + { + return BigInteger.valueOf((Long) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigInteger(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value) + { + return toBigInteger(value, null); + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigDecimal) + { + return (BigDecimal) value; + } + if (value instanceof Long) + { + return new BigDecimal((Long) value); + } + if (value instanceof Double) + { + return new BigDecimal((Double) value); + } + if (value instanceof Integer) + { + return new BigDecimal((Integer) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigDecimal(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value) + { + return toBigDecimal(value, null); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @return 字符串 + */ + public static String utf8Str(Object obj) + { + return str(obj, CharsetKit.CHARSET_UTF_8); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charsetName 字符集 + * @return 字符串 + */ + public static String str(Object obj, String charsetName) + { + return str(obj, Charset.forName(charsetName)); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(Object obj, Charset charset) + { + if (null == obj) + { + return null; + } + + if (obj instanceof String) + { + return (String) obj; + } + else if (obj instanceof byte[] || obj instanceof Byte[]) + { + return str((Byte[]) obj, charset); + } + else if (obj instanceof ByteBuffer) + { + return str((ByteBuffer) obj, charset); + } + return obj.toString(); + } + + /** + * 将byte数组转为字符串 + * + * @param bytes byte数组 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(byte[] bytes, String charset) + { + return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); + } + + /** + * 解码字节码 + * + * @param data 字符串 + * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 + * @return 解码后的字符串 + */ + public static String str(byte[] data, Charset charset) + { + if (data == null) + { + return null; + } + + if (null == charset) + { + return new String(data); + } + return new String(data, charset); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, String charset) + { + if (data == null) + { + return null; + } + + return str(data, Charset.forName(charset)); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, Charset charset) + { + if (null == charset) + { + charset = Charset.defaultCharset(); + } + return charset.decode(data).toString(); + } + + // ----------------------------------------------------------------------- 全角半角转换 + /** + * 半角转全角 + * + * @param input String. + * @return 全角字符串. + */ + public static String toSBC(String input) + { + return toSBC(input, null); + } + + /** + * 半角转全角 + * + * @param input String + * @param notConvertSet 不替换的字符集合 + * @return 全角字符串. + */ + public static String toSBC(String input, Set notConvertSet) + { + char c[] = input.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == ' ') + { + c[i] = '\u3000'; + } + else if (c[i] < '\177') + { + c[i] = (char) (c[i] + 65248); + + } + } + return new String(c); + } + + /** + * 全角转半角 + * + * @param input String. + * @return 半角字符串 + */ + public static String toDBC(String input) + { + return toDBC(input, null); + } + + /** + * 替换全角为半角 + * + * @param text 文本 + * @param notConvertSet 不替换的字符集合 + * @return 替换后的字符 + */ + public static String toDBC(String text, Set notConvertSet) + { + char c[] = text.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == '\u3000') + { + c[i] = ' '; + } + else if (c[i] > '\uFF00' && c[i] < '\uFF5F') + { + c[i] = (char) (c[i] - 65248); + } + } + String returnString = new String(c); + + return returnString; + } + + /** + * 数字金额大写转换 先写个完整的然后将如零拾替换成零 + * + * @param n 数字 + * @return 中文大写数字 + */ + public static String digitUppercase(double n) + { + String[] fraction = { "角", "分" }; + String[] digit = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; + String[][] unit = { { "元", "万", "亿" }, { "", "拾", "佰", "仟" } }; + + String head = n < 0 ? "负" : ""; + n = Math.abs(n); + + String s = ""; + for (int i = 0; i < fraction.length; i++) + { + s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); + } + if (s.length() < 1) + { + s = "整"; + } + int integerPart = (int) Math.floor(n); + + for (int i = 0; i < unit[0].length && integerPart > 0; i++) + { + String p = ""; + for (int j = 0; j < unit[1].length && n > 0; j++) + { + p = digit[integerPart % 10] + unit[1][j] + p; + integerPart = integerPart / 10; + } + s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; + } + return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); + } +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/HttpStatus.java b/gateway/src/main/java/com/yxt/wms/utils/HttpStatus.java new file mode 100644 index 0000000..fc2e1bc --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/HttpStatus.java @@ -0,0 +1,23 @@ +package com.yxt.wms.utils; + +/** + * @author dimengzhe + * @date 2021/6/16 10:50 + * @description + */ + +public class HttpStatus { + + /** + * 操作成功 + */ + public static final int SUCCESS = 200; + + /** + * 系统内部错误 + */ + public static final int ERROR = 500; + + public static final String OVERDUE = "5000"; + +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/HttpUtils.java b/gateway/src/main/java/com/yxt/wms/utils/HttpUtils.java new file mode 100644 index 0000000..eb2a432 --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/HttpUtils.java @@ -0,0 +1,167 @@ +package com.yxt.wms.utils; + +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class HttpUtils { + private static final Logger log = LoggerFactory.getLogger(HttpUtils.class); + private static final CloseableHttpClient httpclient = HttpClients.createDefault(); + private static final String userAgent = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36"; + + /** + * 发送HttpGet请求 * * @param url * 请求地址 * @return 返回字符串 + */ + public static String sendGet(String url, String token) { + String result = null; + CloseableHttpResponse response = null; + try { + HttpGet httpGet = new HttpGet(url); + httpGet.setHeader("User-Agent", userAgent); + httpGet.setHeader("Authorization", "token " + token); + response = httpclient.execute(httpGet); + HttpEntity entity = response.getEntity(); + if (entity != null) { + result = EntityUtils.toString(entity); + } + } catch (Exception e) { + log.error("处理失败 {}" + e); + e.printStackTrace(); + } finally { + if (response != null) { + try { + response.close(); + } catch (IOException e) { + log.error(e.getMessage()); + } + } + + } + return result; + } + + /** + * 发送HttpPost请求,参数为map * * @param url * 请求地址 * @param map * 请求参数 * @return 返回字符串 + */ + public static String sendPost(String url, Map map) { + // 设置参数 + List formparams = new ArrayList(); + for (Map.Entry entry : map.entrySet()) { + formparams.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); + } + // 编码 + UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(formparams, Consts.UTF_8); + // 取得HttpPost对象 + HttpPost httpPost = new HttpPost(url); + // 防止被当成攻击添加的 + httpPost.setHeader("User-Agent", userAgent); + // 参数放入Entity + httpPost.setEntity(formEntity); + CloseableHttpResponse response = null; + String result = null; + try { + // 执行post请求 + response = httpclient.execute(httpPost); + // 得到entity + HttpEntity entity = response.getEntity(); + // 得到字符串 + result = EntityUtils.toString(entity); + } catch (IOException e) { + log.error(e.getMessage()); + } finally { + if (response != null) { + try { + response.close(); + } catch (IOException e) { + log.error(e.getMessage()); + } + } + } + return result; + } + + + /** + * 发送HttpPost请求,参数为json字符串 * * @param url * @param jsonStr * @return + */ + public static String sendPost(String url, String jsonStr) { + String result = null; + // 字符串编码 + StringEntity entity = new StringEntity(jsonStr, Consts.UTF_8); + // 设置content-type + entity.setContentType("application/json"); + HttpPost httpPost = new HttpPost(url); + // 防止被当成攻击添加的 + httpPost.setHeader("User-Agent", userAgent); + // 接收参数设置 + httpPost.setHeader("Accept", "application/json"); + httpPost.setEntity(entity); + CloseableHttpResponse response = null; + try { + response = httpclient.execute(httpPost); + HttpEntity httpEntity = response.getEntity(); + result = EntityUtils.toString(httpEntity); + } catch (IOException e) { + log.error(e.getMessage()); + } finally { + // 关闭CloseableHttpResponse + if (response != null) { + try { + response.close(); + } catch (IOException e) { + log.error(e.getMessage()); + } + } + } + return result; + } + + /** + * 发送不带参数的HttpPost请求 * * @param url * @return + */ + public static String sendPost(String url) { + String result = null; + // 得到一个HttpPost对象 + HttpPost httpPost = new HttpPost(url); + // 防止被当成攻击添加的 + httpPost.setHeader("User-Agent", userAgent); + CloseableHttpResponse response = null; + try { + // 执行HttpPost请求,并得到一个CloseableHttpResponse + response = httpclient.execute(httpPost); + // 从CloseableHttpResponse中拿到HttpEntity + HttpEntity entity = response.getEntity(); + // 将HttpEntity转换为字符串 + result = EntityUtils.toString(entity); + } catch (IOException e) { + log.error(e.getMessage()); + } finally { + // 关闭CloseableHttpResponse + if (response != null) { + try { + response.close(); + } catch (IOException e) { + log.error(e.getMessage()); + } + } + } + return result; + } + +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/IResultCodeMsg.java b/gateway/src/main/java/com/yxt/wms/utils/IResultCodeMsg.java new file mode 100644 index 0000000..13f8c43 --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/IResultCodeMsg.java @@ -0,0 +1,44 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.utils; + +/** + * Project: yxt-common
+ * File: IResultCodeMsg.java
+ * Class: com.yxt.common.core.result.IResultCodeMsg
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021/9/11 下午11:00
+ * + * @author popo + * @version 1.0 + * @since 1.0 + */ +public interface IResultCodeMsg { + String getCode(); + String getMsg(); +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/IgnoreWhiteProperties.java b/gateway/src/main/java/com/yxt/wms/utils/IgnoreWhiteProperties.java new file mode 100644 index 0000000..85f913a --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/IgnoreWhiteProperties.java @@ -0,0 +1,42 @@ +package com.yxt.wms.utils; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.context.annotation.Configuration; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author dimengzhe + * @date 2020/12/2 9:54 + * @description 放行白名单配置 + */ +@Configuration +@RefreshScope +@ConfigurationProperties(prefix = "ignore") +public class IgnoreWhiteProperties { + + /** + * 放行白名单配置,网关不校验此处的白名单 + */ + private List whites = new ArrayList<>(); + + public List getWhites() { + return whites; + } + + public void setWhites(List whites) { + this.whites = whites; + } + + private List whitesTwo = new ArrayList<>(); + + public List getWhitesTwo() { + return whitesTwo; + } + + public void setWhitesTwo(List whitesTwo) { + this.whitesTwo = whitesTwo; + } +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/ResultBean.java b/gateway/src/main/java/com/yxt/wms/utils/ResultBean.java new file mode 100644 index 0000000..06138d3 --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/ResultBean.java @@ -0,0 +1,191 @@ +package com.yxt.wms.utils; + +import java.io.Serializable; + +/** + * Project: yxt-common-core
+ * File: ResultBean.java
+ * Class: com.yxt.common.core.result.ResultBean
+ * Description: 通过接口、Rest、逻辑处理执行后的结果信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2020/8/4 0:51
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +public class ResultBean implements Serializable { + private static final long serialVersionUID = 4529658978692424234L; + + private long timestamp = System.currentTimeMillis(); + + public long getTimestamp() { + return timestamp; + } + + // 是否成功 + private boolean success; + + // 消息 返回结果的说明 + private String msg; + + // 结果状态码 + private String code; + + // 数据 + private T data; + + private String message; + + public String getMessage() { + return message; + } + + public ResultBean setMessage(String message) { + this.message = message; + return this; + } + + public ResultBean() { + } + + public ResultBean(boolean success) { + this.success = success; + } + + public ResultBean(boolean success, String msg) { + this.success = success; + this.msg = msg; + } + + public ResultBean(boolean success, String msg, String code) { + this.success = success; + this.msg = msg; + this.code = code; + } + + public ResultBean(T data) { + this.success = true; + this.data = data; + } + + public ResultBean(String code, T data) { + this.success = true; + this.code = code; + this.data = data; + } + + public ResultBean(String code, String msg, T data) { + this.success = true; + this.code = code; + this.msg = msg; + this.data = data; + } + + public boolean getSuccess() { + return success; + } + + public ResultBean setSuccess(boolean success) { + this.success = success; + return this; + } + + public String getMsg() { + return msg; + } + + public ResultBean setMsg(String msg) { + this.msg = msg; + return this; + } + + public String getCode() { + return code; + } + + public ResultBean setCode(String code) { + this.code = code; + return this; + } + + public T getData() { + return data; + } + + public ResultBean setData(T data) { + this.data = data; + return this; + } + + public ResultBean successOne() { + this.setSuccess(true); + this.setCode("0"); + this.setMessage("成功!"); + return this; + } + + public ResultBean failOne() { + this.setSuccess(false); + this.setCode(String.valueOf(HttpStatus.ERROR)); + this.setMessage("操作失败!"); + return this; + } + + public ResultBean success() { + this.setSuccess(true); + this.setCode(String.valueOf(HttpStatus.SUCCESS)); + this.setMsg("操作成功!"); + return this; + } + + public ResultBean fail() { + this.setSuccess(false); + this.setCode(String.valueOf(HttpStatus.ERROR)); + this.setMsg("操作失败!"); + return this; + } + + public static ResultBean fireSuccess() { + ResultBean rb = new ResultBean(); + rb.setSuccess(true); + rb.setCode(String.valueOf(HttpStatus.SUCCESS)); + rb.setMsg("操作成功!"); + return rb; + } + + public static ResultBean fireFail() { + ResultBean rb = new ResultBean(); + rb.setSuccess(false); + rb.setCode(String.valueOf(HttpStatus.ERROR)); + rb.setMsg("操作失败!"); + return rb; + } + + /** + * 设置返回code及msg + * + * @param codeMsg Code和Msg的枚举 + * @return + */ + public ResultBean setCode(IResultCodeMsg codeMsg) { + this.code = codeMsg.getCode(); + this.msg = codeMsg.getMsg(); + return this; + } + + /** + * 返回失败信息,并指定结果code + * + * @param codeMsg Code和Msg的枚举 + * @return + */ + public ResultBean fail(IResultCodeMsg codeMsg) { + this.setSuccess(false); + this.code = codeMsg.getCode(); + this.msg = codeMsg.getMsg(); + return this; + } + +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/StrFormatter.java b/gateway/src/main/java/com/yxt/wms/utils/StrFormatter.java new file mode 100644 index 0000000..ad6b753 --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/StrFormatter.java @@ -0,0 +1,91 @@ +package com.yxt.wms.utils; + +/** + * @author dimengzhe + * @date 2020/12/2 10:00 + * @description + */ + +public class StrFormatter { + + public static final String EMPTY_JSON = "{}"; + public static final char C_BACKSLASH = '\\'; + public static final char C_DELIM_START = '{'; + public static final char C_DELIM_END = '}'; + + /** + * 格式化字符串
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param strPattern 字符串模板 + * @param argArray 参数列表 + * @return 结果 + */ + public static String format(final String strPattern, final Object... argArray) + { + if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) + { + return strPattern; + } + final int strPatternLength = strPattern.length(); + + // 初始化定义好的长度以获得更好的性能 + StringBuilder sbuf = new StringBuilder(strPatternLength + 50); + + int handledPosition = 0; + int delimIndex;// 占位符所在位置 + for (int argIndex = 0; argIndex < argArray.length; argIndex++) + { + delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); + if (delimIndex == -1) + { + if (handledPosition == 0) + { + return strPattern; + } + else + { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果 + sbuf.append(strPattern, handledPosition, strPatternLength); + return sbuf.toString(); + } + } + else + { + if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) + { + if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) + { + // 转义符之前还有一个转义符,占位符依旧有效 + sbuf.append(strPattern, handledPosition, delimIndex - 1); + sbuf.append(Convert.utf8Str(argArray[argIndex])); + handledPosition = delimIndex + 2; + } + else + { + // 占位符被转义 + argIndex--; + sbuf.append(strPattern, handledPosition, delimIndex - 1); + sbuf.append(C_DELIM_START); + handledPosition = delimIndex + 1; + } + } + else + { + // 正常占位符 + sbuf.append(strPattern, handledPosition, delimIndex); + sbuf.append(Convert.utf8Str(argArray[argIndex])); + handledPosition = delimIndex + 2; + } + } + } + // 加入最后一个占位符后所有的字符 + sbuf.append(strPattern, handledPosition, strPattern.length()); + + return sbuf.toString(); + } +} diff --git a/gateway/src/main/java/com/yxt/wms/utils/StringUtils.java b/gateway/src/main/java/com/yxt/wms/utils/StringUtils.java new file mode 100644 index 0000000..f08546d --- /dev/null +++ b/gateway/src/main/java/com/yxt/wms/utils/StringUtils.java @@ -0,0 +1,526 @@ +package com.yxt.wms.utils; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * @author dimengzhe + * @date 2020/12/2 9:59 + * @description + */ + +public class StringUtils extends org.apache.commons.lang3.StringUtils { + + /** + * 空字符串 + */ + private static final String NULLSTR = ""; + + /** + * 下划线 + */ + private static final char SEPARATOR = '_'; + + /** + * 星号 + */ + private static final String START = "*"; + + /** + * 获取参数不为空值 + * + * @param value defaultValue 要判断的value + * @return value 返回值 + */ + public static T nvl(T value, T defaultValue) { + return value != null ? value : defaultValue; + } + + /** + * * 判断一个Collection是否为空, 包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Collection coll) { + return isNull(coll) || coll.isEmpty(); + } + + /** + * * 判断一个Collection是否非空,包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Collection coll) { + return !isEmpty(coll); + } + + /** + * * 判断一个对象数组是否为空 + * + * @param objects 要判断的对象数组 + * * @return true:为空 false:非空 + */ + public static boolean isEmpty(Object[] objects) { + return isNull(objects) || (objects.length == 0); + } + + /** + * * 判断一个对象数组是否非空 + * + * @param objects 要判断的对象数组 + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Object[] objects) { + return !isEmpty(objects); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Map map) { + return isNull(map) || map.isEmpty(); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Map map) { + return !isEmpty(map); + } + + /** + * * 判断一个字符串是否为空串 + * + * @param str String + * @return true:为空 false:非空 + */ + public static boolean isEmpty(String str) { + return isNull(str) || NULLSTR.equals(str.trim()); + } + + /** + * * 判断一个字符串是否为非空串 + * + * @param str String + * @return true:非空串 false:空串 + */ + public static boolean isNotEmpty(String str) { + return !isEmpty(str); + } + + /** + * * 判断一个对象是否为空 + * + * @param object Object + * @return true:为空 false:非空 + */ + public static boolean isNull(Object object) { + return object == null; + } + + /** + * * 判断一个对象是否非空 + * + * @param object Object + * @return true:非空 false:空 + */ + public static boolean isNotNull(Object object) { + return !isNull(object); + } + + /** + * * 判断一个对象是否是数组类型(Java基本型别的数组) + * + * @param object 对象 + * @return true:是数组 false:不是数组 + */ + public static boolean isArray(Object object) { + return isNotNull(object) && object.getClass().isArray(); + } + + /** + * 去空格 + */ + public static String trim(String str) { + return (str == null ? "" : str.trim()); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @return 结果 + */ + public static String substring(final String str, int start) { + if (str == null) { + return NULLSTR; + } + + if (start < 0) { + start = str.length() + start; + } + + if (start < 0) { + start = 0; + } + if (start > str.length()) { + return NULLSTR; + } + + return str.substring(start); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @param end 结束 + * @return 结果 + */ + public static String substring(final String str, int start, int end) { + if (str == null) { + return NULLSTR; + } + + if (end < 0) { + end = str.length() + end; + } + if (start < 0) { + start = str.length() + start; + } + + if (end > str.length()) { + end = str.length(); + } + + if (start > end) { + return NULLSTR; + } + + if (start < 0) { + start = 0; + } + if (end < 0) { + end = 0; + } + + return str.substring(start, end); + } + + /** + * 格式化文本, {} 表示占位符
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param template 文本模板,被替换的部分用 {} 表示 + * @param params 参数值 + * @return 格式化后的文本 + */ + public static String format(String template, Object... params) { + if (isEmpty(params) || isEmpty(template)) { + return template; + } + return StrFormatter.format(template, params); + } + + /** + * 下划线转驼峰命名 + */ + public static String toUnderScoreCase(String str) { + if (str == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + // 前置字符是否大写 + boolean preCharIsUpperCase = true; + // 当前字符是否大写 + boolean curreCharIsUpperCase = true; + // 下一字符是否大写 + boolean nexteCharIsUpperCase = true; + for (int i = 0; i < str.length(); i++) { + char c = str.charAt(i); + if (i > 0) { + preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); + } else { + preCharIsUpperCase = false; + } + + curreCharIsUpperCase = Character.isUpperCase(c); + + if (i < (str.length() - 1)) { + nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); + } + + if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) { + sb.append(SEPARATOR); + } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) { + sb.append(SEPARATOR); + } + sb.append(Character.toLowerCase(c)); + } + + return sb.toString(); + } + + /** + * 是否包含字符串 + * + * @param str 验证字符串 + * @param strs 字符串组 + * @return 包含返回true + */ + public static boolean inStringIgnoreCase(String str, String... strs) { + if (str != null && strs != null) { + for (String s : strs) { + if (str.equalsIgnoreCase(trim(s))) { + return true; + } + } + } + return false; + } + + /** + * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld + * + * @param name 转换前的下划线大写方式命名的字符串 + * @return 转换后的驼峰式命名的字符串 + */ + public static String convertToCamelCase(String name) { + StringBuilder result = new StringBuilder(); + // 快速检查 + if (name == null || name.isEmpty()) { + // 没必要转换 + return ""; + } else if (!name.contains("_")) { + // 不含下划线,仅将首字母大写 + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + // 用下划线将原始字符串分割 + String[] camels = name.split("_"); + for (String camel : camels) { + // 跳过原始字符串中开头、结尾的下换线或双重下划线 + if (camel.isEmpty()) { + continue; + } + // 首字母大写 + result.append(camel.substring(0, 1).toUpperCase()); + result.append(camel.substring(1).toLowerCase()); + } + return result.toString(); + } + + /** + * 驼峰式命名法 例如:user_name->userName + */ + public static String toCamelCase(String s) { + if (s == null) { + return null; + } + s = s.toLowerCase(); + StringBuilder sb = new StringBuilder(s.length()); + boolean upperCase = false; + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + + if (c == SEPARATOR) { + upperCase = true; + } else if (upperCase) { + sb.append(Character.toUpperCase(c)); + upperCase = false; + } else { + sb.append(c); + } + } + return sb.toString(); + } + + /** + * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matchesTwo(String str, List strs) { + if (isEmpty(str) || isEmpty(strs)) { + return false; + } + for (String testStr : strs) { + if (matchesTwo(str, testStr)) { + return true; + } + } + return false; + } + + public static boolean matches(String str, List strs) { + if (isEmpty(str) || isEmpty(strs)) { + return false; + } + for (String testStr : strs) { + if (matches(str, testStr)) { + return true; + } + } + return false; + } + + /** + * 查找指定字符串是否匹配指定字符串数组中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matches(String str, String... strs) { + if (isEmpty(str) || isEmpty(strs)) { + return false; + } + for (String testStr : strs) { + if (matches(str, testStr)) { + return true; + } + } + return false; + } + + public static boolean matches(String str, String pattern) { + if (isEmpty(pattern) || isEmpty(str)) { + return false; + } + + pattern = pattern.replaceAll("\\s*", ""); // 替换空格 + int beginOffset = 0; // pattern截取开始位置 + int formerStarOffset = -1; // 前星号的偏移位置 + int latterStarOffset = -1; // 后星号的偏移位置 + + String remainingURI = str; + String prefixPattern = ""; + String suffixPattern = ""; + + boolean result = false; + do { + formerStarOffset = indexOf(pattern, START, beginOffset); + prefixPattern = substring(pattern, beginOffset, formerStarOffset > -1 ? formerStarOffset : pattern.length()); + + // 匹配前缀Pattern + result = remainingURI.equals(prefixPattern); + // 已经没有星号,直接返回 + if (formerStarOffset == -1) { + return result; + } + + // 匹配失败,直接返回 + if (!result){ + return false; + } + if (!isEmpty(prefixPattern)) { + remainingURI = substringAfter(str, prefixPattern); + } + + // 匹配后缀Pattern + latterStarOffset = indexOf(pattern, START, formerStarOffset + 1); + suffixPattern = substring(pattern, formerStarOffset + 1, latterStarOffset > -1 ? latterStarOffset : pattern.length()); + + result = remainingURI.equals(suffixPattern); + // 匹配失败,直接返回 + if (!result){ + return false; + } + if (!isEmpty(suffixPattern)) { + remainingURI = substringAfter(str, suffixPattern); + } + + // 移动指针 + beginOffset = latterStarOffset + 1; + + } + while (!isEmpty(suffixPattern) && !isEmpty(remainingURI)); + + return true; + } + + /** + * 查找指定字符串是否匹配 + * + * @param str 指定字符串 + * @param pattern 需要检查的字符串 + * @return 是否匹配 + */ + public static boolean matchesTwo(String str, String pattern) { + if (isEmpty(pattern) || isEmpty(str)) { + return false; + } + + pattern = pattern.replaceAll("\\s*", ""); // 替换空格 + int beginOffset = 0; // pattern截取开始位置 + int formerStarOffset = -1; // 前星号的偏移位置 + int latterStarOffset = -1; // 后星号的偏移位置 + + String remainingURI = str; + String prefixPattern = ""; + String suffixPattern = ""; + + boolean result = false; + do { + formerStarOffset = indexOf(pattern, START, beginOffset); + prefixPattern = substring(pattern, beginOffset, formerStarOffset > -1 ? formerStarOffset : pattern.length()); + + // 匹配前缀Pattern + result = remainingURI.contains(prefixPattern); + // 已经没有星号,直接返回 + if (formerStarOffset == -1) { + return result; + } + + // 匹配失败,直接返回 + if (!result){ + return false; + } + if (!isEmpty(prefixPattern)) { + remainingURI = substringAfter(str, prefixPattern); + } + + // 匹配后缀Pattern + latterStarOffset = indexOf(pattern, START, formerStarOffset + 1); + suffixPattern = substring(pattern, formerStarOffset + 1, latterStarOffset > -1 ? latterStarOffset : pattern.length()); + + result = remainingURI.contains(suffixPattern); + // 匹配失败,直接返回 + if (!result){ + return false; + } + if (!isEmpty(suffixPattern)) { + remainingURI = substringAfter(str, suffixPattern); + } + + // 移动指针 + beginOffset = latterStarOffset + 1; + + } + while (!isEmpty(suffixPattern) && !isEmpty(remainingURI)); + + return true; + } + + @SuppressWarnings("unchecked") + public static T cast(Object obj) { + return (T) obj; + } +} diff --git a/gateway/src/main/resources/application-dev.yml b/gateway/src/main/resources/application-dev.yml new file mode 100644 index 0000000..8faaa6b --- /dev/null +++ b/gateway/src/main/resources/application-dev.yml @@ -0,0 +1,20 @@ +spring: + resources: + static-locations: file:D://supervise + cloud: + nacos: + discovery: +# namespace: supervise + server-addr: 127.0.0.1:8848 + redis: + database: 3 # Redis数据库索引(默认为0) + host: 127.0.0.1 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: + port: 6379 + timeout: 0 # 连接超时时间(毫秒) \ No newline at end of file diff --git a/gateway/src/main/resources/application-pro.yml b/gateway/src/main/resources/application-pro.yml new file mode 100644 index 0000000..8faaa6b --- /dev/null +++ b/gateway/src/main/resources/application-pro.yml @@ -0,0 +1,20 @@ +spring: + resources: + static-locations: file:D://supervise + cloud: + nacos: + discovery: +# namespace: supervise + server-addr: 127.0.0.1:8848 + redis: + database: 3 # Redis数据库索引(默认为0) + host: 127.0.0.1 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: + port: 6379 + timeout: 0 # 连接超时时间(毫秒) \ No newline at end of file diff --git a/gateway/src/main/resources/application-test.yml b/gateway/src/main/resources/application-test.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/gateway/src/main/resources/application-test.yml @@ -0,0 +1 @@ + diff --git a/gateway/src/main/resources/application.yml b/gateway/src/main/resources/application.yml new file mode 100644 index 0000000..05f7cd3 --- /dev/null +++ b/gateway/src/main/resources/application.yml @@ -0,0 +1,36 @@ +hystrix: + command: + default: + execution: + isolation: + strategy: SEMAPHORE + thread: + timeoutInMilliseconds: 300000 +server: + port: 8111 +spring: + application: + name: gateway + profiles: + active: dev +# active: pro + cloud: + gateway: + routes: + - id: wms-biz + predicates: + - Path= /wms/** + uri: lb://wms-biz + filters: + - StripPrefix=1 + +ignore: + whites: + - /wms/apiadmin/sysuser/login #pc端登录 + - /wms/apiadmin/sysuser/register #pc端登录 + + + + + whitesTwo: #包含所有 + - /upload/** diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7eec16d --- /dev/null +++ b/pom.xml @@ -0,0 +1,404 @@ + + + 4.0.0 + + com.yxt + share-store + pom + 1.0-SNAPSHOT + + gateway + wms-biz + + + + + + 1.8 + + UTF-8 + + UTF-8 + 1.8 + 1.8 + + + + 2.2.9.RELEASE + + Hoxton.SR6 + + 2.2.1.RELEASE + + 1.3.0 + + + + 2.5 + 1.14 + + 1.9.3 + + 2.6.2 + + + 3.4.0 + + 1.2.73 + + 0.9.1 + + + + 2.9.2 + 2.0.5 + + 3.17 + + 2.3.2 + + 1.19 + + 1.7 + + 5.4.0 + 6.0.20.Final + 1.18.24 + 3.1.0 + 3.10.1 + 2.2.9.RELEASE + 1.8.1 + 4.1.2 + 6.5.0 + 2.0.25 + + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + ${spring-cloud-alibaba.version} + pom + import + + + + com.alibaba.nacos + nacos-client + ${nacos.version} + + + + org.springframework.boot + spring-boot-starter-data-redis + ${redis.version} + + + io.lettuce + lettuce-core + + + + + + com.auth0 + java-jwt + ${java-jwt.version} + + + + redis.clients + jedis + ${jedis.version} + + + + commons-io + commons-io + ${commons.io.version} + + + commons-codec + commons-codec + ${commons-codec.version} + + + + commons-beanutils + commons-beanutils + ${commons.beanutils.version} + + + + org.apache.commons + commons-pool2 + ${common-pool.version} + + + com.baomidou + mybatis-plus-boot-starter + ${mybatis-plus.version} + + + com.baomidou + mybatis-plus-annotation + ${mybatis-plus.version} + + + + com.alibaba + fastjson + ${fastjson.version} + + + + io.jsonwebtoken + jjwt + ${jjwt.version} + + + + + io.springfox + springfox-swagger2 + ${swagger.fox.version} + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + com.github.xiaoymin + knife4j-dependencies + ${knife4j-Swagger} + pom + import + + + + org.apache.poi + poi-ooxml + ${poi.version} + + + + com.github.penggle + kaptcha + ${kaptcha.version} + + + + eu.bitwalker + UserAgentUtils + ${bitwalker.version} + + + + org.apache.velocity + velocity + ${velocity.version} + + + + + cn.hutool + hutool-all + ${hutool.version} + + + + cn.hutool + hutool-core + ${hutool.version} + + + + cn.hutool + hutool-http + ${hutool.version} + + + + cn.hutool + hutool-crypto + ${hutool.version} + + + + cn.hutool + hutool-cache + ${hutool.version} + + + + cn.hutool + hutool-captcha + ${hutool.version} + + + + cn.hutool + hutool-poi + ${hutool.version} + + + + cn.hutool + hutool-json + ${hutool.version} + + + + cn.hutool + hutool-cron + ${hutool.version} + + + + cn.hutool + hutool-system + ${hutool.version} + + + + cn.hutool + hutool-setting + ${hutool.version} + + + + cn.hutool + hutool-extra + ${hutool.version} + + + + cn.hutool + hutool-aop + ${hutool.version} + + + + cn.hutool + hutool-bloomFilter + ${hutool.version} + + + + cn.hutool + hutool-db + ${hutool.version} + + + + cn.hutool + hutool-log + ${hutool.version} + + + + cn.hutool + hutool-socket + ${hutool.version} + + + + cn.hutool + hutool-dfa + ${hutool.version} + + + + cn.hutool + hutool-script + ${hutool.version} + + + org.hibernate.validator + hibernate-validator + ${hibernate-validator.version} + compile + + + org.projectlombok + lombok + true + ${lombok.version} + + + + + com.deepoove + poi-tl + ${poi-tl.version} + + + + org.apache.poi + poi + ${poi.version} + + + + org.flowable + flowable-engine + ${flowable.version} + compile + + + + org.flowable + flowable-spring-boot-starter-basic + ${flowable.version} + + + org.mybatis + mybatis + + + + + + org.apache.pdfbox + pdfbox + ${pdfbox.version} + + + + + + + + nexus-releases + http://nexus3.yyundong.com/repository/yxt-mvn-releases/ + + + nexus-snapshots + http://nexus3.yyundong.com/repository/yxt-mvn-snapshot/ + + + + \ No newline at end of file diff --git a/wms-biz/pom.xml b/wms-biz/pom.xml new file mode 100644 index 0000000..cd144e5 --- /dev/null +++ b/wms-biz/pom.xml @@ -0,0 +1,168 @@ + + + + share-store + com.yxt + 1.0-SNAPSHOT + + 4.0.0 + + com.yxt.share + wms-biz + + + 8 + 8 + UTF-8 + + + + com.alibaba + easyexcel + 3.3.2 + + + com.yxt + yxt-common-base + 0.0.1 + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + mysql + mysql-connector-java + runtime + + + com.baomidou + mybatis-plus-boot-starter + + + com.baomidou + mybatis-plus-annotation + + + org.projectlombok + lombok + 1.18.24 + true + + + + com.yxt + yxt-common-base + 0.0.1 + + + + org.springframework.boot + spring-boot-starter-web + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + + mysql + mysql-connector-java + runtime + + + + com.baomidou + mybatis-plus-boot-starter + + + com.baomidou + mybatis-plus-annotation + + + junit + junit + compile + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + cn.dev33 + sa-token-spring-boot-starter + 1.37.0 + + + cn.hutool + hutool-all + 5.8.23 + + + cn.hutool + hutool-core + 5.8.23 + + + com.google.zxing + core + 3.5.2 + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.5.6 + + + + repackage + + + + + + + + src/main/java + + **/*Mapper.xml + + + + src/main/resources + + **/*.* + + false + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/WmsApplication.java b/wms-biz/src/main/java/com/yxt/wms/WmsApplication.java new file mode 100644 index 0000000..0a78af7 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/WmsApplication.java @@ -0,0 +1,24 @@ +package com.yxt.wms; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * @author wangpengfei + * @date ${DATE} ${TIME} + */ +@SpringBootApplication(scanBasePackages = { + "com.yxt.common.base.config", + "com.yxt.wms" +}) +@EnableDiscoveryClient +@EnableScheduling +@EnableFeignClients +public class WmsApplication { + public static void main(String[] args) { + SpringApplication.run(WmsApplication.class, args); + } +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/apiadmin/AdminHomeRest.java b/wms-biz/src/main/java/com/yxt/wms/apiadmin/AdminHomeRest.java new file mode 100644 index 0000000..73f703b --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/apiadmin/AdminHomeRest.java @@ -0,0 +1,10 @@ +package com.yxt.wms.apiadmin; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController("com.yxt.wms.apiadmin.AdminHomeRest") +@RequestMapping("/apiadmin/home") +public class AdminHomeRest { + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsBrandRest.java b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsBrandRest.java new file mode 100644 index 0000000..c07b9eb --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsBrandRest.java @@ -0,0 +1,66 @@ +package com.yxt.wms.apiadmin; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoService; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoDto; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoQuery; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 15:49 + */ +@Api(tags = "商品品牌") +@RestController +@RequestMapping("/apiadmin/base/basegoodsbrand") +public class BaseGoodsBrandRest { + + @Autowired + BaseBrandInfoService baseBrandInfoService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseBrandInfoService.listPage(pq); + } + + @ApiOperation("查询所有的品牌") + @GetMapping("/listAll") + public ResultBean> listAll() { + return baseBrandInfoService.listAll(); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseBrandInfoDto dto) { + return baseBrandInfoService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseBrandInfoService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseBrandInfoService.delete(sid); + } + + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { + return baseBrandInfoService.updateIsEnable(sid,isEnable); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsSpuRest.java b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsSpuRest.java new file mode 100644 index 0000000..49488aa --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsSpuRest.java @@ -0,0 +1,74 @@ +package com.yxt.wms.apiadmin; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuService; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuDto; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuQuery; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * @author wangpengfei + * @date 2024/4/12 11:20 + */ +@RestController() +@RequestMapping("/apiadmin/base/basegoodsspu") +public class BaseGoodsSpuRest { + + + @Autowired + BaseGoodsSpuService baseGoodsSpuService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseGoodsSpuService.listPage(pq); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsSpuDto dto) { + return baseGoodsSpuService.saveOrUpdate(dto); + } + // @ApiOperation("保存商品信息及sku") +// @PostMapping("/save") +// public ResultBean save(@RequestBody BaseGoodsSpuDto dto) { +// return baseGoodsSpuService.save(dto); +// } + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseGoodsSpuService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseGoodsSpuService.delete(sid); + } + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { + return baseGoodsSpuService.updateIsEnable(sid,isEnable); + } + @ApiOperation("下载模版") + @PostMapping("/download") + public void download(HttpServletRequest request, HttpServletResponse response) { + baseGoodsSpuService.download(request, response); + } + @ApiOperation("导入excel") + @PostMapping("/importExcel") + public ResultBean importExcel(@RequestParam("file")MultipartFile file) throws IOException { + return baseGoodsSpuService.importExcel(file); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsTypeRest.java b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsTypeRest.java new file mode 100644 index 0000000..1db4c54 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsTypeRest.java @@ -0,0 +1,61 @@ +package com.yxt.wms.apiadmin; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basegoodstype.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:44 + */ +@Api(tags = "商品类型") +@RestController +@RequestMapping("/apiadmin/base/basegoodstype") +public class BaseGoodsTypeRest { + @Autowired + BaseGoodsTypeService baseGoodsTypeService; + + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseGoodsTypeService.listPage(pq); + } + @ApiOperation("查询所有的类别") + @GetMapping("/listAll") + public ResultBean> listAll() { + return baseGoodsTypeService.listAll(); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsTypeDto dto) { + return baseGoodsTypeService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseGoodsTypeService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseGoodsTypeService.delete(sid); + } + + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { + return baseGoodsTypeService.updateIsEnable(sid,isEnable); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsUnitRest.java b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsUnitRest.java new file mode 100644 index 0000000..f124a02 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseGoodsUnitRest.java @@ -0,0 +1,61 @@ +package com.yxt.wms.apiadmin; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basegoodsunit.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/3/8 9:19 + */ +@Api(tags = "商品类型") +@RestController +@RequestMapping("/apiadmin/base/basegoodsunit") +public class BaseGoodsUnitRest { + @Autowired + BaseGoodsUnitService baseGoodsUnitService; + + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseGoodsUnitService.listPage(pq); + } + @ApiOperation("查询所有的类别") + @GetMapping("/listAll") + public ResultBean> listAll() { + return baseGoodsUnitService.listAll(); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsUnitDto dto) { + return baseGoodsUnitService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseGoodsUnitService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseGoodsUnitService.delete(sid); + } + + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { + return baseGoodsUnitService.updateIsEnable(sid,isEnable); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseManufacturerRest.java b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseManufacturerRest.java new file mode 100644 index 0000000..0b12066 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseManufacturerRest.java @@ -0,0 +1,69 @@ +package com.yxt.wms.apiadmin; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basemanufacturer.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/27 13:56 + */ +@Api(tags = "厂家信息") +@RestController +@RequestMapping("/apiadmin/base/basemanufacturer") +public class BaseManufacturerRest { + + @Autowired + BaseManufacturerService baseManufacturerService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseManufacturerService.listPage(pq); + } + + @ApiOperation("查询所有的厂家") + @GetMapping("/listAll") + public ResultBean> listAll() { + return baseManufacturerService.listAll(); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseManufacturerDto dto) { + return baseManufacturerService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseManufacturerService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseManufacturerService.delete(sid); + } + + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid, @PathVariable("isEnable") String isEnable) { + return baseManufacturerService.updateIsEnable(sid, isEnable); + } + + @ApiOperation("查询分公司下所有的厂家") + @GetMapping("/getAllTypeByUseOrgSid") + public ResultBean> getAllTypeByUseOrgSid(@RequestParam("useOrgSid") String useOrgSid) { + return baseManufacturerService.getAllTypeByUseOrgSid(useOrgSid); + } + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseSupplierInfoRest.java b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseSupplierInfoRest.java new file mode 100644 index 0000000..634d397 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/apiadmin/BaseSupplierInfoRest.java @@ -0,0 +1,92 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.apiadmin; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basesupplierinfo.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierInfoFeignFallback.java
+ * Class: com.yxt.anrui.as.biz.basesupplierinfo.BaseSupplierInfoRest
+ * Description: 供应商信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "供应商信息") +@RestController +@RequestMapping("/apiadmin/base/basesupplierinfo") +public class BaseSupplierInfoRest { + + @Autowired + private BaseSupplierInfoService baseSupplierInfoService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + return baseSupplierInfoService.listPageVo(pq); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody BaseSupplierInfoDto dto){ + return baseSupplierInfoService.saveOrUpdateDto(dto); + } + + @ApiOperation("根据sid批量删除") + @DeleteMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + baseSupplierInfoService.delAll(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean< BaseSupplierInfoDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ + return baseSupplierInfoService.fetchDetailsVoBySid(sid); + } + + @ApiOperation("选择供应商") + @PostMapping("/choiceSupplierInfo") + public ResultBean> choiceSupplierInfo(@RequestParam("createOrgSid") String createOrgSid){ + return baseSupplierInfoService.choiceSupplierInfo(createOrgSid); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/apiadmin/SysUserRest.java b/wms-biz/src/main/java/com/yxt/wms/apiadmin/SysUserRest.java new file mode 100644 index 0000000..acda6ef --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/apiadmin/SysUserRest.java @@ -0,0 +1,63 @@ +package com.yxt.wms.apiadmin; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.yxt.common.core.result.ResultBean; +import com.yxt.wms.biz.sysuser.SysUserService; +import com.yxt.wms.feign.user.sysuser.SysUserDto; +import com.yxt.wms.feign.user.sysuser.SysUserQuery; +import com.yxt.wms.feign.user.sysuser.SysUserVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; + +/** + * @author wangpengfei + * @date 2024/5/6 10:29 + */ +@Api(tags = "供应商信息") +@RestController +@RequestMapping("/apiadmin/sysuser") +public class SysUserRest { + @Autowired + SysUserService sysUserService; + + + @PostMapping("/login") + @ResponseBody + @ApiOperation(value = "3、登录") + @ApiOperationSupport(order = 30) + public ResultBean login(@RequestBody SysUserQuery userQuery){ + return sysUserService.login(userQuery); + } + @PostMapping("/register") + @ResponseBody + @ApiOperation(value = "3、注册") + @ApiOperationSupport(order = 30) + public ResultBean register(@RequestBody SysUserDto dto){ + return sysUserService.register(dto); + } + @PostMapping("/loginDetails") + @ResponseBody + @ApiOperation(value = "获取登录人") + @ApiOperationSupport(order = 30) + public ResultBean loginDetails(HttpServletRequest httpServletRequest){ + return sysUserService.loginDetails(httpServletRequest); + } + @PostMapping("/sendMessageCode") + @ResponseBody + @ApiOperation(value = "3、获取注册码") + @ApiOperationSupport(order = 30) + public ResultBean sendMessageCode(String mobile){ + return sysUserService.sendMessageCode(mobile); + } + @PostMapping("/sendMessageLogin") + @ResponseBody + @ApiOperation(value = "3、获取登录码") + @ApiOperationSupport(order = 30) + public ResultBean sendMessageLogin(String mobile){ + return sysUserService.sendMessageLogin(mobile); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/apiwx/WxHomeRest.java b/wms-biz/src/main/java/com/yxt/wms/apiwx/WxHomeRest.java new file mode 100644 index 0000000..f17e45a --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/apiwx/WxHomeRest.java @@ -0,0 +1,10 @@ +package com.yxt.wms.apiwx; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController("com.yxt.wms.apiwx.WxHomeRest") +@RequestMapping("/apiwx/home") +public class WxHomeRest { + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfo.java new file mode 100644 index 0000000..9f189b5 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfo.java @@ -0,0 +1,21 @@ +package com.yxt.wms.biz.basebrandinfo; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseBrandInfo extends BaseEntity { + + private String brandName;//品牌代码 + private String brandCode;//品牌名称 + private String image;//品牌图片url地址 + private String letter;//品牌的首字母大写 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoDto.java new file mode 100644 index 0000000..4f4bf9c --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoDto.java @@ -0,0 +1,27 @@ +package com.yxt.wms.biz.basebrandinfo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseBrandInfoDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String brandName;//品牌代码 + private String brandCode;//品牌名称 + private String image;//品牌图片url地址 + private String letter;//品牌的首字母大写 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoMapper.java new file mode 100644 index 0000000..345f3df --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoMapper.java @@ -0,0 +1,18 @@ +package com.yxt.wms.biz.basebrandinfo; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseBrandInfoMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoMapper.xml new file mode 100644 index 0000000..69caf0b --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoQuery.java new file mode 100644 index 0000000..3560f94 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoQuery.java @@ -0,0 +1,13 @@ +package com.yxt.wms.biz.basebrandinfo; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseBrandInfoQuery implements Query { + private String name; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoService.java new file mode 100644 index 0000000..d5c598b --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoService.java @@ -0,0 +1,57 @@ +package com.yxt.wms.biz.basebrandinfo; + +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.feign.base.basebrandinfo.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseBrandInfoService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + BaseBrandInfoFeign baseBrandInfoFeign; + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + return baseBrandInfoFeign.listPage(pq); + } + public ResultBean> listAll() { + ResultBean rb = ResultBean.fireFail(); + + return baseBrandInfoFeign.listAll(); +} + public ResultBean saveOrUpdate(BaseBrandInfoDto dto) { + ResultBean rb = ResultBean.fireFail(); + + return baseBrandInfoFeign.saveOrUpdate(dto); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + + return baseBrandInfoFeign.initialization(sid); + } + + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + return rb.success().setMsg("成功"); + } + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + return baseBrandInfoFeign.updateIsEnable(sid,isEnable); + } + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoVo.java new file mode 100644 index 0000000..ef50521 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basebrandinfo/BaseBrandInfoVo.java @@ -0,0 +1,32 @@ +package com.yxt.wms.biz.basebrandinfo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseBrandInfoVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String brandName;//品牌代码 + private String brandCode;//品牌名称 + private String image;//品牌图片url地址 + private String letter;//品牌的首字母大写 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSku.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSku.java new file mode 100644 index 0000000..3349911 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSku.java @@ -0,0 +1,21 @@ +package com.yxt.wms.biz.basegoodssku; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsSku extends BaseEntity { + private String goodsSkuCode;//商品Sku代码 + private String title;//商品标题 + private String goodsSpuSid;//商品基础信息Sid + private String externalCode;//外部编码 + private String indexes;//特有规格属性在spu表中special_spec字段对应每个参数值数组下标的组合,如0_0_0,1_0_0,相当于SKU这条记录的编码。 + @TableField(value = "own_spec") + private String ownSpec;//sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序 + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuDetailsVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuDetailsVo.java new file mode 100644 index 0000000..2de04e4 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuDetailsVo.java @@ -0,0 +1,69 @@ +package com.yxt.wms.biz.basegoodssku; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/19 + **/ +@Data +public class BaseGoodsSkuDetailsVo { + + @ApiModelProperty("商品代码") + private String goodsCode; + @ApiModelProperty("条形码") + private String barCode; + @ApiModelProperty("商品名称") + private String goodsName; + @ApiModelProperty("副标题") + private String subTitle; + @ApiModelProperty("拼音缩写") + private String goodsPY; + @ApiModelProperty("商品简称") + private String goodsShortName; + @ApiModelProperty("商品分类sid") + private String goodsTypeSid; + @ApiModelProperty("品牌sid") + private String brandSid; + @ApiModelProperty("厂家sid") + private String manufacturersid; + @ApiModelProperty("商品单位sid") + private String goodsUnitSid; + @ApiModelProperty("商品单位名称") + private String goodsUnitName; + + @ApiModelProperty("商品Sku代码") + private String goodsSkuCode; + @ApiModelProperty("商品标题") + private String title; + @ApiModelProperty("是否一品一码(goodID),0否,1是") + @JsonProperty("isGoodsID") + private int isGoodsID; + + //================================= + + //商品名称 + //零件号 + //拼音 + //条形码 + //计量单位 + //商品类别 + private String goodsTypeName;//商品类别名称 + //厂家 + //规格 + //品牌 + //车型 + //原厂标志 + //产地 + //锁定售价 + //备注 + //上限数量 + //下限数量 + //积分商品 + //所需积分 + + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuDto.java new file mode 100644 index 0000000..194b5c8 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuDto.java @@ -0,0 +1,31 @@ +package com.yxt.wms.biz.basegoodssku; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import com.yxt.wms.biz.basegoodsskuextend.BaseGoodsSkuExtendDto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsSkuDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodsSkuCode;//商品Sku代码 + private String title;//商品标题 + private String goodsSpuSid;//商品基础信息Sid + private String externalCode;//外部编码 + private String indexes;//特有规格属性在spu表中special_spec字段对应每个参数值数组下标的组合,如0_0_0,1_0_0,相当于SKU这条记录的编码。 + @TableField(value = "own_spec") + private String ownSpec;//sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序 + private BaseGoodsSkuExtendDto baseGoodsSkuExtend;//sku扩展 +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuMapper.java new file mode 100644 index 0000000..abe2194 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuMapper.java @@ -0,0 +1,26 @@ +package com.yxt.wms.biz.basegoodssku; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsSkuMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + List getSkusBySpuSid(@Param("spuSid")String spuSid); + BaseGoodsSkuVo getSkuBySid(@Param("sid")String sid); + + IPage getSelectList(IPage page, @Param(Constants.WRAPPER)QueryWrapper qw); + + IPage purGoodsListPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuMapper.xml new file mode 100644 index 0000000..5c42027 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuPurSelectList.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuPurSelectList.java new file mode 100644 index 0000000..4d2e3dd --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuPurSelectList.java @@ -0,0 +1,35 @@ +package com.yxt.wms.biz.basegoodssku; + +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/21 + **/ +@Data +public class BaseGoodsSkuPurSelectList { + + //sid + private String sid; + //零件号 + private String goodsSkuCode; + //规格 + private String title; + //商品名称 + private String goodsName; + //商品拼音 + private String goodsPY; + //商品简称 + private String goodsShortName; + //商品类别sid + private String goodsTypeSid; + //品牌sid + private String brandSid; + //厂家sid + private String manufacturerSid; + //商品单位名称 + private String goodsUnitName; + //sku特有规格参数键值对 + private String ownSpec; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuPurSelectQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuPurSelectQuery.java new file mode 100644 index 0000000..e10752a --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuPurSelectQuery.java @@ -0,0 +1,30 @@ +package com.yxt.wms.biz.basegoodssku; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/21 + **/ +@Data +public class BaseGoodsSkuPurSelectQuery implements Query { + + //组织sid + private String orgSid; + //商品名称 + private String goodsName; + //商品类别sid + private String goodsTypeSid; + //商品拼音 + private String goodsPY; + //品牌sid + private String brandSid; + //零件号 + private String goodsSkuCode; + //规格 + private String title; + //其他查询条件 + private String otherQuery; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuQuery.java new file mode 100644 index 0000000..62ea151 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuQuery.java @@ -0,0 +1,13 @@ +package com.yxt.wms.biz.basegoodssku; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSkuQuery implements Query { + private String name; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuSelectList.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuSelectList.java new file mode 100644 index 0000000..85008ef --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuSelectList.java @@ -0,0 +1,36 @@ +package com.yxt.wms.biz.basegoodssku; + +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/21 + **/ +@Data +public class BaseGoodsSkuSelectList { + + //商品名称 + private String goodsSpuSid; + private String goodsSpuName; + //商品sid + private String goodsSkuSid; + //商品编码 + private String goodsSkuCode; + //规格/型号 + private String goodsSkuTitle; + //计量单位 + private String goodsUnitSid; + private String goodsUnitName; + //仓库名称 + //货位 + //单位成本(进货价) + //数量 + //税额 + //含税价 + //金额 + //销售价1 + //销售价2 + //操作时间 + //操作人 +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuSelectQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuSelectQuery.java new file mode 100644 index 0000000..42b48c1 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuSelectQuery.java @@ -0,0 +1,15 @@ +package com.yxt.wms.biz.basegoodssku; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/21 + **/ +@Data +public class BaseGoodsSkuSelectQuery implements Query { + + private String goodsSkuCode; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuService.java new file mode 100644 index 0000000..870273c --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuService.java @@ -0,0 +1,175 @@ +package com.yxt.wms.biz.basegoodssku; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsSkuService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; +// @Autowired +// BaseGoodsSpuDetailService baseGoodsSpuDetailService; +// @Autowired +// BaseGoodsSkuExtendService baseGoodsSkuExtendService; +// @Autowired +// private BaseGoodsSpuService baseGoodsSpuService; +// @Autowired +// BaseGoodsTypeService baseGoodsTypeService; + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getName())) { + qw.like("goodsName", query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return rb.success().setData(p); + } + @Transactional + public ResultBean saveOrUpdate(BaseGoodsSkuDto dto) { + ResultBean rb = ResultBean.fireFail(); + + return rb.success().setMsg("成功"); + } + @Transactional + public ResultBean saveOrUpdate(List dtos) { + ResultBean rb = ResultBean.fireFail(); + for (BaseGoodsSkuDto dto : dtos) { + BaseGoodsSku sku=baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + String sid = ""; + if (null!=sku) { + sid = dto.getSid(); + BaseGoodsSku wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setModifyTime(new Date()); + baseMapper.updateById(wmsGoods); + dto.getBaseGoodsSkuExtend().setGoodsSkuSid(wmsGoods.getSid()); +// baseGoodsSkuExtendService.saveOrUpdate(dto.getBaseGoodsSkuExtend()); + } else { + BaseGoodsSku wmsGoods = new BaseGoodsSku(); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + dto.getBaseGoodsSkuExtend().setGoodsSkuSid(wmsGoods.getSid()); +// baseGoodsSkuExtendService.saveOrUpdate(dto.getBaseGoodsSkuExtend()); + } + } + + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuVo vo = baseMapper.getSkuBySid(sid); +// BaseGoodsSkuExtendVo vo1=baseGoodsSkuExtendService.getExtendBySkuSid(vo.getSid()).getData(); +// if(vo1==null){ +// vo.setBaseGoodsSkuExtend(new BaseGoodsSkuExtendVo()); +// } +// vo.setBaseGoodsSkuExtend(vo1); + return rb.success().setData(vo); + } + + public ResultBean> getSkusBySpuSid(String sid) { + ResultBean rb = ResultBean.fireFail(); + List vo = baseMapper.getSkusBySpuSid(sid); + return rb.success().setData(vo); + } + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSku wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid, String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSku wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } + + public ResultBean getDetails(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuDetailsVo baseGoodsSkuDetailsVo = new BaseGoodsSkuDetailsVo(); + BaseGoodsSku baseGoodsSku = fetchBySid(sid); + return rb.success().setData(baseGoodsSkuDetailsVo); + } + + public PagerVo getSelectList(PagerQuery pagerQuery) { + BaseGoodsSkuSelectQuery query = pagerQuery.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (query != null) { + //商品编码 + if (StringUtils.isNotBlank(query.getGoodsSkuCode())) { + qw.like("sku.goodsSkuCode", query.getGoodsSkuCode()); + } + } + IPage page = PagerUtil.queryToPage(pagerQuery); + IPage pagging = baseMapper.getSelectList(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public ResultBean> purGoodsListPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuPurSelectQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getOrgSid())){ + qw.eq("s.createOrgSid",query.getOrgSid()); + } + if (StringUtils.isNotBlank(query.getGoodsName())) { + qw.like("a.goodsName", query.getGoodsName()); + } + if (StringUtils.isNotBlank(query.getGoodsTypeSid())) { + qw.eq("a.goodsTypeSid", query.getGoodsTypeSid()); + } + if (StringUtils.isNotBlank(query.getGoodsPY())) { + qw.like("a.goodsPY", query.getGoodsPY()); + } + if (StringUtils.isNotBlank(query.getBrandSid())) { + qw.like("a.brandSid", query.getBrandSid()); + } + if (StringUtils.isNotBlank(query.getGoodsSkuCode())) { + qw.like("s.goodsSkuCode", query.getGoodsSkuCode()); + } + if (StringUtils.isNotBlank(query.getTitle())) { + qw.like("s.title", query.getTitle()); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getOtherQuery())){ + qw.and(wrapper -> wrapper.like("a.goodsName", query.getOtherQuery()).or().like("s.goodsSkuCode", query.getOtherQuery()).or().like("a.goodsPY",query.getOtherQuery())); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.purGoodsListPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return rb.success().setData(p); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuVo.java new file mode 100644 index 0000000..42d99f5 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodssku/BaseGoodsSkuVo.java @@ -0,0 +1,38 @@ +package com.yxt.wms.biz.basegoodssku; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import com.yxt.wms.biz.basegoodsskuextend.BaseGoodsSkuExtendVo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSkuVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodsSkuCode;//商品Sku代码 + private String title;//商品标题 + private String goodsSpuSid;//商品基础信息Sid + private String externalCode;//外部编码 + private String indexes;//特有规格属性在spu表中special_spec字段对应每个参数值数组下标的组合,如0_0_0,1_0_0,相当于SKU这条记录的编码。 + @TableField(value = "own_spec") + private String ownSpec;//sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序 + private String goodsName; + private BaseGoodsSkuExtendVo baseGoodsSkuExtend; + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtend.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtend.java new file mode 100644 index 0000000..644c74e --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtend.java @@ -0,0 +1,34 @@ +package com.yxt.wms.biz.basegoodsskuextend; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsSkuExtend extends BaseEntity { + private String goodsSkuSid;//商品Sku代码 + private String finalPurchasePrice;//最后采购价 + private String safetyStockDays;//安全库存天数 + private String isOriginalFactory;//是否原厂 + private String isInventoryAlert;//是否库存警戒 + @TableField(value = "InventoryAlertUpperLimit") + private String inventoryAlertUpperLimit;//库存警戒上线 + @TableField(value = "InventoryAlertLowerLimit") + private String inventoryAlertLowerLimit;//库存警戒下线 + private String costPrice;//成本价 + private String tagPrice;//吊牌价 + private String salesPrice;//销售单价 + private String standardPurchasePrice;//标准进价 + private String agencyPrice;//代理价 + private String discount;//折扣 + private String minimumSalesPrice;//最低零售价 + private String isLockingSalesPrice;//是否锁定销售价 + private String isIntegralExchange;//是否可以积分兑换 + private String integralAmount;//积分数量 + private String sortNo;//排序 + private String picUrl;//商品的图片,多个图片以‘,’分割 +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendDto.java new file mode 100644 index 0000000..8a9c7a4 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendDto.java @@ -0,0 +1,46 @@ +package com.yxt.wms.biz.basegoodsskuextend; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsSkuExtendDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodsSkuSid;//商品Sku代码 + private String finalPurchasePrice;//最后采购价 + private String safetyStockDays;//安全库存天数 + private String isOriginalFactory;//是否原厂 + private String isInventoryAlert;//是否库存警戒 + @TableField(value = "InventoryAlertUpperLimit") + private String inventoryAlertUpperLimit;//库存警戒上线 + @TableField(value = "InventoryAlertLowerLimit") + private String inventoryAlertLowerLimit;//库存警戒下线 + private String costPrice;//成本价 + private String tagPrice;//吊牌价 + private String salesPrice;//销售单价 + private String standardPurchasePrice;//标准进价 + private String agencyPrice;//代理价 + private String discount;//折扣 + private String minimumSalesPrice;//最低零售价 + private String isLockingSalesPrice;//是否锁定销售价 + private String isIntegralExchange;//是否可以积分兑换 + private String integralAmount;//积分数量 + private String sortNo;//排序 + private String picUrl;//商品的图片,多个图片以‘,’分割 +// private String [] Urls={};//图片数组 + private List urls;//图片数组 +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendMapper.java new file mode 100644 index 0000000..0595b55 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendMapper.java @@ -0,0 +1,20 @@ +package com.yxt.wms.biz.basegoodsskuextend; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsSkuExtendMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + BaseGoodsSkuExtendVo getExtendBySkuSid(@Param("skuSid")String skuSid); + BaseGoodsSkuExtendVo getExtendBySid(@Param("sid")String sid); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendMapper.xml new file mode 100644 index 0000000..c6c850e --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendQuery.java new file mode 100644 index 0000000..ea4c804 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendQuery.java @@ -0,0 +1,13 @@ +package com.yxt.wms.biz.basegoodsskuextend; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSkuExtendQuery implements Query { + private String name; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendService.java new file mode 100644 index 0000000..514bf70 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendService.java @@ -0,0 +1,135 @@ +package com.yxt.wms.biz.basegoodsskuextend; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Collections; +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsSkuExtendService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; +// @Autowired +// private BaseBrandInfoService baseBrandInfoService; +// @Autowired +// private BaseGoodsTypeService baseGoodsTypeService; +// @Autowired +// private BaseManufacturerService baseManufacturerService; +// @Autowired +// BaseGoodsSpuDetailService baseGoodsSpuDetailService; + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtendQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getName())){ + qw.like("goodsName",query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + List records = pagging.getRecords(); + records.removeAll(Collections.singleton(null)); +// if (!records.isEmpty()) { +// for (BaseGoodsSpuVo record : records) { +// if (StringUtils.isNotBlank(record.getPicUrl())) { +// record.setPicUrl(fileUploadComponent.getUrlPrefix() + record.getPicUrl()); +// } +// } +// } + return rb.success().setData(p); + } + @Transactional + public ResultBean saveOrUpdate(BaseGoodsSkuExtendDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + BaseGoodsSkuExtend extend=baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + if (null!=extend) { + sid = dto.getSid(); + BaseGoodsSkuExtend wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setModifyTime(new Date()); + for (UrlsVo url : dto.getUrls()) { + String urlPrefix = fileUploadComponent.getUrlPrefix(); + String path = url.getUrl().substring(urlPrefix.length()); + if(StringUtils.isBlank(dto.getPicUrl())){ + wmsGoods.setPicUrl(path); + }else{ + wmsGoods.setPicUrl(wmsGoods.getPicUrl()+","+path); + } + } + if (StringUtils.isNotBlank(dto.getPicUrl())) { + String urlPrefix = fileUploadComponent.getUrlPrefix(); + String path = dto.getPicUrl().substring(urlPrefix.length()); + wmsGoods.setPicUrl(path); + } + baseMapper.updateById(wmsGoods); + + } else { + BaseGoodsSkuExtend wmsGoods = new BaseGoodsSkuExtend(); + sid = wmsGoods.getSid(); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setCreateTime(new DateTime()); + for (UrlsVo url : dto.getUrls()) { + String urlPrefix = fileUploadComponent.getUrlPrefix(); + String path = url.getUrl().substring(urlPrefix.length()); + if(StringUtils.isBlank(dto.getPicUrl())){ + wmsGoods.setPicUrl(path); + }else{ + wmsGoods.setPicUrl(wmsGoods.getPicUrl()+","+path); + } + } + baseMapper.insert(wmsGoods); + } + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtendVo vo = baseMapper.getExtendBySid(sid); + return rb.success().setData(vo); + } + + public ResultBean getExtendBySkuSid(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtendVo vo = baseMapper.getExtendBySkuSid(sid); + return rb.success().setData(vo); + } + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtend wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtend wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendVo.java new file mode 100644 index 0000000..52d2684 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/BaseGoodsSkuExtendVo.java @@ -0,0 +1,53 @@ +package com.yxt.wms.biz.basegoodsskuextend; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSkuExtendVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodsSkuSid;//商品Skusid + private String finalPurchasePrice;//最后采购价 + private String safetyStockDays;//安全库存天数 + private String isOriginalFactory;//是否原厂 + private String isInventoryAlert;//是否库存警戒 + @TableField(value = "InventoryAlertUpperLimit") + private String inventoryAlertUpperLimit;//库存警戒上线 + @TableField(value = "InventoryAlertLowerLimit") + private String inventoryAlertLowerLimit;//库存警戒下线 + private String costPrice;//成本价 + private String tagPrice;//吊牌价 + private String salesPrice;//销售单价 + private String standardPurchasePrice;//标准进价 + private String agencyPrice;//代理价 + private String discount;//折扣 + private String minimumSalesPrice;//最低零售价 + private String isLockingSalesPrice;//是否锁定销售价 + private String isIntegralExchange;//是否可以积分兑换 + private String integralAmount;//积分数量 + private String sortNo;//排序 + private String picUrl;//商品的图片,多个图片以‘,’分割 +// private String [] Urls={};//图片数组 + private List urls;//图片数组 + private String title;//sku标题 + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/UrlsVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/UrlsVo.java new file mode 100644 index 0000000..57c5973 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsskuextend/UrlsVo.java @@ -0,0 +1,12 @@ +package com.yxt.wms.biz.basegoodsskuextend; + +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/3/22 10:20 + */ +@Data +public class UrlsVo { + private String url; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpu.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpu.java new file mode 100644 index 0000000..3716437 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpu.java @@ -0,0 +1,32 @@ +package com.yxt.wms.biz.basegoodsspu; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsSpu extends BaseEntity { + private String goodsCode;//商品代码 + private String barCode;//条形码 + private String goodsName;//商品名称 + private String subTitle;//商品名称 + private String goodsPY;//拼音缩写 + private String goodsShortName;//商品简称 + private String goodsTypeSid;//商品分类sid + private String brandSid;//品牌sid + private String manufacturerSid;//厂家sid + private String goodsUnitSid;//商品单位sid + private String goodsUnitName;//商品单位名称 + private String taxRate;//税率 + private String shelfLife;//保质期天 + private String nationalStandardCode;//国标码 + private String sortNo;//排序 + private String externalCode;//外部编码 + private String factoryCode;//厂家货号 + private String isListed;//是否上架 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuDto.java new file mode 100644 index 0000000..01e5e96 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuDto.java @@ -0,0 +1,47 @@ +package com.yxt.wms.biz.basegoodsspu; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import com.yxt.wms.biz.basegoodssku.BaseGoodsSkuDto; +import com.yxt.wms.biz.basegoodsspudetail.BaseGoodsSpuDetailDto; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsSpuDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodsCode;//商品代码 + private String barCode;//条形码 + private String goodsName;//商品名称 + private String subTitle;//副标题 + private String goodsPY;//拼音缩写 + private String goodsShortName;//商品简称 + private String goodsTypeSid;//商品分类sid + private String brandSid;//品牌sid + private String manufacturerSid;//厂家sid + private String goodsUnitSid;//商品单位sid + private String goodsUnitName;//商品单位名称 + private String taxRate;//税率 + private String shelfLife;//保质期天 + private String nationalStandardCode;//国标码 + private String sortNo;//排序 + private String externalCode;//外部编码 + private String factoryCode;//厂家货号 + private String isListed;//是否上架 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + private BaseGoodsSpuDetailDto baseGoodsSpuDetail;//商品spu详情 + private List baseGoodsSkus;//商品sku + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuMapper.java new file mode 100644 index 0000000..89ae924 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuMapper.java @@ -0,0 +1,19 @@ +package com.yxt.wms.biz.basegoodsspu; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsSpuMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + BaseGoodsSpuVo initialization(@Param("sid")String sid); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuMapper.xml new file mode 100644 index 0000000..4280837 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuQuery.java new file mode 100644 index 0000000..208a758 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuQuery.java @@ -0,0 +1,13 @@ +package com.yxt.wms.biz.basegoodsspu; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSpuQuery implements Query { + private String name; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuService.java new file mode 100644 index 0000000..2df77e1 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuService.java @@ -0,0 +1,383 @@ +package com.yxt.wms.biz.basegoodsspu; + +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.apiadmin.BaseGoodsBrandRest; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfo; +import com.yxt.wms.biz.basegoodssku.BaseGoodsSku; +import com.yxt.wms.biz.basegoodssku.BaseGoodsSkuDto; +import com.yxt.wms.biz.basegoodsskuextend.BaseGoodsSkuExtend; +import com.yxt.wms.biz.basegoodsskuextend.BaseGoodsSkuExtendDto; +import com.yxt.wms.biz.basegoodsspudetail.BaseGoodsSpuDetail; +import com.yxt.wms.biz.basegoodsspudetail.BaseGoodsSpuDetailDto; +import com.yxt.wms.biz.basegoodstype.BaseGoodsType; +import com.yxt.wms.biz.basegoodsunit.BaseGoodsUnit; +import com.yxt.wms.biz.basemanufacturer.BaseManufacturer; +import com.yxt.wms.feign.base.basebrandinfo.BaseBrandInfoFeign; +import com.yxt.wms.feign.base.basegoodsspu.*; +import com.yxt.wms.feign.base.basegoodstype.BaseGoodsTypeFeign; +import com.yxt.wms.feign.base.basegoodsunit.BaseGoodsUnitFeign; +import com.yxt.wms.feign.base.basemanufacturer.BaseManufacturerFeign; +import com.yxt.wms.utils.ExcelUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsSpuService extends MybatisBaseService { + // @Autowired +// private FileUploadComponent fileUploadComponent; + @Autowired + BaseGoodsTypeFeign baseGoodsTypeFeign; + @Autowired + BaseBrandInfoFeign baseBrandInfoFeign; + @Autowired + BaseManufacturerFeign baseManufacturerFeign; + @Autowired + BaseGoodsUnitFeign baseGoodsUnitFeign; + @Value("${image.upload.path:http://127.0.0.1:8080/upload/}") + String path; + @Autowired + BaseGoodsSpuFeign baseGoodsSpuFeign; + + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsSpuFeign.listPage(pq); + } + + @Transactional + public ResultBean saveOrUpdate(BaseGoodsSpuDto dto) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsSpuFeign.saveOrUpdate(dto); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsSpuFeign.initialization(sid); + } + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpu wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid, String isEnable) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsSpuFeign.updateIsEnable(sid, isEnable); + } + + public void download(HttpServletRequest request, HttpServletResponse response) { + + // 指定要下载的文件路径 + String filePath = path + "商品导入模板.xls"; + String fileName = new File(filePath).getName(); + String encodedFileName = null; + try { + encodedFileName = URLEncoder.encode(fileName, "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + // 设置响应头信息 + response.setHeader("Content-Disposition", "attachment; filename=\"" + encodedFileName + "\""); + // 获取文件名 + response.setContentType("application/octet-stream"); + // 读取文件并将其写入响应输出流 + try (InputStream in = new FileInputStream(filePath); + OutputStream out = response.getOutputStream()) { + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = in.read(buffer)) != -1) { + out.write(buffer, 0, bytesRead); + } + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public ResultBean importExcel(MultipartFile file) throws IOException { +// return baseGoodsSpuFeign.importExcel(file); + ResultBean rb=new ResultBean().fail(); + //檢查excel + ExcelUtil.checkFile(file); + //解析excel + List list = ExcelUtil.readExcel(file); + if (!list.isEmpty()) { + List tt = new ArrayList(); + List tt1 = new ArrayList(); + for (int i = 0; i < list.size(); i++) { + BaseGoodsSpuDto dto =new BaseGoodsSpuDto(); + String taxRate = StringUtils.isEmpty(list.get(i)[10]) ? null : list.get(i)[10]; + if(StringUtils.isNotBlank(taxRate)){ + if(!taxRate.contains(".")){ + return rb.setMsg("第" + (i + 1) + "行税率格式不正确!"); + } + if(taxRate.length()>4){ + return rb.setMsg("第" + (i + 1) + "行税率长度不正确!"); + } + } + + dto = this.packaging(list.get(i),dto); + if (null == dto) { + return rb.setMsg("导入失败,第" + (i + 1) + "行数据错误!"); + } else { + tt.add(dto); + } + } + tt1=a(tt); + for (BaseGoodsSpuDto baseGoodsSpuDto : tt1) { + String goodsTypeSid = StringUtils.isEmpty(baseGoodsSpuDto.getGoodsTypeSid()) ? null : baseGoodsSpuDto.getGoodsTypeSid(); + if (StringUtils.isNotBlank(goodsTypeSid)) { + BaseGoodsType baseGoodsType = baseGoodsTypeFeign.getTypeByName(goodsTypeSid).getData(); + if (null != baseGoodsType) { + baseGoodsSpuDto.setGoodsTypeSid(baseGoodsType.getSid()); + } else { + return rb.setMsg("商品分类:" + goodsTypeSid + "不存在,请先添加"); + } + } + + String brandSid = StringUtils.isEmpty(baseGoodsSpuDto.getBrandSid()) ? null : baseGoodsSpuDto.getBrandSid(); + if (StringUtils.isNotBlank(brandSid)) { + BaseBrandInfo brand = baseBrandInfoFeign.getBrandByName(brandSid).getData(); + if (null != brand) { + baseGoodsSpuDto.setBrandSid(brand.getSid()); + } else { + return rb.setMsg("商品品牌:" + brandSid + "不存在,请先添加"); + } + } + + String manufacturerSid = StringUtils.isEmpty(baseGoodsSpuDto.getManufacturerSid()) ? null : baseGoodsSpuDto.getManufacturerSid(); + if (StringUtils.isNotBlank(manufacturerSid)) { + BaseManufacturer baseManufacturer = baseManufacturerFeign.getManufacturerByName(manufacturerSid).getData(); + if (null != baseManufacturer) { + baseGoodsSpuDto.setManufacturerSid(baseManufacturer.getSid()); + } else { + return rb.setMsg("商品厂家:" + manufacturerSid + "不存在,请先添加"); + } + } + + String goodsUnitSid = StringUtils.isEmpty(baseGoodsSpuDto.getGoodsUnitName()) ? null : baseGoodsSpuDto.getGoodsUnitName(); + if (StringUtils.isNotBlank(goodsUnitSid)) { + BaseGoodsUnit baseGoodsUnit = baseGoodsUnitFeign.getUnitByName(goodsUnitSid).getData(); + if (null != baseGoodsUnit) { + baseGoodsSpuDto.setGoodsUnitSid(baseGoodsUnit.getSid()); + } else { + return rb.setMsg("商品单位:" + goodsUnitSid + "不存在,请先添加"); + } + } + } + baseGoodsSpuFeign.batchSave(tt1); + return rb.success().setMsg("导入成功"); + + } else { + return rb.setMsg("导入文件没有有效数据"); + } + } + + public List a(List dtos) { + ResultBean rb=new ResultBean().fail(); + List spus = new ArrayList<>();//spu list + int goodsCode =dtos.stream().filter(b->StringUtils.isEmpty(b.getGoodsCode())).collect(Collectors.toList()).size(); + if(goodsCode==0){ + spus = dtos.stream().filter(distinctByKey(BaseGoodsSpuDto::getGoodsCode)).collect(Collectors.toList()); + }else{ + spus = dtos.stream().filter(distinctByKey(BaseGoodsSpuDto::getGoodsName)).collect(Collectors.toList()); + } + for (BaseGoodsSpuDto baseGoodsSpuDto : spus) { + BaseGoodsSpuDetailDto spuDetail = new BaseGoodsSpuDetailDto(); + List skus = new ArrayList<>(); + String sid = UUID.randomUUID().toString(); + baseGoodsSpuDto.setSid(sid); + List dtos1=new ArrayList<>(); + if(goodsCode==0){ + dtos1 = dtos.stream().filter(d -> d.getGoodsCode().equals(baseGoodsSpuDto.getGoodsCode())).collect(Collectors.toList()); + }else{ + dtos1 = dtos.stream().filter(d -> d.getGoodsName().equals(baseGoodsSpuDto.getGoodsName())).collect(Collectors.toList()); + } + spuDetail.setGoodsExplain(dtos1.get(0).getBaseGoodsSpuDetail().getGoodsExplain()); + spuDetail.setGoodsDescription(dtos1.get(0).getBaseGoodsSpuDetail().getGoodsDescription()); + spuDetail.setSid(UUID.randomUUID().toString()); + spuDetail.setGoodSpuSid(baseGoodsSpuDto.getSid()); + for (BaseGoodsSpuDto dto : dtos1) { + BaseGoodsSkuDto sku = new BaseGoodsSkuDto(); + String skuSid = UUID.randomUUID().toString(); + sku.setGoodsSkuCode(dto.getBaseGoodsSkus().get(0).getGoodsSkuCode()); + sku.setTitle(dto.getBaseGoodsSkus().get(0).getTitle()); + sku.setExternalCode(dto.getBaseGoodsSkus().get(0).getExternalCode()); + sku.setGoodsSpuSid(sid); + sku.setSid(skuSid); + BaseGoodsSkuExtendDto skuExtend = new BaseGoodsSkuExtendDto(); + skuExtend.setSid(UUID.randomUUID().toString()); + skuExtend.setGoodsSkuSid(skuSid); + skuExtend.setSortNo("1"); + skuExtend.setFinalPurchasePrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getFinalPurchasePrice()); + skuExtend.setSafetyStockDays(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getSafetyStockDays()); + skuExtend.setIsOriginalFactory(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIsOriginalFactory()); + skuExtend.setIsInventoryAlert(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIsInventoryAlert()); + skuExtend.setInventoryAlertUpperLimit(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getInventoryAlertUpperLimit()); + skuExtend.setInventoryAlertLowerLimit(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getInventoryAlertLowerLimit()); + skuExtend.setCostPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getCostPrice()); + skuExtend.setTagPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getTagPrice()); + skuExtend.setSalesPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getSalesPrice()); + skuExtend.setStandardPurchasePrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getStandardPurchasePrice()); + skuExtend.setAgencyPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getAgencyPrice()); + skuExtend.setDiscount(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getDiscount()); + skuExtend.setMinimumSalesPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getMinimumSalesPrice()); + skuExtend.setIsLockingSalesPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIsLockingSalesPrice()); + skuExtend.setIsIntegralExchange(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIsIntegralExchange()); + skuExtend.setIntegralAmount(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIntegralAmount()); + sku.setBaseGoodsSkuExtend(skuExtend); + skus.add(sku); + } + baseGoodsSpuDto.setBaseGoodsSkus(skus); + baseGoodsSpuDto.setBaseGoodsSpuDetail(spuDetail); + } + return spus; + } + + private static Predicate distinctByKey(Function keyExtractor) { + Set seen = ConcurrentHashMap.newKeySet(); + return t -> seen.add(keyExtractor.apply(t)); + } + + private BaseGoodsSpuDto packaging(String[] arr, BaseGoodsSpuDto baseGoodsSpuDto) { + Map result = new HashMap<>(); + //0四电名称1四电类别2规格3数量4单价5总价6单位7备注 +// BaseGoodsSpuDto baseGoodsSpuDto =null; + try { + String goodsCode = StringUtils.isEmpty(arr[0]) ? "" : arr[0];// + String barCode = StringUtils.isEmpty(arr[1]) ? "" : arr[1];// + String goodsName = StringUtils.isEmpty(arr[2]) ? "" : arr[2];// + String subTitle = StringUtils.isEmpty(arr[3]) ? "" : arr[3]; + String goodsPY = StringUtils.isEmpty(arr[4]) ? "": arr[4]; + String goodsShortName = StringUtils.isEmpty(arr[5]) ? "" :arr[5]; + String goodsTypeSid = StringUtils.isEmpty(arr[6]) ? "" : arr[6]; + String brandSid = StringUtils.isEmpty(arr[7]) ? "" : arr[7]; + String manufacturerSid = StringUtils.isEmpty(arr[8]) ? "" : arr[8]; +// String goodsUnitSid = StringUtils.isEmpty(arr[9]) ? null : arr[9]; + String goodsUnitName = StringUtils.isEmpty(arr[9]) ? "" : arr[9]; + String taxRate = StringUtils.isEmpty(arr[10]) ? "0" : arr[10]; + String shelfLife = StringUtils.isEmpty(arr[11]) ? "0" : arr[11]; + String nationalStandardCode = StringUtils.isEmpty(arr[12]) ? "" : arr[12]; + String externalCode = StringUtils.isEmpty(arr[13]) ? "" : arr[13]; + String factoryCode = StringUtils.isEmpty(arr[14]) ? "" : arr[14]; + String isListed = (StringUtils.isEmpty(arr[15]) ? "1" : arr[15].equals("是")? "1":"2"); + String useOrgSid = StringUtils.isEmpty(arr[16]) ? "" : arr[16]; + String createOrgSid = StringUtils.isEmpty(arr[17]) ? "" : arr[17]; + +// String goodSpuSid = StringUtils.isEmpty(arr[19]) ? null : arr[19]; + String goodsExplain = StringUtils.isEmpty(arr[18]) ? "" : arr[18]; + String goodsDescription = StringUtils.isEmpty(arr[19]) ? "" : arr[19]; + + String goodsSkuSid = ""; + String goodsSkuCode = StringUtils.isEmpty(arr[20]) ? "" : arr[20]; + String title = StringUtils.isEmpty(arr[21]) ? "" : arr[21]; + String skuExternalCode = StringUtils.isEmpty(arr[22]) ? "" : arr[22]; + + String finalPurchasePrice = StringUtils.isEmpty(arr[23]) ? "" : arr[23]; + String safetyStockDays = StringUtils.isEmpty(arr[24]) ? "" : arr[24]; + String isOriginalFactory = (StringUtils.isEmpty(arr[25]) ? "1" : arr[25].equals("是")? "1":"2"); + String isInventoryAlert = (StringUtils.isEmpty(arr[26]) ? "1" : arr[26].equals("是")? "1":"2"); + String inventoryAlertUpperLimit = StringUtils.isEmpty(arr[27]) ? "0" : arr[27]; + String inventoryAlertLowerLimit = StringUtils.isEmpty(arr[28]) ? "0" : arr[28]; + String costPrice = StringUtils.isEmpty(arr[29]) ? "0" : arr[29]; + String tagPrice = StringUtils.isEmpty(arr[30]) ? "0" : arr[30]; + String salesPrice = StringUtils.isEmpty(arr[31]) ? "0" : arr[31]; + String standardPurchasePrice = StringUtils.isEmpty(arr[32]) ? "0" : arr[32]; + String agencyPrice = StringUtils.isEmpty(arr[33]) ? "0" : arr[33]; + String discount = StringUtils.isEmpty(arr[34]) ? "0" : arr[34]; + String minimumSalesPrice = StringUtils.isEmpty(arr[35]) ? "0" : arr[35]; + String isLockingSalesPrice = (StringUtils.isEmpty(arr[36]) ? "1" : arr[36].equals("是")? "1":"2"); + String isIntegralExchange = (StringUtils.isEmpty(arr[37]) ? "1" : arr[37].equals("是")? "1":"2"); + String integralAmount = StringUtils.isEmpty(arr[38]) ? "0" : arr[38]; + + //excel表中物资类别保存的是分类编号,插入数据库时 根据分类编号查询基础数据中 物资类别表的id + + baseGoodsSpuDto.setSortNo("1"); + baseGoodsSpuDto.setGoodsCode(goodsCode); + baseGoodsSpuDto.setBarCode(barCode);//物资类别 保存物资类别表id + baseGoodsSpuDto.setGoodsName(goodsName); + baseGoodsSpuDto.setSubTitle(subTitle); + baseGoodsSpuDto.setGoodsPY(goodsPY); + baseGoodsSpuDto.setGoodsShortName(goodsShortName); + + baseGoodsSpuDto.setGoodsTypeSid(goodsTypeSid); + baseGoodsSpuDto.setBrandSid(brandSid); + baseGoodsSpuDto.setManufacturerSid(manufacturerSid); +// baseGoodsSpuDto.setGoodsUnitSid(goodsUnitSid); + baseGoodsSpuDto.setGoodsUnitName(goodsUnitName); + baseGoodsSpuDto.setTaxRate(taxRate); + baseGoodsSpuDto.setShelfLife(shelfLife); + baseGoodsSpuDto.setNationalStandardCode(nationalStandardCode); + baseGoodsSpuDto.setExternalCode(externalCode); + baseGoodsSpuDto.setFactoryCode(factoryCode); + baseGoodsSpuDto.setIsListed(isListed); + baseGoodsSpuDto.setUseOrgSid(useOrgSid); + baseGoodsSpuDto.setCreateOrgSid(createOrgSid); + BaseGoodsSpuDetailDto dto=new BaseGoodsSpuDetailDto(); + dto.setGoodsExplain(goodsExplain); + dto.setGoodsDescription(goodsDescription); + baseGoodsSpuDto.setBaseGoodsSpuDetail(dto); + List dtos=new ArrayList<>(); + BaseGoodsSkuDto dto1=new BaseGoodsSkuDto(); + dto1.setGoodsSkuCode(goodsSkuCode); + dto1.setTitle(title); + dto1.setExternalCode(skuExternalCode); + BaseGoodsSkuExtendDto dto2=new BaseGoodsSkuExtendDto(); + dto2.setSortNo("1"); + dto2.setFinalPurchasePrice(finalPurchasePrice); + dto2.setSafetyStockDays(safetyStockDays); + dto2.setIsOriginalFactory(isOriginalFactory); + dto2.setIsInventoryAlert(isInventoryAlert); + dto2.setInventoryAlertUpperLimit(inventoryAlertUpperLimit); + dto2.setInventoryAlertLowerLimit(inventoryAlertLowerLimit); + dto2.setCostPrice(costPrice); + dto2.setTagPrice(tagPrice); + dto2.setSalesPrice(salesPrice); + dto2.setStandardPurchasePrice(standardPurchasePrice); + dto2.setAgencyPrice(agencyPrice); + dto2.setDiscount(discount); + dto2.setMinimumSalesPrice(minimumSalesPrice); + dto2.setIsLockingSalesPrice(isLockingSalesPrice); + dto2.setIsIntegralExchange(isIntegralExchange); + dto2.setIntegralAmount(integralAmount); + dto1.setBaseGoodsSkuExtend(dto2); + dtos.add(dto1); + baseGoodsSpuDto.setBaseGoodsSkus(dtos); + + } catch (Exception e) { + e.printStackTrace(); + return null; + } + return baseGoodsSpuDto; + } + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuVo.java new file mode 100644 index 0000000..89ccda3 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspu/BaseGoodsSpuVo.java @@ -0,0 +1,51 @@ +package com.yxt.wms.biz.basegoodsspu; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import com.yxt.wms.biz.basegoodssku.BaseGoodsSkuVo; +import com.yxt.wms.biz.basegoodsspudetail.BaseGoodsSpuDetailVo; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSpuVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodsCode;//商品代码 + private String barCode;//条形码 + private String goodsName;//商品名称 + private String subTitle;//商品名称 + private String goodsPY;//拼音缩写 + private String goodsShortName;//商品简称 + private String goodsTypeSid;//商品分类sid + private String brandSid;//品牌sid + private String manufacturerSid;//厂家sid + private String goodsUnitSid;//商品单位sid + private String goodsUnitName;//商品单位名称 + private String taxRate;//税率 + private String shelfLife;//保质期天 + private String nationalStandardCode;//国标码 + private String sortNo;//排序 + private String externalCode;//外部编码 + private String factoryCode;//厂家货号 + private String isListed;//是否上架 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + private BaseGoodsSpuDetailVo baseGoodsSpuDetail; + private List baseGoodsSkus; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetail.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetail.java new file mode 100644 index 0000000..d261b14 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetail.java @@ -0,0 +1,20 @@ +package com.yxt.wms.biz.basegoodsspudetail; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsSpuDetail extends BaseEntity { + private String goodSpuSid;//商品基础信息Sid + private String goodsExplain;//商品详细说明 + private String goodsDescription;//商品描述 + @TableField(value = "generic_spec") + private String genericSpec;//通用规格参数及数据,json格式(规格参数id,规格参数值的键值对) + @TableField(value = "special_spec") + private String specialSpec;//特有规格参数及可选值信息,json格式(特有规格参数id,[可选参数值]) +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailDto.java new file mode 100644 index 0000000..ab3e0b3 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailDto.java @@ -0,0 +1,29 @@ +package com.yxt.wms.biz.basegoodsspudetail; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsSpuDetailDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodSpuSid;//商品基础信息Sid + private String goodsExplain;//商品详细说明 + private String goodsDescription;//商品描述 + @TableField(value = "generic_spec") + private String genericSpec;//通用规格参数及数据,json格式(规格参数id,规格参数值的键值对) + @TableField(value = "special_spec") + private String specialSpec;//特有规格参数及可选值信息,json格式(特有规格参数id,[可选参数值]) +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailMapper.java new file mode 100644 index 0000000..9ed3a97 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailMapper.java @@ -0,0 +1,20 @@ +package com.yxt.wms.biz.basegoodsspudetail; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsSpuDetailMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + BaseGoodsSpuDetailVo getSpuDetailsBySpuSid (@Param("skuSid")String skuSid); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailMapper.xml new file mode 100644 index 0000000..f68f271 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailQuery.java new file mode 100644 index 0000000..1e4b4bd --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailQuery.java @@ -0,0 +1,13 @@ +package com.yxt.wms.biz.basegoodsspudetail; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSpuDetailQuery implements Query { + private String name; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailService.java new file mode 100644 index 0000000..82e70f6 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailService.java @@ -0,0 +1,102 @@ +package com.yxt.wms.biz.basegoodsspudetail; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsSpuDetailService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; +// @Autowired +// private BaseBrandInfoService baseBrandInfoService; +// @Autowired +// private BaseGoodsTypeService baseGoodsTypeService; +// @Autowired +// private BaseManufacturerService wmsManufacturerService; + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetailQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getName())){ + qw.like("goodsName",query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return rb.success().setData(p); + } + + public ResultBean saveOrUpdate(BaseGoodsSpuDetailDto dto) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetail detail=baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + String sid = ""; + if (null!=detail) { + sid = dto.getSid(); + BaseGoodsSpuDetail baseGoodsSpuDetail = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, baseGoodsSpuDetail); + baseGoodsSpuDetail.setModifyTime(new Date()); + baseMapper.updateById(baseGoodsSpuDetail); + } else { + + BaseGoodsSpuDetail baseGoodsSpuDetail = new BaseGoodsSpuDetail(); + sid = baseGoodsSpuDetail.getSid(); + BeanUtil.copyProperties(dto, baseGoodsSpuDetail); + baseGoodsSpuDetail.setCreateTime(new DateTime()); + + baseMapper.insert(baseGoodsSpuDetail); + } + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetailVo vo = new BaseGoodsSpuDetailVo(); + BaseGoodsSpuDetail wmsGoods = fetchBySid(sid); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + BeanUtil.copyProperties(wmsGoods, vo); + return rb.success().setData(vo); + } + public ResultBean getSpuDetailsBySpuSid(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetailVo vo = baseMapper.getSpuDetailsBySpuSid(sid); + return rb.success().setData(vo); + } + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetail wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetail wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailVo.java new file mode 100644 index 0000000..f4d5721 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsspudetail/BaseGoodsSpuDetailVo.java @@ -0,0 +1,35 @@ +package com.yxt.wms.biz.basegoodsspudetail; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSpuDetailVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodSpuSid;//商品基础信息Sid + private String goodsExplain;//商品详细说明 + private String goodsDescription;//商品描述 + @TableField(value = "generic_spec") + private String genericSpec;//通用规格参数及数据,json格式(规格参数id,规格参数值的键值对) + @TableField(value = "special_spec") + private String specialSpec;//特有规格参数及可选值信息,json格式(特有规格参数id,[可选参数值]) + private String goodsName; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsType.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsType.java new file mode 100644 index 0000000..10c5745 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsType.java @@ -0,0 +1,22 @@ +package com.yxt.wms.biz.basegoodstype; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsType extends BaseEntity { + private String goodsTypeName;//商品类别名称 + private String goodsTypeCode;//类别编码 + private String percentageRate;//提成比例 + private String percentageAmount;//提成金额 + private String pSid;//父级sid + private String isParent;//是否为父节点,0为否,1为是,0标识为叶子节点 + private String isGoodsID;//是否一品一码 0 否 1是 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeDto.java new file mode 100644 index 0000000..d5c7e7f --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeDto.java @@ -0,0 +1,33 @@ +package com.yxt.wms.biz.basegoodstype; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsTypeDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodsTypeName;//商品类别名称 + private String goodsTypeCode;//类别编码 + private String percentageRate;//提成比例 + private String percentageAmount;//提成金额 + private String pSid;//父级sid + private String isParent;//是否为父节点,0为否,1为是,0标识为叶子节点 + private String isGoodsID;//是否一品一码 0 否 1是 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + private String pName;//创建组织sid + private String sids;//父级sid +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeMapper.java new file mode 100644 index 0000000..3f6e54e --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeMapper.java @@ -0,0 +1,17 @@ +package com.yxt.wms.biz.basegoodstype; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsTypeMapper extends BaseMapper { + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeMapper.xml new file mode 100644 index 0000000..63031e3 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeQuery.java new file mode 100644 index 0000000..06cc3f7 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeQuery.java @@ -0,0 +1,13 @@ +package com.yxt.wms.biz.basegoodstype; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsTypeQuery implements Query { + private String name; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeService.java new file mode 100644 index 0000000..992d8dd --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeService.java @@ -0,0 +1,56 @@ +package com.yxt.wms.biz.basegoodstype; + +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.feign.base.basegoodstype.BaseGoodsTypeFeign; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsTypeService extends MybatisBaseService { + + @Autowired + BaseGoodsTypeFeign baseGoodsTypeFeign; + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsTypeFeign.listPage(pq); + } + public ResultBean> listAll() { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsTypeFeign.listAll(); + } + + public ResultBean saveOrUpdate(BaseGoodsTypeDto dto) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsTypeFeign.saveOrUpdate(dto); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsTypeFeign.initialization(sid); + } + + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsType wmsGoodsType = fetchBySid(sid); + if (null != wmsGoodsType) { + baseMapper.deleteById(wmsGoodsType.getId()); + } + return rb.success(); + } + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsTypeFeign.updateIsEnable(sid, isEnable); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeVo.java new file mode 100644 index 0000000..16d2013 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodstype/BaseGoodsTypeVo.java @@ -0,0 +1,38 @@ +package com.yxt.wms.biz.basegoodstype; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsTypeVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodsTypeName;//商品类别名称 + private String goodsTypeCode;//类别编码 + private String percentageRate;//提成比例 + private String percentageAmount;//提成金额 + private String pSid;//父级sid + private String pName;//父级sid + private String isParent="1";//是否为父节点,0为否,1为是,0标识为叶子节点 + private String isGoodsID="1";//是否一品一码 0 否 1是 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + private String sids;//创建组织sid +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnit.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnit.java new file mode 100644 index 0000000..1e6a937 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnit.java @@ -0,0 +1,14 @@ +package com.yxt.wms.biz.basegoodsunit; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsUnit extends BaseEntity { + + private String unitName;//单位名称 +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitDto.java new file mode 100644 index 0000000..4217006 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitDto.java @@ -0,0 +1,27 @@ +package com.yxt.wms.biz.basegoodsunit; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsUnitDto implements Dto { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String unitName;//单位名称 +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitMapper.java new file mode 100644 index 0000000..b1c57c7 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitMapper.java @@ -0,0 +1,17 @@ +package com.yxt.wms.biz.basegoodsunit; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsUnitMapper extends BaseMapper { + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitMapper.xml new file mode 100644 index 0000000..e971a54 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitQuery.java new file mode 100644 index 0000000..bdd0706 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitQuery.java @@ -0,0 +1,13 @@ +package com.yxt.wms.biz.basegoodsunit; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsUnitQuery implements Query { + private String name; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitService.java new file mode 100644 index 0000000..52d1939 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitService.java @@ -0,0 +1,56 @@ +package com.yxt.wms.biz.basegoodsunit; + +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.feign.base.basegoodsunit.BaseGoodsUnitFeign; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsUnitService extends MybatisBaseService { + + @Autowired + BaseGoodsUnitFeign baseGoodsUnitFeign; + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsUnitFeign.listPage(pq); + } + public ResultBean> listAll() { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsUnitFeign.listAll(); + } + + public ResultBean saveOrUpdate(BaseGoodsUnitDto dto) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsUnitFeign.saveOrUpdate(dto); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsUnitFeign.initialization(sid); + } + + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsUnit wmsGoodsType = fetchBySid(sid); + if (null != wmsGoodsType) { + baseMapper.deleteById(wmsGoodsType.getId()); + } + return rb.success(); + } + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + return baseGoodsUnitFeign.updateIsEnable(sid, isEnable); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitVo.java new file mode 100644 index 0000000..72a630a --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basegoodsunit/BaseGoodsUnitVo.java @@ -0,0 +1,27 @@ +package com.yxt.wms.biz.basegoodsunit; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsUnitVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String unitName;//单位名称 +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturer.java b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturer.java new file mode 100644 index 0000000..c9c1ce3 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturer.java @@ -0,0 +1,20 @@ +package com.yxt.wms.biz.basemanufacturer; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseManufacturer extends BaseEntity { + private String manufacturerName;//厂家名称 + private String manufacturerCode;//厂家编码 + private String address;//地址 + private String telephone;//电话 + private String contacts;//联系人 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerDto.java new file mode 100644 index 0000000..504cf1d --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerDto.java @@ -0,0 +1,35 @@ +package com.yxt.wms.biz.basemanufacturer; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseManufacturerDto implements Dto { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + + private String manufacturerName;//厂家名称 + private String manufacturerCode;//厂家编码 + private String address;//地址 + private String telephone;//电话 + private String contacts;//联系人 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerMapper.java new file mode 100644 index 0000000..ba84219 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerMapper.java @@ -0,0 +1,21 @@ +package com.yxt.wms.biz.basemanufacturer; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseManufacturerMapper extends BaseMapper { + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + List getAllTypeByUseOrgSid(@Param("useOrgSid") String useOrgSid); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerMapper.xml new file mode 100644 index 0000000..30ac8a3 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerQuery.java new file mode 100644 index 0000000..7fda0bc --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerQuery.java @@ -0,0 +1,13 @@ +package com.yxt.wms.biz.basemanufacturer; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseManufacturerQuery implements Query { + private String name; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerService.java new file mode 100644 index 0000000..5c45b6e --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerService.java @@ -0,0 +1,60 @@ +package com.yxt.wms.biz.basemanufacturer; + +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.feign.base.basemanufacturer.BaseManufacturerFeign; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseManufacturerService extends MybatisBaseService { + @Autowired + BaseManufacturerFeign baseManufacturerFeign; + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + return baseManufacturerFeign.listPage(pq); + } + public ResultBean> listAll() { + ResultBean rb = ResultBean.fireFail(); + return baseManufacturerFeign.listAll(); + } + + public ResultBean saveOrUpdate(BaseManufacturerDto dto) { + ResultBean rb = ResultBean.fireFail(); + return baseManufacturerFeign.saveOrUpdate(dto); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + return baseManufacturerFeign.initialization(sid); + } + + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseManufacturer wmsManufacturer = fetchBySid(sid); + if (null != wmsManufacturer) { + baseMapper.deleteById(wmsManufacturer.getId()); + } + return rb.success(); + } + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + return baseManufacturerFeign.updateIsEnable(sid, isEnable); + } + + public ResultBean> getAllTypeByUseOrgSid(String useOrgSid) { + ResultBean rb = ResultBean.fireFail(); + return baseManufacturerFeign.getAllTypeByUseOrgSid(useOrgSid); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerVo.java new file mode 100644 index 0000000..df231f9 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basemanufacturer/BaseManufacturerVo.java @@ -0,0 +1,36 @@ +package com.yxt.wms.biz.basemanufacturer; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseManufacturerVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String createBySid; + private String updateBySid; + private String manufacturerName;//厂家名称 + private String manufacturerCode;//厂家编码 + private String address;//地址 + private String telephone;//电话 + private String contacts;//联系人 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBank.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBank.java new file mode 100644 index 0000000..a7b92fe --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBank.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierBank; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBank.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBank
+ * Description: 供应商开户行信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息", description = "供应商开户行信息") +@TableName("base_supplier_bank") +public class BaseSupplierBank extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankDetailsVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankDetailsVo.java new file mode 100644 index 0000000..adfb71b --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankDetailsVo.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierBank; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankVo.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankVo
+ * Description: 供应商开户行信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息 视图数据详情", description = "供应商开户行信息 视图数据详情") +public class BaseSupplierBankDetailsVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankDto.java new file mode 100644 index 0000000..be0b24a --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankDto.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierBank; + + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankDto.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankDto
+ * Description: 供应商开户行信息 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息 数据传输对象", description = "供应商开户行信息 数据传输对象") +public class BaseSupplierBankDto implements Dto { + + private String sid; // sid + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankMapper.java new file mode 100644 index 0000000..8911bc7 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankMapper.java @@ -0,0 +1,67 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierBank; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankMapper.java
+ * Class: com.yxt.base.biz.basesupplierbank.BaseSupplierBankMapper
+ * Description: 供应商开户行信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface BaseSupplierBankMapper extends BaseMapper { + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from base_supplier_bank") + List selectListVo(); + + @Delete("delete from base_supplier_bank where supplierSid = #{supplierSid}") + int deleteBySupplierSid(String supplierSid); + + @Select("select * from base_supplier_bank where supplierSid = #{supplierSid}") + List selectBySupplierSid(String supplierSid); +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankMapper.xml new file mode 100644 index 0000000..2648c13 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankQuery.java new file mode 100644 index 0000000..d41910d --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankQuery.java @@ -0,0 +1,74 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierBank; + + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankQuery.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankQuery
+ * Description: 供应商开户行信息 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息 查询条件", description = "供应商开户行信息 查询条件") +public class BaseSupplierBankQuery implements Query { + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankService.java new file mode 100644 index 0000000..edfb5d1 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankService.java @@ -0,0 +1,104 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierBank; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankService.java
+ * Class: com.yxt.base.biz.basesupplierbank.BaseSupplierBankService
+ * Description: 供应商开户行信息 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class BaseSupplierBankService extends MybatisBaseService { + + public PagerVo listPageVo(PagerQuery pq) { + BaseSupplierBankQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(BaseSupplierBankDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(BaseSupplierBankDto dto){ + BaseSupplierBank entity = new BaseSupplierBank(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(BaseSupplierBankDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + BaseSupplierBank entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public BaseSupplierBankDetailsVo fetchDetailsVoBySid(String sid){ + BaseSupplierBank entity = fetchBySid(sid); + BaseSupplierBankDetailsVo vo = new BaseSupplierBankDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public int deleteBySupplierSid(String supplierSid) { + return baseMapper.deleteBySupplierSid(supplierSid); + } + + public List selectBySupplierSid(String supplierSid) { + return baseMapper.selectBySupplierSid(supplierSid); + } +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankVo.java new file mode 100644 index 0000000..016078c --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierBank/BaseSupplierBankVo.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierBank; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankVo.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankVo
+ * Description: 供应商开户行信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息 视图数据对象", description = "供应商开户行信息 视图数据对象") +public class BaseSupplierBankVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfo.java new file mode 100644 index 0000000..b1d1fbe --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfo.java @@ -0,0 +1,112 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierinfo; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfo.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfo
+ * Description: 供应商信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息", description = "供应商信息") +@TableName("base_supplier_info") +public class BaseSupplierInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("编码") + private String supplierCode; // 编码 + @ApiModelProperty("供应商名称") + private String supplierName; // 供应商名称 + @ApiModelProperty("供应商名称拼音") + private String supplierPY; // 供应商名称拼音 + @ApiModelProperty("供应商类型sid") + private String supplierTypeSid; // 供应商类型sid + @ApiModelProperty("供应商类型") + private String supplierTypeName; // 供应商类型 + @ApiModelProperty("省sid") + private String provinceSid; // 省sid + @ApiModelProperty("province") + private String province; // + @ApiModelProperty("市sid") + private String citySid; // 市sid + @ApiModelProperty("city") + private String city; // + @ApiModelProperty("收货县区sid") + private String countySid; // 收货县区sid + @ApiModelProperty("county") + private String county; // + @ApiModelProperty("详细地址") + private String address; // 详细地址 + @ApiModelProperty("手机") + private String contactMobile; // 手机 + @ApiModelProperty("电话") + private String contactTelePhone; // 电话 + @ApiModelProperty("联系人") + private String contactName; // 联系人 + @ApiModelProperty("传真") + private String fax; // 传真 + @ApiModelProperty("邮编") + private String zipCode; // 邮编 + @ApiModelProperty("电子邮件") + private String email; // 电子邮件 + @ApiModelProperty("网址") + private String website; // 网址 + @ApiModelProperty("开票公司名称") + private String billingCompanyName; // 开票公司名称 + @ApiModelProperty("税号") + private String registNum; // 税号 + @ApiModelProperty("法人") + private String legalName; // 法人 + @ApiModelProperty("采购员") + private String purchaser; // 采购员 + @ApiModelProperty("排序") + private Integer sortNo; // 排序 + @ApiModelProperty("开票类型key") + private String billingTypeKey; // 开票类型key + @ApiModelProperty("开票类型value") + private String billingTypeValue; // 开票类型value + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoChoice.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoChoice.java new file mode 100644 index 0000000..a99c592 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoChoice.java @@ -0,0 +1,54 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierinfo; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoVo.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoVo
+ * Description: 供应商信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 视图数据对象", description = "供应商信息 视图数据对象") +public class BaseSupplierInfoChoice implements Vo { + + private String sid; + @ApiModelProperty("供应商名称") + private String supplierName; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoDetailsVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoDetailsVo.java new file mode 100644 index 0000000..690adf5 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoDetailsVo.java @@ -0,0 +1,116 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierinfo; + + +import com.yxt.common.core.vo.Vo; +import com.yxt.wms.biz.basesupplierBank.BaseSupplierBankDetailsVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoVo.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoVo
+ * Description: 供应商信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 视图数据详情", description = "供应商信息 视图数据详情") +public class BaseSupplierInfoDetailsVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("编码") + private String supplierCode; // 编码 + @ApiModelProperty("供应商名称") + private String supplierName; // 供应商名称 + @ApiModelProperty("供应商名称拼音") + private String supplierPY; // 供应商名称拼音 + @ApiModelProperty("供应商类型sid") + private String supplierTypeSid; // 供应商类型sid + @ApiModelProperty("供应商类型") + private String supplierTypeName; // 供应商类型 + @ApiModelProperty("省sid") + private String provinceSid; // 省sid + @ApiModelProperty("province") + private String province; // + @ApiModelProperty("市sid") + private String citySid; // 市sid + @ApiModelProperty("city") + private String city; // + @ApiModelProperty("收货县区sid") + private String countySid; // 收货县区sid + @ApiModelProperty("county") + private String county; // + @ApiModelProperty("详细地址") + private String address; // 详细地址 + @ApiModelProperty("手机") + private String contactMobile; // 手机 + @ApiModelProperty("电话") + private String contactTelePhone; // 电话 + @ApiModelProperty("联系人") + private String contactName; // 联系人 + @ApiModelProperty("传真") + private String fax; // 传真 + @ApiModelProperty("邮编") + private String zipCode; // 邮编 + @ApiModelProperty("电子邮件") + private String email; // 电子邮件 + @ApiModelProperty("网址") + private String website; // 网址 + @ApiModelProperty("开票公司名称") + private String billingCompanyName; // 开票公司名称 + @ApiModelProperty("税号") + private String registNum; // 税号 + @ApiModelProperty("法人") + private String legalName; // 法人 + @ApiModelProperty("采购员") + private String purchaser; // 采购员 + @ApiModelProperty("排序") + private Integer sortNo; // 排序 + @ApiModelProperty("开票类型key") + private String billingTypeKey; // 开票类型key + @ApiModelProperty("开票类型value") + private String billingTypeValue; // 开票类型value + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + @ApiModelProperty("供应商开户行") + private List baseSupplierBankList; +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoDto.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoDto.java new file mode 100644 index 0000000..e79b240 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoDto.java @@ -0,0 +1,116 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierinfo; + + +import com.yxt.common.core.dto.Dto; +import com.yxt.wms.biz.basesupplierBank.BaseSupplierBankDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoDto.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoDto
+ * Description: 供应商信息 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 数据传输对象", description = "供应商信息 数据传输对象") +public class BaseSupplierInfoDto implements Dto { + + private String sid; // sid + + @ApiModelProperty("编码") + private String supplierCode; // 编码 + @ApiModelProperty("供应商名称") + private String supplierName; // 供应商名称 + @ApiModelProperty("供应商名称拼音") + private String supplierPY; // 供应商名称拼音 + @ApiModelProperty("供应商类型sid") + private String supplierTypeSid; // 供应商类型sid + @ApiModelProperty("供应商类型") + private String supplierTypeName; // 供应商类型 + @ApiModelProperty("省sid") + private String provinceSid; // 省sid + @ApiModelProperty("province") + private String province; // + @ApiModelProperty("市sid") + private String citySid; // 市sid + @ApiModelProperty("city") + private String city; // + @ApiModelProperty("收货县区sid") + private String countySid; // 收货县区sid + @ApiModelProperty("county") + private String county; // + @ApiModelProperty("详细地址") + private String address; // 详细地址 + @ApiModelProperty("手机") + private String contactMobile; // 手机 + @ApiModelProperty("电话") + private String contactTelePhone; // 电话 + @ApiModelProperty("联系人") + private String contactName; // 联系人 + @ApiModelProperty("传真") + private String fax; // 传真 + @ApiModelProperty("邮编") + private String zipCode; // 邮编 + @ApiModelProperty("电子邮件") + private String email; // 电子邮件 + @ApiModelProperty("网址") + private String website; // 网址 + @ApiModelProperty("开票公司名称") + private String billingCompanyName; // 开票公司名称 + @ApiModelProperty("税号") + private String registNum; // 税号 + @ApiModelProperty("法人") + private String legalName; // 法人 + @ApiModelProperty("采购员") + private String purchaser; // 采购员 + @ApiModelProperty("排序") + private Integer sortNo; // 排序 + @ApiModelProperty("开票类型key") + private String billingTypeKey; // 开票类型key + @ApiModelProperty("开票类型value") + private String billingTypeValue; // 开票类型value + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + @ApiModelProperty("开户行信息") + private List baseSupplierBankList; +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoMapper.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoMapper.java new file mode 100644 index 0000000..4ce1054 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoMapper.java @@ -0,0 +1,67 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierinfo; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; + +import java.util.List; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierInfoMapper.java
+ * Class: com.yxt.anrui.as.biz.basesupplierinfo.BaseSupplierInfoMapper
+ * Description: 供应商信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface BaseSupplierInfoMapper extends BaseMapper { + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from base_supplier_info") + List selectListVo(); + + @Update("update base_supplier_info set isDelete = '1' where sid = #{sid}") + int updateBySidIsDelete(String sid); + + @Select("select * from base_supplier_info") + List choiceSupplierInfo(String createOrgSid); +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoMapper.xml b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoMapper.xml new file mode 100644 index 0000000..f47299d --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoQuery.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoQuery.java new file mode 100644 index 0000000..a6eae2f --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoQuery.java @@ -0,0 +1,62 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierinfo; + + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoQuery.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoQuery
+ * Description: 供应商信息 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 查询条件", description = "供应商信息 查询条件") +public class BaseSupplierInfoQuery implements Query { + + @ApiModelProperty("供应商名称") + private String supplierName; + @ApiModelProperty("供应商类型") + private String supplierTypeName; + @ApiModelProperty("电话") + private String contactTelePhone; + @ApiModelProperty("联系人") + private String contactName; + + @ApiModelProperty("其他查询条件") + private String otherQuery; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoService.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoService.java new file mode 100644 index 0000000..484434a --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoService.java @@ -0,0 +1,93 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierinfo; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.feign.base.basesupplierinfo.BaseSupplierInfoFeign; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierInfoService.java
+ * Class: com.yxt.anrui.as.biz.basesupplierinfo.BaseSupplierInfoService
+ * Description: 供应商信息 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class BaseSupplierInfoService extends MybatisBaseService { + +// @Autowired +// private SysStaffOrgFeign sysStaffOrgFeign; +// @Autowired +// private SysOrganizationFeign sysOrganizationFeign; +// @Autowired +// private BaseSupplierBankService baseSupplierBankService; + @Autowired + BaseSupplierInfoFeign baseSupplierInfoFeign; + + public ResultBean> listPageVo(PagerQuery pq) { + BaseSupplierInfoQuery query = pq.getParams(); + return baseSupplierInfoFeign.listPage(pq); + } + + public ResultBean saveOrUpdateDto(BaseSupplierInfoDto dto){ + return baseSupplierInfoFeign.save(dto); + } + + public ResultBean fetchDetailsVoBySid(String sid){ + return baseSupplierInfoFeign.fetchDetailsBySid(sid); + } + + public void delAll(String[] sids) { + for (String sid : sids) { + //删除厂商基础信息 + int count = baseMapper.updateBySidIsDelete(sid); + //删除厂商开户行信息 +// int i = baseSupplierBankService.deleteBySupplierSid(sid); + } + } + + public ResultBean> choiceSupplierInfo(String createOrgSid) { + return baseSupplierInfoFeign.choiceSupplierInfo(createOrgSid); + } +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoVo.java b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoVo.java new file mode 100644 index 0000000..9680e7a --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/basesupplierinfo/BaseSupplierInfoVo.java @@ -0,0 +1,65 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.wms.biz.basesupplierinfo; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoVo.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoVo
+ * Description: 供应商信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 视图数据对象", description = "供应商信息 视图数据对象") +public class BaseSupplierInfoVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("供应商名称") + private String supplierName; + @ApiModelProperty("供应商类型") + private String supplierTypeName; + @ApiModelProperty("详细地址") + private String address; + @ApiModelProperty("电话") + private String contactTelePhone; + @ApiModelProperty("联系人") + private String contactName; + @ApiModelProperty("手机") + private String contactMobile; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/package-info.java b/wms-biz/src/main/java/com/yxt/wms/biz/package-info.java new file mode 100644 index 0000000..5b4ed4c --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通 仓库管理 项目后台逻辑和接口 + */ +package com.yxt.wms.biz; \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/biz/sysuser/SysUserService.java b/wms-biz/src/main/java/com/yxt/wms/biz/sysuser/SysUserService.java new file mode 100644 index 0000000..c94f7ca --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/biz/sysuser/SysUserService.java @@ -0,0 +1,49 @@ +package com.yxt.wms.biz.sysuser; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.yxt.common.core.result.ResultBean; +import com.yxt.wms.feign.user.sysuser.SysUserDto; +import com.yxt.wms.feign.user.sysuser.SysUserFeign; +import com.yxt.wms.feign.user.sysuser.SysUserQuery; +import com.yxt.wms.feign.user.sysuser.SysUserVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; + +/** + * @author wangpengfei + * @date 2024/5/6 10:29 + */ +@Service +public class SysUserService { + @Autowired + SysUserFeign sysUserFeign; + + + + + public ResultBean login(@RequestBody SysUserQuery userQuery){ + return sysUserFeign.login(userQuery); + } + + public ResultBean register(@RequestBody SysUserDto dto){ + return sysUserFeign.register(dto); + } + + public ResultBean loginDetails(HttpServletRequest httpServletRequest){ + return sysUserFeign.loginDetails(httpServletRequest); + } + + public ResultBean sendMessageCode(String mobile){ + return sysUserFeign.sendMessageCode(mobile); + } + + public ResultBean sendMessageLogin(String mobile){ + return sysUserFeign.sendMessageLogin(mobile); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/config/SaTokenConfigure.java b/wms-biz/src/main/java/com/yxt/wms/config/SaTokenConfigure.java new file mode 100644 index 0000000..3f69db9 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/config/SaTokenConfigure.java @@ -0,0 +1,114 @@ +package com.yxt.wms.config;//package com.yxt.wms.config; +// +//import cn.dev33.satoken.interceptor.SaInterceptor; +//import cn.dev33.satoken.stp.StpUtil; +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +// +///** +// * @author wangpengfei +// * @date 2023/5/16 14:43 +// */ +//@Configuration +//public class SaTokenConfigure implements WebMvcConfigurer { +// @Value("${image.url.prefix:http://127.0.0.1:8080/upload/}") +// private String urlPrefix; +// // 注册 Sa-Token 拦截器 +// @Override +// public void addInterceptors(InterceptorRegistry registry) { +// // 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验。 +// +// registry.addInterceptor(new SaInterceptor(handler -> StpUtil.checkLogin())) +// .addPathPatterns("/**") +// .excludePathPatterns("/sysuser/doLogin") +// .excludePathPatterns("/lpkgiftcard/gifCardByCustomerSid") +// .excludePathPatterns("/empcardgift/gifCardByCustomerSid") +// .excludePathPatterns("/empcard/getEmpCardByCustomerSid") +// .excludePathPatterns("/lpkgiftcard/getGifCardBySid/**") +// .excludePathPatterns("/empcardgift/getGifCardBySid/**") +// .excludePathPatterns("/empcard/getEmpCardBySid/**") +// .excludePathPatterns("/lpkgiftcard/isSaturAndSun/**") +// .excludePathPatterns("/empcardgift/isSaturAndSun/**") +// .excludePathPatterns("/empcard/isSaturAndSun/**") +// .excludePathPatterns("/lpkgiftcard/getReservationBySid/**") +// .excludePathPatterns("/lpksreservoorder/submission") +// .excludePathPatterns("/lpksreservoorder/exportExcelByStore") +// .excludePathPatterns("/empsreservoorder/createNewUserBagOrder") +// .excludePathPatterns("/lpksreservoorders/submission") +// .excludePathPatterns("/empsreservoorder/ordersList") +// .excludePathPatterns("/empsreservoorder/submission") +// .excludePathPatterns("/empsreservoorder/submissionEmp") +// .excludePathPatterns("/empcardgift/generateCard") +// .excludePathPatterns("/lpkgiftcard/bindCard") +// .excludePathPatterns("/empcard/bindCard") +// .excludePathPatterns("/lpksreservoorder/orderByCardSid/**") +// .excludePathPatterns("/lpksreservoorder/orderListByUserSid/**") +// .excludePathPatterns("/lpksreservoorder/orderDetails/**") +// .excludePathPatterns("/newcomerrecorecord/recommendNewUsers") +// .excludePathPatterns("/newcomerrecorecord/recommendedAssistance") +// .excludePathPatterns("/newcomerrecorecord/recordList/**") +// .excludePathPatterns("/transferrecords/transferRecordsList") +// .excludePathPatterns("/empsreservoorder/createVegeOrder") +// .excludePathPatterns("/empsreservoorder/OrderDetails/**") +// .excludePathPatterns("/empsreservoorder/changePayState/**") +// .excludePathPatterns("/lpkgoods/goodsDetails/**") +// .excludePathPatterns("/lpkstore/getAllStoreByQuery") +// .excludePathPatterns("/vegetablecellar/receiveTransferGoods") +// .excludePathPatterns("/transferrecords/submission") +// .excludePathPatterns("/lpkgiftcard/getCardByBank") +// .excludePathPatterns("/empcard/getEmpCard") +// .excludePathPatterns("/empcardgift/shareEmpCard/**") +// .excludePathPatterns("/empcardgift/generateEmpCardGift") +// .excludePathPatterns("/empcardgift/generateEmpCard") +// .excludePathPatterns("/lpkcustomer/wxSilentLogin") +// .excludePathPatterns("/lpkgiftcard/gifCardsByCustomerSid") +// .excludePathPatterns("/lpkgoods/getAllGiftBag") +// .excludePathPatterns("/appletgiftbag/getGiftBagBySid/**") +// .excludePathPatterns("/appletgiftbag/appletGiftBagList") +// .excludePathPatterns("/lpkgiftcard/cardShareDetail/**") +// .excludePathPatterns("/lpkgiftcard/cardShareGoodsDetail/**") +// .excludePathPatterns("/empcardgift/generateTopEmpCard/**") +// .excludePathPatterns("/empsreservoorder/createOrder") +// .excludePathPatterns("/appletgiftbag/recommendRecord/**") +// //2024-01-17 +// .excludePathPatterns("/lpkgiftcard/getAllGoodsType/**") +// .excludePathPatterns("/appletnotice/getNotice") +// .excludePathPatterns("/empsreservoorder/getPreOrder") +// .excludePathPatterns("/lpkgoods/getAllGoodsType/**") +// .excludePathPatterns("/transferrecords/submission") +// .excludePathPatterns("/vegetablecellar/receiveTransferGoods") +// .excludePathPatterns("/customerstore/isSaturAndSun") +// .excludePathPatterns("/lpkgiftcard/getGoodsByType/**") +// .excludePathPatterns("/lpkgoods/getGoodsTypeAndBrand") +// .excludePathPatterns("/lpkgoods/getGoodsByType") +// .excludePathPatterns("/lpksreservoorders/orderListByUserSid") +// .excludePathPatterns("/appletgiftbag/newUserQuota") +// .excludePathPatterns("/shoppingcart/addShoppingCart") +// .excludePathPatterns("/shoppingcart/getGoodsWeight") +// .excludePathPatterns("/shoppingcart/shoppingCartList") +// .excludePathPatterns("/shoppingcart/delShoppingCart/**") +// .excludePathPatterns("/lpkgoods/vegeCellarTypeList") +// .excludePathPatterns("/vegetablecellar/addGoods/**") +// .excludePathPatterns("/lpkgoods/vegeCellarList") +// .excludePathPatterns("/customerstore/getStoreBySid/**") +// .excludePathPatterns("/lpkgiftcard/bindAllCard") +// .excludePathPatterns("/lpkcustomer/customerInfo/**") +// .excludePathPatterns("/vegetablecellar/saveGoods") +// .excludePathPatterns("/transferrecords/getTransferByCode/**") +// //2024-01-18 +// .excludePathPatterns("/lpkcustomer/getCustomerInfo/**") +// .excludePathPatterns("/lpkcustomer/modifyUserNickName") +// .excludePathPatterns("/lpkcustomer/modifyHeadImage") +// .excludePathPatterns("/upload/**") +// .excludePathPatterns("/lpkcustomer/getPhoneNumber") +// .excludePathPatterns("/lpkcustomer/getRealInfo/**") +// .excludePathPatterns("/lpkcustomer/saveRealInfo") +// .excludePathPatterns("/pms/PmsBrand/getList") +// .excludePathPatterns("/LpkCustomerBank/getBankList") +// .excludePathPatterns("/lpkcustomer/updateCustomerBank") +// .excludePathPatterns("//wxapi/**") +// ; +// } +//} diff --git a/wms-biz/src/main/java/com/yxt/wms/config/SaTokenGloableException.java b/wms-biz/src/main/java/com/yxt/wms/config/SaTokenGloableException.java new file mode 100644 index 0000000..2b791e0 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/config/SaTokenGloableException.java @@ -0,0 +1,67 @@ +package com.yxt.wms.config; + +import com.yxt.common.base.config.handler.GlobalExceptionHandler; +import com.yxt.common.core.result.ResultBean; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.validation.BindException; +import org.springframework.validation.ObjectError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.NoHandlerFoundException; + +/** + * @author dimengzhe + * @date 2020/9/12 3:23 + * @description 全局异常处理 + */ +@RestControllerAdvice +public class SaTokenGloableException extends GlobalExceptionHandler { + + private static final Logger L = LoggerFactory.getLogger(GlobalExceptionHandler.class); + + public SaTokenGloableException() { + } + @ExceptionHandler({Exception.class}) + public ResultBean handleException(Exception e) { + if(null !=e.getMessage()){ + if(e.getMessage().contains("token 无效:")){ + L.error(e.getMessage(), e); + return ResultBean.fireFail().setCode("5000").setMsg("系统异常::" + e.getMessage()); + } + if(e.getMessage().contains("未能读取到有效 token")){ +// L.error(e.getMessage(), e); + return ResultBean.fireFail().setMsg("系统异常::" + e.getMessage()); + } + } + + L.error(e.getMessage(), e); + return ResultBean.fireFail().setMsg("系统异常::" + e.getMessage()); + } + @ExceptionHandler({NoHandlerFoundException.class}) + public ResultBean handlerNoFoundException(Exception e) { + L.error(e.getMessage(), e); + return ResultBean.fireFail().setCode("404").setMsg("路径不存在,请检查路径是否正确"); + } + +// @ExceptionHandler({Exception.class}) +// public ResultBean handleException(Exception e) { +// L.error(e.getMessage(), e); +// return ResultBean.fireFail().setMsg("系统异常::" + e.getMessage()); +// } + + @ExceptionHandler({BindException.class}) + public ResultBean validatedBindException(BindException e) { + L.error(e.getMessage(), e); + String message = ((ObjectError)e.getAllErrors().get(0)).getDefaultMessage(); + return ResultBean.fireFail().setCode("405").setMsg(message); + } + + @ExceptionHandler({MethodArgumentNotValidException.class}) + public ResultBean validExceptionHandler(MethodArgumentNotValidException e) { + L.error(e.getMessage(), e); + String message = e.getBindingResult().getFieldError().getDefaultMessage(); + return ResultBean.fireFail().setCode("405").setMsg(message); + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/config/package-info.java b/wms-biz/src/main/java/com/yxt/wms/config/package-info.java new file mode 100644 index 0000000..8c17b57 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/config/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通监管项目-光伏(山海新能源)项目后台逻辑和接口-接口声明 + */ +package com.yxt.wms.config; \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basebrandinfo/BaseBrandInfoFeign.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basebrandinfo/BaseBrandInfoFeign.java new file mode 100644 index 0000000..41bc066 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basebrandinfo/BaseBrandInfoFeign.java @@ -0,0 +1,53 @@ +package com.yxt.wms.feign.base.basebrandinfo; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoDto; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoQuery; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@FeignClient( + contextId = "ss-common-goods-GoodsBrand", + name = "ss-common-goods", + path = "/apiadmin/base/basegoodsbrand", + fallback = BaseBrandInfoFeignFallback.class) +public interface BaseBrandInfoFeign { + + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq); + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseBrandInfoDto dto); + @ApiOperation("查询所有的品牌") + @GetMapping("/listAll") + public ResultBean> listAll(); + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid); + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable); + @ApiOperation("根据品牌名查询") + @GetMapping("/getBrandByName/{name}") + public ResultBean getBrandByName(@PathVariable("name") String name); + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basebrandinfo/BaseBrandInfoFeignFallback.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basebrandinfo/BaseBrandInfoFeignFallback.java new file mode 100644 index 0000000..503f6d7 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basebrandinfo/BaseBrandInfoFeignFallback.java @@ -0,0 +1,51 @@ +package com.yxt.wms.feign.base.basebrandinfo; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoDto; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoQuery; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoVo; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/20 + **/ +@Component +public class BaseBrandInfoFeignFallback implements BaseBrandInfoFeign { + + @Override + public ResultBean> listPage(PagerQuery pq) { + return null; + } + + @Override + public ResultBean saveOrUpdate(BaseBrandInfoDto dto) { + return null; + } + + @Override + public ResultBean> listAll() { + return null; + } + + @Override + public ResultBean initialization(String sid) { + return null; + } + + @Override + public ResultBean updateIsEnable(String sid, String isEnable) { + return null; + } + + @Override + public ResultBean getBrandByName(String name) { + return null; + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodssku/BaseGoodsSkuDetailsVo.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodssku/BaseGoodsSkuDetailsVo.java new file mode 100644 index 0000000..9e31af9 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodssku/BaseGoodsSkuDetailsVo.java @@ -0,0 +1,48 @@ +package com.yxt.wms.feign.base.basegoodssku; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/20 + **/ +@Data +public class BaseGoodsSkuDetailsVo { + + @ApiModelProperty("商品代码") + private String goodsCode; + @ApiModelProperty("条形码") + private String barCode; + @ApiModelProperty("商品名称") + private String goodsName; + @ApiModelProperty("副标题") + private String subTitle; + @ApiModelProperty("拼音缩写") + private String goodsPY; + @ApiModelProperty("商品简称") + private String goodsShortName; + @ApiModelProperty("商品分类sid") + private String goodsTypeSid; + @ApiModelProperty("品牌sid") + private String brandSid; + @ApiModelProperty("厂家sid") + private String manufacturersid; + @ApiModelProperty("商品单位sid") + private String goodsUnitSid; + @ApiModelProperty("商品单位名称") + private String goodsUnitName; + + @ApiModelProperty("商品Sku代码") + private String goodsSkuCode; + @ApiModelProperty("商品标题") + private String title; + + @ApiModelProperty("是否一品一码(goodID),0否,1是") + @JsonProperty("isGoodsID") + private int isGoodsID; + @ApiModelProperty("商品类别名称") + private String goodsTypeName; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodssku/BaseGoodsSkuFeign.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodssku/BaseGoodsSkuFeign.java new file mode 100644 index 0000000..1f3eb2d --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodssku/BaseGoodsSkuFeign.java @@ -0,0 +1,24 @@ +package com.yxt.wms.feign.base.basegoodssku; + +import com.yxt.common.core.result.ResultBean; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/20 + **/ +@FeignClient( + contextId = "yss-common-goods-GoodsSku", + name = "ss-common-goods", + path = "/apiadmin/base/basegoodssku", + fallback = BaseGoodsSkuFeignFallback.class) +public interface BaseGoodsSkuFeign { + + @ApiOperation("获取商品信息") + @GetMapping("/getDetails") + ResultBean getDetails(@RequestParam("sid") String sid); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodssku/BaseGoodsSkuFeignFallback.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodssku/BaseGoodsSkuFeignFallback.java new file mode 100644 index 0000000..74f7970 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodssku/BaseGoodsSkuFeignFallback.java @@ -0,0 +1,17 @@ +package com.yxt.wms.feign.base.basegoodssku; + +import com.yxt.common.core.result.ResultBean; +import org.springframework.stereotype.Component; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/20 + **/ +@Component +public class BaseGoodsSkuFeignFallback implements BaseGoodsSkuFeign{ + @Override + public ResultBean getDetails(String sid) { + return null; + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsspu/BaseGoodsSpuFeign.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsspu/BaseGoodsSpuFeign.java new file mode 100644 index 0000000..d60a01c --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsspu/BaseGoodsSpuFeign.java @@ -0,0 +1,52 @@ +package com.yxt.wms.feign.base.basegoodsspu; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuDto; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuQuery; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@FeignClient( + contextId = "ss-common-goods-GoodsSpu", + name = "ss-common-goods", + path = "/apiadmin/base/basegoodsspu", + fallback = BaseGoodsSpuFeignFallback.class) +public interface BaseGoodsSpuFeign { + + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq); + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsSpuDto dto); + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid); + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable); + @ApiOperation("批量保存") + @PostMapping("/batchSave") + public ResultBean batchSave(@RequestBody List dtos); + @ApiOperation("导入excel") + @PostMapping(value ="/importExcel" ,consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ResultBean importExcel(@RequestPart("file") MultipartFile file) throws IOException; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsspu/BaseGoodsSpuFeignFallback.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsspu/BaseGoodsSpuFeignFallback.java new file mode 100644 index 0000000..65d0074 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsspu/BaseGoodsSpuFeignFallback.java @@ -0,0 +1,52 @@ +package com.yxt.wms.feign.base.basegoodsspu; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuDto; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuQuery; +import com.yxt.wms.biz.basegoodsspu.BaseGoodsSpuVo; +import org.springframework.stereotype.Component; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@Component +public class BaseGoodsSpuFeignFallback implements BaseGoodsSpuFeign { + + @Override + public ResultBean> listPage(PagerQuery pq) { + return null; + } + + @Override + public ResultBean saveOrUpdate(BaseGoodsSpuDto dto) { + return null; + } + + @Override + public ResultBean initialization(String sid) { + return null; + } + + @Override + public ResultBean updateIsEnable(String sid, String isEnable) { + return null; + } + + @Override + public ResultBean batchSave(List dtos) { + return null; + } + + @Override + public ResultBean importExcel(MultipartFile file) throws IOException { + return null; + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodstype/BaseGoodsTypeFeign.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodstype/BaseGoodsTypeFeign.java new file mode 100644 index 0000000..580b994 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodstype/BaseGoodsTypeFeign.java @@ -0,0 +1,53 @@ +package com.yxt.wms.feign.base.basegoodstype; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basegoodstype.BaseGoodsType; +import com.yxt.wms.biz.basegoodstype.BaseGoodsTypeDto; +import com.yxt.wms.biz.basegoodstype.BaseGoodsTypeQuery; +import com.yxt.wms.biz.basegoodstype.BaseGoodsTypeVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@FeignClient( + contextId = "ss-common-goods-GoodsType", + name = "ss-common-goods", + path = "/apiadmin/base/basegoodstype", + fallback = BaseGoodsTypeFeignFallback.class) +public interface BaseGoodsTypeFeign { + + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq); + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsTypeDto dto); + @ApiOperation("查询所有的品牌") + @GetMapping("/listAll") + public ResultBean> listAll(); + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid); + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable); + @ApiOperation("根据类型名查询") + @GetMapping("/getTypeByName/{name}") + public ResultBean getTypeByName(@PathVariable("name") String name); + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodstype/BaseGoodsTypeFeignFallback.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodstype/BaseGoodsTypeFeignFallback.java new file mode 100644 index 0000000..28fcb44 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodstype/BaseGoodsTypeFeignFallback.java @@ -0,0 +1,51 @@ +package com.yxt.wms.feign.base.basegoodstype; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basegoodstype.BaseGoodsType; +import com.yxt.wms.biz.basegoodstype.BaseGoodsTypeDto; +import com.yxt.wms.biz.basegoodstype.BaseGoodsTypeQuery; +import com.yxt.wms.biz.basegoodstype.BaseGoodsTypeVo; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@Component +public class BaseGoodsTypeFeignFallback implements BaseGoodsTypeFeign { + + @Override + public ResultBean> listPage(PagerQuery pq) { + return null; + } + + @Override + public ResultBean saveOrUpdate(BaseGoodsTypeDto dto) { + return null; + } + + @Override + public ResultBean> listAll() { + return null; + } + + @Override + public ResultBean initialization(String sid) { + return null; + } + + @Override + public ResultBean updateIsEnable(String sid, String isEnable) { + return null; + } + + @Override + public ResultBean getTypeByName(String name) { + return null; + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsunit/BaseGoodsUnitFeign.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsunit/BaseGoodsUnitFeign.java new file mode 100644 index 0000000..43bbb0b --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsunit/BaseGoodsUnitFeign.java @@ -0,0 +1,53 @@ +package com.yxt.wms.feign.base.basegoodsunit; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basegoodsunit.BaseGoodsUnit; +import com.yxt.wms.biz.basegoodsunit.BaseGoodsUnitDto; +import com.yxt.wms.biz.basegoodsunit.BaseGoodsUnitQuery; +import com.yxt.wms.biz.basegoodsunit.BaseGoodsUnitVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@FeignClient( + contextId = "ss-common-goods-GoodsUnit", + name = "ss-common-goods", + path = "/apiadmin/base/basegoodsunit", + fallback = BaseGoodsUnitFeignFallback.class) +public interface BaseGoodsUnitFeign { + + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq); + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsUnitDto dto); + @ApiOperation("查询所有的品牌") + @GetMapping("/listAll") + public ResultBean> listAll(); + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid); + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable); + @ApiOperation("根据单位名查询") + @GetMapping("/getUnitByName/{name}") + public ResultBean getUnitByName(@PathVariable("name") String name); + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsunit/BaseGoodsUnitFeignFallback.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsunit/BaseGoodsUnitFeignFallback.java new file mode 100644 index 0000000..3dd7f3c --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basegoodsunit/BaseGoodsUnitFeignFallback.java @@ -0,0 +1,52 @@ +package com.yxt.wms.feign.base.basegoodsunit; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basegoodsunit.BaseGoodsUnit; +import com.yxt.wms.biz.basegoodsunit.BaseGoodsUnitDto; +import com.yxt.wms.biz.basegoodsunit.BaseGoodsUnitQuery; +import com.yxt.wms.biz.basegoodsunit.BaseGoodsUnitVo; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@Component +public class BaseGoodsUnitFeignFallback implements BaseGoodsUnitFeign { + + + @Override + public ResultBean> listPage(PagerQuery pq) { + return null; + } + + @Override + public ResultBean saveOrUpdate(BaseGoodsUnitDto dto) { + return null; + } + + @Override + public ResultBean> listAll() { + return null; + } + + @Override + public ResultBean initialization(String sid) { + return null; + } + + @Override + public ResultBean updateIsEnable(String sid, String isEnable) { + return null; + } + + @Override + public ResultBean getUnitByName(String name) { + return null; + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basemanufacturer/BaseManufacturerFeign.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basemanufacturer/BaseManufacturerFeign.java new file mode 100644 index 0000000..4bc578c --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basemanufacturer/BaseManufacturerFeign.java @@ -0,0 +1,54 @@ +package com.yxt.wms.feign.base.basemanufacturer; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basemanufacturer.BaseManufacturer; +import com.yxt.wms.biz.basemanufacturer.BaseManufacturerDto; +import com.yxt.wms.biz.basemanufacturer.BaseManufacturerQuery; +import com.yxt.wms.biz.basemanufacturer.BaseManufacturerVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@FeignClient( + contextId = "ss-common-goods-GoodsManufacturer", + name = "ss-common-goods", + path = "/apiadmin/base/basemanufacturer", + fallback = BaseManufacturerFeignFallback.class) +public interface BaseManufacturerFeign { + + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq); + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseManufacturerDto dto); + @ApiOperation("查询所有的品牌") + @GetMapping("/listAll") + public ResultBean> listAll(); + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid); + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable); + + @ApiOperation("查询分公司下所有的厂家") + @GetMapping("/getAllTypeByUseOrgSid") + public ResultBean> getAllTypeByUseOrgSid(@RequestParam("useOrgSid") String useOrgSid); + @ApiOperation("根据厂家名查询") + @GetMapping("/getManufacturerByName/{name}") + public ResultBean getManufacturerByName(@PathVariable("name") String name); + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basemanufacturer/BaseManufacturerFeignFallback.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basemanufacturer/BaseManufacturerFeignFallback.java new file mode 100644 index 0000000..a2a0e89 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basemanufacturer/BaseManufacturerFeignFallback.java @@ -0,0 +1,57 @@ +package com.yxt.wms.feign.base.basemanufacturer; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basemanufacturer.BaseManufacturer; +import com.yxt.wms.biz.basemanufacturer.BaseManufacturerDto; +import com.yxt.wms.biz.basemanufacturer.BaseManufacturerQuery; +import com.yxt.wms.biz.basemanufacturer.BaseManufacturerVo; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@Component +public class BaseManufacturerFeignFallback implements BaseManufacturerFeign { + + + @Override + public ResultBean> listPage(PagerQuery pq) { + return null; + } + + @Override + public ResultBean saveOrUpdate(BaseManufacturerDto dto) { + return null; + } + + @Override + public ResultBean> listAll() { + return null; + } + + @Override + public ResultBean initialization(String sid) { + return null; + } + + @Override + public ResultBean updateIsEnable(String sid, String isEnable) { + return null; + } + + @Override + public ResultBean> getAllTypeByUseOrgSid(String useOrgSid) { + return null; + } + + @Override + public ResultBean getManufacturerByName(String name) { + return null; + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basesupplierinfo/BaseSupplierInfoFeign.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basesupplierinfo/BaseSupplierInfoFeign.java new file mode 100644 index 0000000..131be3d --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basesupplierinfo/BaseSupplierInfoFeign.java @@ -0,0 +1,46 @@ +package com.yxt.wms.feign.base.basesupplierinfo; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basesupplierinfo.*; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/3/26 17:12 + */ +@FeignClient( + contextId = "ss-common-goods-BaseSupplierInfo", + name = "ss-common-goods", + path = "/apiadmin/base/basesupplierinfo", + fallback = BaseSupplierInfoFeignFallback.class) +public interface BaseSupplierInfoFeign { + + @ApiOperation("根据SID获取供应商") + @GetMapping("/fetchDetailsBySid/{sid}") + ResultBean fetchDetailsBySid(@PathVariable("sid") String sid); + + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq); + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody BaseSupplierInfoDto dto); + + @ApiOperation("根据sid批量删除") + @DeleteMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids); + + + + @ApiOperation("选择供应商") + @PostMapping("/choiceSupplierInfo") + public ResultBean> choiceSupplierInfo(@RequestParam("createOrgSid") String createOrgSid); +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/base/basesupplierinfo/BaseSupplierInfoFeignFallback.java b/wms-biz/src/main/java/com/yxt/wms/feign/base/basesupplierinfo/BaseSupplierInfoFeignFallback.java new file mode 100644 index 0000000..5f559c1 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/base/basesupplierinfo/BaseSupplierInfoFeignFallback.java @@ -0,0 +1,43 @@ +package com.yxt.wms.feign.base.basesupplierinfo; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basesupplierinfo.*; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/3/26 17:12 + */ +@Component +public class BaseSupplierInfoFeignFallback implements BaseSupplierInfoFeign { + + + @Override + public ResultBean fetchDetailsBySid(String sid) { + return null; + } + + @Override + public ResultBean> listPage(PagerQuery pq) { + return null; + } + + @Override + public ResultBean save(BaseSupplierInfoDto dto) { + return null; + } + + @Override + public ResultBean delBySids(String[] sids) { + return null; + } + + @Override + public ResultBean> choiceSupplierInfo(String createOrgSid) { + return null; + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/package-info.java b/wms-biz/src/main/java/com/yxt/wms/feign/package-info.java new file mode 100644 index 0000000..39d2e43 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通监管项目-光伏(山海新能源)项目后台逻辑和接口-接口声明 + */ +package com.yxt.wms.feign; \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/OrgList.java b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/OrgList.java new file mode 100644 index 0000000..6c067b7 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/OrgList.java @@ -0,0 +1,21 @@ +package com.yxt.wms.feign.user.sysuser; + +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/9/21 9:26 + * @Description + */ +@Data +public class OrgList implements Vo { + private static final long serialVersionUID = -2867882982421321776L; + + private String orgName; + private String orgPath; + + private String deptName; + + private String deptSid; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysOrganization.java b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysOrganization.java new file mode 100644 index 0000000..c15c93f --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysOrganization.java @@ -0,0 +1,87 @@ +package com.yxt.wms.feign.user.sysuser; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysOrganization.java
+ * Class: SysOrganization
+ * Description: 组织机构表.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:28
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@ApiModel(value = "组织机构表", description = "组织机构表") +@TableName("sys_organization") +@Data +public class SysOrganization extends BaseEntity { + private static final long serialVersionUID = 1L; + + + @ApiModelProperty("部门/组织名称") + private String name; + + @ApiModelProperty("父(部门/组织) sid") + private String psid; + + @ApiModelProperty("联系电话") + private String linkPhone; + @ApiModelProperty("联系人") + private String linkPerson; + + @ApiModelProperty("部门sid全路径") + private String orgSidPath; + + @ApiModelProperty("排序") + private Integer sort; + + @ApiModelProperty("地址") + private String addrs; + + @ApiModelProperty("地理位置经纬度") + private String jwd; + + @ApiModelProperty("二维码") + private String qrText; + + @ApiModelProperty("限制本部门成员查看通讯录:限制开启后,本部门成员只能看到限定范围内的通讯录不能看到所有通讯录,仅可见自己") + private Integer limitOrgMember; + + @ApiModelProperty("部门编码") + private String orgCode; + +// @ApiModelProperty("部门简称(地区简称+门店名称首字母(遇到首字母重复时用2个字母))") +// private String orgShortName; + + @ApiModelProperty("销售区域划分(本店终端销售:0,门店对应业务区域划分销售:1至9,具体编号划分各门店报备确定)") + private String regionDivision; + + @ApiModelProperty("是否是部门(0否,1是)") + private Integer isDept; + + @ApiModelProperty("组织简称") + private String orgAbbre; + + @ApiModelProperty("组织属性key") + private String orgAttributeKey; + + @ApiModelProperty("组织属性value") + private String orgAttributeValue; + + @ApiModelProperty("管理层级key") + private String orgLevelKey; + + @ApiModelProperty("管理层级value") + private String orgLevelValue; + + @ApiModelProperty("其他编码") + private String otherCode; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserDto.java b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserDto.java new file mode 100644 index 0000000..fdf5bf0 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserDto.java @@ -0,0 +1,47 @@ +package com.yxt.wms.feign.user.sysuser; + + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysUserDto.java
+ * Class: com.yxt.anrui.portal.api.sysuser.SysUserDto
+ * Description: 用户表 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:30
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@ApiModel(value = "用户表 数据传输对象", description = "用户表 数据传输对象") +@Data +public class SysUserDto implements Dto { + @ApiModelProperty("手机号") + private String mobile; + @ApiModelProperty("用户类型:1员工、2客户、3供应商") + private Integer userType; + @ApiModelProperty(value = "姓名", required = true) + @NotBlank(message = "姓名不能为空") + private String name; + @ApiModelProperty(value = "验证码", required = true) + @NotBlank(message = "验证码不能为空") + private String verificationCode; + @ApiModelProperty(value = "部门sid") + private String deptSid; + @ApiModelProperty(value = "岗位sid") + private String postSid; + private String companyName;//公司名 + private String contacts;//联系人 + private String provinces;//省 + private String cities;//市 + private String districts;//区 + +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserFeign.java b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserFeign.java new file mode 100644 index 0000000..36d80e0 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserFeign.java @@ -0,0 +1,60 @@ +package com.yxt.wms.feign.user.sysuser; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.yxt.common.base.utils.RegexUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoDto; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoQuery; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoVo; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * @description: + * @author: wangpengfei + * @date: 2024/4/12 + **/ +@FeignClient( + contextId = "ss-common-user-SysUser", + name = "ss-common-user", + path = "/apiadmin/sysuser", + fallback = SysUserFeignFallback.class) +public interface SysUserFeign { + + @PostMapping("/login") + @ResponseBody + @ApiOperation(value = "3、登录") + @ApiOperationSupport(order = 30) + public ResultBean login(@RequestBody SysUserQuery userQuery); + @PostMapping("/register") + @ResponseBody + @ApiOperation(value = "3、注册") + @ApiOperationSupport(order = 30) + public ResultBean register(@RequestBody SysUserDto dto); + @PostMapping("/loginDetails") + @ResponseBody + @ApiOperation(value = "获取登录人") + @ApiOperationSupport(order = 30) + public ResultBean loginDetails(HttpServletRequest httpServletRequest); + + @PostMapping("/sendMessageCode") + @ResponseBody + @ApiOperation(value = "3、获取注册码") + @ApiOperationSupport(order = 30) + public ResultBean sendMessageCode(String mobile); + + @PostMapping("/sendMessageLogin") + @ResponseBody + @ApiOperation(value = "3、获取登录码") + @ApiOperationSupport(order = 30) + public ResultBean sendMessageLogin(String mobile); + +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserFeignFallback.java b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserFeignFallback.java new file mode 100644 index 0000000..4496ef1 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserFeignFallback.java @@ -0,0 +1,48 @@ +package com.yxt.wms.feign.user.sysuser; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfo; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoDto; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoQuery; +import com.yxt.wms.biz.basebrandinfo.BaseBrandInfoVo; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/20 + **/ +@Component +public class SysUserFeignFallback implements SysUserFeign { + + + @Override + public ResultBean login(SysUserQuery userQuery) { + return null; + } + + @Override + public ResultBean register(SysUserDto dto) { + return null; + } + + @Override + public ResultBean loginDetails(HttpServletRequest httpServletRequest) { + return null; + } + + @Override + public ResultBean sendMessageCode(String mobile) { + return null; + } + + @Override + public ResultBean sendMessageLogin(String mobile) { + return null; + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserQuery.java b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserQuery.java new file mode 100644 index 0000000..1ba7cbf --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserQuery.java @@ -0,0 +1,56 @@ +package com.yxt.wms.feign.user.sysuser; + + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysUserQuery.java
+ * Class: com.yxt.anrui.portal.api.sysuser.SysUserQuery
+ * Description: 用户表 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:30
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@ApiModel(value = "用户表 查询条件", description = "用户表 查询条件") +@Data +public class SysUserQuery implements Query { + + + @ApiModelProperty("角色sid") + private String roleSid; + @ApiModelProperty("用户名称") + private String userName; + @ApiModelProperty("姓名") + private String name; + @ApiModelProperty("部门名称") + private String orgName; + + @ApiModelProperty("密码(加密或签名后)") + private String password; + + @ApiModelProperty("用户登录时随机生成身份验证字符串") + private String token; + @ApiModelProperty("用户登录时随机生成的验证码字符串") + private String verifyCode; + private String uuid; + + @ApiModelProperty("手机登录唯一标识,手机与用户绑定字段") + private String appId; + @ApiModelProperty("手机登录类型:1、密码登录2、验证码登录") + private String type; + @ApiModelProperty(value = "是否是测试",example = "false") + private Boolean isTest; + private Boolean companyName;//公司名 + private Boolean contacts;//联系人 + private Boolean provinces;//省 + private Boolean cities;//市 + private Boolean districts;//区 +} \ No newline at end of file diff --git a/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserVo.java b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserVo.java new file mode 100644 index 0000000..c14630f --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/feign/user/sysuser/SysUserVo.java @@ -0,0 +1,98 @@ +package com.yxt.wms.feign.user.sysuser; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysUserVo.java
+ * Class: com.yxt.anrui.portal.api.sysuser.SysUserVo
+ * Description: 用户表 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:30
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@ApiModel(value = "用户表 视图数据对象", description = "用户表 视图数据对象") +@Data +@NoArgsConstructor +public class SysUserVo implements Vo { + private static final long serialVersionUID = 2415131854581950721L; + @ApiModelProperty("部门sid") + private String departmentSid; + @ApiModelProperty("部门名称") + private String departmentName; + @ApiModelProperty("上级部门名称-本级部门名称 岗位名称") + @JsonProperty("pNameAndDepartmentNameAndPostName") + private String pNameAndDepartmentNameAndPostName; + @ApiModelProperty("岗位名称") + private String postName; + @ApiModelProperty("岗位Sid") + private String postSid; + @ApiModelProperty("单位sid") + private String organizationSid; + @ApiModelProperty("单位名称") + private String organizationName; + @ApiModelProperty("用户姓名") + private String name; + @ApiModelProperty("登录名,登录名不能相同") + private String userName; + + @ApiModelProperty("id") + private Integer id; + @ApiModelProperty("用户sid") + private String sid; + @ApiModelProperty("是否是管理员:1管理员,2一般用户,0是超级管理员,3尚无单位人员") + private String isAdmin; + @ApiModelProperty("角色名称") + private String roleName; + + @ApiModelProperty("关联的人员sid") + private String staffSid; + + @ApiModelProperty("手机号") + private String mobile; + @ApiModelProperty(value = "禁用状态") + private String isEnable; + + @ApiModelProperty("用户类型:1员工、2客户、3供应商") + private String userType; + @ApiModelProperty("用户类型:1、2、3") + private String userTypeKey; + @ApiModelProperty("用户头像") + private String headImage; + @ApiModelProperty("组织名称") + private String orgNamePath; + @ApiModelProperty("组织sid") + private String orgSidPath; + @ApiModelProperty(value = "token") + private String token; + @ApiModelProperty(value = "角色sids") + private List roleSids = new ArrayList<>(); + + private List orgList = new ArrayList<>(); + @ApiModelProperty("默认的组织机构sid全路径") + private String defaultOrgPath; + @ApiModelProperty("默认的组织机构名称全路径") + private String defaultOrgPathName; + + private String defaultDeptName; + private String defaultDeptSid; + + @ApiModelProperty("是否需要更换密码") + private Boolean needResetPsd; + @ApiModelProperty("工号") + private String jobNumber; + List sysOrganizations; +} diff --git a/wms-biz/src/main/java/com/yxt/wms/utils/DoubleUtils.java b/wms-biz/src/main/java/com/yxt/wms/utils/DoubleUtils.java new file mode 100644 index 0000000..b73c432 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/utils/DoubleUtils.java @@ -0,0 +1,93 @@ +package com.yxt.wms.utils; + +import java.math.BigDecimal; + +/** + * @author wangpengfei + * @date 2024/1/24 8:53 + */ +public class DoubleUtils { + + /** + * 对double数据进行取精度. + * @param value double数据. + * @param scale 精度位数(保留的小数位数). + * @param roundingMode 精度取值方式. + * @return 精度计算后的数据. + */ + public static double round(double value, int scale, + int roundingMode) { + BigDecimal bd = BigDecimal.valueOf(value); + bd = bd.setScale(scale, roundingMode); + double d = bd.doubleValue(); + bd = null; + return d; + } + + + /** + * double 相加 + * @param d1 + * @param d2 + * @return + */ + public static double sum(double d1,double d2){ + BigDecimal bd1 = BigDecimal.valueOf(d1); + BigDecimal bd2 = BigDecimal.valueOf(d2); + return bd1.add(bd2).doubleValue(); + } + + + /** + * double 相减 + * @param d1 + * @param d2 + * @return + */ + public static double sub(double d1,double d2){ + BigDecimal bd1 = BigDecimal.valueOf(d1); + BigDecimal bd2 = BigDecimal.valueOf(d2); + return bd1.subtract(bd2).doubleValue(); + } + + /** + * double 乘法 + * @param d1 + * @param d2 + * @return + */ + public static double mul(double d1, double d2){ + BigDecimal bd1 = BigDecimal.valueOf(d1); + BigDecimal bd2 = BigDecimal.valueOf(d2); + return bd1.multiply(bd2).doubleValue(); + } + + + /** + * double 除法 + * @param d1 + * @param d2 + * @param scale 四舍五入 小数点位数 + * @return + */ + public static double div(double d1,double d2,int scale){ + BigDecimal bd1 = BigDecimal.valueOf(d1); + BigDecimal bd2 = BigDecimal.valueOf(d2); + return bd1.divide + (bd2,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); + } + /** + * 去除多余.0 + * @param num + * @return + */ + public static String removeZeros(String num) { + if (num.indexOf(".") > 0) { + // 去掉多余的0 + num = num.replaceAll("0+?$", ""); + // 如果最后一位是. 则去掉 + num = num.replaceAll("[.]$", ""); + } + return num; + } +} diff --git a/wms-biz/src/main/java/com/yxt/wms/utils/ExcelUtil.java b/wms-biz/src/main/java/com/yxt/wms/utils/ExcelUtil.java new file mode 100644 index 0000000..b43e391 --- /dev/null +++ b/wms-biz/src/main/java/com/yxt/wms/utils/ExcelUtil.java @@ -0,0 +1,171 @@ +package com.yxt.wms.utils; + + +//import org.apache.log4j.Logger; +import com.yxt.common.core.result.ResultBean; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.web.multipart.MultipartFile; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import static org.apache.poi.ss.usermodel.CellType.NUMERIC; +import static org.apache.poi.ss.usermodel.CellType.STRING; + + +/** + * @author wangpengfei + * @date 2024/4/23 13:53 + */ +public class ExcelUtil { +// private static Logger logger = Logger.getLogger(ExcelUtil.class); + private final static String xls = "xls"; + private final static String xlsx = "xlsx"; + + /** + * 读入excel文件,解析后返回 + * + * @param file + * @throws IOException + */ + public static List readExcel(MultipartFile file) throws IOException { + //检查文件 + checkFile(file); + //获得Workbook工作薄对象 + Workbook workbook = getWorkBook(file); + //创建返回对象,把每行中的值作为一个数组,所有行作为一个集合返回 + List list = new ArrayList(); + if (workbook != null) { + for (int sheetNum = 0; sheetNum < workbook.getNumberOfSheets(); sheetNum++) { + //获得当前sheet工作表 + Sheet sheet = workbook.getSheetAt(sheetNum); + if (sheet == null) { + continue; + } + //获得当前sheet的开始行 + int firstRowNum = sheet.getFirstRowNum(); + //获得当前sheet的结束行 + int lastRowNum = sheet.getLastRowNum(); + int arrLength = sheet.getRow(firstRowNum).getPhysicalNumberOfCells(); + int rowNumb=firstRowNum + 1; + //循环除了第一行的所有行 + for (int rowNum = rowNumb; rowNum <= lastRowNum; rowNum++) { + //获得当前行 + Row row = sheet.getRow(rowNum); + if (row == null) { + continue; + } + //获得当前行的开始列 + int firstCellNum = row.getFirstCellNum(); + //获得当前行的列数 + int lastCellNum = row.getPhysicalNumberOfCells(); + String[] cells = new String[arrLength]; + //循环当前行 + for(int i =0 ;i + + + + + + + + + %yellow(%date{yyyy-MM-dd HH:mm:ss}) |%highlight(%-5level) |%green(%logger:%line) |%blue(%msg%n) + + + + + + + + + + + + + + ${log.base}.log + + ${log.base}.%d{yyyyMMdd}.%i.log.zip + + + + 1MB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} + -%msg%n + + + + + + + + + + \ No newline at end of file