Commit 774ca8e5 authored by 黎聪聪's avatar 黎聪聪

二维码管理

parent 6c482644
...@@ -99,13 +99,31 @@ ...@@ -99,13 +99,31 @@
<label>二维码类别</label> <label>二维码类别</label>
<select class="form-control select2" name="typeselect" <select class="form-control select2" name="typeselect"
id="typeselect" style="width: 100%;"> id="typeselect" style="width: 100%;">
<option value="0">门店</option> <option value="1">医师二维码</option>
<option value="1">SA人员</option> <option value="2">客服二维码</option>
<option value="2">门店车辆</option> <option value="3">医生二维码</option>
<option value="4">组织二维码</option>
</select> </select>
</div> </div>
</div> </div>
<!--<div class="form-group form-md-line-input col-md-20">
<label>所属栏目</label>
<div class="input-group">
<input type="text" name="column" id="column"
value="$!{data.column}"
class="form-control" style="display: none">
<input type="text" id="columnName"
name="columnName" value="$!{columnName}"
class="form-control" disabled>
<span class="input-group-btn">
<button type="button" id="columnSelect"
class="btn btn-info btn-flat">选择</button>
</span>
</div>
</div>-->
<div class="row"> <div class="row">
<div class="form-group form-md-line-input col-md-12"> <div class="form-group form-md-line-input col-md-12">
<label>描述</label> <label>描述</label>
...@@ -179,6 +197,8 @@ ...@@ -179,6 +197,8 @@
Cfapp.init(); Cfapp.init();
recdTypeAdd.init(); recdTypeAdd.init();
}); });
//选择栏目
var recdTypeAdd = function () { var recdTypeAdd = function () {
......
...@@ -110,13 +110,30 @@ ...@@ -110,13 +110,30 @@
<label>二维码类别</label> <label>二维码类别</label>
<select class="form-control select2" name="typeselect" <select class="form-control select2" name="typeselect"
id="typeselect" style="width: 100%;"> id="typeselect" style="width: 100%;">
<option value="0">门店</option> <option value="0">客服二维码</option>
<option value="1">SA人员</option> <option value="1">药师二维码</option>
<option value="2">门店车辆</option> <option value="2">医生二维码</option>
<option value="3">组织二维码</option>
</select> </select>
</div> </div>
<div class="form-group form-md-line-input col-md-6">
<label>选择二维码所绑定的对象</label>
<div class="input-group">
<input type="text" name="bindId" id="bindId"
value="$!{data.bindId}"
class="form-control" style="display: none">
<input type="text" id="columnName"
name="columnName" value="$!{columnName}"
class="form-control" disabled>
<span class="input-group-btn">
<button type="button" id="columnSelect"
class="btn btn-info btn-flat">选择</button>
</span>
</div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="form-group form-md-line-input col-md-12"> <div class="form-group form-md-line-input col-md-12">
<label>描述</label> <label>描述</label>
...@@ -197,8 +214,76 @@ ...@@ -197,8 +214,76 @@
$().ready(function () { $().ready(function () {
Cfapp.init(); Cfapp.init();
recdTypeAdd.init(); recdTypeAdd.init();
}); });
// var Id ="";
// $("#typeselect").click(function () {
// var value = $("#typeselect").val();
// if (value=="医师二维码"){
// Id = 1;
// }else if (value=="客服二维码"){
// Id = 2;
// }else if (value=="医生二维码"){
// Id = 3;
// }else if (value=="组织二维码"){
// Id = 4;
// }
// })
// var columnUrl = "#springUrl('/a/wxQrcode/listUser?userId=" + Id + "')";
// var cfArticleUrl = "#springUrl('/a/cfarticle/listData')";
var columnUrl = "";
//选择栏目
$("#columnSelect").click(function () {
var Id= $("#typeselect").val()
if (Id=="3"){
columnUrl ="#springUrl('/a/wxQrcode/listOrg')"
}else{
columnUrl ="#springUrl('/a/wxQrcode/listUser?userId=" + Id + "')"
}
Cfapp.f7({
dataUrl: columnUrl,
checkType: 'single', // 多选为multi
title: "选择二维码绑定对象",
btnoktext: "确定",
btncanceltext: "取消",
columns: ['选择', '人员名称'],
isSearch: '0',
searchColumns: ["name"],//搜索的字段名称
searchColumnsRemarks: ['人员名称'],//搜索的字段备注
aoColumns: [{
"mData": "id"
}, {
"mData": "name"
}
],
aoColumnDefs: [{
"aTargets": [0],
"mData": "id",
"mRender": function (a, b, c, d) {
return '<input class="bindId" value="' + a + '" type="radio" id="' + a + '" name="sel" data-value="' + a + '" data-name="' + c.name + '">';
}
}, {
"aTargets": [1],
"mData": "name",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}],
success: function () {
},
cancel: function () {
},
storeFields: 'bindId', // 储存的字段
displayFields: 'columnName'
})
});
var recdTypeAdd = function () { var recdTypeAdd = function () {
var initForm = function () { var initForm = function () {
......
...@@ -97,9 +97,10 @@ ...@@ -97,9 +97,10 @@
<select class="form-control select2" name="type" <select class="form-control select2" name="type"
id="type"> id="type">
<option value="-1" selected="selected">全部</option> <option value="-1" selected="selected">全部</option>
<option value="0">门店</option> <option value="1">医师二维码</option>
<option value="1">Sa人员</option> <option value="2">客服二维码</option>
<option value="2">门店车辆</option> <option value="3">医生二维码</option>
<option value="4">组织二维码</option>
</select> </select>
</div> </div>
</div> </div>
...@@ -201,7 +202,7 @@ ...@@ -201,7 +202,7 @@
var sSource = "#springUrl('/a/wxQrcode/listData')"; var sSource = "#springUrl('/a/wxQrcode/listData')";
var aoData = { var aoData = {
iDisplayStart: 1, iDisplayStart: 1,
iDosplayLength: 20 iDosplayLength: 10
} }
var retrieveData = function (sSource, aoData, fnCallback) { var retrieveData = function (sSource, aoData, fnCallback) {
...@@ -253,9 +254,11 @@ ...@@ -253,9 +254,11 @@
}, },
{ {
"mData": "ticket" "mData": "ticket"
},{
"mData": "storeName"
}, },
{
"mData": "qrcodeNames"
},
{ {
"mData": "sceneId" "mData": "sceneId"
}, },
...@@ -285,16 +288,12 @@ ...@@ -285,16 +288,12 @@
} }
},{ },{
"aTargets": [2], "aTargets": [2],
"mData": "storeName", "mData": "qrcodeNames",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a!==null && a !== '') { if (a!==null && a !== '') {
return '<font color="blue">'+a+'</font>'; return a;
} else if (c.empName !== null && c.empName !== '') { }else{
return '<font color="green">'+c.empName+'</font>'; return "";
}else if (c.carName !== null && c.carName !== '') {
return '<font color="orange">'+c.carName+'</font>';
} else {
return '<font color="red">未被绑定</font>';
} }
} }
...@@ -303,7 +302,7 @@ ...@@ -303,7 +302,7 @@
"aTargets": [3], "aTargets": [3],
"mData": "sceneId", "mData": "sceneId",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return '<a href="#springUrl("/a/wxQrcode/form?id=' + c.id + '")" data-id="' + c.id + '" data-action="view">' + a + '</a>'; return a;
} }
}, },
...@@ -312,11 +311,15 @@ ...@@ -312,11 +311,15 @@
"mData": "type", "mData": "type",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a == '0') { if (a == '0') {
return '门店'; return '客服二维码';
} else if (a == '1') { } else if (a == '1') {
return 'SA人员'; return '医师二位码';
}else if(a == '2'){ }else if(a == '2'){
return '门店车辆'; return '医生二维码';
}else if(a=="3"){
return '组织二维码';
}else{
return "";
} }
} }
}, },
...@@ -329,6 +332,13 @@ ...@@ -329,6 +332,13 @@
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
}, },
{
"aTargets": [6],
"mData": "description",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
},
{ {
"aTargets": [7], "aTargets": [7],
"mData": "id", "mData": "id",
......
package com.cftech.shop.qrcode.dao; package com.cftech.shop.qrcode.dao;
import com.alibaba.fastjson.JSONObject;
import com.cftech.shop.qrcode.model.QyUser;
import com.cftech.shop.qrcode.model.WxQrcode; import com.cftech.shop.qrcode.model.WxQrcode;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.shop.qrcode.model.vo.WxQrcodeVO; import com.cftech.shop.qrcode.model.vo.WxQrcodeVO;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import java.util.List; import java.util.List;
...@@ -26,4 +29,11 @@ public interface WxQrcodeMapper extends GenericDao<WxQrcode> { ...@@ -26,4 +29,11 @@ public interface WxQrcodeMapper extends GenericDao<WxQrcode> {
List<WxQrcode> fetchSingleSearchInfo(Map<String, Object> params); List<WxQrcode> fetchSingleSearchInfo(Map<String, Object> params);
List<QyUser> fromUser(@Param("userId") int userId, @Param("name")String name);
List<WxQrcode> fromOrg(@Param("name")String name);
int countUser(int userId);
int countOrg();
} }
\ No newline at end of file
...@@ -129,8 +129,9 @@ ...@@ -129,8 +129,9 @@
</select> </select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_shop_wxqrcode t SELECT COUNT(1) FROM t_shop_wxqrcode t
left join t_orgunit o on o.id = t.org_id LEFT JOIN t_qyuser q ON q.id = t.bind_id
LEFT JOIN t_orgunit o ON o.id = t.bind_id AND t.type='3'
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="orgId > 0"> <if test="orgId > 0">
and instr(o.parent_ids,',${orgId},')>0 and instr(o.parent_ids,',${orgId},')>0
...@@ -139,13 +140,25 @@ ...@@ -139,13 +140,25 @@
</select> </select>
<select id="fetchSearchByPageVO" parameterType="java.util.Map" resultMap="resultMapVO"> <select id="fetchSearchByPageVO" parameterType="java.util.Map" resultMap="resultMapVO">
SELECT t.id id, s.name store_name, u.name emp_name,c.name car_name, t.scene_id scene_id, SELECT
t.type type, t.ticket ticket, t.create_time create_time, t.description description t.id,
FROM t_shop_wxqrcode t t.ticket,
left join t_dc_store s on s.id = t.bind_id and t.type='0' t.scene_id sceneId,
left join t_qyuser u on u.id = t.bind_id and t.type='1' t.type,
LEFT JOIN t_fours_store_car sc on sc.id=t.bind_id and t.type='2' t.create_time createTime,
LEFT JOIN t_fours_base_cars c on c.id=sc.carid t.description,
q.`name`,
o.org_name,
CASE
WHEN t.type = '0' OR t.type = '1' OR t.type = '2' THEN
q.`name`
WHEN t.type = '3' THEN
o.org_name ELSE ''
END qrcodeNames
FROM
t_shop_wxqrcode t
LEFT JOIN t_qyuser q ON q.id = t.bind_id
LEFT JOIN t_orgunit o ON o.id = t.bind_id AND t.type='3'
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
...@@ -208,7 +221,7 @@ ...@@ -208,7 +221,7 @@
</if> </if>
<if test="updateBy != null"> <if test="updateBy != null">
update_by = #{updateBy, jdbcType=BIGINT}, update_by = #{updateBy, jdbcType=BIGINT},
</if>,update_time = now() </if>update_time = now()
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
...@@ -229,5 +242,16 @@ ...@@ -229,5 +242,16 @@
limit 0,1 limit 0,1
</select> </select>
<select id="fromUser" resultType="com.cftech.shop.qrcode.model.QyUser">
select id,name from t_qyuser where user_type=#{userId} <if test=" name !=null and name != '' "> and name like '%${name}%'</if>
</select>
<select id="fromOrg" resultType="com.cftech.shop.qrcode.model.Orgunit">
select id,org_name name from t_orgunit <if test=" name !=null and name != '' "> where org_name like '%${name}%'</if>
</select>
<select id="countUser" resultType="java.lang.Integer">
select count(1) from t_qyuser where user_type=#{userId}
</select>
<select id="countOrg" resultType="java.lang.Integer">
select count(1) from t_orgunit
</select>
</mapper> </mapper>
\ No newline at end of file
package com.cftech.shop.qrcode.model;
import lombok.Data;
/**
* @author :licc
* @date :Created in 2020/9/29 10:44
* @description:
*/
@Data
public class Orgunit {
/* 人员id*/
private Long id;
/* 人员name*/
private String name;
}
package com.cftech.shop.qrcode.model;
import lombok.Data;
import java.security.PrivateKey;
/**
* @author :licc
* @date :Created in 2020/9/28 15:19
* @description:
*/
@Data
public class QyUser {
/* 人员id*/
private Long id;
/* 人员name*/
private String name;
}
...@@ -13,7 +13,7 @@ import java.util.Date; ...@@ -13,7 +13,7 @@ import java.util.Date;
* @date: 2017-12-04 17:56 * @date: 2017-12-04 17:56
*/ */
@Data @Data
public class WxQrcode implements Serializable { public class WxQrcode implements Serializable {
/* 主键id */ /* 主键id */
private Long id; private Long id;
...@@ -46,7 +46,8 @@ public class WxQrcode implements Serializable { ...@@ -46,7 +46,8 @@ public class WxQrcode implements Serializable {
private Long createBy; private Long createBy;
/* 更新人 */ /* 更新人 */
private Long updateBy; private Long updateBy;
/* 绑定对象 */
private String qrcodeNames;
public WxQrcode() { public WxQrcode() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
......
...@@ -46,5 +46,6 @@ public class WxQrcodeVO implements Serializable { ...@@ -46,5 +46,6 @@ public class WxQrcodeVO implements Serializable {
*/ */
private String description; private String description;
/* 绑定对象 */
private String qrcodeNames;
} }
package com.cftech.shop.qrcode.service; package com.cftech.shop.qrcode.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cftech.shop.qrcode.model.QyUser;
import com.cftech.shop.qrcode.model.WxQrcode; import com.cftech.shop.qrcode.model.WxQrcode;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
...@@ -26,4 +29,11 @@ public interface WxQrcodeService extends GenericService<WxQrcode> { ...@@ -26,4 +29,11 @@ public interface WxQrcodeService extends GenericService<WxQrcode> {
boolean updateBindId(WxQrcode wxQrcode); boolean updateBindId(WxQrcode wxQrcode);
List<WxQrcode> fetchSingleSearchInfo(Conds conds, Sort sort, int page, int pageSize); List<WxQrcode> fetchSingleSearchInfo(Conds conds, Sort sort, int page, int pageSize);
List<QyUser> fromUser(int userId,String name);
List<WxQrcode> fromOrg(String name);
int countUser(int userId);
int countOrg();
} }
package com.cftech.shop.qrcode.service.impl; package com.cftech.shop.qrcode.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cftech.shop.qrcode.model.QyUser;
import com.cftech.shop.qrcode.model.WxQrcode; import com.cftech.shop.qrcode.model.WxQrcode;
import com.cftech.shop.qrcode.dao.WxQrcodeMapper; import com.cftech.shop.qrcode.dao.WxQrcodeMapper;
import com.cftech.shop.qrcode.model.vo.WxQrcodeVO; import com.cftech.shop.qrcode.model.vo.WxQrcodeVO;
...@@ -83,4 +85,24 @@ public class WxQrcodeServiceImpl extends GenericServiceImpl<WxQrcode> implements ...@@ -83,4 +85,24 @@ public class WxQrcodeServiceImpl extends GenericServiceImpl<WxQrcode> implements
return wxQrcodeMapper.fetchSingleSearchInfo(params); return wxQrcodeMapper.fetchSingleSearchInfo(params);
} }
@Override
public List<QyUser> fromUser(int userId,String name) {
return wxQrcodeMapper.fromUser(userId,name);
}
@Override
public List<WxQrcode> fromOrg(String name) {
return wxQrcodeMapper.fromOrg(name);
}
@Override
public int countUser(int userId) {
return wxQrcodeMapper.countUser(userId);
}
@Override
public int countOrg() {
return wxQrcodeMapper.countOrg();
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment