Sfoglia il codice sorgente

Merge branch 'dev' into dev-xcq

xucaiqin 2 anni fa
parent
commit
d940c98111
21 ha cambiato i file con 892 aggiunte e 152 eliminazioni
  1. 5 0
      sckw-auth/src/main/java/com/sckw/auth/model/vo/res/EntInfoResVo.java
  2. 9 2
      sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java
  3. 145 127
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java
  4. 5 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginEntInfo.java
  5. 8 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java
  6. 5 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntCacheResDto.java
  7. 73 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntTypeResDto.java
  8. 38 0
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/vo/req/CompleteReqVo.java
  9. 7 4
      sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwoTransportDemandController.java
  10. 1 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/AddTransportDemandParam.java
  11. 21 3
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/ExportTransportDemandParam.java
  12. 31 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/TransportDemandSquaresParam.java
  13. 6 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/TransportDemandDetailRes.java
  14. 124 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/TransportDemandListRes.java
  15. 99 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/TransportDemandSquaresListRes.java
  16. 287 11
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java
  17. 1 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java
  18. 13 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java
  19. 4 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java
  20. 9 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java
  21. 1 1
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/CommonService.java

+ 5 - 0
sckw-auth/src/main/java/com/sckw/auth/model/vo/res/EntInfoResVo.java

@@ -72,4 +72,9 @@ public class EntInfoResVo {
      */
     private List<EntCertificateResDto> certificateInfo;
 
+    /**
+     * 企业属性
+     */
+    private String entTypes;
+
 }

+ 9 - 2
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -83,8 +83,6 @@ public class AuthServiceImpl implements IAuthService {
             afterProcessor(loginResVo);
             return loginResVo;
         }
-        EntInfoResVo entInfoResVo = new EntInfoResVo();
-        entInfoResVo.setDeptInfo(BeanUtils.copyToList(kwsDepts, DeptInfoResVo.class));
 
         /*3、查企业*/
         //目前一个人只能归属于一个企业,所以这里取第一个就行
@@ -95,7 +93,16 @@ public class AuthServiceImpl implements IAuthService {
             afterProcessor(loginResVo);
             return loginResVo;
         }
+
+        EntInfoResVo entInfoResVo = new EntInfoResVo();
         BeanUtils.copyProperties(kwsEnterpriseResDto, entInfoResVo);
+        entInfoResVo.setDeptInfo(BeanUtils.copyToList(kwsDepts, DeptInfoResVo.class));
+
+        //查企业类型
+        List<EntTypeResDto> entTypeResDtos = remoteUserService.queryEntTypeById(entId);
+        if (CollectionUtils.isNotEmpty(entTypeResDtos)) {
+            entInfoResVo.setEntTypes(String.join(Global.COMMA, entTypeResDtos.stream().map(EntTypeResDto::getType).map(String::valueOf).distinct().toList()));
+        }
         loginResVo.setEntInfo(entInfoResVo);
 
         /* 4、查资质*/

+ 145 - 127
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java

@@ -1,11 +1,12 @@
 package com.sckw.core.utils;
 
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
+import com.sckw.core.exception.BusinessException;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 /**
  * @Description 自测公共处理类
@@ -14,26 +15,37 @@ import java.util.regex.Pattern;
  */
 public class StringUtils {
 
-    /** 空字符串 */
+    /**
+     * 空字符串
+     */
     private static final String NULLSTR = "";
-    /** 下划线 */
+    /**
+     * 下划线
+     */
     private static final char SEPARATOR_CHAR = '_';
-    /** 下划线 */
+    /**
+     * 下划线
+     */
     private static final String SEPARATOR_STRING = "_";
-    /** 加密字符 */
+    /**
+     * 加密字符
+     */
     public static final String HASH_ALGORITHM = "SHA-1";
-    /**${xxx}**/
+    /**
+     * ${xxx}
+     **/
     public static final Pattern pattern = Pattern.compile("(\\$\\{)([\\w]+)(\\})");
 
     /**
      * 判断字符串是否为空
+     *
      * @param str 源字符串
+     * @return
      * @author dengyinghui
      * @date 2018/11/12
-     * @return
      */
-    public static boolean validatorEmpty(String str){
-        if(str != null && !"".equals(str)){
+    public static boolean validatorEmpty(String str) {
+        if (str != null && !"".equals(str)) {
             return false;
         }
 
@@ -42,6 +54,7 @@ public class StringUtils {
 
     /**
      * 判空操作(空)
+     *
      * @param str
      * @return
      */
@@ -52,6 +65,7 @@ public class StringUtils {
 
     /**
      * 判空操作(空)
+     *
      * @param value
      * @return
      */
@@ -61,6 +75,7 @@ public class StringUtils {
 
     /**
      * 判空操作(非空)
+     *
      * @param str
      * @return
      */
@@ -71,6 +86,7 @@ public class StringUtils {
 
     /**
      * 判空操作(非空)
+     *
      * @param value
      * @return
      */
@@ -80,6 +96,7 @@ public class StringUtils {
 
     /**
      * 获取uuid
+     *
      * @return
      */
     public static String uuid() {
@@ -92,8 +109,7 @@ public class StringUtils {
      * @param value defaultValue 要判断的value
      * @return value 返回值
      */
-    public static <T> T nvl(T value, T defaultValue)
-    {
+    public static <T> T nvl(T value, T defaultValue) {
         return value != null ? value : defaultValue;
     }
 
@@ -103,8 +119,7 @@ public class StringUtils {
      * @param coll 要判断的Collection
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Collection<?> coll)
-    {
+    public static boolean isEmpty(Collection<?> coll) {
         return isNull(coll) || coll.isEmpty();
     }
 
@@ -114,8 +129,7 @@ public class StringUtils {
      * @param coll 要判断的Collection
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Collection<?> coll)
-    {
+    public static boolean isNotEmpty(Collection<?> coll) {
         return !isEmpty(coll);
     }
 
@@ -123,10 +137,9 @@ public class StringUtils {
      * * 判断一个对象数组是否为空
      *
      * @param objects 要判断的对象数组
-     ** @return true:为空 false:非空
+     *                * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Object[] objects)
-    {
+    public static boolean isEmpty(Object[] objects) {
         return isNull(objects) || (objects.length == 0);
     }
 
@@ -136,8 +149,7 @@ public class StringUtils {
      * @param objects 要判断的对象数组
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Object[] objects)
-    {
+    public static boolean isNotEmpty(Object[] objects) {
         return !isEmpty(objects);
     }
 
@@ -147,8 +159,7 @@ public class StringUtils {
      * @param map 要判断的Map
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Map<?, ?> map)
-    {
+    public static boolean isEmpty(Map<?, ?> map) {
         return isNull(map) || map.isEmpty();
     }
 
@@ -158,8 +169,7 @@ public class StringUtils {
      * @param map 要判断的Map
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Map<?, ?> map)
-    {
+    public static boolean isNotEmpty(Map<?, ?> map) {
         return !isEmpty(map);
     }
 
@@ -169,8 +179,7 @@ public class StringUtils {
      * @param str String
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(String str)
-    {
+    public static boolean isEmpty(String str) {
         return isNull(str) || NULLSTR.equals(str.trim());
     }
 
@@ -180,8 +189,7 @@ public class StringUtils {
      * @param str String
      * @return true:非空串 false:空串
      */
-    public static boolean isNotEmpty(String str)
-    {
+    public static boolean isNotEmpty(String str) {
         return !isEmpty(str);
     }
 
@@ -191,8 +199,7 @@ public class StringUtils {
      * @param object Object
      * @return true:为空 false:非空
      */
-    public static boolean isNull(Object object)
-    {
+    public static boolean isNull(Object object) {
         return object == null;
     }
 
@@ -202,8 +209,7 @@ public class StringUtils {
      * @param object Object
      * @return true:非空 false:空
      */
-    public static boolean isNotNull(Object object)
-    {
+    public static boolean isNotNull(Object object) {
         return !isNull(object);
     }
 
@@ -213,44 +219,37 @@ public class StringUtils {
      * @param object 对象
      * @return true:是数组 false:不是数组
      */
-    public static boolean isArray(Object object)
-    {
+    public static boolean isArray(Object object) {
         return isNotNull(object) && object.getClass().isArray();
     }
 
     /**
      * 去空格
      */
-    public static String trim(String str)
-    {
+    public static String trim(String str) {
         return (str == null ? "" : str.trim());
     }
 
     /**
      * 截取字符串
      *
-     * @param str 字符串
+     * @param str   字符串
      * @param start 开始
      * @return 结果
      */
-    public static String substring(final String str, int start)
-    {
-        if (str == null)
-        {
+    public static String substring(final String str, int start) {
+        if (str == null) {
             return NULLSTR;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = str.length() + start;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = 0;
         }
-        if (start > str.length())
-        {
+        if (start > str.length()) {
             return NULLSTR;
         }
 
@@ -260,43 +259,35 @@ public class StringUtils {
     /**
      * 截取字符串
      *
-     * @param str 字符串
+     * @param str   字符串
      * @param start 开始
-     * @param end 结束
+     * @param end   结束
      * @return 结果
      */
-    public static String substring(final String str, int start, int end)
-    {
-        if (str == null)
-        {
+    public static String substring(final String str, int start, int end) {
+        if (str == null) {
             return NULLSTR;
         }
 
-        if (end < 0)
-        {
+        if (end < 0) {
             end = str.length() + end;
         }
-        if (start < 0)
-        {
+        if (start < 0) {
             start = str.length() + start;
         }
 
-        if (end > str.length())
-        {
+        if (end > str.length()) {
             end = str.length();
         }
 
-        if (start > end)
-        {
+        if (start > end) {
             return NULLSTR;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = 0;
         }
-        if (end < 0)
-        {
+        if (end < 0) {
             end = 0;
         }
 
@@ -318,45 +309,37 @@ public class StringUtils {
 
     public static String format(String template, Object... params)
     {
-        if (isEmpty(params) || isEmpty(template))
-        {
-            return template;
-        }
-        return StrFormatter.format(template, params);
+    if (isEmpty(params) || isEmpty(template))
+    {
+    return template;
+    }
+    return StrFormatter.format(template, params);
     }*/
 
     /**
      * 下划线转驼峰命名
      */
-    public static String toUnderScoreCase(String s)
-    {
-        if (s == null)
-        {
+    public static String toUnderScoreCase(String s) {
+        if (s == null) {
             return null;
         }
         StringBuilder sb = new StringBuilder();
         boolean upperCase = false;
-        for (int i = 0; i < s.length(); i++)
-        {
+        for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);
 
             boolean nextUpperCase = true;
 
-            if (i < (s.length() - 1))
-            {
+            if (i < (s.length() - 1)) {
                 nextUpperCase = Character.isUpperCase(s.charAt(i + 1));
             }
 
-            if ((i > 0) && Character.isUpperCase(c))
-            {
-                if (!upperCase || !nextUpperCase)
-                {
+            if ((i > 0) && Character.isUpperCase(c)) {
+                if (!upperCase || !nextUpperCase) {
                     sb.append(SEPARATOR_CHAR);
                 }
                 upperCase = true;
-            }
-            else
-            {
+            } else {
                 upperCase = false;
             }
 
@@ -369,18 +352,14 @@ public class StringUtils {
     /**
      * 是否包含字符串
      *
-     * @param str 验证字符串
+     * @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)))
-                {
+    public static boolean inStringIgnoreCase(String str, String... strs) {
+        if (str != null && strs != null) {
+            for (String s : strs) {
+                if (str.equalsIgnoreCase(trim(s))) {
                     return true;
                 }
             }
@@ -390,21 +369,55 @@ public class StringUtils {
 
     /**
      * 字符串转数组
+     *
      * @param params 字符串
-     * @param regex 截取字符
+     * @param regex  截取字符
      * @return
      */
-    public static String [] splitStr(String params, String regex){
+    public static String[] splitStr(String params, String regex) {
         regex = StringUtils.isNotBlank(regex) ? regex : ",";
         return StringUtils.isNotBlank(params) ? params.split(regex) : new String[]{};
     }
 
+    /**
+     * 字符串分割转list
+     *
+     * @param str   字符串
+     * @param regex 截取字符
+     * @param cls 转换类型class
+     * @return
+     */
+    public static <T> List<T> splitStrToList(String str, String regex, Class<T> cls) {
+        regex = StringUtils.isNotBlank(regex) ? regex : ",";
+        if (StringUtils.isBlank(str)) {
+            return Collections.emptyList();
+        }
+        List<T> result;
+        if (cls == String.class) {
+            result = Arrays.stream(str.split(regex))
+                    .map(strValue -> (T) strValue)
+                    .collect(Collectors.toList());
+        } else {
+            result = Arrays.stream(str.split(regex))
+                    .map(strValue -> {
+                        try {
+                            return cls.getConstructor(String.class).newInstance(strValue);
+                        } catch (InstantiationException | IllegalAccessException | InvocationTargetException |
+                                 NoSuchMethodException e) {
+                            throw new BusinessException("字符串转集合异常!");
+                        }
+                    }).collect(Collectors.toList());
+        }
+        return result;
+    }
+
     /**
      * Object对象转字符串
+     *
      * @param obj
      * @return
      */
-    public static String objectStr(Object obj){
+    public static String objectStr(Object obj) {
         if (obj != null) {
             return obj.toString();
         }
@@ -415,12 +428,13 @@ public class StringUtils {
         if (str == null) {
             return "";
         } else {
-            return str instanceof String ? ((String)str).trim() : str.toString();
+            return str instanceof String ? ((String) str).trim() : str.toString();
         }
     }
 
     /**
      * 解析出url请求的路径,包括页面
+     *
      * @param strURL url地址
      * @return url路径
      */
@@ -555,8 +569,8 @@ public class StringUtils {
     /**
      * 转换为Double类型
      */
-    public static Double toDouble(Object val){
-        if (val == null){
+    public static Double toDouble(Object val) {
+        if (val == null) {
             return 0D;
         }
         try {
@@ -573,31 +587,32 @@ public class StringUtils {
         return toDouble(val).floatValue();
     }
 
-        /**
-         * 转换为Long类型
-         */
-    public static Long toLong(Object val){
+    /**
+     * 转换为Long类型
+     */
+    public static Long toLong(Object val) {
         return toDouble(val).longValue();
     }
 
     /**
      * 转换为Integer类型
      */
-    public static Integer toInteger(Object val){
+    public static Integer toInteger(Object val) {
         return toLong(val).intValue();
     }
 
     /**
      * Object转String
+     *
      * @param val 源字符串
+     * @return
      * @author dengyinghui
      * @date 2018/2/27
-     * @return
      */
-    public static String valueOf(Object val){
-        if(val == null){
+    public static String valueOf(Object val) {
+        if (val == null) {
             return "";
-        } else{
+        } else {
             return String.valueOf(val);
         }
     }
@@ -605,7 +620,7 @@ public class StringUtils {
     private static String toHex(byte[] bytes) {
         final char[] hexDigits = "0123456789ABCDEF".toCharArray();
         StringBuilder ret = new StringBuilder(bytes.length * 2);
-        for (int i=0; i<bytes.length; i++) {
+        for (int i = 0; i < bytes.length; i++) {
             ret.append(hexDigits[(bytes[i] >> 4) & 0x0f]);
             ret.append(hexDigits[bytes[i] & 0x0f]);
         }
@@ -614,20 +629,21 @@ public class StringUtils {
 
     /**
      * 替换字符串${xxxx}
-     * @param content 账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!
-     * @param regex 需要替换的字符(account)
+     *
+     * @param content     账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!
+     * @param regex       需要替换的字符(account)
      * @param replacement 替换值(173xxxxxxxx)
      * @return
      */
-    public static String replace(String content, String regex, String replacement){
-        if (content == null || regex == null || replacement == null){
+    public static String replace(String content, String regex, String replacement) {
+        if (content == null || regex == null || replacement == null) {
             return null;
         }
         Matcher matcher = pattern.matcher(content);
         StringBuffer strBuf = new StringBuffer();
         while (matcher.find()) {
             String group = matcher.group().replace("${", "").replace("}", "");
-            if (group.equals(regex)){
+            if (group.equals(regex)) {
                 matcher.appendReplacement(strBuf, replacement);
                 return matcher.appendTail(strBuf).toString();
             }
@@ -637,20 +653,21 @@ public class StringUtils {
 
     /**
      * 替换字符串${xxxx}
-     * @param content  账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!
-     * @param params {"account":"xxxxx", "pwd":"xxxx"}
+     *
+     * @param content 账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!
+     * @param params  {"account":"xxxxx", "pwd":"xxxx"}
      * @return
      */
-    public static String replace1(String content, Map<String, Object> params){
-        if (content == null || params == null){
+    public static String replace1(String content, Map<String, Object> params) {
+        if (content == null || params == null) {
             return null;
         }
 
         Matcher matcher = pattern.matcher(content);
         StringBuffer strBuf = new StringBuffer();
-        while(matcher.find()){
+        while (matcher.find()) {
             String group = matcher.group().replace("${", "").replace("}", "");
-            if (params.get(group) != null){
+            if (params.get(group) != null) {
                 String replacement = StringUtils.objectStr(params.get(group));
                 matcher.appendReplacement(strBuf, replacement);
             }
@@ -685,6 +702,7 @@ public class StringUtils {
 
     /**
      * 值替换
+     *
      * @param prefix
      * @param args
      * @return
@@ -693,12 +711,12 @@ public class StringUtils {
         return String.format(prefix, args);
     }
 
-    public static void main(String[] args){
+    public static void main(String[] args) {
         Map<String, Object> param = new HashMap();
         param.put("account", "17358629955");
         param.put("pwd", "123456");
         String template = "账号创建成功,欢迎使用危品汇!登录账号:${account},默认密码:${pwd}!";
-        for(String key : param.keySet()){
+        for (String key : param.keySet()) {
             template = StringUtils.replace(template, key, StringUtils.objectStr(param.get(key)));
         }
         System.out.println(template);
@@ -706,6 +724,6 @@ public class StringUtils {
         Map<String, Object> m = new HashMap<>();
         m.put("account", "han");
         m.put("pwd", "zhong");
-        System.out.println( replace1(template, m));
+        System.out.println(replace1(template, m));
     }
 }

+ 5 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginEntInfo.java

@@ -76,6 +76,11 @@ public class LoginEntInfo {
      */
     private Boolean valid;
 
+    /**
+     * 企业属性
+     */
+    private String entTypes;
+
     /**
      * 资质
      */

+ 8 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java

@@ -167,4 +167,12 @@ public interface RemoteUserService {
      */
     void checkRegisterParam(String entName, String phone, Integer systemType);
 
+    /**
+     * @param entId 企业id
+     * @return EntTypeResDto
+     * @desc: 根据企业id 查属性
+     * @author: czh
+     * @date: 2023/7/27
+     */
+    List<EntTypeResDto> queryEntTypeById(Long entId);
 }

+ 5 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntCacheResDto.java

@@ -65,6 +65,11 @@ public class EntCacheResDto implements Serializable {
      */
     private String entDeptIds;
 
+    /**
+     * 企业属性 (1供应商,2采购商,34PL物流,43PL物流)
+     */
+    private String entTypes;
+
     /**
      * 机构信息
      */

+ 73 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntTypeResDto.java

@@ -0,0 +1,73 @@
+package com.sckw.system.api.model.dto.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author czh
+ * @desc 企业类型
+ * @date 2023/7/27
+ */
+@Data
+public class EntTypeResDto implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1158513264803000013L;
+
+    /**
+     * 企业ID或企业子公司所属机构ID
+     */
+    private Long entId;
+
+    /**
+     * 用户类型(1供应商,2采购商,3 4PL物流,4 3PL物流)
+     */
+    private Integer type;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 状态:0正常/1锁定
+     */
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    private Long createBy;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    private Long updateBy;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 删除标识(0正常/-1删除)
+     */
+    private Integer delFlag = 0;
+
+
+}

+ 38 - 0
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/vo/req/CompleteReqVo.java

@@ -0,0 +1,38 @@
+package com.sckw.contract.model.vo.req;
+
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author czh
+ * @desc 完结
+ * @date 2023/7/27
+ */
+@Data
+public class CompleteReqVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 4191696463874543248L;
+
+    /**
+     * 主键id
+     */
+    @NotNull(message = "id不能为空")
+    private Long id;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 履约量
+     */
+    @NotNull(message = "履约量不能为空")
+    private BigDecimal performedAmount;
+
+}

+ 7 - 4
sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwoTransportDemandController.java

@@ -2,6 +2,7 @@ package com.sckw.order.controller;
 
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.order.model.dto.TransportDemandExport;
@@ -142,8 +143,9 @@ public class KwoTransportDemandController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @GetMapping("/batchTakeOffShelves")
-    public HttpResult batchTakeOffShelves(@RequestParam List<Long> ids) {
-        kwoTransportDemandService.batchTakeOffShelves(ids);
+    public HttpResult batchTakeOffShelves(@RequestParam String ids) {
+        List<Long> list = StringUtils.splitStrToList(ids, ",", Long.class);
+        kwoTransportDemandService.batchTakeOffShelves(list);
         return HttpResult.ok("批量下架成功");
     }
 
@@ -155,8 +157,9 @@ public class KwoTransportDemandController {
      * @return: com.sckw.core.web.response.HttpResult
      */
     @GetMapping("/batchDelete")
-    public HttpResult batchDelete(@RequestParam List<Long> ids) {
-        kwoTransportDemandService.batchDelete(ids);
+    public HttpResult batchDelete(@RequestParam String ids) {
+        List<Long> list = StringUtils.splitStrToList(ids, ",", Long.class);
+        kwoTransportDemandService.batchDelete(list);
         return HttpResult.ok("批量删除成功");
     }
 

+ 1 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/AddTransportDemandParam.java

@@ -97,7 +97,7 @@ public class AddTransportDemandParam {
     /**
      * 卸货区域code
      */
-    @NotBlank(message = "卸货区域code不能为空")
+    @NotNull(message = "卸货区域code不能为空")
     private Integer unloadAreaCode;
 
     /**

+ 21 - 3
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/ExportTransportDemandParam.java

@@ -1,10 +1,11 @@
 package com.sckw.order.model.vo.req;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 
-import java.util.List;
+import java.util.Date;
 
 /**
  * @desc: 运需导出请求参数
@@ -22,9 +23,16 @@ public class ExportTransportDemandParam {
     private String keywords;
 
     /**
-     * 商品类型集合
+     * 创建时间开始
      */
-    private List<String> goodsTypes;
+    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    private Date startCreateTime;
+
+    /**
+     * 创建时间结束
+     */
+    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    private Date endCreateTime;
 
     /**
      * 装货地区code
@@ -46,4 +54,14 @@ public class ExportTransportDemandParam {
      */
     private Integer unloadAreaLevel;
 
+    /**
+     * 运需状态
+     */
+    private Integer status;
+
+    /**
+     * 运需ids
+     */
+    private String ids;
+
 }

+ 31 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/TransportDemandSquaresParam.java

@@ -5,8 +5,10 @@ import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 
+import java.util.List;
+
 /**
- * @desc: TODO
+ * @desc: 运需广场列表请求参数
  * @author: yzc
  * @date: 2023-07-26 10:27
  */
@@ -15,6 +17,34 @@ import lombok.ToString;
 @ToString
 public class TransportDemandSquaresParam extends PageRequest {
 
+    /**
+     * 关键词模糊匹配 商品名
+     */
+    private String keywords;
+
+    /**
+     * 商品类型集合
+     */
+    private List<String> goodsTypes;
+
+    /**
+     * 装货地区code
+     */
+    private Integer loadAreaCode;
+
+    /**
+     * 装货地区等级
+     */
+    private Integer loadAreaLevel;
+
+    /**
+     * 卸货地区code
+     */
+    private Integer unloadAreaCode;
 
+    /**
+     * 卸货地区等级
+     */
+    private Integer unloadAreaLevel;
 
 }

+ 6 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/TransportDemandDetailRes.java

@@ -6,6 +6,8 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.experimental.Accessors;
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.time.LocalDate;
 import java.util.Date;
 
@@ -18,7 +20,10 @@ import java.util.Date;
 @Setter
 @ToString
 @Accessors(chain = true)
-public class TransportDemandDetailRes {
+public class TransportDemandDetailRes implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 5175877052604993108L;
 
     private Long id;
 

+ 124 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/TransportDemandListRes.java

@@ -0,0 +1,124 @@
+package com.sckw.order.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.time.LocalDate;
+import java.util.Date;
+
+/**
+ * @desc: TODO
+ * @author: yzc
+ * @date: 2023-07-26 13:35
+ */
+@Getter
+@Setter
+@ToString
+@Accessors(chain = true)
+public class TransportDemandListRes implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -2367242506786660933L;
+
+    private Long id;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 状态label
+     */
+    private String statusLabel;
+
+    /**
+     * 商品名称
+     */
+    private String name;
+
+    /**
+     * 商品分类
+     */
+    private String goodsType;
+
+    /**
+     * 商品分类Label
+     */
+    private String goodsTypeLabel;
+
+    /**
+     * 商品规格
+     */
+    private String spec;
+
+    /**
+     * 交易方式(预付款、货到付款、线下付款)
+     */
+    private String trading;
+
+    /**
+     * 交易方式Label
+     */
+    private String tradingLabel;
+
+    /**
+     * 运需单价
+     */
+    private String price;
+
+    /**
+     * 运输总量
+     */
+    private String amount;
+
+
+    /**
+     * 装货地址
+     */
+    private String loadAddress;
+
+    /**
+     * 卸货地址
+     */
+    private String unloadAddress;
+
+    /**
+     * 截止时间(yyyy-MM-dd)
+     */
+    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate deadline;
+
+    /**
+     * 联系人姓名
+     */
+    private String contacts;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
+    /**
+     * 创建时间
+     */
+    @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 updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 99 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/TransportDemandSquaresListRes.java

@@ -0,0 +1,99 @@
+package com.sckw.order.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * @desc: 运需广场列表响应
+ * @author: yzc
+ * @date: 2023-07-26 14:38
+ */
+@Getter
+@Setter
+@ToString
+@Accessors(chain = true)
+public class TransportDemandSquaresListRes implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -3625148950210432786L;
+
+    private Long id;
+
+    /**
+     * 商品名称
+     */
+    private String name;
+
+    /**
+     * 商品分类
+     */
+    private String goodsType;
+
+    /**
+     * 商品分类Label
+     */
+    private String goodsTypeLabel;
+
+    /**
+     * 商品规格
+     */
+    private String spec;
+
+    /**
+     * 运需单价
+     */
+    private String price;
+
+    /**
+     * 运输总量
+     */
+    private String amount;
+
+    /**
+     * 交易方式(预付款、货到付款、线下付款)
+     */
+    private String trading;
+
+    /**
+     * 交易方式Label
+     */
+    private String tradingLabel;
+
+    /**
+     * 装货地址
+     */
+    private String loadAddress;
+
+    /**
+     * 卸货地址
+     */
+    private String unloadAddress;
+
+    /**
+     * 托运单位
+     */
+    private String demandUnit;
+
+    /**
+     * 截止时间(yyyy-MM-dd)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate deadline;
+
+    /**
+     * 联系人姓名
+     */
+    private String contacts;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
+}

+ 287 - 11
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java

@@ -1,19 +1,39 @@
 package com.sckw.order.serivce;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
+import com.sckw.core.common.enums.enums.DictEnum;
+import com.sckw.core.common.enums.enums.DictTypeEnum;
+import com.sckw.core.exception.BusinessException;
+import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageResult;
+import com.sckw.core.model.vo.TableBottom;
 import com.sckw.core.model.vo.TableStatisticRes;
+import com.sckw.core.model.vo.TableTop;
 import com.sckw.core.utils.BeanUtils;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.excel.utils.DateUtil;
 import com.sckw.order.dao.KwoTransportDemandMapper;
 import com.sckw.order.model.KwoTransportDemand;
 import com.sckw.order.model.dto.TransportDemandExport;
 import com.sckw.order.model.vo.req.*;
 import com.sckw.order.model.vo.res.TransportDemandDetailRes;
+import com.sckw.order.model.vo.res.TransportDemandListRes;
+import com.sckw.order.model.vo.res.TransportDemandSquaresListRes;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @desc: 运需service
@@ -27,6 +47,9 @@ public class KwoTransportDemandService {
 
     private final KwoTransportDemandMapper kwoTransportDemandMapper;
 
+    @DubboReference(version = "2.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
 
     /**
      * @desc: 添加草稿
@@ -37,7 +60,7 @@ public class KwoTransportDemandService {
      */
     public void addDraft(AddTransportDemandDraftParam param) {
         KwoTransportDemand transportDemand = BeanUtils.copyProperties(param, KwoTransportDemand.class);
-        transportDemand.setEntId(LoginUserHolder.getEntId()).setStatus(0);
+        transportDemand.setEntId(LoginUserHolder.getEntId()).setStatus(Integer.valueOf(DictEnum.TRANSPORT_DEMAND_STATUS_0.getValue()));
         kwoTransportDemandMapper.insert(transportDemand);
     }
 
@@ -49,7 +72,9 @@ public class KwoTransportDemandService {
      * @return: void
      */
     public void addShelves(AddTransportDemandParam param) {
-
+        KwoTransportDemand transportDemand = BeanUtils.copyProperties(param, KwoTransportDemand.class);
+        transportDemand.setEntId(LoginUserHolder.getEntId()).setStatus(Integer.valueOf(DictEnum.TRANSPORT_DEMAND_STATUS_1.getValue()));
+        kwoTransportDemandMapper.insert(transportDemand);
     }
 
     /**
@@ -60,7 +85,28 @@ public class KwoTransportDemandService {
      * @return: com.sckw.order.model.vo.res.TransportDemandDetailRes
      */
     public TransportDemandDetailRes detail(Long id) {
-        return null;
+        KwoTransportDemand transportDemand = getById(id);
+        if (Objects.isNull(transportDemand)) {
+            throw new BusinessException("数据不存在!");
+        }
+        TransportDemandDetailRes res = BeanUtils.copyProperties(transportDemand, TransportDemandDetailRes.class);
+        res.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), res.getGoodsType()))
+                .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), res.getTrading()))
+                .setStatusLabel(DictEnum.getLabel(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType(), String.valueOf(res.getStatus())));
+        return res;
+    }
+
+    /**
+     * @desc: 根据id获取
+     * @author: yzc
+     * @date: 2023-07-26 11:27
+     * @Param id:
+     * @return: com.sckw.order.model.KwoTransportDemand
+     */
+    private KwoTransportDemand getById(Long id) {
+        LambdaQueryWrapper<KwoTransportDemand> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(KwoTransportDemand::getId, id).eq(KwoTransportDemand::getDelFlag, Global.NO).last("LIMIT 1");
+        return kwoTransportDemandMapper.selectOne(wrapper);
     }
 
     /**
@@ -71,7 +117,55 @@ public class KwoTransportDemandService {
      * @return: void
      */
     public void update(UpdateTransportDemandParam param) {
+        KwoTransportDemand demand = getById(param.getId());
+        if (Objects.isNull(demand)) {
+            throw new BusinessException("数据不存在!");
+        }
+        if (!Objects.equals(demand.getEntId(), LoginUserHolder.getEntId())) {
+            throw new BusinessException("无操作权限!");
+        }
+        if (!Objects.equals(String.valueOf(demand.getStatus()), DictEnum.TRANSPORT_DEMAND_STATUS_0.getValue())) {
+            checkParams(param);
+        }
+        BeanUtils.copyProperties(param, demand);
+        kwoTransportDemandMapper.updateById(demand);
+    }
 
+    /**
+     * @desc: 参数校验
+     * @author: yzc
+     * @date: 2023-07-26 11:30
+     * @Param param:
+     * @return: void
+     */
+    private void checkParams(UpdateTransportDemandParam param) {
+        if (StringUtils.isBlank(param.getName())) {
+            throw new BusinessException("商品名称不能为空");
+        }
+        if (StringUtils.isBlank(param.getPrice())) {
+            throw new BusinessException("运需单价不能为空");
+        }
+        if (StringUtils.isBlank(param.getAmount())) {
+            throw new BusinessException("运输总量不能为空");
+        }
+        if (StringUtils.isBlank(param.getContacts())) {
+            throw new BusinessException("联系人姓名不能为空");
+        }
+        if (StringUtils.isBlank(param.getPhone())) {
+            throw new BusinessException("联系人电话不能为空");
+        }
+        if (Objects.isNull(param.getLoadAreaCode())) {
+            throw new BusinessException("装货区域code不能为空");
+        }
+        if (StringUtils.isBlank(param.getLoadAreaName())) {
+            throw new BusinessException("装货区域名称不能为空");
+        }
+        if (Objects.isNull(param.getUnloadAreaCode())) {
+            throw new BusinessException("卸货区域code不能为空");
+        }
+        if (StringUtils.isBlank(param.getUnloadAreaName())) {
+            throw new BusinessException("卸货区域名称不能为空");
+        }
     }
 
     /**
@@ -82,7 +176,68 @@ public class KwoTransportDemandService {
      * @return: com.sckw.core.model.page.PageResult
      */
     public PageResult select(SelectTransportDemandParam param) {
-        return null;
+        LambdaQueryWrapper<KwoTransportDemand> wrapper = buildWrapper(BeanUtils.copyProperties(param, ExportTransportDemandParam.class));
+        IPage<KwoTransportDemand> page = new Page<>(param.getPage(), param.getPageSize());
+        IPage<KwoTransportDemand> demandPage = kwoTransportDemandMapper.selectPage(page, wrapper);
+        List<KwoTransportDemand> list = demandPage.getRecords();
+        if (CollectionUtils.isEmpty(list)) {
+            return PageResult.build(param.getPage(), param.getPageSize(), demandPage.getTotal(), Collections.emptyList());
+        }
+        List<TransportDemandListRes> result = Lists.newArrayList();
+        list.forEach(e -> {
+            TransportDemandListRes demand = BeanUtils.copyProperties(e, TransportDemandListRes.class);
+            demand.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), e.getGoodsType()))
+                    .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), e.getTrading()))
+                    .setStatusLabel(DictEnum.getLabel(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType(), String.valueOf(e.getStatus())))
+                    .setLoadAddress(e.getLoadAreaName() + e.getLoadDetailAddress())
+                    .setUnloadAddress(e.getUnloadAreaName() + e.getUnloadDetailAddress());
+            result.add(demand);
+        });
+        return PageResult.build(param.getPage(), param.getPageSize(), demandPage.getTotal(), result);
+    }
+
+    /**
+     * @desc: 构建wrapper
+     * @author: yzc
+     * @date: 2023-07-26 14:00
+     * @Param param:
+     * @return: com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<com.sckw.order.model.KwoTransportDemand>
+     */
+    private LambdaQueryWrapper<KwoTransportDemand> buildWrapper(ExportTransportDemandParam param) {
+        LambdaQueryWrapper<KwoTransportDemand> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(KwoTransportDemand::getEntId, LoginUserHolder.getEntId()).eq(KwoTransportDemand::getDelFlag, Global.NO);
+        if (StringUtils.isNotBlank(param.getIds())) {
+            List<Long> ids = StringUtils.splitStrToList(param.getIds(), ",", Long.class);
+            wrapper.in(KwoTransportDemand::getId, ids);
+            return wrapper;
+        }
+        if (Objects.nonNull(param.getEndCreateTime())) {
+            wrapper.le(KwoTransportDemand::getCreateTime, DateUtil.offsetDay(param.getEndCreateTime(), 1));
+        }
+        wrapper.ge(Objects.nonNull(param.getStartCreateTime()), KwoTransportDemand::getCreateTime, param.getStartCreateTime())
+                .eq(Objects.nonNull(param.getStatus()), KwoTransportDemand::getStatus, param.getStatus())
+                .like(Objects.nonNull(param.getKeywords()), KwoTransportDemand::getName, param.getKeywords());
+        Integer loadCode = param.getLoadAreaCode();
+        if (Objects.nonNull(loadCode) && Objects.nonNull(param.getLoadAreaLevel())) {
+            switch (param.getLoadAreaLevel()) {
+                case 1 ->
+                        wrapper.likeRight(KwoTransportDemand::getLoadAreaCode, Integer.valueOf(String.valueOf(loadCode).substring(0, 2)));
+                case 2 ->
+                        wrapper.likeRight(KwoTransportDemand::getLoadAreaCode, Integer.valueOf(String.valueOf(loadCode).substring(0, 4)));
+                case 3 -> wrapper.eq(KwoTransportDemand::getLoadAreaCode, loadCode);
+            }
+        }
+        Integer unloadCode = param.getUnloadAreaCode();
+        if (Objects.nonNull(unloadCode) && Objects.nonNull(param.getLoadAreaLevel())) {
+            switch (param.getUnloadAreaLevel()) {
+                case 1 ->
+                        wrapper.likeRight(KwoTransportDemand::getUnloadAreaCode, Integer.valueOf(String.valueOf(unloadCode).substring(0, 2)));
+                case 2 ->
+                        wrapper.likeRight(KwoTransportDemand::getUnloadAreaCode, Integer.valueOf(String.valueOf(unloadCode).substring(0, 4)));
+                case 3 -> wrapper.eq(KwoTransportDemand::getUnloadAreaCode, unloadCode);
+            }
+        }
+        return wrapper;
     }
 
     /**
@@ -93,7 +248,24 @@ public class KwoTransportDemandService {
      * @return: com.sckw.core.model.vo.TableStatisticRes
      */
     public TableStatisticRes statistic(StatisticTransportDemandParam param) {
-        return null;
+        TableStatisticRes res = new TableStatisticRes();
+        LambdaQueryWrapper<KwoTransportDemand> wrapper = buildWrapper(BeanUtils.copyProperties(param, ExportTransportDemandParam.class));
+        List<KwoTransportDemand> demands = kwoTransportDemandMapper.selectList(wrapper);
+        Map<Integer, List<KwoTransportDemand>> map = demands.stream().collect(Collectors.groupingBy(KwoTransportDemand::getStatus));
+        List<TableTop> tableTops = new ArrayList<>();
+        List<DictEnum> enums = DictEnum.getEnumsByType(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType());
+        enums.forEach(e -> {
+            Integer value = Integer.valueOf(e.getValue());
+            List<KwoTransportDemand> list = map.get(value);
+            int total = CollectionUtils.isEmpty(list) ? 0 : list.size();
+            TableTop tableTop = new TableTop();
+            tableTop.setName(e.getLabel()).setValue(value).setTotal(total);
+            tableTops.add(tableTop);
+        });
+        TableBottom tableBottom = new TableBottom();
+        tableBottom.setTotal(CollectionUtils.isEmpty(demands) ? 0 : demands.size());
+        res.setTableTops(tableTops).setTableBottom(tableBottom);
+        return res;
     }
 
     /**
@@ -104,7 +276,24 @@ public class KwoTransportDemandService {
      * @return: java.util.List<com.sckw.order.model.dto.TransportDemandExport>
      */
     public List<TransportDemandExport> export(ExportTransportDemandParam param) {
-        return null;
+        LambdaQueryWrapper<KwoTransportDemand> wrapper = buildWrapper(param);
+        List<KwoTransportDemand> demands = kwoTransportDemandMapper.selectList(wrapper);
+        if (CollectionUtils.isEmpty(demands)) {
+            return Collections.emptyList();
+        }
+        List<TransportDemandExport> result = Lists.newArrayList();
+        demands.forEach(e -> {
+            TransportDemandExport export = BeanUtils.copyProperties(e, TransportDemandExport.class);
+            export.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), e.getGoodsType()))
+                    .setStatusLabel(DictEnum.getLabel(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType(), String.valueOf(e.getStatus())))
+                    .setLoadAddress(e.getLoadAreaName() + e.getLoadDetailAddress())
+                    .setUnloadAddress(e.getUnloadAreaName() + e.getUnloadDetailAddress())
+                    .setDeadline(Objects.isNull(e.getDeadline()) ? null : DateUtil.dateToStr(e.getDeadline()))
+                    .setCreateTime(Objects.isNull(e.getCreateTime()) ? null : DateUtil.getDateTime(e.getCreateTime()))
+                    .setUpdateTime(Objects.isNull(e.getUpdateTime()) ? null : DateUtil.getDateTime(e.getUpdateTime()));
+            result.add(export);
+        });
+        return result;
     }
 
     /**
@@ -115,7 +304,22 @@ public class KwoTransportDemandService {
      * @return: void
      */
     public void putOnShelves(Long id) {
-
+        KwoTransportDemand demand = getById(id);
+        if (Objects.isNull(demand)) {
+            throw new BusinessException("数据不存在!");
+        }
+        if (!Objects.equals(demand.getEntId(), LoginUserHolder.getEntId())) {
+            throw new BusinessException("无操作权限!");
+        }
+        if (Objects.equals(String.valueOf(demand.getStatus()), DictEnum.TRANSPORT_DEMAND_STATUS_1.getValue())) {
+            throw new BusinessException("上架操作仅针对“已下架”“草稿”状态的单据!");
+        }
+        if (Objects.equals(String.valueOf(demand.getStatus()), DictEnum.TRANSPORT_DEMAND_STATUS_0.getValue())) {
+            UpdateTransportDemandParam param = BeanUtils.copyProperties(demand, UpdateTransportDemandParam.class);
+            checkParams(param);
+        }
+        demand.setStatus(Integer.valueOf(DictEnum.TRANSPORT_DEMAND_STATUS_1.getValue()));
+        kwoTransportDemandMapper.updateById(demand);
     }
 
     /**
@@ -126,7 +330,18 @@ public class KwoTransportDemandService {
      * @return: void
      */
     public void batchTakeOffShelves(List<Long> ids) {
-
+        LambdaQueryWrapper<KwoTransportDemand> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(KwoTransportDemand::getId, ids)
+                .eq(KwoTransportDemand::getStatus, Integer.valueOf(DictEnum.TRANSPORT_DEMAND_STATUS_1.getValue()))
+                .eq(KwoTransportDemand::getEntId, LoginUserHolder.getEntId()).eq(KwoTransportDemand::getDelFlag, Global.NO);
+        List<KwoTransportDemand> list = kwoTransportDemandMapper.selectList(wrapper);
+        if (!Objects.equals(ids.size(), list.size())) {
+            throw new BusinessException("下架操作仅针对“已上架”状态的单据");
+        }
+        LambdaUpdateWrapper<KwoTransportDemand> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.set(KwoTransportDemand::getStatus, Integer.valueOf(DictEnum.TRANSPORT_DEMAND_STATUS_2.getValue()))
+                .in(KwoTransportDemand::getId, ids);
+        kwoTransportDemandMapper.update(null, updateWrapper);
     }
 
     /**
@@ -137,7 +352,16 @@ public class KwoTransportDemandService {
      * @return: void
      */
     public void batchDelete(List<Long> ids) {
-
+        LambdaQueryWrapper<KwoTransportDemand> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(KwoTransportDemand::getId, ids).in(KwoTransportDemand::getStatus, 0, 2)
+                .eq(KwoTransportDemand::getEntId, LoginUserHolder.getEntId()).eq(KwoTransportDemand::getDelFlag, Global.NO);
+        List<KwoTransportDemand> list = kwoTransportDemandMapper.selectList(wrapper);
+        if (!Objects.equals(ids.size(), list.size())) {
+            throw new BusinessException("删除操作仅针对“已下架”“草稿”状态的单据");
+        }
+        LambdaUpdateWrapper<KwoTransportDemand> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.set(KwoTransportDemand::getDelFlag, Global.YES).in(KwoTransportDemand::getId, ids);
+        kwoTransportDemandMapper.update(null, updateWrapper);
     }
 
     /**
@@ -148,6 +372,58 @@ public class KwoTransportDemandService {
      * @return: com.sckw.core.model.page.PageResult
      */
     public PageResult demandSquaresList(TransportDemandSquaresParam param) {
-        return null;
+        Page<KwoTransportDemand> page = new Page<>(param.getPage(), param.getPageSize());
+        LambdaQueryWrapper<KwoTransportDemand> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(CollectionUtils.isNotEmpty(param.getGoodsTypes()), KwoTransportDemand::getGoodsType, param.getGoodsTypes())
+                .eq(KwoTransportDemand::getStatus, Integer.valueOf(DictEnum.TRANSPORT_DEMAND_STATUS_1.getValue()))
+                .eq(KwoTransportDemand::getDelFlag, Global.NO);
+        Integer loadCode = param.getLoadAreaCode();
+        if (Objects.nonNull(loadCode) && Objects.nonNull(param.getLoadAreaLevel())) {
+            switch (param.getLoadAreaLevel()) {
+                case 1 ->
+                        wrapper.likeRight(KwoTransportDemand::getLoadAreaCode, Integer.valueOf(String.valueOf(loadCode).substring(0, 2)));
+                case 2 ->
+                        wrapper.likeRight(KwoTransportDemand::getLoadAreaCode, Integer.valueOf(String.valueOf(loadCode).substring(0, 4)));
+                case 3 -> wrapper.eq(KwoTransportDemand::getLoadAreaCode, loadCode);
+            }
+        }
+        Integer unloadCode = param.getUnloadAreaCode();
+        if (Objects.nonNull(unloadCode) && Objects.nonNull(param.getLoadAreaLevel())) {
+            switch (param.getUnloadAreaLevel()) {
+                case 1 ->
+                        wrapper.likeRight(KwoTransportDemand::getUnloadAreaCode, Integer.valueOf(String.valueOf(unloadCode).substring(0, 2)));
+                case 2 ->
+                        wrapper.likeRight(KwoTransportDemand::getUnloadAreaCode, Integer.valueOf(String.valueOf(unloadCode).substring(0, 4)));
+                case 3 -> wrapper.eq(KwoTransportDemand::getUnloadAreaCode, unloadCode);
+            }
+        }
+        if (StringUtils.isNotBlank(param.getKeywords())) {
+            List<EntCacheResDto> entList = remoteSystemService.queryEntCacheByName(param.getKeywords());
+            List<Long> entIds = entList.stream().map(EntCacheResDto::getId).toList();
+            if (CollectionUtils.isNotEmpty(entIds)) {
+                wrapper.and(e -> e.in(KwoTransportDemand::getEntId, entIds).or().like(KwoTransportDemand::getName, param.getKeywords()));
+            } else {
+                wrapper.like(KwoTransportDemand::getName, param.getKeywords());
+            }
+        }
+        Page<KwoTransportDemand> kwpGoodsPage = kwoTransportDemandMapper.selectPage(page, wrapper);
+        List<KwoTransportDemand> list = kwpGoodsPage.getRecords();
+        if (CollectionUtils.isEmpty(list)) {
+            return PageResult.build(param.getPage(), param.getPageSize(), kwpGoodsPage.getTotal(), Collections.emptyList());
+        }
+        List<Long> entIds = list.stream().map(KwoTransportDemand::getEntId).toList();
+        Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntCacheMapByIds(entIds);
+        List<TransportDemandSquaresListRes> result = Lists.newArrayList();
+        list.forEach(e -> {
+            TransportDemandSquaresListRes res = BeanUtils.copyProperties(e, TransportDemandSquaresListRes.class);
+            EntCacheResDto ent = entMap.get(e.getEntId());
+            res.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), e.getGoodsType()))
+                    .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), e.getTrading()))
+                    .setLoadAddress(e.getLoadAreaName() + e.getLoadDetailAddress())
+                    .setUnloadAddress(e.getUnloadAreaName() + e.getUnloadDetailAddress())
+                    .setDemandUnit(Objects.nonNull(ent) ? ent.getFirmName() : null);
+            result.add(res);
+        });
+        return PageResult.build(param.getPage(), param.getPageSize(), kwpGoodsPage.getTotal(), result);
     }
 }

+ 1 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java

@@ -413,7 +413,7 @@ public class KwpGoodsService {
                 supplyEntIds.add(e.getSupplyEntId());
             }
             if (Objects.nonNull(e.getManager())){
-                supplyEntIds.add(e.getManager());
+                userIds.add(e.getManager());
             }
             if (Objects.nonNull(e.getCreateBy())){
                 userIds.add(e.getCreateBy());

+ 13 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java

@@ -6,6 +6,7 @@ import com.sckw.core.utils.CollectionUtils;
 import com.sckw.system.api.model.dto.res.*;
 import com.sckw.system.api.model.pojo.DeptInfoPojo;
 import com.sckw.system.dao.KwsEntDeptDao;
+import com.sckw.system.dao.KwsEntTypeDao;
 import com.sckw.system.model.*;
 import com.sckw.system.model.pojo.FindEntDeptInfoPojo;
 import com.sckw.system.model.vo.res.CertificateResVo;
@@ -44,6 +45,9 @@ public class RemoteBaseService {
     @Resource
     private KwsEntDeptDao kwsEntDeptDao;
 
+    @Resource
+    private KwsEntTypeDao kwsEntTypeDao;
+
 
     public KwsEnterpriseResDto queryEnterpriseById(Long id) {
         KwsEnterprise kwsEnterprise = kwsEnterpriseService.queryKwsEnterpriseById(id);
@@ -142,4 +146,13 @@ public class RemoteBaseService {
     public List<KwsEntDept> queryEntDeptCacheByIds(List<Long> entIds) {
         return kwsEntDeptDao.selectByEntPidList(entIds);
     }
+
+    public List<EntTypeResDto> queryEntTypeById(Long entId) {
+        List<KwsEntType> list = kwsEntTypeDao.findListByEntId(entId);
+        if (CollectionUtils.isEmpty(list)) {
+            return Collections.emptyList();
+        }
+
+        return BeanUtils.copyToList(list, EntTypeResDto.class);
+    }
 }

+ 4 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -216,6 +216,10 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
             BeanUtils.copyProperties(kwsEnterpriseResDto, entCacheResDto);
             entCacheResDto.setDeptInfo(remoteBaseService.queryDeftInfoByEntId(entId));
             entCacheResDto.setCertificateInfo(remoteBaseService.queryCertificateByEntId(entId));
+            List<EntTypeResDto> entTypeResDtos = remoteBaseService.queryEntTypeById(entId);
+            if (CollectionUtils.isNotEmpty(entTypeResDtos)) {
+                entCacheResDto.setEntTypes(String.join(Global.COMMA, entTypeResDtos.stream().map(EntTypeResDto::getType).map(String::valueOf).distinct().toList()));
+            }
             RedissonUtils.putString(key, JSON.toJSONString(entCacheResDto), Global.COMMON_EXPIRE);
             return entCacheResDto;
         }

+ 9 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java

@@ -10,6 +10,7 @@ import com.sckw.system.api.model.dto.req.RegisterReqDto;
 import com.sckw.system.api.model.dto.req.UpdatePasswordReqDto;
 import com.sckw.system.api.model.dto.req.UserLoginReqDto;
 import com.sckw.system.api.model.dto.res.*;
+import com.sckw.system.dao.KwsEntTypeDao;
 import com.sckw.system.dao.KwsEnterpriseDao;
 import com.sckw.system.dao.KwsUserLoginDao;
 import com.sckw.system.dao.SysDictDao;
@@ -56,6 +57,9 @@ public class RemoteUserServiceImpl implements RemoteUserService {
     @Resource
     private KwsEnterpriseDao kwsEnterpriseDao;
 
+    @Resource
+    private KwsEntTypeDao kwsEntTypeDao;
+
     @Resource
     private SysDictDao sysDictDao;
 
@@ -164,6 +168,11 @@ public class RemoteUserServiceImpl implements RemoteUserService {
         kwsUserService.checkAccountValid(phone, systemType);
     }
 
+    @Override
+    public List<EntTypeResDto> queryEntTypeById(Long entId) {
+        return remoteBaseService.queryEntTypeById(entId);
+    }
+
     @Override
     public KwsUserResDto getUserByAccount(String username) {
         return remoteBaseService.getUserByAccount(username);

+ 1 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/CommonService.java

@@ -19,7 +19,7 @@ import java.util.List;
 
 /**
  * @author czh
- * @desc TODO
+ * @desc 公共方法
  * @date 2023/6/30
  */
 @Service