sunmingan vor 4 Jahren
Ursprung
Commit
bf7135ddfe

+ 17 - 11
UI/src/components/Grid/BirdGrid.js

@@ -61,7 +61,8 @@ class BirdGrid extends React.Component {
       checkedValues: [],
       autoQuery: autoQuery, //页面渲染完成之后是否自动查询,默认为true
 
-      filterOption: gridOption.filterOption || {}
+      filterOption: gridOption.filterOption || {},
+      filterClose:true,
     };
 
     /* <MyInput onChange={this.update.bind(this)} />;
@@ -1073,17 +1074,22 @@ class BirdGrid extends React.Component {
       return <Row key={'filter_group_' + gindex}>
         {group.map((rule, rindex) => {
           let index = gindex * 3 + rindex + 1;//在filterRules中的index
+
+          let closeButton = '';
+          if(self.state.filterClose)
+          closeButton = <Button icon='close' type='danger' onClick={() => self.removeFilter(index)}/>;
+
           return <Col span={8} key={'filter_group_' + gindex + '_rule_' + rindex}>
-            <Row>
-              <Col span={20}>
-                <BirdGridFilter fields={self.state.queryColumns} rule={rule}
-                  option={self.state.filterOption}
-                  onChange={self.filterChange(index)} />
-              </Col>
-              <Col span={4}>
-                <Button icon='close' type='danger' onClick={() => self.removeFilter(index)} />
-              </Col>
-            </Row>
+          <Row>
+            <Col span={20}>
+              <BirdGridFilter fields={self.state.queryColumns} rule={rule}
+                option={self.state.filterOption}
+                onChange={self.filterChange(index)} />
+            </Col>
+            <Col span={4}>
+              {closeButton}
+            </Col>
+          </Row>
           </Col>
         })}
       </Row>

+ 4 - 4
UI/src/pages/.umi/DvaContainer.js

@@ -10,10 +10,10 @@ let app = dva({
 window.g_app = app;
 app.use(createLoading());
 
-app.model({ namespace: 'app', ...(require('d:/home/qiyewechatApp/UI/src/models/app.js').default) });
-app.model({ namespace: 'model', ...(require('d:/home/qiyewechatApp/UI/src/pages/login/model.js').default) });
-app.model({ namespace: 'panel', ...(require('d:/home/qiyewechatApp/UI/src/pages/auth/models/panel.js').default) });
-app.model({ namespace: 'panel', ...(require('d:/home/qiyewechatApp/UI/src/pages/user/models/panel.js').default) });
+app.model({ namespace: 'app', ...(require('D:/home/qiyewechatApp/UI/src/models/app.js').default) });
+app.model({ namespace: 'model', ...(require('D:/home/qiyewechatApp/UI/src/pages/login/model.js').default) });
+app.model({ namespace: 'panel', ...(require('D:/home/qiyewechatApp/UI/src/pages/auth/models/panel.js').default) });
+app.model({ namespace: 'panel', ...(require('D:/home/qiyewechatApp/UI/src/pages/user/models/panel.js').default) });
 
 class DvaContainer extends Component {
   render() {

+ 2 - 2
UI/src/pages/.umi/router.js

@@ -477,12 +477,12 @@ let routes = [
         "component": require('../demo/tabs.js').default
       },
       {
-        "component": () => React.createElement(require('d:/home/qiyewechatApp/UI/node_modules/umi-build-dev/lib/plugins/404/NotFound.js').default, { pagesPath: 'src/pages', hasRoutesInConfig: false })
+        "component": () => React.createElement(require('D:/home/qiyewechatApp/UI/node_modules/umi-build-dev/lib/plugins/404/NotFound.js').default, { pagesPath: 'src/pages', hasRoutesInConfig: false })
       }
     ]
   },
   {
-    "component": () => React.createElement(require('d:/home/qiyewechatApp/UI/node_modules/umi-build-dev/lib/plugins/404/NotFound.js').default, { pagesPath: 'src/pages', hasRoutesInConfig: false })
+    "component": () => React.createElement(require('D:/home/qiyewechatApp/UI/node_modules/umi-build-dev/lib/plugins/404/NotFound.js').default, { pagesPath: 'src/pages', hasRoutesInConfig: false })
   }
 ];
 

+ 182 - 50
UI/src/pages/sellmanage/portManagement.js

@@ -1,9 +1,12 @@
 import React, { Component } from "react";
 import { BirdGrid } from "components/Grid";
 import { Modal, Tabs, message, Input, Button } from "antd";
+import request from "utils/request";
 import AutoForm from "components/Grid/BirdGridForm";
 import config from "utils/config";
 import "antd/dist/antd.css";
+import { throws } from "assert";
+
 // import { Button } from "antd/lib/radio";
 
 const { APIV3Auth , WXMpAPI} = config;
@@ -13,26 +16,51 @@ class AddminiFans extends Component {
   constructor(props) {
     super(props);
     this.state = {
-      //设置列分组
-      listVisiable: false,
-      listConfirmLoading: false,
-      listSecret: { group: "" },
-      //设置总分组
-      totalVisiable: false,
-      totalConfirmLoading: false,
-      totalSecret: {},
+      type : '1',
+      mode : '',
+      editType : '1',
+      //编辑模态框
+      editVisiable: false,
+      editConfirmLoading: false,
+      editSecret: {},
       //宽度
       formOption: [],
       formOption2: [],
       formOption3: [],
+      formOption4: [],
+      formOption5: [],
+      formOption6: [],
       formWidth: 520,
       formConfirmLoading: false,
       formOption: { modal: "", title: "" },
       formOption2: { modal: "", title: "" },
-      formOption3: { modal: "", title: "" }
+      formOption3: { modal: "", title: "" },
+      formOption4: { modal: "", title: "" },
+      formOption5: { modal: "", title: "" },
+      formOption6: { modal: "", title: "" }
     };
   }
-
+ //点击编辑
+  changeEdit = data =>{
+    this.setState({
+      editVisiable: true,
+      editConfirmLoading: true
+    });
+  }
+  /* 编辑弹出框取消事件 */
+  editCancelClick(){
+    this.setState({
+      editVisiable: false,
+      editConfirmLoading: false
+    });
+  }
+  /* 编辑弹出框确认事件 */
+  editClick(){
+    this.setState({
+      editVisiable: false,
+      editConfirmLoading: false
+    });
+  }
   /* 弹出框取消事件 */
   cancelClick() {
     this.setState({
@@ -41,23 +69,57 @@ class AddminiFans extends Component {
     });
   }
 
-  callback(key) {
+  callback(_this,key) {
+    console.log(_this);
     console.log(key);
+    this.setState({ type: key });
   }
 
   saveClick(callback) {
     let self = this;
-    let form = this.refs.autoForm;
+    let add_type = this.state.type;
+    let edit_type = this.state.editType;
+
+    
+    let form ;
+    if('0' == this.state.mode ){
+      //新增
+      if(add_type == '1'){
+        form =this.refs.autoForm1
+      }else if(add_type == '2'){
+        form =this.refs.autoForm2
+      }else if(add_type == '3'){
+        form =this.refs.autoForm3
+      }
+      if(add_type == '1'){ // 公众号新增配置增加默认添加方式为 0:参数配置
+        dto['addWay'] = '0';
+      }
+    }else if('1' == this.state.mode){
+      //编辑
+      if(edit_type == '1'){
+        form =this.refs.autoForm4
+      }else if(edit_type == '2'){
+        form =this.refs.autoForm5
+      }else if(edit_type == '3'){
+        form =this.refs.autoForm6
+      }
+    }
+    
     if (!form.validate()) return;
 
     let dto = form.state.initValue;
-
+    if('0' == this.state.mode ){
+      dto['type'] = add_type; //根据当前所处页面添加公众号... 
+    }else if('1' == this.state.mode){
+      dto['type'] = edit_type; //根据当前所处页面添加公众号... 
+    }
+    console.log(form.state.extraParams)
     let extraParams = form.state.extraParams;
     for (let extra of extraParams) {
       dto[extra.field] = extra.value;
     }
     request({
-      url: "/web/auth/add",
+      url: WXMpAPI + "/wx/port/save",
       method: "post",
       data: dto
     }).then(function(result) {
@@ -75,7 +137,8 @@ class AddminiFans extends Component {
         formVisiable: false,
         formConfirmLoading: false
       });
-      self.refs.tg.getGrid().reload();
+      //self.refs.tg.getGrid().reload();
+      //self.refs.gridOptionResource.reload;
     });
   }
   render() {
@@ -88,30 +151,38 @@ class AddminiFans extends Component {
       url: {
         read: WXMpAPI + "/wx/port/getAll",
         // add: APIV3Auth + "/ums/resource/addResource",
-        //edit: APIV3Auth + "/ums/resource/update"
+        // edit: APIV3Auth + "/ums/resource/update"
       },
       afterSave: function() {
         console.log(self.refs.gridResource);
       },
       afterQuery: function(resultout, filters) {
-        if(self.state.hasInitFilters){
+        if(!self.state.hasInitFilters){
           return;
         }
+        self.refs.gridResource.setState({
+          filterRules:[{
+            field:"portName",
+            operate:"contains",
+            value:"",
+          },{
+            field:"typeName",
+            operate:"equal",
+            value:"",
+          }]
+        },() => {
+          self.setState({hasInitFilters:false});
+        });
       },
-      dataSource: [
-        {
-          id: 1,
-          headImg:
-            "https://axhub.im/ax9/152bb62cb584111a/images/%E7%AB%AF%E5%8F%A3%E7%AE%A1%E7%90%86/u90.svg",
-          name: "小红"
-        }
-      ],
       columns: [
         { title: "端口ID", data: "id", type: "number" },
-        { title: "端口名称", data: "port_name",  operate:"or" , type: "text",query: true,editor: {}},
-        { title: "端口类型", data: "type",type: "text",query: false,editor: {}},
-        { title: "绑定端口图标", data: "head_img",  type: "img", query: false, editor: {}, hide: true },
-        { title: "绑定端口图标", data: "head_img",  render: (text, row, index) => (
+        { title: "端口名称", data: "portName",  type: "text",query: true,editor: {}},
+        { title: "端口类型", data: "typeName",type: "dropdown",source:{multi:true,data:[
+          {label:'企业微信',value:'0'},
+          {label:'公众号',value:'1'}
+        ]}, query: true,editor: {}},
+        { title: "绑定端口图标", data: "headImg",   type: "img", query: false, editor: {}, hide: true },
+        { title: "绑定端口图标", data: "headImg",  render: (text, row, index) => (
             <div key={index}>
               <div>
                 <img
@@ -122,33 +193,70 @@ class AddminiFans extends Component {
                     marginLeft: "30px",
                     marginTop: "10px"
                   }}
-                  src={row.head_img}
+                  src={row.headImg}
                 />
               </div>
             </div>
           )
         },
-        { title: "绑定端口名称", data: "name", type: "text",  query: false, editor: {} },
-        { title: "绑定端口AppId", data: "appId", operate:"or", type: "text",  query: true, editor: {} },
-        { title: "绑定状态", data: "state", type: "text", query: false, editor: {} },
-        { title: "操作选项", type: "command" ,actions: [
-          {
-            name: "编辑",
-            onClick: data => {
-              
-            }
+        { title: "绑定端口名称", data: "name", type: "text",  query: false, editor: { ap: 'hide', ep: 'hide' } },
+        { title: "绑定端口AppId", data: "appId",type: "text", query: true, editor: {} },
+        { title: "绑定状态", data: "stateName", type: "text", query: false, editor: {} },
+        // { title: "操作选项", type: "head_img" ,render: (text, row, index) => (
+        //   <div key={index}>
+        //     <div>
+        //       <button onClick={this.changeEdit(row)}>编辑</button>
+        //     </div>
+        //   </div>
+        // )}
+        {title: "操作选项", type: "command", actions: [{
+          name: '编辑',
+          onClick: (data) => {
+            this.changeEdit(data)
+            
+            const fields = [{ title: "端口名称", data: "portName" ,type: "text",  editor: { tips: "填写一个方便记忆的名称,以免公众号/企业微信等同名" },query: true},
+            { title: "公众号图标",data: "headImg", type: "img", editor: { tips: "请上传1:1尺寸的图标" }, query: true },
+            { title: "公众号名称",data: "name", type: "text", editor: { tips: "微信公众号名称"}, query: true},
+            { title: "AppID", data: "appId", type: "text", editor: { tips: "微信公众号AppID" }, query: true },
+            { title: "AppSecret", data: "secret", type: "text", editor: { tips: "微信公众号AppSecret" },query: true },
+            { title: "token", data: "token", type: "text", editor: { tips: "微信公众号token" }, query: true },
+            { title: "aesKey", data: "aesKey", type: "text", editor: { tips: "微信公众号aesKey" },query: true }
+          ];
+          const fields2 = [ { title: "端口名称",data: "text4",type: "text",editor: {},query: true} ];
+          const fields3 = [ { title: "端口名称",data: "text5",type: "text",editor: {},query: true},
+            { title: "企业微信图标", data: "imgIcon2", type: "img", editor: { tips: "请上传1:1尺寸的图标" }, query: true },
+            { title: "企业微信名称", data: "text6", type: "text", editor: { tips: "企业微信名称" }, query: true },
+            { title: "企业ID", data: "text7", type: "text", editor: { tips: "企业微信后台,“我的企业”中的企业ID,也叫corpid" }, query: true },
+            { title: "客户联系", data: "text8", type: "text", editor: { tips: "企业微信后台,“客户联系”中获取" }, query: true },
+            { title: "通讯录同步",data: "text9",type: "text", editor: {tips: "企业微信后台,“管理工具-通讯录同步”中获取"},query: true},
+            { title: "客户信息查询",data: "text10",type: "text",editor: { tips: "企业微信后台,“应用管理-自建-客户信息查询”中获取" }, query: true }
+          ];
+          let formOption4 = { model: "update",title: "添加端口", fields: fields, value: data, extraParams: [] };
+          let formOption5 = {  model: "update", title: "基础设置", fields: fields2, value: {}, extraParams: [] };
+          let formOption6 = { model: "update", title: "基础设置", fields: fields3, value: {}, extraParams: [] };
+          self.setState({
+            editVisiable: true,
+            formOption4: formOption4,
+            formOption5: formOption5,
+            formOption6: formOption6,
+            mode: '1'
+          });
+
+          // 查询请求
           }
-        ]}
+        }]}
       ],
       actions: [
         {
           name: "添加端口",
           onClick: function() {
-            const fields = [{ title: "端口名称", data: "field-text", type: "text",  editor: { tips: "填写一个方便记忆的名称,以免公众号/企业微信等同名" },query: true},
-              { title: "公众号图标",data: "imgIcon", type: "img", editor: { tips: "请上传1:1尺寸的图标" }, query: true },
-              { title: "公众号名称",data: "text1", type: "text", editor: { tips: "微信公众号名称"}, query: true},
-              { title: "AppID", data: "text2", type: "text", editor: { tips: "微信公众号AppID" }, query: true },
-              { title: "AppSecret", data: "text3", type: "text", editor: { tips: "微信公众号AppSecret" },query: true }
+            const fields = [{ title: "端口名称", data: "portName", type: "text",  editor: { tips: "填写一个方便记忆的名称,以免公众号/企业微信等同名" },query: true},
+              { title: "公众号图标",data: "headImg", type: "img", editor: { tips: "请上传1:1尺寸的图标" }, query: true },
+              { title: "公众号名称",data: "name", type: "text", editor: { tips: "微信公众号名称"}, query: true},
+              { title: "AppID", data: "appId", type: "text", editor: { tips: "微信公众号AppID" }, query: true },
+              { title: "AppSecret", data: "secret", type: "text", editor: { tips: "微信公众号AppSecret" },query: true },
+              { title: "token", data: "token", type: "text", editor: { tips: "微信公众号token" }, query: true },
+              { title: "aesKey", data: "aesKey", type: "text", editor: { tips: "微信公众号aesKey" },query: true }
             ];
             const fields2 = [ { title: "端口名称",data: "text4",type: "text",editor: {},query: true} ];
             const fields3 = [ { title: "端口名称",data: "text5",type: "text",editor: {},query: true},
@@ -166,7 +274,8 @@ class AddminiFans extends Component {
               formVisiable: true,
               formOption: formOption,
               formOption2: formOption2,
-              formOption3: formOption3
+              formOption3: formOption3,
+              mode: '0'
             });
           }
         }
@@ -185,18 +294,41 @@ class AddminiFans extends Component {
           onCancel={() => this.cancelClick()}
           confirmLoading={this.state.formConfirmLoading}
         >
-          <Tabs defaultActiveKey="1">
+          <Tabs ActiveKey="1" activeKey={self.state.type} onChange={(key)=>{
+            this.setState({ type: key });
+          }}>
             <TabPane tab="公众号" key="1">
-              <AutoForm formOption={this.state.formOption} ref="autoForm" />
+              <AutoForm formOption={this.state.formOption} ref="autoForm1" />
             </TabPane>
             <TabPane tab="小程序" key="2">
-              <AutoForm formOption={this.state.formOption2} ref="autoForm" />
+              <AutoForm formOption={this.state.formOption2} ref="autoForm2" />
             </TabPane>
             <TabPane tab="企业微信" key="3">
-              <AutoForm formOption={this.state.formOption3} ref="autoForm" />
+              <AutoForm formOption={this.state.formOption3} ref="autoForm3" />
             </TabPane>
           </Tabs>
         </Modal>
+        <Modal
+          title="编辑"
+          width={this.state.formWidth}
+          visible={this.state.editVisiable}
+          onOk={() => this.saveClick()}
+          onCancel={() => this.editCancelClick()}
+        >
+          <Tabs ActiveKey="1" activeKey={self.state.type} onChange={(key)=>{
+            this.setState({ type: key });
+          }}>
+            <TabPane tab="公众号" key="1">
+              <AutoForm formOption={this.state.formOption4} ref="autoForm4" />
+            </TabPane>
+            <TabPane tab="小程序" key="2">
+              <AutoForm formOption={this.state.formOption5} ref="autoForm5" />
+            </TabPane>
+            <TabPane tab="企业微信" key="3">
+              <AutoForm formOption={this.state.formOption6} ref="autoForm6" />
+            </TabPane>
+          </Tabs>
+          </Modal>
       </div>
     );
   }

+ 31 - 28
mpwechatApp/src/main/java/com/liangjian11/wx/mp/mapper/ChannelPortMapper.java

@@ -14,8 +14,8 @@ public interface ChannelPortMapper extends BaseMapper<ChannelPort> {
      * 新增
      * @param port
      */
-    @Insert("INSERT INTO channel_port ([type],[name], [port_name], [add_way], [head_img], [nick_name], [service_type_info], [verify_type_info], [user_name], [principal_name], [alias], [business_info], [qrcode_url], [mp_message_url], [mp_openid_url], [appId], [secret], [token], [aesKey], [create_time], [update_time],[app_hostId],[enterprise_wechatId]) VALUES" +
-        " (#{port.type},#{port.name} ,#{port.portName}, #{port.addWay}, #{port.headImg}, #{port.nickName}, #{port.serviceTypeInfo}, #{port.verifyTypeInfo}, #{port.userName}, #{port.principalName}, #{port.alias}, #{port.businessInfo}, #{port.qrcodeUrl}, #{port.mpMessageUrl}, #{port.mpOpenidUrl}, #{port.appId}, #{port.secret}, #{port.token}, #{port.aesKey}, #{port.createTime}, #{port.updateTime},#{appHostId},#{enterpriseWechatId})")
+    @Insert("INSERT INTO channel_port ([type],[name], [portName], [addWay], [headImg], [nickName], [serviceTypeInfo], [verifyTypeInfo], [userName], [principalName], [alias], [businessInfo], [qrcodeUrl], [mpMessageUrl], [mpOpenidUrl], [appId], [secret], [token], [aesKey], [createTime], [updateTime],[appHostId],[enterpriseWechatId]) VALUES" +
+        " (#{port.type},#{port.name} ,#{port.portName}, #{port.addWay}, #{port.headImg}, #{port.nickName}, #{port.serviceTypeInfo}, #{port.verifyTypeInfo}, #{port.userName}, #{port.principalName}, #{port.alias}, #{port.businessInfo}, #{port.qrcodeUrl}, #{port.mpMessageUrl}, #{port.mpOpenidUrl}, #{port.appId}, #{port.secret}, #{port.token}, #{port.aesKey}, #{port.createTime}, #{port.updateTime},#{port.appHostId},#{port.enterpriseWechatId})")
     @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")/*增加这个注解插入记录后会返回自增长的id*/
     void save(@Param("port") ChannelPort port);
 
@@ -24,30 +24,31 @@ public interface ChannelPortMapper extends BaseMapper<ChannelPort> {
      * @param port
      */
     @Update("<script> " +
-        "update channel_port set " +
-        "<if test='type!=null and type.size() > 0'> type = #{type},</if>" +
-        "<if test='name!=null and name.size() > 0'> name=#{name} ,</if>\n" +
-        "<if test='portName!=null and portName.size() > 0'> port_name=#{portName} ,</if>\n" +
-        "<if test='addWay!=null and addWay.size() > 0'> add_way=#{addWay} ,</if>\n" +
-        "<if test='headImg!=null and headImg.size() > 0'> headImg=#{head_img}, </if>" +
-        "<if test='nickName!=null and nickName.size() > 0'> nick_name=#{nickName},</if> " +
-        "<if test='serviceTypeInfo!=null and serviceTypeInfo.size() > 0'> service_type_info=#{serviceTypeInfo},</if> " +
-        "<if test='verifyTypeInfo!=null and verifyTypeInfo.size() > 0'> verify_type_info=#{verifyTypeInfo},</if> " +
-        "<if test='principalName!=null and principalName.size() > 0'> principal_name=#{principalName},</if> " +
-        "<if test='alias!=null and alias.size() > 0'> alias=#{alias},</if> " +
-        "<if test='businessInfo!=null and businessInfo.size() > 0'> business_info=#{businessInfo},</if> " +
-        "<if test='qrcodeUrl!=null and qrcodeUrl.size() > 0'> qrcode_url=#{qrcodeUrl},</if> " +
-        "<if test='mpMessageUrl!=null and mpMessageUrl.size() > 0'> mp_message_url=#{mpMessageUrl},</if> " +
-        "<if test='mpOpenidUrl!=null and mpOpenidUrl.size() > 0'> mp_openid_url=#{mpOpenidUrl},</if> " +
-        "<if test='appId!=null and appId.size() > 0'> appId=#{appId},</if> " +
-        "<if test='secret!=null and secret.size() > 0'> secret=#{secret},</if> " +
-        "<if test='token!=null and token.size() > 0'> token=#{token},</if> " +
-        "<if test='secret!=null and secret.size() > 0'> secret=#{secret},</if> " +
-        "<if test='aesKey!=null and aesKey.size() > 0'> aesKey=#{aesKey},</if> " +
-        "<if test='createTime!=null and createTime.size() > 0'> create_time=#{createTime},</if> " +
-        "<if test='updateTime!=null and updateTime.size() > 0'> update_time=#{updateTime},</if> " +
-        "<if test='appHostId!=null and appHostId.size() > 0'> app_hostId=#{appHostId},</if> " +
-        "<if test='enterpriseWechatId!=null and enterpriseWechatId.size() > 0'> enterprise_wechatId=#{enterpriseWechatId},</if> " +
+        "update channel_port  " +
+        "<trim prefix='set' suffixOverrides=','> " +
+        "<if test='type!=null and type.length() > 0'> type = #{type},</if>" +
+        "<if test='name!=null and name.length() > 0'> name=#{name} ,</if>\n" +
+        "<if test='portName!=null and portName.length() > 0'> portName=#{portName} ,</if>\n" +
+        "<if test='addWay!=null and addWay.length() > 0'> addWay=#{addWay} ,</if>\n" +
+        "<if test='headImg!=null and headImg.length() > 0'> headImg=#{headImg}, </if>" +
+        "<if test='nickName!=null and nickName.length() > 0'> nickName=#{nickName},</if> " +
+        "<if test='serviceTypeInfo!=null and serviceTypeInfo.length() > 0'> serviceTypeInfo=#{serviceTypeInfo},</if> " +
+        "<if test='verifyTypeInfo!=null and verifyTypeInfo.length() > 0'> verifyTypeInfo=#{verifyTypeInfo},</if> " +
+        "<if test='principalName!=null and principalName.length() > 0'> principalName=#{principalName},</if> " +
+        "<if test='alias!=null and alias.length() > 0'> alias=#{alias},</if> " +
+        "<if test='businessInfo!=null and businessInfo.length() > 0'> businessInfo=#{businessInfo},</if> " +
+        "<if test='qrcodeUrl!=null and qrcodeUrl.length() > 0'> qrcodeUrl=#{qrcodeUrl},</if> " +
+        "<if test='mpMessageUrl!=null and mpMessageUrl.length() > 0'> mpMessageUrl=#{mpMessageUrl},</if> " +
+        "<if test='mpOpenidUrl!=null and mpOpenidUrl.length() > 0'> mpOpenidUrl=#{mpOpenidUrl},</if> " +
+        "<if test='appId!=null and appId.length() > 0'> appId=#{appId},</if> " +
+        "<if test='secret!=null and secret.length() > 0'> secret=#{secret},</if> " +
+        "<if test='token!=null and token.length() > 0'> token=#{token},</if> " +
+        "<if test='aesKey!=null and aesKey.length() > 0'> aesKey=#{aesKey},</if> " +
+        "<if test='createTime!=null and createTime.length() > 0'> createTime=#{createTime},</if> " +
+        "<if test='updateTime!=null and updateTime.length() > 0'> updateTime=#{updateTime},</if> " +
+        "<if test='appHostId!=null and appHostId.length() > 0'> appHostId=#{appHostId},</if> " +
+        "<if test='enterpriseWechatId!=null and enterpriseWechatId.length() > 0'> enterpriseWechatId=#{enterpriseWechatId},</if> " +
+        "</trim>"+
         " where id = #{id} " +
         "</script>")
     void updateByIdSelect(ChannelPort port);
@@ -59,8 +60,10 @@ public interface ChannelPortMapper extends BaseMapper<ChannelPort> {
      * @param size
      * @return
      */
-    @Select("SELECT * from (select  row_number() over (  order by u.create_time DESC)  as rownum,u.* from channel_port u ${sqlStr} ) A where A.rownum>#{index} AND A.rownum<#{size} ")
-    List<ChannelPort> queryExternalList(@Param("sqlStr")String sqlStr, @Param("index")Integer index, @Param("size")Integer size);
+    @Select("SELECT * from (select  row_number() over (  order by u.createTime DESC)  as rownum,u.*" +
+        ",case type when '1' then '企业微信' when '0' then '公众号' end 'typeName'" +
+        ",case state when '0' then '正常' when '1' then '失效' end'stateName' from channel_port u ${sqlStr} ) A where A.rownum>#{index} AND A.rownum<#{size} ")
+    List<Map<String,Object>> queryExternalList(@Param("sqlStr")String sqlStr, @Param("index")Integer index, @Param("size")Integer size);
 
     /**
      * 根据条件查询数量

+ 16 - 16
mpwechatApp/src/main/java/com/liangjian11/wx/mp/modle/ChannelPort.java

@@ -26,43 +26,43 @@ public class ChannelPort implements Serializable {
     @TableField("name")
     private String name;
 
-    @TableField("port_name")
+    @TableField("portName")
     private String portName;
 
-    @TableField("add_way")
+    @TableField("addWay")
     private String addWay;
 
-    @TableField("head_img")
+    @TableField("headImg")
     private String headImg;
 
-    @TableField("nick_name")
+    @TableField("nickName")
     private String nickName;
 
-    @TableField("service_type_info")
+    @TableField("serviceTypeInfo")
     private String serviceTypeInfo;
 
-    @TableField("verify_type_info")
+    @TableField("verifyTypeInfo")
     private String verifyTypeInfo;
 
-    @TableField("user_name")
+    @TableField("userName")
     private String userName;
 
-    @TableField("principal_name")
+    @TableField("principalName")
     private String principalName;
 
     @TableField("alias")
     private String alias;
 
-    @TableField("business_info")
+    @TableField("businessInfo")
     private String businessInfo;
 
-    @TableField("qrcode_url")
+    @TableField("qrcodeUrl")
     private String qrcodeUrl;
 
-    @TableField("mp_message_url")
+    @TableField("mpMessageUrl")
     private String mpMessageUrl;
 
-    @TableField("mp_openid_url")
+    @TableField("mpOpenidUrl")
     private String mpOpenidUrl;
 
     @TableField("appId")
@@ -77,18 +77,18 @@ public class ChannelPort implements Serializable {
     @TableField("aesKey")
     private String aesKey;
 
-    @TableField("create_time")
+    @TableField("createTime")
     private String createTime;
 
-    @TableField("update_time")
+    @TableField("updateTime")
     private String updateTime;
 
     @TableField("state")
     private String state;
 
-    @TableField("app_hostId")
+    @TableField("appHostId")
     private String appHostId;
 
-    @TableField("enterprise_wechatId")
+    @TableField("enterpriseWechatId")
     private String enterpriseWechatId;
 }

+ 2 - 3
mpwechatApp/src/main/java/com/liangjian11/wx/mp/service/impl/ChannelPortServiceImpl.java

@@ -38,7 +38,7 @@ public class ChannelPortServiceImpl implements ChannelPortService {
         String sqlStr=data.getFilterString();
         Integer totalCount=this.portMapper.queryExternalCount(sqlStr);
 
-        List<ChannelPort> list = new ArrayList<>();
+        List<Map<String,Object>> list = new ArrayList<>();
         if(totalCount != null && totalCount > 0){
             list = this.portMapper.queryExternalList(sqlStr,start,end);
         }
@@ -61,11 +61,10 @@ public class ChannelPortServiceImpl implements ChannelPortService {
         if(port.getId() == null){
             //新增
             port.setCreateTime(DateUtil.getNowDateTimeStr());
+            port.setUpdateTime(DateUtil.getNowDateTimeStr());
             portMapper.save(port);
-
         } else {
             //编辑
-            port.setCreateTime(DateUtil.getNowDateTimeStr());
             port.setUpdateTime(DateUtil.getNowDateTimeStr());
             portMapper.updateByIdSelect(port);
         }