| | |
| | | /// </summary> |
| | | public class FMAdminCreateDistributionPost |
| | | { |
| | | /// <summary> |
| | | /// 已注册用户手机号码 |
| | | /// </summary> |
| | | public System.String registeredUserMobile { get; set; } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 用户序列 |
| | | /// </summary> |
| | |
| | | public System.String mobile { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 微信号 |
| | | /// 店铺名称 |
| | | /// </summary> |
| | | public System.String weixin { get; set; } |
| | | public string storeName { get; set; } |
| | | /// <summary> |
| | | /// 区域 |
| | | /// </summary> |
| | | public string areaCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// qq号 |
| | | /// 详细地址 |
| | | /// </summary> |
| | | public System.String qq { get; set; } |
| | | public string address { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 店铺门头 |
| | | /// </summary> |
| | | public string storeBanner { get; set; } |
| | | //public string qq { get; set; } |
| | | //public string weixin { get; set; } |
| | | /// <summary> |
| | | /// 销售额度 |
| | | /// </summary> |
| | | public decimal sales { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 所属行业 |
| | | /// </summary> |
| | | public string profession { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 坐标 |
| | | /// </summary> |
| | | public string storeCoordinate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 审核状态 |
| | |
| | | public static Type[] DbCodeFirstModes (string ModeProjectName, string ModeNamespace = null, string ConfigId = null , Type subClass= null, Type thisAttribute=null) |
| | | { |
| | | |
| | | var a= GetAllAssembly().Where(x => x.FullName.Contains(ModeProjectName + ",")).FirstOrDefault(); |
| | | var b = a.GetTypes(); |
| | | var c = b.WhereIF(!string.IsNullOrEmpty(ModeNamespace), name => name.FullName.Contains(ModeNamespace + ".")).ToArray(); |
| | | var d = c.WhereIF(subClass != null, x => x.IsSubclassOf(subClass)).ToArray(); |
| | | var e = d.WhereIF(thisAttribute != null, x => (x.GetCustomAttributes(thisAttribute, true).Length > 0)).ToArray(); ; |
| | | |
| | | #nullable enable |
| | | Type[]? types = GetAllAssembly().Where(x => x.FullName.Contains(ModeProjectName + ",")).FirstOrDefault()?.GetTypes().WhereIF(!string.IsNullOrEmpty(ModeNamespace), name => name.FullName.Contains(ModeNamespace + ".")).ToArray() |
| | | .WhereIF(subClass!=null, x => x.IsSubclassOf(subClass)).ToArray() |
| | |
| | | using CoreCms.Net.Utility.Extensions; |
| | | using CoreCms.Net.Utility.Helper; |
| | | using CoreCms.Net.Web.Admin.Infrastructure; |
| | | using Essensoft.Paylink.Alipay.Domain; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Hosting; |
| | | using Microsoft.AspNetCore.Mvc; |
| | |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var user = await _userServices.QueryByClauseAsync(p => p.mobile == entity.registeredUserMobile); |
| | | var user = await _userServices.QueryByClauseAsync(p => p.id == entity.userId); |
| | | if (user == null) |
| | | { |
| | | jm.msg = "提交的【已注册手机号】未查询到注册用户"; |
| | |
| | | var isDistribution = await _coreCmsDistributionServices.ExistsAsync(p => p.userId == user.id); |
| | | if (isDistribution) |
| | | { |
| | | jm.msg = "提交的【已注册手机号】已经是经销商了。"; |
| | | jm.msg = "提交的用户已经有经销商记录,请找到相关项进行审核"; |
| | | return jm; |
| | | } |
| | | var model = new CoreCmsDistribution(); |
| | | |
| | | model.userId = user.id; |
| | | model.mobile = entity.registeredUserMobile; |
| | | model.userId = user.id; |
| | | model.name = entity.name; |
| | | model.gradeId = entity.gradeId; |
| | | model.mobile = string.IsNullOrEmpty(entity.mobile) ? user.mobile : entity.mobile; |
| | | model.weixin = entity.weixin; |
| | | model.qq = entity.qq; |
| | | model.profession = entity.profession; |
| | | model.storeCoordinate = entity.storeCoordinate; |
| | | model.storeLogo = entity.storeBanner; |
| | | model.storeName= entity.storeName; |
| | | model.sales=entity.sales; |
| | | model.areaCode=entity.areaCode; |
| | | model.address=entity.address; |
| | | model.verifyStatus = entity.verifyStatus; |
| | | model.createTime = DateTime.Now; |
| | | model.isDelete = false; |
| | | if (model.verifyStatus == (int)GlobalEnumVars.DistributionVerifyStatus.VerifyYes) model.verifyTime = DateTime.Now; |
| | | try |
| | | { |
| | | _unitOfWork.BeginTran(); |
| | | if (model.verifyStatus == (int)GlobalEnumVars.DistributionVerifyStatus.VerifyYes) |
| | | { |
| | | model.verifyTime = DateTime.Now; |
| | | //老模型未通过审核,新模型未通过审核,那么为审核通过过程 |
| | | var allConfigs = await _coreCmsSettingServices.GetConfigDictionaries(); |
| | | var kc = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DictionaryUserGroupKey); |
| | | |
| | | var group = await _userGradeServices.GetUserGradeByValueKey(kc); |
| | | if (group != null) |
| | | { |
| | | |
| | | var id = await _coreCmsDistributionServices.InsertAsync(model); |
| | | //关联经销商用户等级 |
| | | if (user != null) |
| | | { |
| | | user.grade = group.id; |
| | | user.updataTime = DateTime.Now; |
| | | await _userServices.UpdateAsync(user); |
| | | |
| | | jm.code = id > 0 ? 0 : 1; |
| | | jm.msg = id > 0 ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; |
| | | } |
| | | } |
| | | //处理店铺 |
| | | if (entity.profession == "文具店") |
| | | { |
| | | |
| | | //新建店铺名称 |
| | | |
| | | var store = await _coreCmsStoreServices.QueryByClauseAsync(x => x.userID == model.userId); |
| | | if (store != null) |
| | | { |
| | | //存在店铺 |
| | | store.coordinate = entity.storeCoordinate; |
| | | store.storeName = entity.storeName; |
| | | //用logo代替门头照片 |
| | | store.logoImage = model.storeLogo; |
| | | store.en = true; |
| | | store.updateTime = DateTime.Now; |
| | | await _coreCmsStoreServices.UpdateAsync(store); |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | var areaCode = model.areaCode.Split(',').OrderByDescending(x => x).FirstOrDefault(); |
| | | var db = _unitOfWork.GetDbClient(); |
| | | string[] lat = []; |
| | | if (!string.IsNullOrEmpty(model.storeCoordinate)) |
| | | lat = model.storeCoordinate.Split(","); |
| | | //新建地铺 |
| | | store = new CoreCmsStore |
| | | { |
| | | userID = model.userId, |
| | | address = model.address, |
| | | areaId = areaCode.ToInt32OrDefault(510000), |
| | | storeName = model.storeName, |
| | | coordinate = model.storeCoordinate, |
| | | createTime = DateTime.Now, |
| | | mobile = model.mobile, |
| | | linkMan = user.nickName, |
| | | |
| | | |
| | | |
| | | }; |
| | | if (lat.Length == 2) |
| | | { |
| | | store.latitude = lat[0]; |
| | | store.longitude = lat[1]; |
| | | } |
| | | var storeid = await _unitOfWork.GetDbClient().Insertable(store).ExecuteReturnIdentityAsync(); |
| | | |
| | | //将自己设置为店员 |
| | | CoreCmsClerk clerk = new CoreCmsClerk() |
| | | { |
| | | createTime = DateTime.Now, |
| | | storeId = storeid, |
| | | userId = entity.userId, |
| | | |
| | | }; |
| | | await _coreCmsClerkServices.InsertAsync(clerk); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | await _coreCmsDistributionServices.InsertAsync(model); |
| | | |
| | | _unitOfWork.CommitTran(); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | _unitOfWork.RollbackTran(); |
| | | throw; |
| | | } |
| | | |
| | | |
| | | jm.code = 1; |
| | | jm.msg = GlobalConstVars.CreateSuccess ; |
| | | return jm; |
| | | } |
| | | #endregion |
| | |
| | | { |
| | | where = where.And(p => p.School.Contains(School)); |
| | | } |
| | | // 地推人员 |
| | | var pUserID = Request.Form["pUserID"].FirstOrDefault().ToInt32OrDefault(0); |
| | | if (pUserID>0) |
| | | { |
| | | where = where.And(p => p.PUserID==pUserID); |
| | | } |
| | | //经销商名称 varchar |
| | | var DealerName = Request.Form["DealerName"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(DealerName)) |
| | |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp12 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp12.SetCellValue(listModel[i].NegotiationRecord.ToString()); |
| | | rowTemp12.SetCellValue(listModel[i].NegotiationRecord?.ToString()); |
| | | rowTemp12.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | |
| | | dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" |
| | | connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456" |
| | | --> |
| | | <target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=MS-FSEUTNLCXFDB\SQLEXPRESS;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;Trusted_Connection=True; "> |
| | | <target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=MS-FSEUTNLCXFDB\SQLEXPRESS;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;integrated security=True;"> |
| | | <commandText> |
| | | INSERT INTO SysNLogRecords |
| | | (LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label for="pUserID" class="layui-form-label ">推荐人</label> |
| | | <label for="pUserID" class="layui-form-label ">地推人</label> |
| | | <div class="layui-input-block"> |
| | | <select lay-search="" name="pUserID" id="CreatOfflinedisSelUserID"> |
| | | <option value="">请选择或搜索(设置区分大小写)</option> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label for="pUserID" class="layui-form-label ">推荐人</label> |
| | | <label for="pUserID" class="layui-form-label ">地推人</label> |
| | | <div class="layui-input-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select lay-search="" name="pUserID" id="EditOfflinedisSelUserID" disabled> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label for="pUserID" class="layui-form-label ">推荐人</label> |
| | | <label for="pUserID" class="layui-form-label ">地推人</label> |
| | | <div class="layui-input-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select lay-search="" name="pUserID" id="EditOfflinedisSelUserID"> |
| | |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="CooperationIntent">地推人员</label> |
| | | <div class="layui-input-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select lay-search="" name="pUserID" id="selOfflinedisSelUserID"> |
| | | <option value="">请选择地推人</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button |
| | | class="layui-btn layui-btn-sm" |
| | |
| | | } |
| | | } |
| | | ); |
| | | formatUserSelInPut( |
| | | coreHelper, |
| | | form, |
| | | "selOfflinedisSelUserID", |
| | | "" |
| | | ); |
| | | dropdown.render({ |
| | | elem: "#SeCooperationIntent", |
| | | data: [ |
| | |
| | | <script type="text/html" template lay-done="layui.data.done(d);"> |
| | | <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsDistribution-createForm" id="LAY-app-CoreCmsDistribution-createForm"> |
| | | |
| | | <input type="hidden" name="userId" value="0" /> |
| | | <!-- <input type="hidden" name="userId" value="0" /> --> |
| | | <div class="layui-form-item"> |
| | | <label for="mobile" class="layui-form-label layui-form-required">已注册手机号</label> |
| | | <div class="layui-input-inline"> |
| | | <label for="mobile" class="layui-form-label layui-form-required">用户</label> |
| | | <div class="layui-input-block"> |
| | | <select lay-search="" name="userId" id="CreatDistrbutorSelUserID" lay-verify="required" > |
| | | <option value="">请选择或搜索(设置区分大小写)</option> |
| | | </select> |
| | | <!-- <div class="layui-input-inline"> |
| | | <input name="registeredUserMobile" lay-verify="required|phone" class="layui-input" placeholder="请输入手机号" lay-reqText="请输入手机号" /> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="profession" class="layui-form-label">所属行业</label> |
| | | <label for="profession" class="layui-form-label layui-form-required">所属行业</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="profession" class="layui-input" placeholder="所属行业" lay-reqText="所属行业" value="{{ '文具店' }}" /> |
| | | <input name="profession" class="layui-input" id="Creatprofession" lay-verify="required" placeholder="所属行业" lay-reqText="所属行业" value="{{ '文具店' }}" /> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label for="sales" class="layui-form-label layui-form-required">年销售额</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="sales" class="layui-input" placeholder="年销售额" lay-reqText="年销售额" lay-verify="required|number" value="{{ '0' }}" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="weixin" class="layui-form-label">微信号</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="weixin" class="layui-input" placeholder="请输入微信号" lay-reqText="请输入微信号" /> |
| | | <span class="layui-form-mid">元</span> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="name" class="layui-form-label layui-form-required">区域</label> |
| | | <div class="layui-input-inline" style="width: 350px;"> |
| | | <input name="CreatDistrbutorSelAreaCode" lay-verify="required" class="layui-input" type="hidden"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="mobile" class="layui-form-label ">详细地址</label> |
| | | <div class="layui-input-block"> |
| | | <input name="address" class="layui-input" placeholder="请输入详细地址" lay-reqText="请输入详细地址" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | |
| | | layui.data.done = function (d) { |
| | | //开启调试情况下获取接口赋值数据 |
| | | if (debug) { console.log(d.params.data); } |
| | | layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'], |
| | | layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg','dropdown'], |
| | | function () { |
| | | var $ = layui.$ |
| | | , form = layui.form |
| | |
| | | , laydate = layui.laydate |
| | | , upload = layui.upload |
| | | , cropperImg = layui.cropperImg |
| | | ,dropdown=layui.dropdown |
| | | , coreHelper = layui.coreHelper; |
| | | |
| | | formatAreaInPut(coreHelper, "CreatDistrbutorSelAreaCode"); |
| | | formatUserSelInPut(coreHelper, form, "CreatDistrbutorSelUserID"); |
| | | dropdown.render({ |
| | | elem: "#Creatprofession", |
| | | data: [ |
| | | { |
| | | title: "文具店", |
| | | id: 101, |
| | | }, |
| | | { |
| | | title: "广告店", |
| | | id: 102, |
| | | }, |
| | | { |
| | | title: "小卖部", |
| | | id: 103, |
| | | }, |
| | | { |
| | | title: "微商", |
| | | id: 104, |
| | | }, |
| | | { |
| | | title: "短视频主播", |
| | | id: 105, |
| | | }, |
| | | { |
| | | title: "教师", |
| | | id: 106, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | | }, |
| | | style: "min-width: 235px;", |
| | | }); |
| | | laydate.render({ |
| | | elem: '#createTime-CoreCmsDistribution-createTime', |
| | | type: 'datetime' |
| | |
| | | * @Author: 小飞侠 |
| | | * @Date: 2024-02-28 13:48:49 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2024-03-27 13:03:32 |
| | | * @LastEditTime: 2024-04-16 15:08:49 |
| | | * Copyright: 2024 MinTinge CO.,LTD. All Rights Reserved. |
| | | * @Descripttion: 写入你的描述 |
| | | --> |
| | |
| | | <div class="layui-form-item"> |
| | | <label for="profession" class="layui-form-label">所属行业</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="profession" class="layui-input" placeholder="所属行业" lay-reqText="所属行业" value="{{d.params.data.model.profession || '' }}" /> |
| | | <input name="profession" class="layui-input" placeholder="所属行业" id="Editprofession" lay-reqText="所属行业" value="{{d.params.data.model.profession || '' }}" /> |
| | | </div> |
| | | <label for="sales" class="layui-form-label layui-form-required">年销售额</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | layui.data.sendParams = function (d) { |
| | | //开启调试情况下获取接口赋值数据 |
| | | if (debug) { console.log(d.params.data); } |
| | | layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper'], |
| | | layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper','dropdown'], |
| | | function () { |
| | | var $ = layui.$ |
| | | , form = layui.form |
| | | , admin = layui.admin |
| | | , laydate = layui.laydate |
| | | , upload = layui.upload |
| | | ,dropdown=layui.dropdown |
| | | , coreHelper = layui.coreHelper; |
| | | |
| | | laydate.render({ |
| | |
| | | elem: '#editTime-CoreCmsDistribution-verifyTime', |
| | | type: 'datetime' |
| | | }); |
| | | dropdown.render({ |
| | | elem: "#Editprofession", |
| | | data: [ |
| | | { |
| | | title: "文具店", |
| | | id: 101, |
| | | }, |
| | | { |
| | | title: "广告店", |
| | | id: 102, |
| | | }, |
| | | { |
| | | title: "小卖部", |
| | | id: 103, |
| | | }, |
| | | { |
| | | title: "微商", |
| | | id: 104, |
| | | }, |
| | | { |
| | | title: "短视频主播", |
| | | id: 105, |
| | | }, |
| | | { |
| | | title: "教师", |
| | | id: 106, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | | }, |
| | | style: "min-width: 235px;", |
| | | }); |
| | | form.verify({ |
| | | |
| | | verifyname: [/^[\S]{0,255}$/, '经销商名称最大只允许输入255位字符,且不能出现空格'], |
| | |
| | | </div> |
| | | |
| | | </script> |
| | | |
| | | <script src="/views/liao.js"></script> |
| | | <script> |
| | | var indexData; |
| | | var debug = layui.setter.debug; |
| | |
| | | admin.popup({ |
| | | shadeClose: false, |
| | | title: '创建数据', |
| | | area: ['640px', '300px'], |
| | | area: ['640px', '500px'], |
| | | id: 'LAY-popup-CoreCmsDistribution-create', |
| | | success: function (layero, index) { |
| | | view(this.id).render('distribution/distributor/create', { data: e.data }).done(function () { |
| | |
| | | form.on('submit(LAY-app-CoreCmsDistribution-createForm-submit)', |
| | | function (data) { |
| | | var field = data.field; //获取提交的字段 |
| | | |
| | | field.areaCode = GetAreaCodeFormFileid( |
| | | field, |
| | | "CreatDistrbutorSelAreaCode" |
| | | ); |
| | | if (debug) { console.log(field); } //开启调试返回数据 |
| | | //提交 Ajax 成功后,关闭当前弹层并重载表格 |
| | | coreHelper.Post("Api/CoreCmsDistribution/DoCreate", field, function (e) { |
| | |
| | | dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" |
| | | connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456" |
| | | --> |
| | | <target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=MS-FSEUTNLCXFDB\SQLEXPRESS;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;Trusted_Connection=True; "> |
| | | <target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=MS-FSEUTNLCXFDB\SQLEXPRESS;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;"> |
| | | <commandText> |
| | | INSERT INTO SysNLogRecords |
| | | (LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod |