⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dealwith_ok.java

📁 ERO系统.针对生产型、分销型、服务型企业等不同的行业特点
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*
 *this file is part of nseer erp
 *Copyright (C)2006-2010 Nseer(Beijing) Technology co.LTD/http://www.nseer.com 
 *
 *This program is free software; you can redistribute it and/or
 *modify it under the terms of the GNU General Public License
 *as published by the Free Software Foundation; either
 *version 2 of the License, or (at your option) any later version.
 */
package crm.discussion;

import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import javax.servlet.*;
import include.nseer_db.*;
import java.io.*;
import java.util.*;
import java.text.SimpleDateFormat;
import include.nseer_cookie.*;
import validata.ValidataNumber;
import validata.ValidataRecord;
import validata.ValidataTag;
import include.get_name_from_ID.getNameFromID;
import include.get_rate_from_ID.getRateFromID;

public class dealwith_ok extends HttpServlet{
ServletContext application;
HttpSession session;
nseer_db_backup erp_db = null;


	
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{
HttpSession dbSession=request.getSession();
JspFactory _jspxFactory=JspFactory.getDefaultFactory();
PageContext pageContext = _jspxFactory.getPageContext(this,request,response,"",true,8192,true);
ServletContext dbApplication=dbSession.getServletContext();

 
try{
PrintWriter out=response.getWriter();
session=request.getSession();
counter count=new counter(dbApplication);
ValidataNumber validata = new ValidataNumber();
ValidataRecord vr = new ValidataRecord();
ValidataTag vt = new ValidataTag();
FileKind  FileKind= new  FileKind();
getNameFromID getNameFromID = new getNameFromID();
getRateFromID getRateFromID = new getRateFromID();

nseer_db_backup1 crm_db = new nseer_db_backup1(dbApplication);

if(crm_db.conn((String)dbSession.getAttribute("unit_db_name"))){


String register_ID=(String)session.getAttribute("human_IDD");
String id=request.getParameter("id") ;
String discussion_ID=request.getParameter("discussion_ID") ;
String customer_ID=request.getParameter("customer_ID") ;
String customer_name=request.getParameter("customer_name") ;
String demand_customer_address=request.getParameter("demand_customer_address") ;
String demand_customer_mailing_address=request.getParameter("demand_customer_mailing_address") ;
String demand_contact_person=request.getParameter("demand_contact_person") ;
String demand_contact_person_tel=request.getParameter("demand_contact_person_tel") ;
String demand_contact_person_fax=request.getParameter("demand_contact_person_fax") ;
String demand_pay_time=request.getParameter("demand_pay_time") ;
String demand_pay_type=request.getParameter("demand_pay_type") ;
String demand_pay_fee_type=request.getParameter("demand_pay_fee_type") ;

String demand_gather_time=request.getParameter("demand_gather_time") ;
String demand_gather_type=request.getParameter("demand_gather_type") ;
String demand_gather_method=request.getParameter("demand_gather_method") ;
String demand_invoice_type=request.getParameter("demand_invoice_type") ;
String process_time=request.getParameter("process_time") ;
String sales_ID=request.getParameter("sales_ID") ;
String sales_name=getNameFromID.getNameFromID((String)dbSession.getAttribute("unit_db_name"),"hr_file","human_ID",sales_ID,"human_name");
String[] aaa=new String[2];
if(!sales_ID.equals("")){
aaa=FileKind.getKind((String)dbSession.getAttribute("unit_db_name"),"hr_file","human_ID",sales_ID);
}
String type=request.getParameter("type") ;
String processer=request.getParameter("processer") ;
String processer_ID=request.getParameter("processer_ID") ;
String bodyc = new String(request.getParameter("remark").getBytes("UTF-8"),"UTF-8");
String remark=exchange.toHtml(bodyc);
String product_amount=request.getParameter("product_amount") ;
int num=Integer.parseInt(product_amount);
String demand_pay_fee_sum2=request.getParameter("demand_pay_fee_sum") ;
StringTokenizer tokenTO1 = new StringTokenizer(demand_pay_fee_sum2,",");        
String demand_pay_fee_sum="";
            while(tokenTO1.hasMoreTokens()) {
                String demand_pay_fee_sum1 = tokenTO1.nextToken();
		demand_pay_fee_sum +=demand_pay_fee_sum1;
		}
double order_discount=getRateFromID.getRateFromID((String)dbSession.getAttribute("unit_db_name"),"security_users","human_ID",sales_ID,"order_discount");
double order_discount1=getRateFromID.getRateFromID((String)dbSession.getAttribute("unit_db_name"),"security_users","human_ID",register_ID,"order_discount");
int n=0;
String pay_ID=NseerId.getId("stock/pay",(String)dbSession.getAttribute("unit_db_name"));
List rsList = GetWorkflow.getList(crm_db, "crm_config_workflow", "04");
for(int i=1;i<=num;i++){
	String tem_amount="amount"+i;
	String tem_off_discount="off_discount"+i;
	String tem_list_price="list_price"+i;
String amount=request.getParameter(tem_amount) ;
String off_discount=request.getParameter(tem_off_discount) ;
String list_price2=request.getParameter(tem_list_price) ;
StringTokenizer tokenTO2 = new StringTokenizer(list_price2,",");     

String list_price="";
            while(tokenTO2.hasMoreTokens()) {
                String list_price1 = tokenTO2.nextToken();
		list_price +=list_price1;
		}
		if(!validata.validata(amount)||!validata.validata(off_discount)||!validata.validata(list_price)){
			n++;
		}else if(Double.parseDouble(off_discount)>order_discount&&Double.parseDouble(off_discount)>order_discount1){
			n++;
		}
}
if(!vt.validata((String)dbSession.getAttribute("unit_db_name"),"crm_discussion","id",id,"discussion_tag").equals("2")){
if(n==0){
String time="";
java.util.Date now = new java.util.Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
time=formatter.format(now);
String order_ID=NseerId.getId("crm/order",(String)dbSession.getAttribute("unit_db_name"));
String sql = "update crm_discussion set order_ID='"+order_ID+"',process_time='"+process_time+"',sales_name='"+sales_name+"',sales_ID='"+sales_ID+"',hr_chain_ID='"+aaa[0]+"',hr_chain_name='"+aaa[1]+"',processer='"+processer+"',processer_ID='"+processer_ID+"',discussion_tag='2',remark='"+remark+"' where id='"+id+"'" ;
	crm_db.executeUpdate(sql) ;
String[] kind_chain=FileKind.getKind((String)dbSession.getAttribute("unit_db_name"),"crm_file","customer_ID",customer_ID);
int service_count=0;
int pay_amount_sum=0;
double sale_price_sum=0.0d;
double cost_price_sum=0.0d;
double real_cost_price_sum=0.0d;
int stock_number=1;
double stock_product_number=0;
double stock_price=0.0d;
double order_sale_bonus_sum=0.00d;
double order_profit_bonus_sum=0.00d;
String sqq3="select * from crm_file where customer_ID='"+customer_ID+"'";
	ResultSet rs=crm_db.executeQuery(sqq3);
	if(rs.next()){
	String sqq = "insert into crm_order(order_ID,chain_ID,chain_name,customer_ID,customer_name,demand_customer_address,demand_customer_mailing_address,demand_contact_person,demand_contact_person_tel,demand_contact_person_fax,demand_pay_time,demand_pay_type,demand_pay_fee_type,demand_gather_type,demand_gather_method,demand_invoice_type,register_time,sales_name,sales_ID,register,register_ID,type,remark,check_tag,excel_tag,hr_chain_ID,hr_chain_name) values ('"+order_ID+"','"+rs.getString("chain_ID")+"','"+rs.getString("chain_name")+"','"+customer_ID+"','"+customer_name+"','"+demand_customer_address+"','"+demand_customer_mailing_address+"','"+demand_contact_person+"','"+demand_contact_person_tel+"','"+demand_contact_person_fax+"','"+demand_pay_time+"','"+demand_pay_type+"','"+demand_pay_fee_type+"','"+demand_gather_type+"','"+demand_gather_method+"','"+demand_invoice_type+"','"+process_time+"','"+sales_name+"','"+sales_ID+"','"+processer+"','"+processer_ID+"','"+type+"','"+remark+"','0','2','"+aaa[0]+"','"+aaa[1]+"')" ;
	crm_db.executeUpdate(sqq) ;
	}
	String sale_bonus_type="";
	String bonus_cost_for_profit_type="";
String sql_hr2="select * from hr_config_public_char where kind='订单销售绩效计算方式'"; 
ResultSet rs_hr2=crm_db.executeQuery(sql_hr2);
if(rs_hr2.next()){ 
sale_bonus_type=rs_hr2.getString("type_name");
bonus_cost_for_profit_type=rs_hr2.getString("bonus_cost_for_profit_type");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -