Browse Source

企业增加品牌

huangxiao 1 month ago
parent
commit
78c860688e

+ 9 - 0
src/main/java/net/mingsoft/tf/action/EnterpriseAction.java

@@ -91,6 +91,7 @@ public class EnterpriseAction extends BaseAction{
     @Parameters({
         @Parameter(name = "enterpriseName", description = "企业名称", in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseType", description = "企业类型", in = ParameterIn.QUERY),
+        @Parameter(name = "enterpriseBrand", description = "品牌名", in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseBooth", description = "展位号", in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseVisits", description = "访问量", in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseContact", description = "联系人", in = ParameterIn.QUERY),
@@ -142,6 +143,7 @@ public class EnterpriseAction extends BaseAction{
     @Parameters({
         @Parameter(name = "enterpriseName", description = "企业名称", required = true, in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseType", description = "企业类型", required = false, in = ParameterIn.QUERY),
+        @Parameter(name = "enterpriseBrand", description = "品牌名", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseBooth", description = "展位号", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseVisits", description = "访问量", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseContact", description = "联系人", required = false, in = ParameterIn.QUERY),
@@ -165,6 +167,9 @@ public class EnterpriseAction extends BaseAction{
         if (!StringUtil.checkLength(enterprise.getEnterpriseName()+"", 0, 255)) {
           return ResultData.build().error(getResString("err.length", this.getResString("enterprise.name"), "0", "255"));
         }
+        if (  StringUtils.isNotBlank(enterprise.getEnterpriseBrand()) && !StringUtil.checkLength(enterprise.getEnterpriseBrand()+"", 0, 255)) {
+          return ResultData.build().error(getResString("err.length", this.getResString("enterprise.brand"), "0", "255"));
+        }
         if (  StringUtils.isNotBlank(enterprise.getEnterpriseBooth()) && !StringUtil.checkLength(enterprise.getEnterpriseBooth()+"", 0, 255)) {
           return ResultData.build().error(getResString("err.length", this.getResString("enterprise.booth"), "0", "255"));
         }
@@ -209,6 +214,7 @@ public class EnterpriseAction extends BaseAction{
         @Parameter(name = "id", description = "主键ID", required =true,in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseName", description = "企业名称", required = true, in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseType", description = "企业类型", required = false, in = ParameterIn.QUERY),
+        @Parameter(name = "enterpriseBrand", description = "品牌名", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseBooth", description = "展位号", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseVisits", description = "访问量", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "enterpriseContact", description = "联系人", required = false, in = ParameterIn.QUERY),
@@ -237,6 +243,9 @@ public class EnterpriseAction extends BaseAction{
         if (!StringUtil.checkLength(enterprise.getEnterpriseName()+"", 0, 255)) {
           return ResultData.build().error(getResString("err.length", this.getResString("enterprise.name"), "0", "255"));
         }
+        if (  StringUtils.isNotBlank(enterprise.getEnterpriseBrand()) && !StringUtil.checkLength(enterprise.getEnterpriseBrand()+"", 0, 255)) {
+          return ResultData.build().error(getResString("err.length", this.getResString("enterprise.brand"), "0", "255"));
+        }
         if (  StringUtils.isNotBlank(enterprise.getEnterpriseBooth()) && !StringUtil.checkLength(enterprise.getEnterpriseBooth()+"", 0, 255)) {
           return ResultData.build().error(getResString("err.length", this.getResString("enterprise.booth"), "0", "255"));
         }

+ 2 - 1
src/main/java/net/mingsoft/tf/biz/impl/EnterpriseBizImpl.java

@@ -34,7 +34,8 @@ public class EnterpriseBizImpl extends BaseBizImpl<IEnterpriseDao, EnterpriseEnt
     public List<EnterpriseEntity> queryByName(String name) {
         return enterpriseDao.selectList(new LambdaQueryWrapper<>(EnterpriseEntity.class)
                 .like(EnterpriseEntity::getEnterpriseName, name)
-                // .isNotNull(EnterpriseEntity::getEnterpriseBooth)
+                .or()
+                .like(EnterpriseEntity::getEnterpriseBrand, name)
         );
     }
 }

+ 1 - 0
src/main/java/net/mingsoft/tf/dao/IEnterpriseDao.xml

@@ -5,6 +5,7 @@
 	<resultMap id="resultMap" type="net.mingsoft.tf.entity.EnterpriseEntity">
 				<result column="ENTERPRISE_NAME" property="enterpriseName" /><!--企业名称 -->
 				<result column="ENTERPRISE_TYPE" property="enterpriseType" /><!--企业类型 -->
+				<result column="ENTERPRISE_BRAND" property="enterpriseBrand" /><!--品牌名 -->
 				<result column="ENTERPRISE_BOOTH" property="enterpriseBooth" /><!--展位号 -->
 				<result column="ENTERPRISE_VISITS" property="enterpriseVisits" /><!--访问量 -->
 				<result column="ENTERPRISE_CONTACT" property="enterpriseContact" /><!--联系人 -->

+ 18 - 0
src/main/java/net/mingsoft/tf/entity/EnterpriseEntity.java

@@ -36,6 +36,11 @@ private static final long serialVersionUID = 1765597336717L;
     
     private String enterpriseType;
     /**
+    * 品牌名
+    */
+    @TableField(condition = SqlCondition.LIKE)
+    private String enterpriseBrand;
+    /**
     * 展位号
     */
     @TableField(condition = SqlCondition.LIKE)
@@ -111,6 +116,19 @@ private static final long serialVersionUID = 1765597336717L;
         return this.enterpriseType;
     }
     /**
+    * 设置品牌名
+    */
+    public void setEnterpriseBrand(String enterpriseBrand) {
+        this.enterpriseBrand = enterpriseBrand;
+    }
+
+    /**
+    * 获取品牌名
+    */
+    public String getEnterpriseBrand() {
+        return this.enterpriseBrand;
+    }
+    /**
     * 设置展位号
     */
     public void setEnterpriseBooth(String enterpriseBooth) {

+ 1 - 0
src/main/java/net/mingsoft/tf/resources/resources_en_US.properties

@@ -27,6 +27,7 @@ channel=channel
 purpose=purpose
 enterprise.name=enterprise name
 enterprise.type=enterprise type
+enterprise.brand=enterprise brand
 enterprise.booth=enterprise booth
 enterprise.visits=enterprise visits
 enterprise.contact=enterprise contact

+ 1 - 0
src/main/java/net/mingsoft/tf/resources/resources_zh_CN.properties

@@ -27,6 +27,7 @@ channel=\u4e86\u89e3\u6e20\u9053
 purpose=\u53c2\u89c2\u76ee\u7684
 enterprise.name=\u4f01\u4e1a\u540d\u79f0
 enterprise.type=\u4f01\u4e1a\u7c7b\u578b
+enterprise.brand=\u54c1\u724c\u540d
 enterprise.booth=\u5c55\u4f4d\u53f7
 enterprise.visits=\u8bbf\u95ee\u91cf
 enterprise.contact=\u8054\u7cfb\u4eba

+ 3 - 1
src/main/java/net/mingsoft/tf/wx/ExhibitorAction.java

@@ -18,6 +18,7 @@ import net.mingsoft.tf.biz.impl.ExhibitorBizImpl;
 import net.mingsoft.tf.entity.ExhibitionEntity;
 import net.mingsoft.tf.entity.ExhibitorEntity;
 import net.mingsoft.tf.wx.dto.ExhibitorInfoResponse;
+import net.mingsoft.tf.wx.dto.ExhibitorQueryResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
@@ -112,12 +113,13 @@ public class ExhibitorAction extends BaseAction {
                 .map(enterpriseBiz::queryByName)
                 .flatMap(Collection::stream)
                 .map(item -> {
-                    ExhibitorEntity ee = new ExhibitorEntity();
+                    ExhibitorQueryResponse ee = new ExhibitorQueryResponse();
                     ee.setId(item.getId());
                     ee.setExhibitorName(item.getEnterpriseName());
                     ee.setExhibitorBooth(item.getEnterpriseBooth());
                     ee.setExhibitorLogo(item.getEnterpriseLogo());
                     ee.setExhibitorIntroduction(item.getEnterpriseIntroduction());
+                    ee.setBrandStr(item.getEnterpriseBrand());
                     return ee;
                 })
                 .peek(item -> {

+ 24 - 0
src/main/java/net/mingsoft/tf/wx/dto/ExhibitorQueryResponse.java

@@ -0,0 +1,24 @@
+package net.mingsoft.tf.wx.dto;
+
+import cn.hutool.core.util.StrUtil;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import net.mingsoft.tf.entity.ExhibitorEntity;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ExhibitorQueryResponse extends ExhibitorEntity {
+    private List<String> brand;
+
+    public void setBrandStr(String brandStr) {
+        this.brand = splitBrand(brandStr);
+    }
+
+    public static List<String> splitBrand(String str) {
+        return Arrays.stream(str.split("[,,]")).filter(StrUtil::isNotBlank).collect(Collectors.toList());
+    }
+}

+ 19 - 1
src/main/webapp/WEB-INF/manager/tf/enterprise/form.ftl

@@ -49,6 +49,20 @@
 
                                 </el-col>
                         </el-row>
+            <!--品牌名-->
+
+	        <el-form-item  label="品牌名" prop="enterpriseBrand">
+	            <el-input
+                        v-model="form.enterpriseBrand"
+                         :disabled="false"
+                          :readonly="false"
+                          :style="{width:  '100%'}"
+                          :clearable="true"
+                        placeholder="请输入品牌名">
+                </el-input>
+                <div class="ms-form-tip">
+多个品牌名,使用中英逗号分隔                </div>
+	        </el-form-item>   
                         <el-row
                                 :gutter="0"
                                 justify="start" align="top">
@@ -217,6 +231,8 @@ placeholder="请选择入驻时间"                    :readonly="false"
                     enterpriseName:'',
                     				// 企业类型
                     				enterpriseType:"",
+                    // 品牌名
+                    enterpriseBrand:'',
                     // 展位号
                     enterpriseBooth:'',
                     // 访问量
@@ -240,6 +256,8 @@ placeholder="请选择入驻时间"                    :readonly="false"
                 rules:{
                         // 企业名称
                         enterpriseName: [{"type":"string","message":"企业名称格式不正确"},{"required":true,"message":"企业名称不能为空"},{"min":0,"max":255,"message":"企业名称长度必须为0-255"}],
+                        // 品牌名
+                        enterpriseBrand: [{"min":0,"max":255,"message":"品牌名长度必须为0-255"}],
                         // 展位号
                         enterpriseBooth: [{"min":0,"max":255,"message":"展位号长度必须为0-255"}],
                         // 访问量
@@ -331,7 +349,7 @@ placeholder="请选择入驻时间"                    :readonly="false"
                 ms.http.get(ms.manager + "/tf/enterprise/get.do", {"id":id}).then(function (res) {
                     that.loading = false
                     if(res.result&&res.data) {
-                                                         
+                                                                            
                    // 自定义模型需要根据控件配置转换
                      if(res.data.enterpriseVisits){
                      	res.data.enterpriseVisits=String(res.data.enterpriseVisits);

+ 33 - 4
src/main/webapp/WEB-INF/manager/tf/enterprise/index.ftl

@@ -51,6 +51,24 @@
 
                                         </el-col>
                                         <el-col :span=8>
+            <!--品牌名-->
+
+	        <el-form-item  label="品牌名" prop="enterpriseBrand">
+	            <el-input
+                        v-model="form.enterpriseBrand"
+                         :disabled="false"
+                          :readonly="false"
+                          :style="{width:  '100%'}"
+                          :clearable="true"
+                        placeholder="请输入品牌名">
+                </el-input>
+                <div class="ms-form-tip">
+多个品牌名,使用中英逗号分隔                </div>
+	        </el-form-item>   
+                                        </el-col>
+                        </el-row>
+                        <el-row>
+                                        <el-col :span=8>
             <!--展位号-->
 
 	        <el-form-item  label="展位号" prop="enterpriseBooth">
@@ -64,8 +82,6 @@
                 </el-input>
 	        </el-form-item>   
                                         </el-col>
-                        </el-row>
-                        <el-row>
                                         <el-col :span=8>
             <!--联系人-->
 
@@ -95,9 +111,11 @@
     </el-form-item>
 
                                         </el-col>
-                                <el-col :span=8 style="display: flex;justify-content: end;padding-right: 10px;">
+                        </el-row>
+                        <el-row>
+                                <el-col :span=24 style="display: flex;justify-content: end;padding-right: 10px;">
                                     <el-button type="primary" class="el-icon-search" size="default" @click="currentPage=1;list(true)">搜索</el-button>
-                                    <el-button @click="rest"  class="el-icon-refresh" size="default">重置</el-button>
+                                    <el-button @click="rest" class="el-icon-refresh" size="default">重置</el-button>
                                     <ms-search ref="search" @search="search" :search-json="searchJson" :search-key="historyKey"></ms-search>
                                 </el-col>
                         </el-row>
@@ -114,6 +132,8 @@
                             </el-table-column>
                         <el-table-column label="企业类型"   align="left" prop="enterpriseType" :formatter="enterpriseTypeFormat">
                         </el-table-column>
+                            <el-table-column label="品牌名"   align="left" prop="enterpriseBrand">
+                            </el-table-column>
                             <el-table-column label="展位号"   align="left" prop="enterpriseBooth">
                             </el-table-column>
                             <el-table-column label="访问量"   align="right" prop="enterpriseVisits">
@@ -214,6 +234,15 @@
 },    {
     "isSearch": "true",
     "action": "and",
+    "field": "ENTERPRISE_BRAND",
+    "el": "eq",
+    "model": "enterpriseBrand",
+    "name": "品牌名",
+    "type": "input"
+    },
+    {
+    "isSearch": "true",
+    "action": "and",
     "field": "ENTERPRISE_BOOTH",
     "el": "eq",
     "model": "enterpriseBooth",

+ 5 - 0
src/main/webapp/static/locale/lang/enterprise/en_US.js

@@ -5,6 +5,11 @@ var en_US ={
             placeholder:'',
             help:'',
         },
+        enterpriseBrand:{
+            text:'品牌名',
+            placeholder:'请输入品牌名',
+            help:'多个品牌名,使用中英逗号分隔',
+        },
         gridQobud:{
             text:'栅格布局',
             placeholder:'',

+ 5 - 0
src/main/webapp/static/locale/lang/enterprise/zh_CN.js

@@ -6,6 +6,11 @@ var zh_CN ={
             placeholder:'',
             help:'',
         },
+        enterpriseBrand:{
+            text:'品牌名',
+            placeholder:'请输入品牌名',
+            help:'多个品牌名,使用中英逗号分隔',
+        },
         gridQobud:{
             text:'栅格布局',
             placeholder:'',

+ 12 - 3
src/test/java/mingsoft/Main.java

@@ -1,12 +1,13 @@
 package mingsoft;
 
 import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.ZipUtil;
 import lombok.SneakyThrows;
-import mingsoft.client.Info;
 
 import java.io.File;
 import java.net.URL;
+import java.nio.file.StandardCopyOption;
 import java.util.Objects;
 import java.util.Optional;
 
@@ -45,7 +46,15 @@ public class Main {
     @SneakyThrows
     private static void copyToSrc(File unzip) {
         File codeSrc = new File(Objects.requireNonNull(unzip.listFiles())[0], "src/main").getCanonicalFile();
-        File localSrc = new File(doc, "../src").getCanonicalFile();
-        FileUtil.copy(codeSrc, localSrc, true);
+        File localSrc = new File(doc, "../src/main").getCanonicalFile();
+        FileUtil.loopFiles(codeSrc, pathname -> {
+            if (StrUtil.endWithAnyIgnoreCase(pathname.getName(), "BaseAction.java", "Const.java", "Biz.java", "BizImpl.java", "Dao.java")) {
+                return !new File(localSrc, pathname.toString().replace(codeSrc.toString(), "")).exists();
+            }
+            return true;
+        }).forEach(codeFile -> {
+            File localFile = new File(localSrc, codeFile.toString().replace(codeSrc.toString(), ""));
+            FileUtil.copyFile(codeFile, localFile, StandardCopyOption.REPLACE_EXISTING);
+        });
     }
 }