Przeglądaj źródła

硬件和商机

huangxiao 2 tygodni temu
rodzic
commit
b3688a476e

+ 3 - 0
src/main/java/net/mingsoft/tf/action/BusinessOpportunityAction.java

@@ -90,6 +90,7 @@ public class BusinessOpportunityAction extends net.mingsoft.tf.action.BaseAction
     @Operation(summary = "查询商机对接列表接口")
     @Parameters({
         @Parameter(name = "businessName", description = "名称", in = ParameterIn.QUERY),
+        @Parameter(name = "businessType", description = "类型", in = ParameterIn.QUERY),
         @Parameter(name = "businessInfo", description = "介绍", in = ParameterIn.QUERY),
     })
     @RequestMapping(value ="/list",method = {RequestMethod.GET,RequestMethod.POST})
@@ -133,6 +134,7 @@ public class BusinessOpportunityAction extends net.mingsoft.tf.action.BaseAction
     @Operation(summary = "保存商机对接列表接口")
     @Parameters({
         @Parameter(name = "businessName", description = "名称", required = false, in = ParameterIn.QUERY),
+        @Parameter(name = "businessType", description = "类型", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "businessInfo", description = "介绍", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "businessImg", description = "二维码", required = false, in = ParameterIn.QUERY),
     })
@@ -173,6 +175,7 @@ public class BusinessOpportunityAction extends net.mingsoft.tf.action.BaseAction
     @Parameters({
         @Parameter(name = "id", description = "主键ID", required =true,in = ParameterIn.QUERY),
         @Parameter(name = "businessName", description = "名称", required = false, in = ParameterIn.QUERY),
+        @Parameter(name = "businessType", description = "类型", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "businessInfo", description = "介绍", required = false, in = ParameterIn.QUERY),
         @Parameter(name = "businessImg", description = "二维码", required = false, in = ParameterIn.QUERY),
     })

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

@@ -4,6 +4,7 @@
 
 	<resultMap id="resultMap" type="net.mingsoft.tf.entity.BusinessOpportunityEntity">
 				<result column="BUSINESS_NAME" property="businessName" /><!--名称 -->
+				<result column="BUSINESS_TYPE" property="businessType" /><!--类型 -->
 				<result column="BUSINESS_INFO" property="businessInfo" /><!--介绍 -->
 				<result column="BUSINESS_IMG" property="businessImg" /><!--二维码 -->
 	</resultMap>

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

@@ -31,6 +31,11 @@ private static final long serialVersionUID = 1767173631548L;
     @TableField(condition = SqlCondition.LIKE)
     private String businessName;
     /**
+    * 类型
+    */
+    
+    private String businessType;
+    /**
     * 介绍
     */
     
@@ -56,6 +61,19 @@ private static final long serialVersionUID = 1767173631548L;
         return this.businessName;
     }
     /**
+    * 设置类型
+    */
+    public void setBusinessType(String businessType) {
+        this.businessType = businessType;
+    }
+
+    /**
+    * 获取类型
+    */
+    public String getBusinessType() {
+        return this.businessType;
+    }
+    /**
     * 设置介绍
     */
     public void setBusinessInfo(String businessInfo) {

+ 0 - 1
src/main/java/net/mingsoft/tf/entity/EnterpriseProductsEntity.java

@@ -68,7 +68,6 @@ private static final long serialVersionUID = 1767167218892L;
     /**
     * 公司ID
     */
-    @TableField(condition = SqlCondition.LIKE)
     private String productEnterpriseId;
     /**
     * 产品信息

+ 4 - 3
src/main/java/net/mingsoft/tf/resources/resources_en_US.properties

@@ -1,3 +1,7 @@
+business.name=business name
+business.type=business type
+business.info=business info
+business.img=business img
 collection.user=collection user
 collection.type=collection type
 collection.value=collection value
@@ -96,9 +100,6 @@ design.visits=design visits
 design.avatar=design avatar
 design.info=design info
 design.works=design works
-business.name=business name
-business.info=business info
-business.img=business img
 browse.data=browse data
 browse.visits=browse visits
 records.user=records user

+ 4 - 3
src/main/java/net/mingsoft/tf/resources/resources_zh_CN.properties

@@ -1,3 +1,7 @@
+business.name=\u540d\u79f0
+business.type=\u7c7b\u578b
+business.info=\u4ecb\u7ecd
+business.img=\u4e8c\u7ef4\u7801
 collection.user=\u7528\u6237
 collection.type=\u7c7b\u578b
 collection.value=\u503c
@@ -96,9 +100,6 @@ design.visits=\u8bbf\u95ee\u91cf
 design.avatar=\u5934\u50cf
 design.info=\u7b80\u4ecb
 design.works=\u4f5c\u54c1
-business.name=\u540d\u79f0
-business.info=\u4ecb\u7ecd
-business.img=\u4e8c\u7ef4\u7801
 browse.data=\u65e5\u671f
 browse.visits=\u8bbf\u95ee\u91cf
 records.user=\u7528\u6237

+ 14 - 0
src/main/java/net/mingsoft/tf/www/Browse2Action.java

@@ -49,4 +49,18 @@ public class Browse2Action {
         map.put("item", biz.queryForList("SELECT BROWSE_DATA, BROWSE_VISITS FROM mdiy_form_browse WHERE BROWSE_DATA >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) order by BROWSE_DATA"));
         return ResultData.build().success(map);
     }
+
+    @GetMapping(value = "/admission")
+    @ResponseBody
+    public ResultData admission() {
+        // 总入场量
+        Map<String, Object> map = new HashMap<>();
+        biz.queryForList("select sum(BROWSE_ADMISSION) as n from mdiy_form_browse")
+                .stream()
+                .findAny()
+                .ifPresent(m -> map.put("total", m.get("n")));
+        // 前30天
+        map.put("item", biz.queryForList("SELECT BROWSE_DATA, BROWSE_ADMISSION FROM mdiy_form_browse WHERE BROWSE_DATA >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) order by BROWSE_DATA"));
+        return ResultData.build().success(map);
+    }
 }

+ 1 - 0
src/main/java/net/mingsoft/tf/www/BrowseAction.java

@@ -46,6 +46,7 @@ public class BrowseAction {
     }
 
     private void incrementDailyVisits() {
+//        TODO 移到biz里,可保存入场量
         Date now = new Date();
         String time = DatePattern.NORM_DATE_FORMAT.format(now);
         if (day.contains(time)) {

+ 24 - 9
src/main/java/net/mingsoft/tf/wx/gate/GateAction.java

@@ -3,6 +3,7 @@ package net.mingsoft.tf.wx.gate;
 import lombok.extern.slf4j.Slf4j;
 import net.mingsoft.tf.biz.IGateService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
@@ -17,18 +18,20 @@ import java.time.format.DateTimeFormatter;
  */
 @Slf4j
 @Controller
-@RequestMapping("/gate")
+@RequestMapping("/api/SelfDevice")
 public class GateAction {
     @Autowired
     private IGateService gateService;
+    @Autowired
+    private Environment env;
 
     /**
      * 心跳
      */
     @ResponseBody
-    @GetMapping(value = "/heartbeat/{deviceNumber}")
+    @GetMapping(value = "/Conne/{deviceNumber}")
     public GateResults<String> heartbeat(@PathVariable("deviceNumber") String deviceNumber) {
-        String message = "heartbeat " + deviceNumber;
+        String message = "Conne " + deviceNumber;
         log.info(message);
         return GateResults.<String>builder()
                 .Code(200)
@@ -41,14 +44,18 @@ public class GateAction {
      * 上线
      */
     @ResponseBody
-    @PostMapping(value = "/online")
+    @PostMapping(value = "/DeviceOnline")
     public GateResults<GateOnlineResponse> online(@RequestBody GateOnlineRequest request) {
-        String message = "online " + request.toString();
+        String message = "DeviceOnline " + request.toString();
         log.info(message);
         return GateResults.<GateOnlineResponse>builder()
                 .Code(200)
                 .Message(message)
-                .Data(GateOnlineResponse.builder().build())
+                .Data(GateOnlineResponse.builder()
+                        .deviceNumber(request.getDeviceNumber())
+                        .deviceType(request.getDeviceType())
+                        .secretKey(env.getProperty("gate.key." + request.getDeviceNumber()))
+                        .build())
                 .build();
     }
 
@@ -56,17 +63,25 @@ public class GateAction {
      * 闸机核销验票接口
      */
     @ResponseBody
-    @PostMapping(value = "/ticketCheck")
+    @PostMapping(value = "/TicketVerify")
     public GateResults<TicketCheckResponse> ticketCheck(@RequestBody TicketCheckRequest request) {
-        String message = "ticketCheck " + request.toString();
+        String message = "TicketVerify " + request.toString();
         log.info(message);
+        TicketCheckResponse.TicketCheckResponseBuilder builder = TicketCheckResponse.builder()
+                .ticketCode(request.getTicketCode())
+                .code(0)
+                .msg("无效");
         if (gateService.checkCode(request.getTicketCode())) {
             // TODO 保存入场总数
+            // TODO 图表接口查入场总数
+            // TODO 展会没开始,不能进?
+            builder.code(1)
+                    .msg("通过");
         }
         return GateResults.<TicketCheckResponse>builder()
                 .Code(200)
                 .Message(message)
-                .Data(TicketCheckResponse.builder().build())
+                .Data(builder.build())
                 .build();
     }
 

+ 1 - 1
src/main/java/net/mingsoft/tf/wx/gate/GateOnlineRequest.java

@@ -5,5 +5,5 @@ import lombok.Data;
 @Data
 public class GateOnlineRequest {
     private String deviceNumber;
-    private String deviceType;
+    private Integer deviceType;
 }

+ 23 - 11
src/main/java/net/mingsoft/tf/wx/gate/GateOnlineResponse.java

@@ -3,23 +3,35 @@ package net.mingsoft.tf.wx.gate;
 import lombok.Builder;
 import lombok.Data;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @Data
 @Builder
 public class GateOnlineResponse {
-    private Integer companyId;
-    private Integer scenicId;
-    private Integer deviceId;
-    private String deviceName;
+    @Builder.Default
+    private Integer companyId = 0;
+    @Builder.Default
+    private Integer scenicId = 0;
+    @Builder.Default
+    private Integer deviceId = 0;
+    @Builder.Default
+    private String deviceName = "";
     private String deviceNumber;
     private Integer deviceType;
-    private Integer enterOut;
-    private String backdropImg;
-    private String advertVideoUrl;
-    private String mainTitle;
-    private String subTitle;
-    private Integer checkMode;
+    @Builder.Default
+    private Integer enterOut = 0;
+    @Builder.Default
+    private String backdropImg = "";
+    @Builder.Default
+    private String advertVideoUrl = "";
+    @Builder.Default
+    private String mainTitle = "mainTitle";
+    @Builder.Default
+    private String subTitle = "subTitle";
+    @Builder.Default
+    private Integer checkMode = 0;
     private String secretKey;
-    private List<String> loopImgList;
+    @Builder.Default
+    private List<String> loopImgList = new ArrayList<>();
 }

+ 17 - 8
src/main/java/net/mingsoft/tf/wx/gate/TicketCheckResponse.java

@@ -3,19 +3,28 @@ package net.mingsoft.tf.wx.gate;
 import lombok.Builder;
 import lombok.Data;
 
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+
 @Data
 @Builder
 public class TicketCheckResponse {
     private Integer code; //验票结果 0=无效票 1=验票成功
     private String msg; //提示信息/票名
-    private String source; //票来源
-    private String time; //开始时间
-    private String endTime; //结束时间
+    @Builder.Default
+    private String source = "小程序"; //票来源
+    private String time;
+    private String endTime;
     private String ticketCode; //门票码
-    private Integer checkMode; //验票模式: 0=一码一验 1=一码全验
-    private Integer count; //本次可通行人数
-    private Integer surplusCount; //剩余可通行人数
-    private Integer parkNumber; //入园总人数
-    private String faceImgUrl; //人脸图像
+    @Builder.Default
+    private Integer checkMode = 0; //验票模式: 0=一码一验 1=一码全验
+    @Builder.Default
+    private Integer count = 1; //本次可通行人数
+    @Builder.Default
+    private Integer surplusCount = 0; //剩余可通行人数
+    @Builder.Default
+    private Integer parkNumber = 0; //入园总人数
+    @Builder.Default
+    private String faceImgUrl = ""; //人脸图像
 
 }

+ 22 - 0
src/main/resources/application.yml

@@ -137,3 +137,25 @@ mybatis-plus:
       where-strategy: not_empty #防止空串及null拼接条件
   configuration:
     database-id: mysql
+
+gate.key:
+  9787dc1e82d9b99c: 7afc04fbb063d66c8408a2c00bb97f66
+  24725723aa53648f: d8397b93af42d1a345878373d177abff
+  80f7d644e7298115: 162805d60828d0a30f2fe722877b0da7
+  725cfafda0a4c3e6: cbac0ba278e7c532abe8b3d5b9803cf3
+  872bc8ed77cb5a1e: c19af972a129502bfa4f61710ef038f1
+  4b1323bc31b28b1c: 4d050420e60a7a7423ac45067e404531
+  6d6e234c4af0acbd: 41a70b67cea7eb52908bfad1e464be78
+  af27a2b52acb57af: 89021446f0c228f419a0d33bf65127f6
+  f160036fe29b4e2d: 9866cb50b8eeda9fbcd8653c2864a8c6
+  11ab953871ff98cd: 52ae2a7c277b67e82f0c8782be6a0c6c
+  e957904fb5d747a6: 6d9b3156c256f3e70ab06e53dd126196
+  cd9372f079b26107: 49f4ed18f039774538f728cb70f1fb78
+  111bee00bc2ec08e: 326af5e2ecd5f967eb07cfcc70e95d40
+  c5217deb895b27d2: 3dc48ab881056bed5b68a10b772fa324
+  2d86269c417d7f44: 2c005c15e63a799aeb64cba1637bb1a8
+  e18aed83d43ce041: 5a5da873353af5f668d6400e3feb3a79
+  6f50cf97ea9df74c: a0b7e709ccc3e098f9b8dc5ed305548b
+  b3ea931ebf1234ce: f49adf64de554bf354e9f02bd2287c63
+  d95d15f1511961ef: 051a3d8ea9b635faa5911c743ffb8afa
+  89fea89f0e6a2812: 48b737453c852af6a63abab574fa1fc7

+ 44 - 0
src/main/webapp/WEB-INF/manager/tf/business-opportunity/form.ftl

@@ -16,6 +16,10 @@
         <el-main class="ms-container" v-loading="loading">
             <el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="right" size="default">
 
+                        <el-row
+                                :gutter="0"
+                                justify="start" align="top">
+                                <el-col :span=12>
             <!--名称-->
 
 	        <el-form-item  label="名称" prop="businessName">
@@ -28,6 +32,24 @@
                         placeholder="请输入名称">
                 </el-input>
 	        </el-form-item>   
+                                </el-col>
+                                <el-col :span=12>
+<!--类型-->
+
+    <el-form-item  label="类型" prop="businessType">
+                <el-select   v-model="form.businessType"
+                       :style="{width: '100%'}"
+                       :filterable="false"
+                       :disabled="false"
+                       :multiple="false" :clearable="true"
+                        placeholder="请选择类型">
+                    <el-option v-for='item in businessTypeOptions' :key="item.value" :value="item.value"
+                               :label="item.label"></el-option>
+                </el-select>
+    </el-form-item>
+
+                                </el-col>
+                        </el-row>
         <!--介绍-->	
 	        <el-form-item  label="介绍" prop="businessInfo">
 	            <el-input
@@ -79,10 +101,14 @@
             return {
                 loading:false,
                 saveDisabled: false,
+                // 类型
+                businessTypeOptions:[{"value":"1","label":"微信组群"},{"value":"2","label":"商机广场"}],
                 //表单数据
                 form: {
                     // 名称
                     businessName:'',
+                    				// 类型
+                    				businessType:"",
                     // 介绍 
                     businessInfo:'',
                     // 二维码
@@ -178,6 +204,23 @@
                     }
                 });
             },
+    //类型  列表格式化
+    businessTypeFormat:function(row, column, cellValue, index){
+        var value="";
+
+            if(cellValue){
+            var data = this.businessTypeOptions.find(function(value){
+            return value.value==cellValue;
+            })
+            if(data&&data.label){
+            value = data.label;
+            }
+            }
+
+        return value;
+    },
+
+//获取businessType数据源
         // businessImg删除
         businessImgHandleRemove: function (file, files) {
         	var index = -1;
@@ -253,6 +296,7 @@
         },        },
         created:function() {
             var that = this;
+           
 
             this.form.id = ms.util.getParameter("id");
             if (this.form.id) {

+ 54 - 4
src/main/webapp/WEB-INF/manager/tf/business-opportunity/index.ftl

@@ -35,7 +35,23 @@
                 </el-input>
 	        </el-form-item>   
                                         </el-col>
-                                <el-col :span=16 style="display: flex;justify-content: end;padding-right: 10px;">
+                                        <el-col :span=8>
+<!--类型-->
+
+    <el-form-item  label="类型" prop="businessType">
+                <el-select   v-model="form.businessType"
+                       :style="{width: '100%'}"
+                       :filterable="false"
+                       :disabled="false"
+                       :multiple="false" :clearable="true"
+                        placeholder="请选择类型">
+                    <el-option v-for='item in businessTypeOptions' :key="item.value" :value="item.value"
+                               :label="item.label"></el-option>
+                </el-select>
+    </el-form-item>
+
+                                        </el-col>
+                                <el-col :span=8 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>
                                     <ms-search ref="search" @search="search" :search-json="searchJson" :search-key="historyKey"></ms-search>
@@ -52,6 +68,8 @@
                     <el-table-column type="selection" width="40" :selectable="isChecked"></el-table-column>
                             <el-table-column label="名称"   align="left" prop="businessName">
                             </el-table-column>
+                        <el-table-column label="类型"   align="left" prop="businessType" :formatter="businessTypeFormat">
+                        </el-table-column>
                     <el-table-column min-width="80" label="二维码"  align="left">
                         <template #default="scope">
                             <template v-if="scope.row.businessImg&&scope.row.businessImg !=''&&JSON.parse(scope.row.businessImg).length">
@@ -74,10 +92,10 @@
                     <el-table-column label="操作"  width="180" align="center" fixed="right">
                             <template #default="scope">
                                 <@shiro.hasPermission name="tf:businessOpportunity:update">
-                                    <el-link type="primary" :underline="false" @click="save(scope.row.id)">编辑</el-link>
+                                    <el-link type="primary" @click="save(scope.row.id)">编辑</el-link>
                                 </@shiro.hasPermission>
                             <@shiro.hasPermission name="tf:businessOpportunity:del">
-                                <el-link type="primary" :underline="false" @click="del([scope.row])" v-if="scope.row.del!=3">删除</el-link>
+                                <el-link type="primary" @click="del([scope.row])" v-if="scope.row.del!=3">删除</el-link>
                             </@shiro.hasPermission>
                 </template>
                 </el-table-column>
@@ -119,7 +137,19 @@
     "name": "名称",
     "type": "input"
     },
-    {
+       {
+  "isSearch": "true",
+  "action": "and",
+  "field": "BUSINESS_TYPE",
+  "el": "eq",
+  "model": "businessType",
+  "name": "类型",
+  "key": "value",
+  "title": "label",
+  "type": "select",
+  "multiple": "false"
+  ,"options":[{"value":"1","label":"微信组群"},{"value":"2","label":"商机广场"}]
+},    {
     "action":"and",
     "field": "BUSINESS_IMG",
     "el": "empty",
@@ -136,6 +166,8 @@
                 manager: ms.manager,
                 loading: true,//加载状态
                 emptyText:'',//提示文字
+                // 类型
+                businessTypeOptions:[{"value":"1","label":"微信组群"},{"value":"2","label":"商机广场"}],
                 //搜索表单
                 form:{
                     sqlWhere:null
@@ -269,6 +301,23 @@
                 this.$refs.searchForm.resetFields();
                 this.list(true);
             },
+    //类型  列表格式化
+    businessTypeFormat:function(row, column, cellValue, index){
+        var value="";
+
+            if(cellValue){
+            var data = this.businessTypeOptions.find(function(value){
+            return value.value==cellValue;
+            })
+            if(data&&data.label){
+            value = data.label;
+            }
+            }
+
+        return value;
+    },
+
+//获取businessType数据源
         // businessImg删除
         businessImgHandleRemove: function (file, files) {
         	var index = -1;
@@ -359,6 +408,7 @@
         },
 		created:function(){
 			var that = this;
+           
         }
     })
 </script>

+ 3 - 3
src/main/webapp/static/locale/lang/business-opportunity/en_US.js

@@ -1,8 +1,8 @@
 var en_US ={
     form:{
-                businessName:{
-            text:'名称',
-            placeholder:'请输入名称',
+                gridZzmow:{
+            text:'栅格布局',
+            placeholder:'',
             help:'',
         },
         businessInfo:{

+ 3 - 3
src/main/webapp/static/locale/lang/business-opportunity/zh_CN.js

@@ -1,9 +1,9 @@
 
 var zh_CN ={
     form:{
-                businessName:{
-            text:'名称',
-            placeholder:'请输入名称',
+                gridZzmow:{
+            text:'栅格布局',
+            placeholder:'',
             help:'',
         },
         businessInfo:{