czh 2 سال پیش
والد
کامیت
d569bc974a
19فایلهای تغییر یافته به همراه144 افزوده شده و 100 حذف شده
  1. 2 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java
  2. 1 1
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java
  3. 5 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/SysDictResDto.java
  4. 0 5
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractTradeUnit.java
  5. 3 1
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java
  6. 5 4
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsTrackService.java
  7. 2 1
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractTradeService.java
  8. 1 0
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsMapper.xml
  9. 1 0
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeMapper.xml
  10. 2 2
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeUnitMapper.xml
  11. 1 1
      sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsEnterpriseController.java
  12. 2 2
      sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsUserController.java
  13. 28 6
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java
  14. 11 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/KwsEnterprise.java
  15. 55 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/UpdateEntInfoReqVo.java
  16. 10 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/EntDetailResVo.java
  17. 2 71
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java
  18. 4 3
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsUserService.java
  19. 9 1
      sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

+ 2 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java

@@ -54,8 +54,8 @@ public enum DictEnum {
     SETTLEMENT_CYCLE_0("settlement_cycle", "0", "周结"),
     SETTLEMENT_CYCLE_1("settlement_cycle", "1", "月结"),
     SETTLEMENT_CYCLE_2("settlement_cycle", "2", "季结"),
-    SIGNING_TYPE_0("signing_type", "0", "线上签约"),
-    SIGNING_TYPE_1("signing_type", "1", "线下签约"),
+    SIGNING_TYPE_1("signing_type", "1", "线上签约"),
+    SIGNING_TYPE_2("signing_type", "2", "线下签约"),
     TORDER_ADDRESS_TYPE_1("tOrder_address_type", "1", "装货地址"),
     TORDER_ADDRESS_TYPE_2("tOrder_address_type", "2", "卸货地址"),
     TORDER_UNIT_TYPE_1("tOrder_unit_type", "1", "采购单位"),

+ 1 - 1
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java

@@ -58,7 +58,7 @@ public interface RemoteSystemService {
     List<SysDictGroupResDto> queryDictGroupByType(String type);
 
     /**
-     * @param type 字典类型
+     * @param type 字典类型 value key
      * @return SysDictResDto
      * @desc: 根据字典类型和key查最底层的数据
      * @author: czh

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

@@ -31,4 +31,9 @@ public class SysDictResDto implements Serializable {
      */
     private String label;
 
+    /**
+     * 类型
+     */
+    private String type;
+
 }

+ 0 - 5
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractTradeUnit.java

@@ -49,11 +49,6 @@ public class KwcContractTradeUnit implements Serializable {
      */
     private String phone;
 
-    /**
-     * 签约电话
-     */
-    private String signHone;
-
     /**
      * 备注
      */

+ 3 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java

@@ -152,7 +152,9 @@ public class KwcContractLogisticsService {
             throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.CONTRACT_NOT_EXISTS);
         }
 
-        addCheckedContract(reqVo);
+        //补充合同直接
+        submit(reqVo);
+//        addCheckedContract(reqVo);
     }
 
     /**

+ 5 - 4
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsTrackService.java

@@ -1,4 +1,5 @@
 package com.sckw.contract.service;
+
 import java.util.Date;
 
 import com.sckw.contract.dao.KwcContractLogisticsTrackMapper;
@@ -13,10 +14,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
-* @author PC
-* @description 针对表【kwc_contract_logistics_track(物流合同(承运合同/托运合同)-物流订单)】的数据库操作Service实现
-* @createDate 2023-07-13 13:36:19
-*/
+ * @author PC
+ * @description 针对表【kwc_contract_logistics_track(物流合同(承运合同/托运合同)-物流订单)】的数据库操作Service实现
+ * @createDate 2023-07-13 13:36:19
+ */
 @Service
 public class KwcContractLogisticsTrackService {
 

+ 2 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractTradeService.java

@@ -207,7 +207,8 @@ public class KwcContractTradeService {
             throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.CONTRACT_NOT_EXISTS);
         }
 
-        addTradeContract(reqVo);
+        submit(reqVo);
+//        addTradeContract(reqVo);
     }
 
 

+ 1 - 0
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsMapper.xml

@@ -80,6 +80,7 @@
           </if>
           <if test="keywords != null and keywords != ''">
               and (b.firm_name like concat('%', #{keywords}, '%') or
+                   e.firm_name like concat('%', #{keywords}, '%') or
                    b.contacts like concat('%', #{keywords}, '%') or
                    b.phone like concat('%', #{keywords}, '%') or
                    b.sign_phone like concat('%', #{keywords}, '%'))

+ 1 - 0
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeMapper.xml

@@ -78,6 +78,7 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (b.firm_name like concat('%', #{keywords}, '%') or
+                 e.firm_name like concat('%', #{keywords}, '%') or
                  b.contacts like concat('%', #{keywords}, '%') or
                  b.phone like concat('%', #{keywords}, '%') or
                  b.sign_phone like concat('%', #{keywords}, '%'))

+ 2 - 2
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeUnitMapper.xml

@@ -12,7 +12,7 @@
             <result property="firm_name" column="firm_name" jdbcType="VARCHAR"/>
             <result property="contacts" column="contacts" jdbcType="VARCHAR"/>
             <result property="phone" column="phone" jdbcType="VARCHAR"/>
-            <result property="sign_hone" column="sign_hone" jdbcType="VARCHAR"/>
+            <result property="sign_phone" column="sign_phone" jdbcType="VARCHAR"/>
             <result property="remark" column="remark" jdbcType="VARCHAR"/>
             <result property="status" column="status" jdbcType="INTEGER"/>
             <result property="create_by" column="create_by" jdbcType="BIGINT"/>
@@ -25,7 +25,7 @@
     <sql id="Base_Column_List">
         id,ent_id,contract_id,
         unit_type,firm_name,contacts,
-        phone,sign_hone,remark,
+        phone,sign_phone,remark,
         status,create_by,create_time,
         update_by,update_time,del_flag
     </sql>

+ 1 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsEnterpriseController.java

@@ -119,7 +119,7 @@ public class KwsEnterpriseController {
      **/
     @Deprecated
     @PostMapping("/update")
-    public HttpResult update(@RequestBody KwsEnterpriseReqVo reqVo) throws SystemException {
+    public HttpResult update(@RequestBody UpdateEntInfoReqVo reqVo) throws SystemException {
         kwsEntService.update(reqVo);
         return HttpResult.ok(HttpStatus.MSG_005);
     }

+ 2 - 2
sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsUserController.java

@@ -163,8 +163,8 @@ public class KwsUserController {
     }
 
     @PostMapping("testEdit")
-    public HttpResult testEdit() {
-        return HttpResult.ok(kwsUserService.test());
+    public HttpResult testEdit(@RequestParam String type, @RequestParam String value) {
+        return HttpResult.ok(kwsUserService.test(type, value));
     }
 
     @PostMapping("testApprove")

+ 28 - 6
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -75,7 +75,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
     public Map<String, SysDictResDto> queryDictMapByType(String type) {
         List<SysDictResDto> sysDictResDtos = queryDictByType(type);
         if (CollectionUtils.isEmpty(sysDictResDtos)) {
-            return new HashMap<>();
+            return new HashMap<>(1);
         }
 
         return sysDictResDtos.stream().collect(Collectors.toMap(SysDictResDto::getValue, v->v));
@@ -162,9 +162,35 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
         return list;
     }
 
+
+    /**
+     * @param type 字典类型 value key
+     * @return SysDictResDto
+     * @desc: 根据字典类型和key查最底层的数据
+     * @author: czh
+     * @date: 2023/7/7
+     */
     @Override
     public List<SysDictResDto> queryDictBottom(String type, String value) {
-        return null;
+        SysDictGroupResDto sysDictGroupResDto = queryDictGroupByTypeAndValue(type, value);
+        if (Objects.isNull(sysDictGroupResDto)) {
+            return Collections.emptyList();
+        }
+
+        return BeanUtils.copyToList(checkNextLevelDict(sysDictGroupResDto.getChild()), SysDictResDto.class);
+    }
+
+    private List<SysDictGroupResDto> checkNextLevelDict(List<SysDictGroupResDto> list) {
+        List<SysDictGroupResDto> sysDictGroupResDtos = list.stream().filter(item -> CollectionUtils.isNotEmpty(item.getChild())).toList();
+        if (CollectionUtils.isEmpty(sysDictGroupResDtos)) {
+            return list;
+        }
+
+        List<SysDictGroupResDto> child = new ArrayList<>();
+        for (SysDictGroupResDto sysDictGroupResDto : sysDictGroupResDtos) {
+            child.addAll(sysDictGroupResDto.getChild());
+        }
+        return checkNextLevelDict(child);
     }
 
     /**
@@ -433,10 +459,6 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
             return null;
         }
 
-        if (Objects.isNull(kwsEnterpriseResDto.getManager())) {
-            return null;
-        }
-
         return queryUserCacheById(kwsEnterpriseResDto.getManager());
     }
 

+ 11 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/KwsEnterprise.java

@@ -121,4 +121,15 @@ public class KwsEnterprise extends BaseModel {
      * 专属客户经理(用户ID)
      */
     private Long manager;
+
+    /**
+     * 官网
+     */
+    private String website;
+
+    /**
+     * 主营业务
+     */
+    private String business;
+
 }

+ 55 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/UpdateEntInfoReqVo.java

@@ -0,0 +1,55 @@
+package com.sckw.system.model.vo.req;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 更新企业信息
+ * @date 2023/7/27
+ */
+@Data
+public class UpdateEntInfoReqVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -8027260827607157244L;
+
+    /**
+     * 法人姓名
+     */
+    private String legalName;
+
+    /**
+     * 法人联系电话
+     */
+    private String legalPhone;
+
+    /**
+     * 区域code
+     */
+    private Integer cityCode;
+
+    /**
+     * 区域名
+     */
+    private String cityName;
+
+    /**
+     * 详细地址
+     */
+    private String detailAddress;
+
+    /**
+     * 官网
+     */
+    private String website;
+
+    /**
+     * 主营业务
+     */
+    private String business;
+
+
+}

+ 10 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/EntDetailResVo.java

@@ -131,4 +131,14 @@ public class EntDetailResVo implements Serializable {
      * 企业属性
      */
     private String entTypes;
+
+    /**
+     * 官网
+     */
+    private String website;
+
+    /**
+     * 主营业务
+     */
+    private String business;
 }

+ 2 - 71
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -122,83 +122,14 @@ public class KwsEnterpriseService {
      * @date: 2023/6/19
      */
     @Transactional(rollbackFor = Exception.class)
-    public void update(KwsEnterpriseReqVo reqVo) throws SystemException {
+    public void update(UpdateEntInfoReqVo reqVo) throws SystemException {
         /*1、更新企业信息表*/
-        long entId = reqVo.getId();
-        KwsEnterprise kwsEnterprise = checkKwsEnterpriseById(entId);
+        KwsEnterprise kwsEnterprise = checkKwsEnterpriseById(LoginUserHolder.getEntId());
         BeanUtils.copyProperties(reqVo, kwsEnterprise);
         if (kwsEnterpriseDao.update(kwsEnterprise) <= 0) {
             throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
         }
 
-//        /*2、更新企业类型*/
-//        List<KwsEntType> kwsEntTypes = kwsEntTypeDao.findListByEntId(entId);
-//        List<String> typeReqList = new ArrayList<>();
-//        String entTypes = reqVo.getEntTypes();
-//        if (StringUtils.isNotBlank(entTypes)) {
-//            typeReqList = Arrays.stream(entTypes.split(",")).toList();
-//        }
-//
-//        //若入参传来的type在表里面本来就有则不管,没有就新增
-//        typeReqList.forEach(item -> {
-//            if (CollectionUtils.isEmpty(kwsEntTypes) || kwsEntTypes.stream().anyMatch(x -> x.getType() == Integer.parseInt(item))) {
-//                return;
-//            }
-//
-//            KwsEntType kwsEntType = new KwsEntType();
-//            kwsEntType.setEntId(entId);
-//            kwsEntType.setType(Integer.parseInt(item));
-//            if (kwsEntTypeDao.insert(kwsEntType) <= 0) {
-//                throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
-//            }
-//        });
-//
-//        //若表里的type没有在入参传来的type里则做逻辑删除,有就不管
-//        if (CollectionUtils.isNotEmpty(kwsEntTypes)) {
-//            List<String> finalTypeReqList = typeReqList;
-//            kwsEntTypes.forEach(item -> {
-//                if (finalTypeReqList.contains(String.valueOf(item.getType()))) {
-//                    item.setDelFlag(Global.YES);
-//                    if (kwsEntTypeDao.update(item) <= 0) {
-//                        throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
-//                    }
-//                }
-//            });
-//        }
-//
-//        /*更新证书信息*/
-//        //1、没有传则全部删除
-//        List<BusinessLicense> certificates = reqVo.getCertificates();
-//        if (CollectionUtils.isEmpty(certificates)) {
-//            List<KwsEntCertificate> kwsEntCertificates = kwsEntCertificateDao.selectByEntId(entId);
-//            if (!CollectionUtils.isEmpty(kwsEntCertificates)) {
-//                kwsEntCertificates.forEach(item -> {
-//                    item.setDelFlag(Global.YES);
-//                    if (kwsEntCertificateDao.update(item) <= 0) {
-//                        throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
-//                    }
-//                });
-//            }
-//            return;
-//        }
-//
-//        certificates.forEach(item -> {
-//            long id = item.getId();
-//            if (Objects.isNull(id)) {
-//                KwsEntCertificate kwsEntCertificate = new KwsEntCertificate();
-//                kwsEntCertificate.setEntId(entId);
-//                BeanUtils.copyProperties(item, kwsEntCertificate);
-//                if (kwsEntCertificateDao.insert(kwsEntCertificate) <= 0) {
-//                    throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
-//                }
-//                return;
-//            }
-//
-//            KwsEntCertificate kwsEntCertificate = checkEntCertificate(id);
-//            BeanUtils.copyProperties(item, kwsEntCertificate);
-//            //不做更新条数校验
-//            kwsEntCertificateDao.update(kwsEntCertificate);
-//        });
     }
 
     /**

+ 4 - 3
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsUserService.java

@@ -11,6 +11,7 @@ import com.sckw.redis.utils.RedissonUtils;
 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.res.RegisterResDto;
+import com.sckw.system.api.model.dto.res.SysDictResDto;
 import com.sckw.system.dao.*;
 import com.sckw.system.dubbo.RemoteSystemServiceImpl;
 import com.sckw.system.model.*;
@@ -20,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.*;
 
@@ -584,9 +586,8 @@ public class KwsUserService {
         updatePwd(reqVo.getNewPassword(), kwsUser);
     }
 
-    public String test() {
-        remoteSystemService.queryEntTreeByIds(Collections.singletonList(Long.parseLong("156382319450525696")));
-        return "";
+    public List<SysDictResDto> test(String type, String value) {
+        return remoteSystemService.queryDictBottom(type, value);
     }
 
 }

+ 9 - 1
sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

@@ -32,13 +32,15 @@
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
+    <result column="website" jdbcType="VARCHAR" property="website" />
+    <result column="business" jdbcType="VARCHAR" property="business" />
   </resultMap>
 
   <sql id="Base_Column_List">
     id, firm_name, code, contacts, phone, legal_name, legal_phone, head, integral,
     balance, experience, member_level, reg_time, reg_source, org_code, city_code, detail_address, 
     lat, lng, approval, approval_time, manager, remark, status, create_by, create_time, 
-    update_by, update_time, del_flag,city_name
+    update_by, update_time, del_flag,city_name, website, business
   </sql>
 
   <select id="selectByKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -528,6 +530,12 @@
       <if test="delFlag != null">
         del_flag = #{delFlag,jdbcType=INTEGER},
       </if>
+      <if test="website != null">
+        website = #{website,jdbcType=VARCHAR},
+      </if>
+      <if test="business != null">
+        business = #{business,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>