xiongzhu преди 7 години
родител
ревизия
a9e756d7b0
променени са 6 файла, в които са добавени 718 реда и са изтрити 555 реда
  1. 25 1
      migrate.sql
  2. 11 4
      src/main/java/system/DBRecordsPack.java
  3. 5 2
      src/main/webapp/_common.jsp
  4. 552 542
      src/main/webapp/member/model_.jsp
  5. 119 0
      src/main/webapp/member/model__.jsp
  6. 6 6
      src/main/webapp/member/query_model.jsp

+ 25 - 1
migrate.sql

@@ -12,6 +12,30 @@ create table sharerecord
 ALTER TABLE cashrecord ALTER COLUMN AccountingDate SET DEFAULT CURRENT_TIMESTAMP;
 ALTER TABLE cashrecord ALTER COLUMN FeeDate SET DEFAULT CURRENT_TIMESTAMP;
 
+CREATE TABLE coin_share_record
+(
+    id             int AUTO_INCREMENT
+        PRIMARY KEY,
+    member_pk      int                                NULL,
+    from_member_pk int                                NULL,
+    total_amount   decimal(18, 4)                     NULL,
+    share_amount   decimal(18, 4)                     NULL,
+    ratio          decimal(18, 4)                     NULL,
+    type           varchar(255)                       NULL,
+    remark         varchar(255)                       NULL,
+    create_time    datetime DEFAULT CURRENT_TIMESTAMP NULL
+);
+
+ALTER TABLE memberinfo ADD income_ratio_gift decimal(18,4) DEFAULT 100 NULL;
+ALTER TABLE memberinfo ADD income_ratio_video decimal(18,4) DEFAULT 50 NULL;
+ALTER TABLE memberinfo ADD income_ratio_service decimal(18,4) DEFAULT 70 NULL;
+ALTER TABLE memberinfo ADD share_ratio_gift decimal(18,4) DEFAULT 0 NULL;
+ALTER TABLE memberinfo ADD share_ratio_video decimal(18,4) DEFAULT 10 NULL;
+ALTER TABLE memberinfo ADD share_ratio_service decimal(18,4) DEFAULT 10 NULL;
+ALTER TABLE memberinfo ADD broker_ratio_git decimal(18,4) DEFAULT 0 NULL;
+ALTER TABLE memberinfo ADD broker_ratio_video decimal(18,4) DEFAULT 10 NULL;
+ALTER TABLE memberinfo ADD broker_ratio_service decimal(18,4) DEFAULT 10 NULL;
+ALTER TABLE memberinfo ADD coin_share decimal(18,4) DEFAULT 0.0000 NULL;
 
 ALTER TABLE modelinfo ADD hobby varchar(255) NULL;
 ALTER TABLE modelinfo
@@ -25,4 +49,4 @@ ALTER TABLE modelinfo ADD constellation varchar(255) NULL;
 ALTER TABLE modelinfo
   MODIFY COLUMN constellation varchar(255) AFTER college;
 
-ALTER TABLE modelinfo ALTER COLUMN VPrice SET DEFAULT 6.0;
+ALTER TABLE modelinfo ALTER COLUMN VPrice SET DEFAULT 6.0;

+ 11 - 4
src/main/java/system/DBRecordsPack.java

@@ -20,8 +20,8 @@ public class DBRecordsPack {
     {
         LastError = "";
         List<JSONObject> jsonList = new ArrayList<JSONObject>();
-        int i, iPos;
-        String fieldValue;
+        int              i, iPos;
+        String           fieldValue;
 
         try {
             if ((rs == null) || !rs.next()) {
@@ -67,8 +67,7 @@ public class DBRecordsPack {
         return Pack(rs);
     }
 
-    public static List<JSONObject> Pack(Result<Record> records) //方法2
-    {
+    public static List<JSONObject> Pack(Result<Record> records) {
         List<JSONObject> jsonObjects = new ArrayList<>();
         for (Record record : records) {
             JSONObject jsonObject = new JSONObject();
@@ -79,5 +78,13 @@ public class DBRecordsPack {
         }
         return jsonObjects;
     }
+
+    public static JSONObject Pack(Record record) {
+        JSONObject jsonObject = new JSONObject();
+        for (Field field : record.fields()) {
+            jsonObject.put(field.getName(), field.getValue(record));
+        }
+        return jsonObject;
+    }
 }
 

+ 5 - 2
src/main/webapp/_common.jsp

@@ -73,8 +73,11 @@
                 dialog.Title = options.title;
                 dialog.URL = options.url;
                 dialog.OnClose = function (zWindow) {
-                    if (zWindow.result == 1)
-                        DoQuery("", -1);
+                    if (zWindow.result == 1) {
+                        if (options.onclose) {
+                            options.onClose();
+                        }
+                    }
                 };
                 dialog.show();
             }

+ 552 - 542
src/main/webapp/member/model_.jsp

@@ -1,542 +1,552 @@
-<%@ page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
-<%request.setCharacterEncoding("utf-8");%>  
-<%@ page language="java" import="java.sql.*,java.util.Arrays" %>
-<%@ page language="java" import="java.util.*" %>
-<%@ page language="java" import="util.*" %>
-<%@ page language="java" import="system.*" %>
-<%@ page language="java" import="biz.*" %>
-<%@ page language="java" import="dbconnection.*" %>
-<%@ page language="java" import="net.sf.json.JSONObject"  %>
-<%@ page language="java" import="java.io.*, org.apache.commons.fileupload.*,java.util.regex.*,java.text.SimpleDateFormat"%>
-<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page" />
-<%
-	String path = request.getContextPath();
-  String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
-  String defaultDate = DateUtil.getYMDHMS();
-  String JJRmemberpk = ExtendString.getDBStr( request.getParameter("bmemberpk") );//经纪人memberpk
-  String JJRbrokepk = ExtendString.getDBStr( request.getParameter("brokepk") );   //经纪人pk
-  String MTmemberpk = ExtendString.getDBStr( request.getParameter("memberpk") );  //模特memberpk
-  String flag = ExtendString.getDBStr( request.getParameter("flag") );  //0查看,1新增,2修改
-  String operator = ExtendString.getDBStr( request.getParameter("operator") );  
-  String tmpName="";  
-  String tmpID, sql;
-  javax.sql.rowset.CachedRowSet rs;
-  
-  if ( (operator==null) || operator.equals("") ) operator = "";
-  if ( JJRmemberpk.equals("") ) JJRmemberpk = "0";
-  if ( JJRbrokepk.equals("") ) JJRbrokepk = "0";
-  if ( MTmemberpk.equals("") ) MTmemberpk = "0";
-  if (flag.equals("")) flag = "0";
-    
-  out.clear();
-  String D_ModelInfopk="0", D_MemberPK="0", D_Tel="", D_Name="", D_Stage="", D_LName="", D_Phone="", D_addr="",
-         D_AreaID="0",  D_BrokePK="0", D_BMemberPK="0", D_nominate="0";
-  String D_ratio_R="100", D_ratio_V="50", D_ratio_S="70", D_Is_V="0", D_CardPK="0";
-  String D_ratio_RR="0", D_ratio_VR="0", D_ratio_SR="0",
-	 D_ratio_RRM="0", D_ratio_VRM="10", D_ratio_SRM="10";
-  String D_Age="", D_hei="0", D_wei="0", D_wai="0", D_bust="0", D_hip="0", D_VPrice="0";
-  String D_SuperName=""; 
-	 
-  if (operator.equalsIgnoreCase("doPost") )//执行插入,更新
-  {
-      try {
-	DiskFileUpload fu = new DiskFileUpload();
-	//fu.initialize(pageContext);
-	fu.setHeaderEncoding("UTF-8"); // 此句为主要代码
-	// 设置允许用户上传文档大小,单位:字节,这里设为100M
-	fu.setSizeMax(100 * 1024 * 1024);
-	// 设置最多只允许在内存中存储的数据,单位:字节
-	fu.setSizeThreshold(4096);
-	// 开始读取上传信息
-	List fileItems = fu.parseRequest(request);
-	// 依次处理每个上传的文件
-	Iterator iter = fileItems.iterator();
-	while (iter.hasNext()) {
-		FileItem item = (FileItem) iter.next();
-		String fieldName = item.getFieldName();
-		if(fieldName==null || fieldName.equals("")) continue; // 忽略其他不是文件域的所有表单信息
-		
-		if (item.isFormField()) //普通数据 
-		{
-		  String formContent = ExtendString.getDBStr( item.getString("utf-8") ); //取值
-		  if (fieldName.equalsIgnoreCase("ModelInfopk"))    D_ModelInfopk  = KindEditor.getDBStr( formContent );
-		  else if (fieldName.equalsIgnoreCase("MemberPK")) 	D_MemberPK = formContent;
-		  else if (fieldName.equalsIgnoreCase("Tel"))       D_Tel   = formContent;
-		  else if (fieldName.equalsIgnoreCase("Name"))      D_Name  =formContent;
-		  else if (fieldName.equalsIgnoreCase("Stage"))     D_Stage =formContent;
-		  else if (fieldName.equalsIgnoreCase("LName"))     D_LName =formContent;
-		  else if (fieldName.equalsIgnoreCase("Phone"))     D_Phone =formContent;
-		  else if (fieldName.equalsIgnoreCase("addr"))      D_addr  =formContent;
-		  else if (fieldName.equalsIgnoreCase("Area"))      D_AreaID=formContent;
-		  else if (fieldName.equalsIgnoreCase("BrokePK"))   D_BrokePK   =formContent;
-		  else if (fieldName.equalsIgnoreCase("BMemberPK")) D_BMemberPK =formContent;
-		  else if (fieldName.equalsIgnoreCase("ratio_R"))   D_ratio_R =formContent;
-		  else if (fieldName.equalsIgnoreCase("ratio_V"))   D_ratio_V =formContent;
-		  else if (fieldName.equalsIgnoreCase("ratio_S"))   D_ratio_S =formContent;
-		  else if (fieldName.equalsIgnoreCase("Is_V"))      D_Is_V    =formContent;
-		  else if (fieldName.equalsIgnoreCase("CardPK"))    D_CardPK  =formContent;
-		  else if (fieldName.equalsIgnoreCase("nominate"))  D_nominate=formContent;
-		  
-		  else if (fieldName.equalsIgnoreCase("ratio_RR"))   D_ratio_RR =formContent;
-		  else if (fieldName.equalsIgnoreCase("ratio_VR"))   D_ratio_VR =formContent;
-		  else if (fieldName.equalsIgnoreCase("ratio_SR"))   D_ratio_SR =formContent;
-		  else if (fieldName.equalsIgnoreCase("ratio_RRM"))  D_ratio_RRM =formContent;
-		  else if (fieldName.equalsIgnoreCase("ratio_VRM"))  D_ratio_VRM =formContent;
-		  else if (fieldName.equalsIgnoreCase("ratio_SRM"))  D_ratio_SRM =formContent;
-		  
-		  else if (fieldName.equalsIgnoreCase("Age"))  D_Age =formContent;
-		  else if (fieldName.equalsIgnoreCase("hei"))  D_hei =formContent;
-		  else if (fieldName.equalsIgnoreCase("wei"))  D_wei =formContent;
-		  else if (fieldName.equalsIgnoreCase("wai"))  D_wai =formContent;
-		  else if (fieldName.equalsIgnoreCase("bust")) D_bust =formContent;
-		  else if (fieldName.equalsIgnoreCase("hip"))  D_hip =formContent;
-		  else if (fieldName.equalsIgnoreCase("VPrice")) D_VPrice =formContent;
-
-	    }
-	    else //文件数据
-	    {
-	    	/*
-		  UpLoad.PostFileResult R= UpLoad.PostFile(request, item, "broker");
-		  if ( R.Result<0 )
-		  {
-		    out.print( R.PostLastError );
-		    return;
-		  }
-		  if (fieldName.equalsIgnoreCase("Pic")) Pic = R.PostFileURL;
-		  else if (fieldName.equalsIgnoreCase("PCScreen")) PCScreen = R.PostFileURL;
-		  */
-		        }
-		      }
-		}catch (Exception e) {
-		e.printStackTrace();
-		out.print(e.getMessage());
-		return;
-      }
-	  //数据合法性检查
-	  if (D_BrokePK.equals("") || D_BMemberPK.equals("0"))
-	  {
-		  out.print("数据传递错误,所属经纪人为空。");
-		  return;
-	  }
-		
-	  if (D_Stage.equals("")) D_Stage = D_Name;
-
-	  String[] sqls = new String[2];
-	  
-	  if (D_ModelInfopk.equals("0"))
-	  {
-		  D_ModelInfopk = dbtool.getNewPK(db, "ModelInfo");
-		  String QRCode = thmodel.getNewMemQrCode( db );
-	  
-		  if (QRCode.equals(""))
-		  {
-			  out.print( "获取推荐码失败:"+db.LastError );
-		  	  return;
-		  }
-		  else if (D_ModelInfopk.equals(""))
-		  {
-	  		out.print( dbtool.LastError );
-	  		return;
-		  }
-		  D_MemberPK= dbtool.getNewPK(db, "MemberInfo");
-		  if (D_MemberPK.equals(""))
-		  {
-	 		 out.print( dbtool.LastError );
-	  		return;
-		  }
-		  
-		  sqls[0] = String.format("Insert Into ModelInfo(PK, MemberPK, Name, Stage, LName, addr, "+
-		  			   "		  BrokePK, BMemberPK, ratio_R, ratio_V, ratio_S, "+
-		  			   "          Is_V, CardPK, nominate, "+
-		  			   "          ratio_RR, ratio_VR, ratio_SR, ratio_RRM, ratio_VRM, ratio_SRM, "+
-		  			   "          hei, wei, wai, bust, hip, VPrice ) "+
-		  			   "Values (%s, %s, '%s', '%s', '%s', '%s', "+
-		  			   "		%s, %s, '%s', %s, %s, "+
-		  			   "        %s, %s, %s, "+
-		  			   "        %s, %s, %s, %s, %s, %s, "+
-		  			   "        %s, %s, %s, %s, %s, %s ) ",
-		  			 D_ModelInfopk, D_MemberPK, D_Name, D_Stage, D_LName, D_addr, 
-		  			 D_BrokePK, D_BMemberPK, D_ratio_R, D_ratio_V, D_ratio_S,
-		  			 D_Is_V, D_CardPK, D_nominate,
-		  			 D_ratio_RR, D_ratio_VR, D_ratio_SR, D_ratio_RRM, D_ratio_VRM, D_ratio_SRM,
-		  			 D_hei, D_wei, D_wai, D_bust, D_hip, D_VPrice );
-		  
-		  sqls[1] = String.format("Insert Into MemberInfo (PK, Tel, Pass, MembType, "+
-  				  "               Phone, Pet, Area, QRCode, Age, MDate ) "+
-  				  "Values(%s, '%s', '123456', %s,  "+
-  				  "  '%s', '%s', %s, '%s', '%s', sysdate() ) ",
-  				  D_MemberPK, D_Tel, thmodel.MEMTYPE_Model,
-  				  D_Phone, D_Stage, D_AreaID, QRCode, D_Age ); 
-	  }
-	  else //更新
-	  {
-		  sqls[0] = String.format("Update ModelInfo "+
-		                  "Set Name='%s', Stage='%s', LName='%s', addr='%s', "+
-	  			   				  "	   ratio_R=%s, ratio_V=%s, ratio_S=%s, "+
-	  			   				  "    Is_V=%s, CardPK = %s, nominate=%s, "+
-	  			   				  "    ratio_RR=%s, ratio_VR=%s, ratio_SR=%s, ratio_RRM=%s, ratio_VRM=%s, ratio_SRM=%s, "+
-	  			   				  "    hei=%s, wei=%s, wai=%s, bust=%s, hip=%s, VPrice=%s "+
-	  			  				  "Where PK = %s ",
-	  							  D_Name,  D_Stage, D_LName, D_addr, 
-	  							  D_ratio_R, D_ratio_V, D_ratio_S, 
-	  							  D_Is_V, D_CardPK, D_nominate,
-	  							  D_ratio_RR, D_ratio_VR, D_ratio_SR, D_ratio_RRM, D_ratio_VRM, D_ratio_SRM,
-	  							  D_hei, D_wei, D_wai, D_bust, D_hip, D_VPrice,
-	  							  D_ModelInfopk ); 
-		  sqls[1] = String.format("Update MemberInfo "+
-		  				  "Set Tel='%s', Pet='%s', Phone='%s', Area=%s, Age='%s' "+
-		  				  "Where PK = %s ",
-		  				  D_Tel, D_Stage, D_Phone, D_AreaID, D_Age,
-		  				  D_MemberPK );
-	  }
-
-	  //检查帐号是否重复
-	  sql = String.format("Select Count(*) C From MemberInfo where Tel='%s' and PK<>%s ", D_Tel, D_MemberPK);
-	  rs = db.executeQuery(sql);
-	  if (rs==null)
-	  {
-		  out.print("检查帐号是否重复失败:"+db.LastError);
-		  return;
-	  }
-	  rs.next();
-	  if (rs.getInt("C")>0)
-	  {
-		  rs.close();
-		  out.println("当前帐号与其它帐号重复,不可保存。");
-		  return;
-	  }
-	  rs.close();
-	  
-	  //
-	  if (db.executeUpdate( sqls ))
-	    out.print("success");
-	  else
-	    out.print("数据保存失败。"+db.LastError ); 
-	  return;
-  }
-  
-  //正常新增或浏览
-  if (!MTmemberpk.equals("0"))
-  {
-	  sql ="select a.pk as ModelInfopk, a.MemberPK, b.Tel, a.Name, a.Stage, a.LName, b.Phone, a.addr, "+
-		 "		 b.Area, a.BrokePK, a.BMemberPK, "+
-		 "       CAST(FORMAT(a.ratio_R,0) as char) as ratio_R, "+
-		 "       CAST(FORMAT(a.ratio_V,0) as char) as ratio_V, "+
-		 "       CAST(FORMAT(a.ratio_S,0) as char) as ratio_S, "+
-		 "       a.ratio_RR, a.ratio_VR, a.ratio_SR, a.ratio_RRM, a.ratio_VRM, a.ratio_SRM, "+
-		 "       a.Is_V, a.CardPK, c.CardName, "+
-		 "       DATE_FORMAT(b.MDate,'%Y-%m-%d %H:%i:%s') as MDate, "+
-		 "       a.nominate, b.age, a.hei, a.wei, a.wai, a.bust, a.hip, a.VPrice  "+
-		 "from ModelInfo a inner Join MemberInfo b on a.MemberPK = b.PK  "+
-		 "     Left Join ModelCard c on a.CardPK = C.PK "+
-		 "where a.MemberPK= "+MTmemberpk+" "; 
-	 rs = db.executeQuery( sql );
-	 if (rs==null)
-	 {
-		  out.print("后台获取数据失败: "+db.LastError);
-	      return;
-	 }
-	  
-     if (rs.next())
-	 {
-    	  D_ModelInfopk = ExtendString.getDBStr( rs.getString("ModelInfopk") ); 
-	      D_MemberPK = ExtendString.getDBStr( rs.getString("MemberPK") );
-	      D_Tel = ExtendString.getDBStr( rs.getString("Tel") );
-	      D_Name = ExtendString.getDBStr( rs.getString("Name") );
-	      D_Stage= ExtendString.getDBStr( rs.getString("Stage") );
-	      D_LName= ExtendString.getDBStr( rs.getString("LName") );
-	      D_Phone= ExtendString.getDBStr( rs.getString("Phone") );
-	      D_addr = ExtendString.getDBStr( rs.getString("addr") );
-	      D_AreaID= ExtendString.getDBStr( rs.getString("Area") );
-	      D_BrokePK = ExtendString.getDBStr( rs.getString("BrokePK") );
-	      D_BMemberPK = ExtendString.getDBStr( rs.getString("BMemberPK") );
-	      D_ratio_R = String.valueOf( rs.getFloat("ratio_R") );
-	      D_ratio_V = String.valueOf( rs.getFloat("ratio_V") );
-	      D_ratio_S = String.valueOf( rs.getFloat("ratio_S") );
-	      D_Is_V = String.valueOf( rs.getInt("Is_V") );
-	      D_CardPK = String.valueOf( rs.getInt("CardPK") );
-	      D_nominate= String.valueOf( rs.getInt("nominate") );
-	      
-	      D_ratio_RR = String.valueOf( rs.getFloat("ratio_RR") );
-	      D_ratio_VR = String.valueOf( rs.getFloat("ratio_VR") );
-	      D_ratio_SR = String.valueOf( rs.getFloat("ratio_SR") );
-	      D_ratio_RRM = String.valueOf( rs.getFloat("ratio_RRM") );
-	      D_ratio_VRM = String.valueOf( rs.getFloat("ratio_VRM") );
-	      D_ratio_SRM = String.valueOf( rs.getFloat("ratio_SRM") );
-	      
-	      D_Age = ExtendString.getDBStr( rs.getString("Age") );
-	      D_hei = String.valueOf( rs.getFloat("hei") );
-	      D_wei = String.valueOf( rs.getFloat("wei") );
-	      D_wai = String.valueOf( rs.getFloat("wai") );
-	      D_bust = String.valueOf( rs.getFloat("bust") );
-	      D_hip = String.valueOf( rs.getFloat("hip") );
-	      D_VPrice = String.valueOf( rs.getFloat("VPrice") );
-	 }
-	 rs.close();	  
-  }
-
-  //查询经纪人所属机构
-  D_MemberPK = MTmemberpk;
-  if (!JJRbrokepk.equals("0"))
-  {
-	  sql = "Select PK, MemberPK, Name from BrokerInfor where PK = "+JJRbrokepk;
-	  rs = db.executeQuery(sql);
-	  if (rs!=null && rs.next())
-	  {
-		  D_BrokePK   = JJRbrokepk;
-		  D_BMemberPK = rs.getString("MemberPK");
-		  D_SuperName = rs.getString("Name");
-	  }
-	  if (rs!=null) rs.close();
-  }
-%>
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<base href="<%=basePath %>"/>
-<title>模特</title>
-<link rel="stylesheet" type="text/css" href="css/style.css" />
-<link rel="stylesheet" type="text/css" href="css/WdatePicker.css" />
-<link rel="stylesheet" type="text/css" href="css/skin_/table.css" />
-<link rel="stylesheet" type="text/css" href="css/jquery.grid.css" />
-<link rel="stylesheet" type="text/css" href="css/skin_/form.css" />
-<link href="umeditor/themes/default/_css/umeditor.css" type="text/css" rel="stylesheet">
-<script type="text/javascript" src="js/jquery.js"></script>
-<script type="text/javascript" src="js/global.js"></script>
-<script type="text/javascript" src="js/jquery.select.js"></script>
-<script type="text/javascript" src="js/core.js"></script>
-<script type="text/javascript" src="js/WdatePicker.js"></script>
-<script type="text/javascript" src="js/jquery-form.js"></script>
-  <style type="text/css"> 
-    .select { width:173px; line-height:25px;}
-    img { height:auto; width:auto; width:100%; }  //所有图片自适应手机屏幕大小
-  </style>
-</head>
-<body>
-<script language="javascript">
-var result = 0;	
-  function check()
-  {
-    if(document.form1.Tel.value == "")
-    {
-	    alert("请输入帐号!");
-		document.form1.Tel.focus();
-	    return false;
-    }
-    
-    if(document.form1.Name.value == "")
-    {
-	    alert("请输入模特姓名!");
-		document.form1.Name.focus();
-	    return false;
-    }
-    
-    $('#form1').ajaxSubmit(
-      {
-        url:  "<%=basePath%>member/model_.jsp?operator=doPost&bmemberpk=<%=JJRmemberpk%>&brokepk=<%=JJRbrokepk%>&memberpk=<%=MTmemberpk%>",
-        contentType: "application/x-www-form-urlencoded; charset=utf-8",  
-        success:function(data)
-        {
-          if( data.indexOf("success")>=0)
-          {
-            result = 1;
-            parentDialog.close();
-          }
-          else alert(data);
-        }
-      }
-    );
-	return true;
-  }
-  
-</script>
-		
-<form name="form1"  id="form1" method="post" enctype="multipart/form-data">
-<div id="container">
-   	<div id="main">
-		<h2 class="subfild">
-            	<span style="width:200px">
-            		<span>模特信息</span>
-            	</span>
-        </h2>
-        
-        <input type="hidden" name="ModelInfopk" value="<%=D_ModelInfopk%>">
-        <input type="hidden" name="MemberPK"    value="<%=D_MemberPK%>">
-        <input type="hidden" name="BrokePK"     value="<%=JJRbrokepk%>">
-        <input type="hidden" name="BMemberPK"   value="<%=JJRmemberpk%>">  
-        
-		<div class="subfild-content base-info" style="width:100%;">
-		<table id="" style="width:100%">
-		<% 
-    	if (!D_SuperName.equals(""))
-    	{
-    		%>
-			<tr>
-				<td style="80px">经纪人</td>
-				<td colspan="3"><%=D_SuperName%></td>
-			</tr>
-    		<%
-    	}
-		%>
-		<tr>
-			<td>帐号</td>
-			<td colspan="3"><input type="text" name="Tel" value="<%=D_Tel%>" /></td>
-		</tr>
-		<tr>
-			<td >姓名</td>
-			<td colspan="3"><input type="text" name="Name" value="<%=D_Name%>" /></td>
-		</tr>
-		<tr>
-			<td >电话</td>
-			<td colspan="3"><input type="text" name="Phone" value="<%=D_Phone%>" /></td>
-		</tr>
-		<tr>
-			<td >艺名</td>
-			<td colspan="3"><input type="text" name="Stage" value="<%=D_Stage%>" /></td>
-		</tr>
-		
-		<tr>
-			<td >年龄</td>
-			<td colspan="3"><input type="text" name="age" value="<%=D_Age%>" /></td>
-		</tr>
-		
-		<tr>
-			<td >身高</td>
-			<td colspan="3"><input type="text" name="hei" value="<%=D_hei%>" /></td>
-		</tr>
-		
-		<tr>
-			<td >体重</td>
-			<td colspan="3"><input type="text" name="wei" value="<%=D_wei%>" /></td>
-		</tr>
-		<tr>
-			<td >腰围</td>
-			<td colspan="3"><input type="text" name="wai" value="<%=D_wai%>" /></td>
-		</tr>
-		<tr>
-			<td >胸围</td>
-			<td colspan="3"><input type="text" name="bust" value="<%=D_bust%>" /></td>
-		</tr>
-		<tr>
-			<td >臀围</td>
-			<td colspan="3"><input type="text" name="hip" value="<%=D_hip%>" /></td>
-		</tr>
-		<tr>
-			<td >视频聊天单价</td>
-			<td colspan="3"><input type="text" name="VPrice" value="<%=D_VPrice%>" /></td>
-		</tr>
-		
-		<tr>
-			<td >个性签名</td>
-			<td colspan="3"><input type="text" name="LName" value="<%=D_LName%>" /></td>
-		</tr>
-
-		<tr>
-			<td >是否接受视频聊天</td>
-			<td colspan="3">
-				<select name="Is_V" id="Is_V"  class="select">
-					<option value="1" <% if (D_Is_V.equals("1")) out.print("selected");%> > 是 </option>
-					<option value="0" <% if (D_Is_V.equals("0")) out.print("selected");%> > 否 </option>
-				</select>
-			</td>
-		</tr>
-		
-		<tr>
-			<td >地区</td>
-			<td colspan="3">
-				<select name="Area" id="Area"  class="select">
-				<% 
-				sql = "Select PK, Name from datatypeinfo where typeName ='地区' order by OrdID ";
-				rs = db.executeQuery( sql );
-	  		  	while ((rs!=null) && rs.next())
-	  		  	{
-	  		  		tmpID = rs.getString("PK");
-	  		  		tmpName = rs.getString("Name");
-	  		  		if (D_AreaID.equals( tmpID ))
-	  		  		{
-	  		  		%>
-        	    		<option value="<%=tmpID%>" selected> <%=tmpName%> </option>
-        	    	<%	
-	  		  		}
-	  		  		else
-	  		  		{
-	  		  		%>
-        	    		<option value="<%=tmpID%>"> <%=tmpName%> </option>
-        	    	<%	
-	  		  		}
-        	    	
-        	  	}
-		      	if (rs!=null) rs.close();     
-				%>
-				</select>
-			</td>
-		</tr>
-		
-		
-		<tr>
-			<td >是否推荐</td>
-			<td colspan="3">
-				<select name="nominate" id="nominate"  class="select">
-					<option value="1" <% if (D_nominate.equals("1")) out.print("selected");%> > 是 </option>
-					<option value="0" <% if (D_nominate.equals("0")) out.print("selected");%> > 否 </option>
-				</select>
-			</td>
-		</tr>		
-
-		<tr>
-		   <td  colspan="4" >&nbsp</td>
-		</tr>
-        <tr>
-          <td>身&nbsp;&nbsp;&nbsp;&nbsp;份</td>
-          <td>红包分成(%)</td>
-          <td>视频分成(%)</td>
-          <td>服务分成(%)</td>
-        </tr>
-
-		<tr>
-			<td >模特自己</td>
-			<td ><input type="text" name="ratio_R" value="<%=D_ratio_R%>"  style='width:80px;'/></td>
-			<td ><input type="text" name="ratio_V" value="<%=D_ratio_V%>"  style='width:80px;'/></td>
-			<td ><input type="text" name="ratio_S" value="<%=D_ratio_S%>"  style='width:80px;'/></td>
-		</tr>
-		
-
-		<tr>
-			<td >其她模特推荐人</td>
-			<td ><input type="text" name="ratio_RR" value="<%=D_ratio_RR%>" style='width:80px;' /></td>
-			<td ><input type="text" name="ratio_VR" value="<%=D_ratio_VR%>" style='width:80px;' /></td>
-			<td ><input type="text" name="ratio_SR" value="<%=D_ratio_SR%>" style='width:80px;' /></td>
-		</tr>
-
-		<tr>
-			<td >会员推荐人</td>
-			<td ><input type="text" name="ratio_RRM" value="<%=D_ratio_RRM%>" style='width:80px;' /></td>
-			<td ><input type="text" name="ratio_VRM" value="<%=D_ratio_VRM%>" style='width:80px;' /></td>
-			<td ><input type="text" name="ratio_SRM" value="<%=D_ratio_SRM%>" style='width:80px;' /></td>
-		</tr>		
-		
-		<tr>
-		   <td  colspan="4" >&nbsp</td>
-		</tr>
-
-		<tr>
-			<td colspan="4"  class="buttons" style="text-align: center;">
-			<% 
-			  if (flag.equals("1") || flag.equals("2") )
-			  {
-				  %>
-				  <input type="button" onClick="javascript:check();" id="btn_save" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" value="保 存"/>
-				  <%
-			  }
-			%>
-    	   	<input type="button" onClick="parentDialog.close();" id="btn_back" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" value="返  回"/></td>
-		</tr>			
-		</table>
-        </div>
-    </div>
-
-</div>
-</form>
-</body>
-</html>
+<%@ page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
+<%request.setCharacterEncoding("utf-8");%>
+<%@ page language="java" import="java.sql.*,java.util.Arrays" %>
+<%@ page language="java" import="java.util.*" %>
+<%@ page language="java" import="util.*" %>
+<%@ page language="java" import="system.*" %>
+<%@ page language="java" import="biz.*" %>
+<%@ page language="java" import="dbconnection.*" %>
+<%@ page language="java" import="net.sf.json.JSONObject" %>
+<%@ page language="java"
+         import="java.io.*, org.apache.commons.fileupload.*,java.util.regex.*,java.text.SimpleDateFormat" %>
+<%@ page import="org.apache.commons.lang.StringUtils" %>
+<%@ page import="javax.sql.rowset.CachedRowSet" %>
+<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page"/>
+<%
+    String path = request.getContextPath();
+    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
+    String defaultDate = DateUtil.getYMDHMS();
+    String JJRmemberpk = ExtendString.getDBStr(request.getParameter("bmemberpk"));//经纪人memberpk
+    String JJRbrokepk = ExtendString.getDBStr(request.getParameter("brokepk"));   //经纪人pk
+    String MTmemberpk = ExtendString.getDBStr(request.getParameter("memberpk"));  //模特memberpk
+    String flag = ExtendString.getDBStr(request.getParameter("flag"));  //0查看,1新增,2修改
+    String operator = ExtendString.getDBStr(request.getParameter("operator"));
+    String tmpName = "";
+    String tmpID, sql;
+    javax.sql.rowset.CachedRowSet rs;
+
+    if (StringUtils.isEmpty(JJRmemberpk) || StringUtils.isNotEmpty(JJRbrokepk)) {
+        String       s   = "select BrokePK, BMemberPK from modelinfo where MemberPK = " + MTmemberpk;
+        CachedRowSet rss = db.executeQuery(s);
+        try {
+            if (rss.next()) {
+                JJRbrokepk = rss.getString("BrokePK");
+                JJRmemberpk = rss.getString("BMemberPK");
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+    }
+
+    if ((operator == null) || operator.equals("")) operator = "";
+    if (JJRmemberpk.equals("")) JJRmemberpk = "0";
+    if (JJRbrokepk.equals("")) JJRbrokepk = "0";
+    if (MTmemberpk.equals("")) MTmemberpk = "0";
+    if (flag.equals("")) flag = "0";
+
+    out.clear();
+    String D_ModelInfopk = "0", D_MemberPK = "0", D_Tel = "", D_Name = "", D_Stage = "", D_LName = "", D_Phone = "", D_addr = "",
+            D_AreaID = "0", D_BrokePK = "0", D_BMemberPK = "0", D_nominate = "0";
+    String D_ratio_R = "100", D_ratio_V = "50", D_ratio_S = "70", D_Is_V = "0", D_CardPK = "0";
+    String D_ratio_RR = "0", D_ratio_VR = "0", D_ratio_SR = "0",
+            D_ratio_RRM = "0", D_ratio_VRM = "10", D_ratio_SRM = "10";
+    String D_Age = "", D_hei = "0", D_wei = "0", D_wai = "0", D_bust = "0", D_hip = "0", D_VPrice = "0";
+    String D_SuperName = "";
+
+    if (operator.equalsIgnoreCase("doPost"))//执行插入,更新
+    {
+        try {
+            DiskFileUpload fu = new DiskFileUpload();
+            //fu.initialize(pageContext);
+            fu.setHeaderEncoding("UTF-8"); // 此句为主要代码
+            // 设置允许用户上传文档大小,单位:字节,这里设为100M
+            fu.setSizeMax(100 * 1024 * 1024);
+            // 设置最多只允许在内存中存储的数据,单位:字节
+            fu.setSizeThreshold(4096);
+            // 开始读取上传信息
+            List fileItems = fu.parseRequest(request);
+            // 依次处理每个上传的文件
+            Iterator iter = fileItems.iterator();
+            while (iter.hasNext()) {
+                FileItem item      = (FileItem) iter.next();
+                String   fieldName = item.getFieldName();
+                if (fieldName == null || fieldName.equals("")) continue; // 忽略其他不是文件域的所有表单信息
+
+                if (item.isFormField()) //普通数据
+                {
+                    String formContent = ExtendString.getDBStr(item.getString("utf-8")); //取值
+                    if (fieldName.equalsIgnoreCase("ModelInfopk")) D_ModelInfopk = KindEditor.getDBStr(formContent);
+                    else if (fieldName.equalsIgnoreCase("MemberPK")) D_MemberPK = formContent;
+                    else if (fieldName.equalsIgnoreCase("Tel")) D_Tel = formContent;
+                    else if (fieldName.equalsIgnoreCase("Name")) D_Name = formContent;
+                    else if (fieldName.equalsIgnoreCase("Stage")) D_Stage = formContent;
+                    else if (fieldName.equalsIgnoreCase("LName")) D_LName = formContent;
+                    else if (fieldName.equalsIgnoreCase("Phone")) D_Phone = formContent;
+                    else if (fieldName.equalsIgnoreCase("addr")) D_addr = formContent;
+                    else if (fieldName.equalsIgnoreCase("Area")) D_AreaID = formContent;
+                    else if (fieldName.equalsIgnoreCase("BrokePK")) D_BrokePK = formContent;
+                    else if (fieldName.equalsIgnoreCase("BMemberPK")) D_BMemberPK = formContent;
+                    else if (fieldName.equalsIgnoreCase("ratio_R")) D_ratio_R = formContent;
+                    else if (fieldName.equalsIgnoreCase("ratio_V")) D_ratio_V = formContent;
+                    else if (fieldName.equalsIgnoreCase("ratio_S")) D_ratio_S = formContent;
+                    else if (fieldName.equalsIgnoreCase("Is_V")) D_Is_V = formContent;
+                    else if (fieldName.equalsIgnoreCase("CardPK")) D_CardPK = formContent;
+                    else if (fieldName.equalsIgnoreCase("nominate")) D_nominate = formContent;
+
+                    else if (fieldName.equalsIgnoreCase("ratio_RR")) D_ratio_RR = formContent;
+                    else if (fieldName.equalsIgnoreCase("ratio_VR")) D_ratio_VR = formContent;
+                    else if (fieldName.equalsIgnoreCase("ratio_SR")) D_ratio_SR = formContent;
+                    else if (fieldName.equalsIgnoreCase("ratio_RRM")) D_ratio_RRM = formContent;
+                    else if (fieldName.equalsIgnoreCase("ratio_VRM")) D_ratio_VRM = formContent;
+                    else if (fieldName.equalsIgnoreCase("ratio_SRM")) D_ratio_SRM = formContent;
+
+                    else if (fieldName.equalsIgnoreCase("Age")) D_Age = formContent;
+                    else if (fieldName.equalsIgnoreCase("hei")) D_hei = formContent;
+                    else if (fieldName.equalsIgnoreCase("wei")) D_wei = formContent;
+                    else if (fieldName.equalsIgnoreCase("wai")) D_wai = formContent;
+                    else if (fieldName.equalsIgnoreCase("bust")) D_bust = formContent;
+                    else if (fieldName.equalsIgnoreCase("hip")) D_hip = formContent;
+                    else if (fieldName.equalsIgnoreCase("VPrice")) D_VPrice = formContent;
+
+                } else //文件数据
+                {
+	    	/*
+		  UpLoad.PostFileResult R= UpLoad.PostFile(request, item, "broker");
+		  if ( R.Result<0 )
+		  {
+		    out.print( R.PostLastError );
+		    return;
+		  }
+		  if (fieldName.equalsIgnoreCase("Pic")) Pic = R.PostFileURL;
+		  else if (fieldName.equalsIgnoreCase("PCScreen")) PCScreen = R.PostFileURL;
+		  */
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            out.print(e.getMessage());
+            return;
+        }
+        //数据合法性检查
+        if (D_BrokePK.equals("") || D_BMemberPK.equals("0")) {
+            out.print("数据传递错误,所属经纪人为空。");
+            return;
+        }
+
+        if (D_Stage.equals("")) D_Stage = D_Name;
+
+        String[] sqls = new String[2];
+
+        if (D_ModelInfopk.equals("0")) {
+            D_ModelInfopk = dbtool.getNewPK(db, "ModelInfo");
+            String QRCode = thmodel.getNewMemQrCode(db);
+
+            if (QRCode.equals("")) {
+                out.print("获取推荐码失败:" + db.LastError);
+                return;
+            } else if (D_ModelInfopk.equals("")) {
+                out.print(dbtool.LastError);
+                return;
+            }
+            D_MemberPK = dbtool.getNewPK(db, "MemberInfo");
+            if (D_MemberPK.equals("")) {
+                out.print(dbtool.LastError);
+                return;
+            }
+
+            sqls[0] = String.format("Insert Into ModelInfo(PK, MemberPK, Name, Stage, LName, addr, " +
+                                            "		  BrokePK, BMemberPK, ratio_R, ratio_V, ratio_S, " +
+                                            "          Is_V, CardPK, nominate, " +
+                                            "          ratio_RR, ratio_VR, ratio_SR, ratio_RRM, ratio_VRM, ratio_SRM, " +
+                                            "          hei, wei, wai, bust, hip, VPrice ) " +
+                                            "Values (%s, %s, '%s', '%s', '%s', '%s', " +
+                                            "		%s, %s, '%s', %s, %s, " +
+                                            "        %s, %s, %s, " +
+                                            "        %s, %s, %s, %s, %s, %s, " +
+                                            "        %s, %s, %s, %s, %s, %s ) ",
+                                    D_ModelInfopk, D_MemberPK, D_Name, D_Stage, D_LName, D_addr,
+                                    D_BrokePK, D_BMemberPK, D_ratio_R, D_ratio_V, D_ratio_S,
+                                    D_Is_V, D_CardPK, D_nominate,
+                                    D_ratio_RR, D_ratio_VR, D_ratio_SR, D_ratio_RRM, D_ratio_VRM, D_ratio_SRM,
+                                    D_hei, D_wei, D_wai, D_bust, D_hip, D_VPrice);
+
+            sqls[1] = String.format("Insert Into MemberInfo (PK, Tel, Pass, MembType, " +
+                                            "               Phone, Pet, Area, QRCode, Age, MDate ) " +
+                                            "Values(%s, '%s', '123456', %s,  " +
+                                            "  '%s', '%s', %s, '%s', '%s', sysdate() ) ",
+                                    D_MemberPK, D_Tel, thmodel.MEMTYPE_Model,
+                                    D_Phone, D_Stage, D_AreaID, QRCode, D_Age);
+        } else //更新
+        {
+            sqls[0] = String.format("Update ModelInfo " +
+                                            "Set Name='%s', Stage='%s', LName='%s', addr='%s', " +
+                                            "	   ratio_R=%s, ratio_V=%s, ratio_S=%s, " +
+                                            "    Is_V=%s, CardPK = %s, nominate=%s, " +
+                                            "    ratio_RR=%s, ratio_VR=%s, ratio_SR=%s, ratio_RRM=%s, ratio_VRM=%s, ratio_SRM=%s, " +
+                                            "    hei=%s, wei=%s, wai=%s, bust=%s, hip=%s, VPrice=%s " +
+                                            "Where PK = %s ",
+                                    D_Name, D_Stage, D_LName, D_addr,
+                                    D_ratio_R, D_ratio_V, D_ratio_S,
+                                    D_Is_V, D_CardPK, D_nominate,
+                                    D_ratio_RR, D_ratio_VR, D_ratio_SR, D_ratio_RRM, D_ratio_VRM, D_ratio_SRM,
+                                    D_hei, D_wei, D_wai, D_bust, D_hip, D_VPrice,
+                                    D_ModelInfopk);
+            sqls[1] = String.format("Update MemberInfo " +
+                                            "Set Tel='%s', Pet='%s', Phone='%s', Area=%s, Age='%s' " +
+                                            "Where PK = %s ",
+                                    D_Tel, D_Stage, D_Phone, D_AreaID, D_Age,
+                                    D_MemberPK);
+        }
+
+        //检查帐号是否重复
+        sql = String.format("Select Count(*) C From MemberInfo where Tel='%s' and PK<>%s ", D_Tel, D_MemberPK);
+        rs = db.executeQuery(sql);
+        if (rs == null) {
+            out.print("检查帐号是否重复失败:" + db.LastError);
+            return;
+        }
+        rs.next();
+        if (rs.getInt("C") > 0) {
+            rs.close();
+            out.println("当前帐号与其它帐号重复,不可保存。");
+            return;
+        }
+        rs.close();
+
+        //
+        if (db.executeUpdate(sqls))
+            out.print("success");
+        else
+            out.print("数据保存失败。" + db.LastError);
+        return;
+    }
+
+    //正常新增或浏览
+    if (!MTmemberpk.equals("0")) {
+        sql = "select a.pk as ModelInfopk, a.MemberPK, b.Tel, a.Name, a.Stage, a.LName, b.Phone, a.addr, " +
+                "		 b.Area, a.BrokePK, a.BMemberPK, " +
+                "       CAST(FORMAT(a.ratio_R,0) as char) as ratio_R, " +
+                "       CAST(FORMAT(a.ratio_V,0) as char) as ratio_V, " +
+                "       CAST(FORMAT(a.ratio_S,0) as char) as ratio_S, " +
+                "       a.ratio_RR, a.ratio_VR, a.ratio_SR, a.ratio_RRM, a.ratio_VRM, a.ratio_SRM, " +
+                "       a.Is_V, a.CardPK, c.CardName, " +
+                "       DATE_FORMAT(b.MDate,'%Y-%m-%d %H:%i:%s') as MDate, " +
+                "       a.nominate, b.age, a.hei, a.wei, a.wai, a.bust, a.hip, a.VPrice  " +
+                "from ModelInfo a inner Join MemberInfo b on a.MemberPK = b.PK  " +
+                "     Left Join ModelCard c on a.CardPK = C.PK " +
+                "where a.MemberPK= " + MTmemberpk + " ";
+        rs = db.executeQuery(sql);
+        if (rs == null) {
+            out.print("后台获取数据失败: " + db.LastError);
+            return;
+        }
+
+        if (rs.next()) {
+            D_ModelInfopk = ExtendString.getDBStr(rs.getString("ModelInfopk"));
+            D_MemberPK = ExtendString.getDBStr(rs.getString("MemberPK"));
+            D_Tel = ExtendString.getDBStr(rs.getString("Tel"));
+            D_Name = ExtendString.getDBStr(rs.getString("Name"));
+            D_Stage = ExtendString.getDBStr(rs.getString("Stage"));
+            D_LName = ExtendString.getDBStr(rs.getString("LName"));
+            D_Phone = ExtendString.getDBStr(rs.getString("Phone"));
+            D_addr = ExtendString.getDBStr(rs.getString("addr"));
+            D_AreaID = ExtendString.getDBStr(rs.getString("Area"));
+            D_BrokePK = ExtendString.getDBStr(rs.getString("BrokePK"));
+            D_BMemberPK = ExtendString.getDBStr(rs.getString("BMemberPK"));
+            D_ratio_R = String.valueOf(rs.getFloat("ratio_R"));
+            D_ratio_V = String.valueOf(rs.getFloat("ratio_V"));
+            D_ratio_S = String.valueOf(rs.getFloat("ratio_S"));
+            D_Is_V = String.valueOf(rs.getInt("Is_V"));
+            D_CardPK = String.valueOf(rs.getInt("CardPK"));
+            D_nominate = String.valueOf(rs.getInt("nominate"));
+
+            D_ratio_RR = String.valueOf(rs.getFloat("ratio_RR"));
+            D_ratio_VR = String.valueOf(rs.getFloat("ratio_VR"));
+            D_ratio_SR = String.valueOf(rs.getFloat("ratio_SR"));
+            D_ratio_RRM = String.valueOf(rs.getFloat("ratio_RRM"));
+            D_ratio_VRM = String.valueOf(rs.getFloat("ratio_VRM"));
+            D_ratio_SRM = String.valueOf(rs.getFloat("ratio_SRM"));
+
+            D_Age = ExtendString.getDBStr(rs.getString("Age"));
+            D_hei = String.valueOf(rs.getFloat("hei"));
+            D_wei = String.valueOf(rs.getFloat("wei"));
+            D_wai = String.valueOf(rs.getFloat("wai"));
+            D_bust = String.valueOf(rs.getFloat("bust"));
+            D_hip = String.valueOf(rs.getFloat("hip"));
+            D_VPrice = String.valueOf(rs.getFloat("VPrice"));
+        }
+        rs.close();
+    }
+
+    //查询经纪人所属机构
+    D_MemberPK = MTmemberpk;
+    if (!JJRbrokepk.equals("0")) {
+        sql = "Select PK, MemberPK, Name from BrokerInfor where PK = " + JJRbrokepk;
+        rs = db.executeQuery(sql);
+        if (rs != null && rs.next()) {
+            D_BrokePK = JJRbrokepk;
+            D_BMemberPK = rs.getString("MemberPK");
+            D_SuperName = rs.getString("Name");
+        }
+        if (rs != null) rs.close();
+    }
+%>
+<html>
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <base href="<%=basePath %>"/>
+    <title>模特</title>
+    <link rel="stylesheet" type="text/css" href="css/style.css"/>
+    <link rel="stylesheet" type="text/css" href="css/WdatePicker.css"/>
+    <link rel="stylesheet" type="text/css" href="css/skin_/table.css"/>
+    <link rel="stylesheet" type="text/css" href="css/jquery.grid.css"/>
+    <link rel="stylesheet" type="text/css" href="css/skin_/form.css"/>
+    <link href="umeditor/themes/default/_css/umeditor.css" type="text/css" rel="stylesheet">
+    <script type="text/javascript" src="js/jquery.js"></script>
+    <script type="text/javascript" src="js/global.js"></script>
+    <script type="text/javascript" src="js/jquery.select.js"></script>
+    <script type="text/javascript" src="js/core.js"></script>
+    <script type="text/javascript" src="js/WdatePicker.js"></script>
+    <script type="text/javascript" src="js/jquery-form.js"></script>
+    <style type="text/css">
+        .select {
+            width: 173px;
+            line-height: 25px;
+        }
+
+        img {
+            height: auto;
+            width: auto;
+            width: 100%;
+        }
+    </style>
+</head>
+<body>
+<script language="javascript">
+    var result = 0;
+
+    function check() {
+        if (document.form1.Tel.value == "") {
+            alert("请输入帐号!");
+            document.form1.Tel.focus();
+            return false;
+        }
+
+        if (document.form1.Name.value == "") {
+            alert("请输入模特姓名!");
+            document.form1.Name.focus();
+            return false;
+        }
+
+        $('#form1').ajaxSubmit(
+            {
+                url: "<%=basePath%>member/model_.jsp?operator=doPost&bmemberpk=<%=JJRmemberpk%>&brokepk=<%=JJRbrokepk%>&memberpk=<%=MTmemberpk%>",
+                contentType: "application/x-www-form-urlencoded; charset=utf-8",
+                success: function (data) {
+                    if (data.indexOf("success") >= 0) {
+                        result = 1;
+                        parentDialog.close();
+                    }
+                    else alert(data);
+                }
+            }
+        );
+        return true;
+    }
+
+</script>
+
+<form name="form1" id="form1" method="post" enctype="multipart/form-data">
+    <div id="container">
+        <div id="main">
+            <h2 class="subfild">
+            	<span style="width:200px">
+            		<span>模特信息</span>
+            	</span>
+            </h2>
+
+            <input type="hidden" name="ModelInfopk" value="<%=D_ModelInfopk%>">
+            <input type="hidden" name="MemberPK" value="<%=D_MemberPK%>">
+            <input type="hidden" name="BrokePK" value="<%=JJRbrokepk%>">
+            <input type="hidden" name="BMemberPK" value="<%=JJRmemberpk%>">
+
+            <div class="subfild-content base-info" style="width:100%;">
+                <table id="" style="width:100%">
+                    <%
+                        if (!D_SuperName.equals("")) {
+                    %>
+                    <tr>
+                        <td style="80px">经纪人</td>
+                        <td colspan="3"><%=D_SuperName%>
+                        </td>
+                    </tr>
+                    <%
+                        }
+                    %>
+                    <tr>
+                        <td>帐号</td>
+                        <td colspan="3"><input type="text" name="Tel" value="<%=D_Tel%>"/></td>
+                    </tr>
+                    <tr>
+                        <td>姓名</td>
+                        <td colspan="3"><input type="text" name="Name" value="<%=D_Name%>"/></td>
+                    </tr>
+                    <tr>
+                        <td>电话</td>
+                        <td colspan="3"><input type="text" name="Phone" value="<%=D_Phone%>"/></td>
+                    </tr>
+                    <tr>
+                        <td>艺名</td>
+                        <td colspan="3"><input type="text" name="Stage" value="<%=D_Stage%>"/></td>
+                    </tr>
+
+                    <tr>
+                        <td>年龄</td>
+                        <td colspan="3"><input type="text" name="age" value="<%=D_Age%>"/></td>
+                    </tr>
+
+                    <tr>
+                        <td>身高</td>
+                        <td colspan="3"><input type="text" name="hei" value="<%=D_hei%>"/></td>
+                    </tr>
+
+                    <tr>
+                        <td>体重</td>
+                        <td colspan="3"><input type="text" name="wei" value="<%=D_wei%>"/></td>
+                    </tr>
+                    <tr>
+                        <td>腰围</td>
+                        <td colspan="3"><input type="text" name="wai" value="<%=D_wai%>"/></td>
+                    </tr>
+                    <tr>
+                        <td>胸围</td>
+                        <td colspan="3"><input type="text" name="bust" value="<%=D_bust%>"/></td>
+                    </tr>
+                    <tr>
+                        <td>臀围</td>
+                        <td colspan="3"><input type="text" name="hip" value="<%=D_hip%>"/></td>
+                    </tr>
+                    <tr>
+                        <td>视频聊天单价</td>
+                        <td colspan="3"><input type="text" name="VPrice" value="<%=D_VPrice%>"/></td>
+                    </tr>
+
+                    <tr>
+                        <td>个性签名</td>
+                        <td colspan="3"><input type="text" name="LName" value="<%=D_LName%>"/></td>
+                    </tr>
+
+                    <tr>
+                        <td>是否接受视频聊天</td>
+                        <td colspan="3">
+                            <select name="Is_V" id="Is_V" class="select">
+                                <option value="1" <% if (D_Is_V.equals("1")) out.print("selected");%> > 是</option>
+                                <option value="0" <% if (D_Is_V.equals("0")) out.print("selected");%> > 否</option>
+                            </select>
+                        </td>
+                    </tr>
+
+                    <tr>
+                        <td>地区</td>
+                        <td colspan="3">
+                            <select name="Area" id="Area" class="select">
+                                <%
+                                    sql = "Select PK, Name from datatypeinfo where typeName ='地区' order by OrdID ";
+                                    rs = db.executeQuery(sql);
+                                    while ((rs != null) && rs.next()) {
+                                        tmpID = rs.getString("PK");
+                                        tmpName = rs.getString("Name");
+                                        if (D_AreaID.equals(tmpID)) {
+                                %>
+                                <option value="<%=tmpID%>" selected><%=tmpName%>
+                                </option>
+                                <%
+                                } else {
+                                %>
+                                <option value="<%=tmpID%>"><%=tmpName%>
+                                </option>
+                                <%
+                                        }
+
+                                    }
+                                    if (rs != null) rs.close();
+                                %>
+                            </select>
+                        </td>
+                    </tr>
+
+
+                    <tr>
+                        <td>是否推荐</td>
+                        <td colspan="3">
+                            <select name="nominate" id="nominate" class="select">
+                                <option value="1" <% if (D_nominate.equals("1")) out.print("selected");%> > 是</option>
+                                <option value="0" <% if (D_nominate.equals("0")) out.print("selected");%> > 否</option>
+                            </select>
+                        </td>
+                    </tr>
+
+                    <tr>
+                        <td colspan="4">&nbsp</td>
+                    </tr>
+                    <tr>
+                        <td>身&nbsp;&nbsp;&nbsp;&nbsp;份</td>
+                        <td>红包分成(%)</td>
+                        <td>视频分成(%)</td>
+                        <td>服务分成(%)</td>
+                    </tr>
+
+                    <tr>
+                        <td>模特自己</td>
+                        <td><input type="text" name="ratio_R" value="<%=D_ratio_R%>" style='width:80px;'/></td>
+                        <td><input type="text" name="ratio_V" value="<%=D_ratio_V%>" style='width:80px;'/></td>
+                        <td><input type="text" name="ratio_S" value="<%=D_ratio_S%>" style='width:80px;'/></td>
+                    </tr>
+
+
+                    <tr>
+                        <td>其她模特推荐人</td>
+                        <td><input type="text" name="ratio_RR" value="<%=D_ratio_RR%>" style='width:80px;'/></td>
+                        <td><input type="text" name="ratio_VR" value="<%=D_ratio_VR%>" style='width:80px;'/></td>
+                        <td><input type="text" name="ratio_SR" value="<%=D_ratio_SR%>" style='width:80px;'/></td>
+                    </tr>
+
+                    <tr>
+                        <td>会员推荐人</td>
+                        <td><input type="text" name="ratio_RRM" value="<%=D_ratio_RRM%>" style='width:80px;'/></td>
+                        <td><input type="text" name="ratio_VRM" value="<%=D_ratio_VRM%>" style='width:80px;'/></td>
+                        <td><input type="text" name="ratio_SRM" value="<%=D_ratio_SRM%>" style='width:80px;'/></td>
+                    </tr>
+
+                    <tr>
+                        <td colspan="4">&nbsp</td>
+                    </tr>
+
+                    <tr>
+                        <td colspan="4" class="buttons" style="text-align: center;">
+                            <%
+                                if (flag.equals("1") || flag.equals("2")) {
+                            %>
+                            <input type="button" onClick="javascript:check();" id="btn_save" class="btn3_mouseout"
+                                   onmouseover="this.className='btn3_mouseover'"
+                                   onmouseout="this.className='btn3_mouseout'"
+                                   onmousedown="this.className='btn3_mousedown'"
+                                   onmouseup="this.className='btn3_mouseup'" value="保 存"/>
+                            <%
+                                }
+                            %>
+                            <input type="button" onClick="parentDialog.close();" id="btn_back" class="btn3_mouseout"
+                                   onmouseover="this.className='btn3_mouseover'"
+                                   onmouseout="this.className='btn3_mouseout'"
+                                   onmousedown="this.className='btn3_mousedown'"
+                                   onmouseup="this.className='btn3_mouseup'" value="返  回"/></td>
+                    </tr>
+                </table>
+            </div>
+        </div>
+
+    </div>
+</form>
+</body>
+</html>

+ 119 - 0
src/main/webapp/member/model__.jsp

@@ -0,0 +1,119 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: drew
+  Date: 2018/10/23
+  Time: 下午7:04
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%request.setCharacterEncoding("utf-8");%>
+<%@ page language="java" import="java.sql.*,java.util.Arrays" %>
+<%@ page language="java" import="java.util.*, util.*" %>
+<%@ page language="java" import="system.*" %>
+<%@ page language="java" import="util.*" %>
+<%@ page language="java" import="biz.*" %>
+<%@ page language="java" import="net.sf.json.JSONObject" %>
+<%@ page import="org.apache.http.entity.ContentType" %>
+<%@ page import="org.jooq.DSLContext" %>
+<%@ page import="org.jooq.impl.DSL" %>
+<%@ page import="org.jooq.SQLDialect" %>
+<%@ page import="jooq.Tables" %>
+<%@ page import="static jooq.Tables.MEMBERINFO" %>
+<%@ page import="org.jooq.Record" %>
+<%@ page import="org.jooq.Result" %>
+<%@ page import="constants.Constants" %>
+<%@ page import="static jooq.Tables.MODELINFO" %>
+<%@ page import="jooq.tables.Memberinfo" %>
+<jsp:useBean id="db" class="dbconnection.DbConnection"/>
+<%
+    String path = request.getContextPath();
+    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
+
+    String operator = ExtendString.getDBStr(request.getParameter("operator"));
+    String memberpk = ExtendString.getDBStr(request.getParameter("memberpk"));
+    String flag = ExtendString.getDBStr(request.getParameter("flag"));
+
+    out.clear();
+    DSLContext ctx = DSL.using(db.getConn(), SQLDialect.MYSQL);
+    JSONObject modelJson;
+    if (operator.equals("save")) {
+        int pageIndex = 1;
+        if (request.getParameter("page") != null) {
+            pageIndex = Integer.parseInt(request.getParameter("page"));
+        }
+
+        Result<Record> records = ctx.select().from(MEMBERINFO)
+                                    .where(MEMBERINFO.MEMBTYPE.equal(Constants.MEMTYPE_HuiYuan))
+                                    .and(MEMBERINFO.INTRODUCERPK.eq(Integer.valueOf(memberpk)))
+                                    .offset(10 * (pageIndex - 1))
+                                    .limit(10)
+                                    .fetch();
+        JSONObject result = new JSONObject();
+        result.put("data", DBRecordsPack.Pack(records));
+        if (pageIndex == 1) {
+            int total = ctx.selectCount().from(MEMBERINFO)
+                           .where(MEMBERINFO.MEMBTYPE.equal(Constants.MEMTYPE_HuiYuan))
+                           .and(MEMBERINFO.INTRODUCERPK.eq(Integer.valueOf(memberpk)))
+                           .fetchOne(0, int.class);
+            result.put("total", total);
+        }
+        out.clear();
+        out.print(result);
+        return;
+    } else {
+        Record record = ctx.select()
+                           .from(MEMBERINFO)
+                           .leftJoin(MODELINFO).on(MEMBERINFO.PK.eq(MODELINFO.MEMBERPK))
+                           .where(MEMBERINFO.PK.equal(Integer.valueOf(memberpk)))
+                           .fetchOne();
+        modelJson = DBRecordsPack.Pack(record);
+    }
+%>
+<html>
+<head>
+    <base href="<%=basePath %>"/>
+    <title>模特信息</title>
+    <%@include file="/_common.jsp" %>
+    <style>
+        .el-form-item {
+            margin-bottom: 4px !important;
+        }
+    </style>
+</head>
+<body>
+<div id="app">
+    <el-form size="mini" label-width="50">
+        <el-form-item label="账号">{{modelInfo.Tel}}</el-form-item>
+        <el-form-item label="姓名">{{modelInfo.Name}}</el-form-item>
+        <el-form-item label="电话">{{modelInfo.Phone}}</el-form-item>
+        <el-form-item label="艺名"><el-input v-model="modelInfo.Stage"></el-input></el-form-item>
+        <el-form-item label="年龄">{{modelInfo.age}}</el-form-item>
+        <el-form-item label="姓名">{{modelInfo.Name}}</el-form-item>
+        <el-form-item label="姓名">{{modelInfo.Name}}</el-form-item>
+    </el-form>
+</div>
+</body>
+<script>
+    new Vue({
+        el: '#app',
+        created: function () {
+        },
+        data: {
+            visible: false,
+            loading: false,
+            tableData: [],
+            keyword: '',
+            Area: 0,
+            currentPage: 1,
+            total: 0,
+            flag: <%=flag%>,
+            modelInfo: JSON.parse('<%=modelJson%>')
+        },
+        methods: {
+            save() {
+
+            }
+        }
+    });
+</script>
+</html>

+ 6 - 6
src/main/webapp/member/query_model.jsp

@@ -38,9 +38,9 @@
 
         String BaseSQL = "select a.pk as ModelInfopk, a.MemberPK, b.Tel, a.Name, a.Stage, a.LName, b.Phone, a.addr, " +
                 "		 b.Area, a.BrokePK, a.BMemberPK, b.qrcode, " +
-                "       CAST(FORMAT(a.ratio_R,0) as char) as ratio_R, " +
-                "       CAST(FORMAT(a.ratio_V,0) as char) as ratio_V, " +
-                "       CAST(FORMAT(a.ratio_S,0) as char) as ratio_S, " +
+                "       b.income_ratio_gift as ratio_R, " +
+                "       b.income_ratio_video as ratio_V, " +
+                "       b.income_ratio_service as ratio_S, " +
                 "       a.Is_V, a.CardPK, c.CardName, " +
                 "       DATE_FORMAT(b.MDate,'%Y-%m-%d %H:%i:%s') as MDate, b.identify, " +
                 "      (Select count(*) C From MemberInfo x where x.IntroducerPK = b.pk and X.MembType=" + thmodel.MEMTYPE_HuiYuan + " ) as C_HuiYuan, " +
@@ -138,7 +138,7 @@
         <el-table-column prop="sort" label="排序"></el-table-column>
         <el-table-column label="操作" width="200" fixed="right" align="center">
             <template slot-scope="{row}">
-                <el-button type="text" size="small" @click="modelDetail(row)">详情</el-button>
+                <el-button type="text" size="small" @click="modelEdit(row)">编辑</el-button>
                 <el-button type="text" size="small" @click="inviteList(row.modelinfopk)">邀请列表</el-button>
                 <el-button type="text" size="small" @click="orderList(row.modelinfopk)">订单</el-button>
                 <el-button type="text" size="small" @click="sort(row.modelinfopk)">排序</el-button>
@@ -218,9 +218,9 @@
                     title: '邀请列表'
                 });
             },
-            modelDetail(row) {
+            modelEdit(row) {
                 this.showIframe({
-                    url: "<%=basePath%>member/model_.jsp?brokepk=<%=brokepk%>&bmemberpk=<%=BMemberPK%>&memberpk=" + row.memberpk + "&flag=" + 0,
+                    url: "<%=basePath%>member/model_.jsp?brokepk=<%=brokepk%>&bmemberpk=<%=BMemberPK%>&memberpk=" + row.memberpk + "&flag=" + 2,
                     title: '模特详情',
                     width: 600,
                     height: '70%',