This commit is contained in:
hyunho 2020-10-19 04:30:54 +00:00
parent 02bd836d6b
commit 1ee968d431
6 changed files with 33 additions and 65 deletions

View File

@ -2,7 +2,6 @@
<div style="@(Model.Assign.asno > 0 && Model.IsAdmin ? "":"display: none;")">
<ul class="pagination pagination-md" style="margin: 0;">
<li class="active"><a href="#" data-toggle="tab">기본정보</a></li>
<li><a href="#" onclick="gotab(1);" data-toggle="tab">회비정보</a></li>
<li><a href="#" onclick="gotab(2);" data-toggle="tab">사이트설정</a></li>
</ul>
</div>
@ -56,11 +55,11 @@
</td>
</tr>
<tr>
<th>담당자명</th>
<th>기본담당자명</th>
<td colspan="3">@Html.TextBoxFor(m => m.Assign.mname, new { @class = "form-control", @maxlength = "50" })</td>
</tr>
<tr>
<th>담당자연락처</th>
<th>기본담당자연락처</th>
<td colspan="3">@Html.TextBoxFor(m => m.Assign.mphone, new { @class = "form-control mobilefmt nocomma", @data_zero = "1", @maxlength = "13" })</td>
</tr>
<tr>

View File

@ -110,7 +110,7 @@
});
function reg(no) {
setv("dform_intval", no);
$("#dform").attr("action", no == 0 ? "/user/asr" :"/user/asv").submit();
$("#dform").attr("action", "/user/asr").submit();
}
function searchthis() {
//고객사 상태

View File

@ -2,7 +2,6 @@
<div>
<ul class="pagination pagination-md" style="margin: 0;">
<li><a href="#" onclick="gotab(0);" data-toggle="tab">기본정보</a></li>
<li><a href="#" onclick="gotab(1);" data-toggle="tab">회비정보</a></li>
<li class="active"><a href="#" data-toggle="tab">사이트설정</a></li>
</ul>
</div>
@ -20,15 +19,6 @@
<tr><th>사이트생성여부</th><td>@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:예;0:아니오" }, { "checked", Model.Assign.issite }, { "name", "issite" } })</td></tr>
<tr><th>서브도메인설정</th><td><input name="subdomain" id="subdomain" type="text" maxlength="20" class="form-control disp-init" style="width: 200px;" value="@Model.Assign.subdomain" /> ※ 서브도메인은 서버(IIS) 및 도메인관리서비스에도 별도로 등록해주셔야 합니다.</td></tr>
<tr><th>사이트명칭</th><td><input name="sitename" id="sitename" maxlength="50" type="text" class="form-control disp-init" style="width: 200px;" value="@Model.Assign.sitename" /> </td></tr>
<tr>
<th>사이트서버IP<br />(사이트별 로그인 링크용)</th>
<td>
<input type="hidden" name="siteip" id="siteip" value="@Model.Assign.siteip" />
<input id="siteip1" maxlength="15" type="text" class="form-control disp-init" style="width: 200px;" value="@((Model.Assign.siteip??"").Split(',')[0])" />
<input id="siteip2" maxlength="15" type="text" class="form-control disp-init" style="width: 200px;" value="@((Model.Assign.siteip??"").Split(',').Length > 1 ? (Model.Assign.siteip??"").Split(',')[1] : "")" />
<input id="siteip3" maxlength="15" type="text" class="form-control disp-init" style="width: 200px;" value="@((Model.Assign.siteip??"").Split(',').Length > 2 ? (Model.Assign.siteip??"").Split(',')[2] : "")" />
</td>
</tr>
<tr>
<th>로고(200x70권장)</th>
<td>
@ -68,7 +58,7 @@
@section scripts{
<script>
function gotab(idx) {
$("#dform").attr("action", "/user/" + (idx == 0 ? "asv" : "asfee")).submit();
$("#dform").attr("action", "/user/asr").submit();
}
$(document).ready(function () {
$('#sitefooter').summernote({
@ -89,9 +79,6 @@
else if ($("#issite1").prop("checked") && check("sitename", null, "사이트명칭을 입력해주세요.")) { }
else if (!$("#issite1").prop("checked") && ($("#subdomain").val() != "" || $("#sitename").val() != "")) { msg("사이트 생성여부를 확인해주세요.");}
else if ($("#issite1").prop("checked") && $("input[name='sitelogofile']").val() == "" && $(".fgbox .filelist .fileitembox").length < 1) { msg("로고를 등록해주세요."); }
else if ($("#siteip1").val() != "" && !checkip($("#siteip1").val())) { focus("siteip1"); msg("사이트아이피를 다시 입력해주세요."); }
else if ($("#siteip2").val() != "" && !checkip($("#siteip2").val())) { focus("siteip2"); msg("사이트아이피를 다시 입력해주세요."); }
else if ($("#siteip3").val() != "" && !checkip($("#siteip3").val())) { focus("siteip3"); msg("사이트아이피를 다시 입력해주세요."); }
else if (confirm("저장하시겠습니까?")) {
var siteip = val("siteip1");
siteip += (siteip == "" ? "" : ",") + val("siteip2");

View File

@ -1114,27 +1114,17 @@ namespace NP.Base.Controllers
//{
// return JsonBack(new JsonRtn() { code = 1, msg = "1000개 이하의 데이터만 업로드해주세요.", obj = "" });
//}
if (data.Where(w => string.IsNullOrEmpty(w.username) || string.IsNullOrEmpty(w.brno) || string.IsNullOrEmpty(w.userid) || string.IsNullOrEmpty(w.email) || string.IsNullOrEmpty(w.mobile)).Count() > 0)
if (data.Where(w => string.IsNullOrEmpty(w.username) || string.IsNullOrEmpty(w.userid) || string.IsNullOrEmpty(w.email) || string.IsNullOrEmpty(w.mobile)).Count() > 0)
{
return JsonBack(new JsonRtn() { code = 1, msg = "사업자등록번호/이름/ID/이메일/핸드폰은 필수입력입니다. 확인 후 다시 업로드해주세요. ", obj = "" });
return JsonBack(new JsonRtn() { code = 1, msg = "이름/ID/이메일/핸드폰은 필수입력입니다. 확인 후 다시 업로드해주세요. ", obj = "" });
}
foreach(var user in data)
{
var brno = user.brno.Replace(" ","");
//숫자로 이루어진 문자열인지 체크
long brno2;
var id = user.userid;
var mobile = user.mobile;
var telno = user.telno;
var chk = 0;
if(brno.ToString().Trim().Length != 10)
{
return JsonBack(new JsonRtn() { code = 1, msg = "사업자등록번호는 10자 숫자여야 합니다. 확인 후 다시 업로드 해주세요. ", obj = "" });
}
if(!Int64.TryParse(brno,out brno2))
{
return JsonBack(new JsonRtn() { code = 1, msg = "사업자등록번호는 -를 제외한 10자리 숫자여야합니다. 확인후 다시 업로드해주세요. ", obj = "" });
}
if(id.ToString().Trim().Length < 4)
{
return JsonBack(new JsonRtn() { code = 1, msg = "ID의 길이는 4자이상이여야 합니다. 확인 후 다시 업로드해주세요. ", obj = "" });
@ -1147,28 +1137,9 @@ namespace NP.Base.Controllers
{
return JsonBack(new JsonRtn() { code = 1, msg = "연락처는 - 를 제외한 숫자만 입력하여야 합니다. 확인 후 다시 업로드해주세요. ", obj = "" });
}
if(!string.IsNullOrEmpty(user.gender2.Trim()) && (user.gender2.Trim()!="남" && user.gender2 != "여")){
return JsonBack(new JsonRtn() { code = 1, msg = "성별은 남,여만 입력하여아 합니다. 확인 후 다시 업로드해주세요. ", obj = "" });
}
}
//brnos
//var brnos = string.Join(",", data.Where(w => !string.IsNullOrEmpty(w.brno)).Select(s => "'" + s.brno + "'").Distinct());
//var assigns = new List<Assign>() { };
//if (!string.IsNullOrEmpty(brnos))
//{
// assigns = Dao.Get<Assign>("users.assigns", new System.Collections.Hashtable() { { "brnos", brnos } }).ToList();
//}
var brnos = string.Join(",", data.Select(s => "'" + s.brno.Replace(" ", "").Replace("-", "") + "'").Distinct());
var list = Dao.Get<Users>("users.batchcheck.bybrnos", new Hashtable() { { "brnos", brnos } });
var listbrnos = string.Join(",", list.Select(s => "'" + s.brno.Replace(" ", "").Replace("-", "") + "'").Distinct());
if(list.Count() > data.Select(s => s.brno).Distinct().Count())
{
return JsonBack(new JsonRtn() { code = 1, msg = "사업자번호가 중복됩니다.<br />" + string.Join(",", data.Where(w=>!(listbrnos.Contains(w.brno))).Select(w=>w.brno)), obj = "" });
}
if (list.Count() != data.Select(s => s.brno).Distinct().Count())
{
return JsonBack(new JsonRtn() { code = 1, msg = "등록되지 않은 사업자번호가 존재합니다.<br />" + string.Join(",", data.Where(w=>!(listbrnos.Contains(w.brno))).Select(w=>w.brno)), obj = "" });
}
var list = Dao.Get<Users>("users.usersall", new Hashtable() { });
var userids = string.Join(",", data.Select(s => "'" + s.userid + "'").Distinct());
list = Dao.Get<Users>("users.batchcheck", new Hashtable() { { "userids", userids } });
if (list.Count() > 0)
@ -1184,18 +1155,16 @@ namespace NP.Base.Controllers
foreach(var u in data)
{
u.userpass = NP.Base.Lib.KISA_SHA256.SHA256Hash(u.mobile.Trim().Replace("-", ""));
u.introhtml = u.brno;
u.userid = u.userid.Trim();
u.gender = string.IsNullOrEmpty(u.gender2.Trim()) ? (int?)null : u.gender2.Trim() =="남" ? 0 : 1;
u.email = u.email.Trim();
u.brno = (u.brno ?? "").Replace(" ","").Replace("-", "");
u.ccjobs = (u.ccjobs ?? "").Replace(" ", "");
u.ccposition = string.IsNullOrEmpty(u.ccposition2) ? (int?)null : Convert.ToInt32(u.ccposition2);
u.telno = u.telno;
u.mobile = (u.mobile.Trim() ?? "").Replace("-", "").Length == 10 ?
string.Format("{0}-{1}-{2}", (u.mobile ?? "").Replace("-", "").Substring(0, 3), (u.mobile ?? "").Replace("-", "").Substring(3,3), (u.mobile ?? "").Replace("-", "").Substring(6)) :
(u.mobile ?? "").Replace("-", "").Length == 11 ?
string.Format("{0}-{1}-{2}", (u.mobile ?? "").Replace("-", "").Substring(0, 3), (u.mobile ?? "").Replace("-", "").Substring(3, 4), (u.mobile ?? "").Replace("-", "").Substring(7)) : u.mobile;
u.asno = string.IsNullOrEmpty(u.asno2) ? (int?)null : (int?)Convert.ToInt32(u.asno2);
u.depart = string.IsNullOrEmpty(u.depart) ? "" : u.depart;
u.uduty = string.IsNullOrEmpty(u.uduty) ? "" : u.uduty;
}
var muser = new Users() { Us = data, uno = SUserInfo.UserNo, uip = GetUserIP() };
return JsonOK(Dao.Save("users.batch", muser), false);

View File

@ -369,6 +369,12 @@
where status =1 and isdel=0
<isNotNull property="brnos">and brno in ($brnos$)</isNotNull>
</select>
<select id="users.usersall" parameterClass="string" resultClass="users">
select
userno,usertype,jointype,snsid,userkind,userid,userpass,username,usernameeng,rrnum,gender,birthday,email,isacceptemail,mobile,isacceptmobile,telno,asno,pasname,depart,ccposition,ccpositionetc,fgnoprofile
,ccjobs,userpno,bankname,bankno,post,address1,address2,introhtml,status,exitreason,logintime,loginkey,send335time,pwcalltime,pwcallno,eastereggkey,eetime,kfcfyear,isassignuser,uduty,slevel,edus,remotekey
from users
</select>
<select id="users.batchcheck" parameterClass="string" resultClass="users">
select userid,CAST(AES_DECRYPT(UNHEX(email), <include refid="sql.digest"></include>) AS char) email from users
where
@ -378,23 +384,29 @@
</isNotNull>
</select>
<update id="users.batch" parameterClass="users">
insert into users (usertype,userid,userpass,username,gender,email,isacceptemail,mobile,telno,asno,depart,ccposition,ccjobs,status,logintime,<include refid="sql.inc"></include><!--,devcol-->)
insert into users (usertype,jointype,userid,userpass,username,gender,email,isacceptemail,isacceptmobile,isassignuser,mobile,telno,asno,depart,ccposition,ccjobs,uduty,status,logintime,<include refid="sql.inc"></include><!--,devcol-->)
<iterate property="Us" open="" conjunction="union all" close="">
select 1,#Us[].userid#,#Us[].userpass#,#Us[].username#
,#Us[].gender#
select 1,0
,#Us[].userid#
,#Us[].userpass#
,#Us[].username#
,null
,HEX(AES_ENCRYPT(#Us[].email#, <include refid="sql.digest"></include>))
,1
,1
,1
,HEX(AES_ENCRYPT(#Us[].mobile#, <include refid="sql.digest"></include>))
,HEX(AES_ENCRYPT(#Us[].telno#, <include refid="sql.digest"></include>))
,b.asno
,#Us[].asno#
,#Us[].depart#
,c.ccode
,#Us[].ccjobs#
,null
,null
,#Us[].uduty#
,1,now(), now(), #uno#, now(), #uno#, #uip#
<!--,#Us[].introhtml#-->
from (select 1 col1) a
left outer join assign b on b.brno=#Us[].brno# and b.isdel=0
left outer join comcode c on c.cgroup='jobposition' and c.ccode=#Us[].ccposition#
<!--left outer join assign b on b.brno=#Us[].brno# and b.isdel=0
left outer join comcode c on c.cgroup='jobposition' and c.ccode=#Us[].ccposition#-->
</iterate>;
</update>
<select id="users.eecall" parameterClass="hashtable" resultClass="users">

View File

@ -75,6 +75,7 @@ namespace NP.Model
/// fkusersassign 소속 assign.asno
/// </summary>
public int? asno { get; set; }
public string asno2 { get; set; }
public String asname { get; set; }
public String ceoname { get; set; }
/// <summary>