Javaをベースにした特徴的なホームステイプラットフォームシステムをどのように実装するか?

著者について: フルスタック開発プロジェクト、Java、Python、フロントエンド、および小規模プログラムの開発と研究に従事し、ビッグデータ アプリケーションと開発に興味があり、

主な内容:Javaプロジェクト、フロントエンドプロジェクト、Pythonプロジェクト、小規模プログラム開発、ビッグデータプロジェクト、マイコン

お気に入り、いいね、迷わず作者フォローすると良いです

記事の最後にあるソースコードを入手してください 

ご清聴ありがとうございます。忘れないようにブックマークしてください。励ましの気持ちを示したい場合、コメントして提案をしてください。愛しています

商品番号:BS-PT-095

目次

1. 環境紹介

2. プロジェクト紹介

三、システム表示

3.1 システムのフロントエンドインターフェースの実装

3.1.1 登録・ログイン機能インターフェースの実現

3.1.2 ホームステイ推薦機能インターフェースの実現

3.1.3 ホームステイ詳細インターフェースの実現

3.1.4 私の予約インターフェースの実装

3.1.5 お気に入りインターフェースの実現

3.1.6 苦情・提案インターフェースの実現

3.2 システムバックグラウンド機能の実現

3.2.1 管理者ログイン機能の実現

3.2.2 パーソナルセンター機能の実現

3.2.3 カルーセルマップ管理機能の実現

3.2.4 ユーザ管理機能の実現

3.2.5 情報管理機能の実現

3.2.6 ホームステイ管理機能の実現

3.2.7 アトラクション管理機能の実現

3.2.8 注文管理機能の実現

3.2.9 戦略管理機能の実現

3.2.10 苦情・提案管理機能の実現

4番目、コアコード表示

5. 関連作品の展示


1. 環境紹介

ロケール: Java: jdk1.8

データベース: MySQL: mysql5.7

アプリケーションサーバー: Tomcat: tomcat8.5.31

開発ツール: IDEA または eclipse

開発技術:SSMフレームワーク+Jquery+Ajax+HTML

アプリケーション アルゴリズム: 協調フィルタリング アルゴリズム

2. プロジェクト紹介

感染症の終息に伴い、全国の経済状況は徐々に改善しており、3年が経ち、観光需要はある程度爆発的に増加しており、春節観光の急増はその好例である。観光産業の回復にも一定の時間がかかり、3年間で多くの観光関連産業が停滞した。そしてホームステイ先の運営はさらにひどい。

こうした民泊業者のプロモーションやトラフィック誘致のために、新技術や新技術、インターネットをどのように活用するかが、このプロジェクトで検討される課題である。このトピックでは、JAVA テクノロジーの関連アプリケーションに基づいて、特徴的なホームステイのオンライン宣伝および予約プラットフォームを開発し、これらの特徴的なホームステイの運営者に何らかの支援を提供し、より多くの旅行愛好家がこのプラットフォームでさらに多くの情報を見つけられるようにします。あなたに合ったものはより良い経験をもたらします。

このシステムは主に SSM フレームワークと MYSQL データベースを使用し、IDEA 開発ツールに基づいて開発および実装され、フロントエンド ユーザーがオンラインでホームステイを閲覧して予約し、ホームステイの旅行戦略を共有し、地図 位置 ホームステイおよびその他の操作、バックグラウンド管理 ユーザー管理 登録ユーザー、ホームステイ情報、旅行ガイドなどの基本情報、およびコメント、お気に入り、フィードバックメッセージなどのユーザー対話のための基本操作を提供します。

このシステムの開発と設計は主にホームステイとその周辺情報を中心に行われ、重要なビジネスモジュールには主にホームステイ情報、周辺観光情報、ホームステイ戦略、業界情報などが含まれ、ユーザーによるオンライン予約、地図上の位置を実現します。協調フィルタリングアルゴリズム等を活用した個人別ホームステイ推薦処理 ユーザーには主にフロントエンド登録ユーザーとプラットフォーム管理ユーザーの 2 種類があり、これら 2 種類のユーザーのユースケース図を以下に示します。具体的には次のとおりです。

ユーザーのユースケース図は次のとおりです。

(1) フロントエンド ユーザーのユースケース図 (図 1 を参照):

図 1 フロントエンド ユーザーのユースケース図

管理者ユーザーのユースケース図を以下の図 2 に示します。

図 2 バックグラウンド ユーザー ユースケース図

特徴的なホームステイ管理プラットフォームは、主にホームステイに関する一部の情報を管理し、オンライン情報の表示と予約を実現し、消費者のホームステイへの理解を促進し、ホームステイ運営者へのトラフィックを増やす全体的な機能構造設計図を以下の図3に示します。

 図3 機能構成図

フロントエンドユーザー向けの機能モジュールの紹介:

(1) 登録・ログイン機能モジュールの設計

 フロントエンドユーザーは、関連業務を行う際にオンライン会員登録が必要となり、個人アカウント情報や個人情報を入力し、登録が完了するとログインが可能となります。

   (2) 個人情報管理機能モジュールの設計

ユーザーがシステムにログインした後、システム管理に入り、パスワードを変更し、古いパスワード、新しいパスワードを入力し、パスワードを確認することができます。新しいパスワードが確認されたパスワードと一致する場合、変更は成功です。矛盾している場合、変更は失敗します。

   (3) 情報閲覧機能モジュール

フロントエンドユーザーはホームステイプラットフォーム上でホームステイ情報、関連景勝地情報、ホームステイ戦略情報、業界情報などを閲覧したり、各種情報の詳細を閲覧したり、オンラインでコメントしたり、お気に入りのホームステイや観光名所を保存したりすることができる。

   (4) オンライン予約機能モジュール

フロントエンドユーザーがログイン後、ホームステイ紹介の詳細ページに入り、予約ボタンをクリックし、オンラインでホームステイを予約し、予約したホームステイをパーソナルセンターで管理し、バックグラウンド管理者の承認後、予約が成功したとみなされます。 。

   (5) B&B戦略モジュール

ユーザーは、ホームステイの宿泊施設についての感想や、ある景勝地の旅行攻略情報などをオンラインに投稿し、自分の投稿をオンラインで管理することができます。

   (6) パーソナライズされたレコメンドモジュール

B&B 管理プラットフォーム システムは、ユーザーの閲覧記録に基づいて関連する計算を実行し、協調フィルタリング アルゴリズムを使用して、さまざまなユーザーに対応する情報を推奨します。現在のデータ モデルは、主にユーザーが閲覧した B&B の特性に基づいており、関連する B&B 情報と照合します。 、ホームページの推奨モジュールに推奨され、表示されます。

   (7) 全文検索モジュール

    ホームステイ管理プラットフォームシステムでは、フロントエンドユーザーは関連キーワードに基づいて検索することができ、ホームステイ情報、景勝地情報などの全文を照合し、タイトルの説明に従ってファジーマッチングを実行し、検索された情報を表示します。

   (8) 苦情及び提案

オンラインコメントやお気に入りなどのインタラクティブな機能をユーザーに提供するだけでなく、苦情や提案モジュールも提供するため、ユーザーは関連する意見をタイムリーにフィードバックでき、バックグラウンド管理者がそれらを処理します。

バックエンドユーザー向けの機能モジュールの紹介:

   (1) 個人情報の管理:管理者はバックグラウンドでログインすることで、個人情報に関する適切な管理操作を行うことができます。

   (2) ユーザー管理: 管理者は、フロントエンドに登録されたユーザー情報に対して、対応する管理操作を実行できます。

   (3) カルーセル マップ管理: フロントエンド ホームページ上のカルーセル マップ情報に対して対応する管理操作を実行し、必要に応じてカルーセル マップを置き換えます。

   (4) 業界情報管理:主にホームステイ業界の関連する動的なニュース情報を管理し、公開します。

   (5) ホームステイ管理:主に公開されたホームステイ情報を管理し、ホームステイの場所と特徴を詳細に紹介し、バックグラウンドでホームステイの地図位置座標を指定します。これにより、フロントエンドユーザーはホームステイの場所を直接見つけることができます。百度地図。

   (6)観光スポット管理:主にホームステイ近くの関連景勝地情報を管理し、景勝地情報の追加、削除、変更、確認の操作を完了します。

   (7) 注文管理:主にフロントエンドユーザーの注文情報を管理し、フロントエンドメンバーがホームステイを予約した後、バックグラウンドで管理者によるレビューが必要となり、その後チェックインして利用することができます。それは有効になります。

   (8)レイダーズ管理:主にフロントエンドB&B会員のユーザーリリースやB&B戦略情報の管理を行います。

   (9) 苦情および提案: フロントエンドユーザーから発行された苦情および提案に対して関連する管理操作を実行します。

三、システム表示

3.1システムのフロントエンドインターフェースの実現

システムのインターフェイス設計には、主にシステムのログイン インターフェイス、メイン インターフェイス、およびさまざまな機能インターフェイスの設計と実現が含まれます。以下は、注目のホームステイのフロントエンドメンバーユーザーによって実装された関連機能モジュールを示しています。

3.1.1登録およびログイン機能インターフェースの実装

    ユーザー登録ページに登録情報を入力するとログインできますが、パスワードを忘れた場合は、登録時のアカウントと携帯電話番号に応じて新しいパスワードを再設定することもできます。図 4-1 および図 4 に示すように、ログイン インターフェイスとログイン インターフェイスが表示されます。-2 は以下を示します。

図 4-1 登録インターフェイス

図 4-2 ログインインターフェース

3.1.2ホームステイ推薦機能インターフェースの実現

   紹介したホームステイのホームページでは、現在ログインしているユーザーの閲覧履歴に基づいて、協調フィルタリングアルゴリズムを使用し、ログインしていない場合は閲覧回数の多い方からおすすめを表示します。以下の図 4-3 に示すように、協調フィルタリング アルゴリズムに従っても推奨されます。

3.1.3ホームステイ詳細インターフェースの実現

   ユーザーはクリックするとホームステイの詳細ページに入り、ホームステイの詳細情報を閲覧・閲覧することができ、気に入ったホームステイはブックマークすることができ、宿泊したい場合はオンライン予約も可能です。図 4-4 に示すように、現在のホームステイをオンラインで確認します。図 4-5 に示すように、

図 4-4 ホームステイ詳細インターフェース

図 4-5 オンライン予約インターフェース

3.1.4私の予約インターフェースの実装

    フロントエンド ユーザーはログインすると、次の図 4-6 に示すように、予約したホームステイ情報を表示し、対応する管理操作を実行できます。

 図 4-6 私の注文インターフェイス

3.1.5お気に入りインターフェースの実現

    フロントエンド ユーザーはログインすると、次の図 4-7 に示すように、お気に入りのホームステイや景勝地の情報を表示し、対応する管理操作を実行できます。

図 4-7 「お気に入り」インターフェイス

3.1.6苦情・提案インターフェースの実現

    フロントエンド ユーザーはログイン後、オンラインで苦情や提案を行うことができ、バックグラウンド管理者がそれを確認し、それに応じて対処します (以下の図 4-8 を参照)。

図 4-8 苦情提案インターフェイス

3.2システムバックグラウンド機能の実現

3.2.1管理者ログイン機能の実現

特徴的なホームステイ システムのバックグラウンド管理者は、バックグラウンド ログイン インターフェイスにアカウントのパスワードを入力してデータをバックグラウンド インターフェイスに送信し、データベースをチェックしてそれが正しいかどうかを比較し、ログインに成功するとバックグラウンドのメイン ページにジャンプします。図 4-9 に示すように。

図 4-9 管理者のログイン インターフェイス

3.2.2パーソナルセンター機能の実現

特徴的なホームステイシステムのバックグラウンド管理者は、バックグラウンドにログインした後、自分のパスワード情報を変更し、古いパスワードと新しいパスワードを入力してデータインターフェースに送信し、古いパスワードが成功したと判断した後、新しいパスワードを更新することができます。図 4-10 に示すように。

図 4-10 個人パスワード変更インターフェイス

3.2.3カルーセルマップ管理機能の実現

特徴的なホームステイシステムのバックグラウンド管理者は、バックグラウンドにログインしてフロントエンドホームページに表示されるカルーセル広告情報を管理し、追加、閲覧、変更、削除などの操作を完了することができる。図 4-11 に示すように。

図 4-11 カルーセル マップ管理インターフェイス

3.2.4ユーザ管理機能の実現

特徴的なホームステイシステムのバックグラウンド管理者は、バックグラウンドにログインしてフロントエンドの登録ユーザー情報を管理し、ユーザーのあいまいなクエリ、変更、削除操作を完了できます。図 4-12 に示すように。

図 4-12 ユーザー管理インターフェイス

3.2.5情報管理機能の実現

特徴的なホームステイシステムのバックグラウンド管理者は、バックステージにログインして、フロントエンドに表示されるホームステイ業界の資格情報を管理し、ニュースやニュースの関連操作を完了することができます。図 4-13 に示すように。

図 4-13 教育管理インターフェイス

3.2.6ホームステイ管理機能の実現

特徴的なホームステイ システムのバックグラウンド管理者は、バックグラウンドにログインして、フロント エンドに表示されるホームステイ詳細を管理し、ホームステイ詳細の関連管理操作を完了できます。図 4-14 に示すように。

図 4-14 ホームステイ管理インターフェース

3.2.7アトラクション管理機能の実現

特徴的なホームステイシステムのバックグラウンド管理者は、バックグラウンドにログインして、フロントエンドに表示される景勝地の詳細情報を管理し、景勝地の詳細の関連管理操作を完了することができます。図 4-15 に示すように。

図 4-15 アトラクション管理インターフェース

3.2.8注文管理機能の実現

特徴的なホームステイシステムのバックグラウンド管理者は、バックステージにログインして、フロントエンドユーザーが予約したホームステイ注文情報を管理し、注文情報の関連管理操作を完了することができます。図 4-16 に示すように。

図 4-16 注文管理インターフェイス

3.2.9戦略管理機能の実現

特徴的なホームステイシステムのバックグラウンド管理者は、バックグラウンドにログインして、フロントエンドユーザーが公開したホームステイ戦略情報を管理し、戦略情報の関連管理操作を完了することができる。図 4-17 に示すように。

図 4-17 戦略管理インターフェイス

3.2.10苦情・提案管理機能の実現

特徴的なホームステイシステムのバックグラウンド管理者は、バックグラウンドにログインして、フロントエンドユーザーが公開した苦情および提案情報を管理し、苦情情報の関連管理操作を完了することができます。図 4-18 に示すように。

図 4-18 苦情管理インターフェイス

4番目、コアコード表示


package com.sys.controller.admin;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sys.controller.MyController;

@Controller("adminController")
@RequestMapping(value = "/admin")
public class AdminController extends MyController {


	@RequestMapping(value = "/index")
	public String frame(Model model, HttpServletRequest request)throws Exception {
		return "/admin/index";
	}

	@RequestMapping(value = "/main")
	public String main(Model model, HttpServletRequest request)throws Exception {
		return "/admin/main";
	}

	@RequestMapping(value = "/tj1")
	public String tj1(Model model, HttpServletRequest request)throws Exception {
		String sql="select DATE_FORMAT(insertDate,'%Y-%m-%d') dates,sum(allPrice) price from t_order order by DATE_FORMAT(insertDate,'%Y-%m-%d')  desc";
		List<Map> list = db.queryForList(sql);
		model.addAttribute("list", list);
		System.out.println(list);
		return "/admin/tj/tj1";
	}


	@RequestMapping(value = "/password")
	public String password(Model model, HttpServletRequest request)throws Exception {
		return "/admin/password";
	}


	@RequestMapping(value = "/changePassword")
	public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String oldPassword,String newPassword) throws Exception {
		Map admin = getAdmin(request);
		if(oldPassword.equals(admin.get("password").toString())){
			String sql="update t_admin set password=? where id=?";
			db.update(sql, new Object[]{newPassword,admin.get("id")});
			return renderData(true,"1",null);
		}else{
			return renderData(false,"1",null);
		}
	}
}

package com.sys.controller.admin;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sys.controller.MyController;
import com.sys.controller.suanfa.Aprioti;
import com.sys.controller.suanfa.Itemset;
import com.sys.controller.xietong.XietongUtil;
import com.sxl.util.RandomValidateCode;
import com.sxl.util.StringHelper;

@Controller("frontController")
@RequestMapping(value = "/front")
public class FrontController extends MyController {

	/**
	 * 使用协同过滤算法进行相关推荐
	 * @param model
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/index")
	public String frame(Model model, HttpServletRequest request)
			throws Exception {
		String sql = "";
		sql = "select * from t_lbt";
		List list3 = db.queryForList(sql);
		request.setAttribute("list3", list3);

		sql = "select a.* from t_product a where 1=1 order by id desc limit 3";
		List listb = db.queryForList(sql);
		request.setAttribute("listb", listb);

		//协同过滤推荐算法
		if(getCustomer(request)!=null){
			//如果该用户登录了,身份确定了, 则可以用协同过滤推荐

			List<Map> customerList = db.queryForList("select * from t_customer");
			List<Map> dataList = db.queryForList("select distinct productId, customerId  from t_productclick where productId is not null and customerId is not null ");
			int usersize = customerList.size();
			String customerId = getCustomer(request).get("id").toString();
			/**
			 * 输入用户-->物品条目  一个用户对应多个物品
			 * 用户ID	物品ID集合
			 *   A		a b d
			 *   B		a c
			 *   C		b e
			 *   D		c d e
			 */
			String[] userdata = new String[customerList.size()];
			for (int i = 0; i < customerList.size(); i++) {
				String customerid = customerList.get(i).get("id").toString();
				String aa="A"+customerid+"";
				for (int j = 0; j < dataList.size(); j++) {
					if(customerid.equals(dataList.get(j).get("customerId").toString())){
						aa+="@"+dataList.get(j).get("productId").toString();
					}
				}
				userdata[i]= aa+="@0";
				System.out.println("******"+aa);
			}
			String out = XietongUtil.xietongjob(usersize, userdata, "A2");


			String sqlall="select a.*  from t_product a where 1=1 ";
			 sql=sqlall;
			if(out!=null&&!"".equals(out)){
				sql+=" and id in ("+out.substring(1,out.length())+")";
			}
			sql+="  order by rand() limit 8 ";
			//以上推荐算法最总结果在根据随机安排推荐

			//注!为了应对一开始人员访问数据量不够推荐算法使用的情况,就进行了数据补足,这个业务逻辑就非常完美了。
			List tuijianList = db.queryForList(sql);
			int a = 8;
			int b = 0;
			if(tuijianList==null||tuijianList.size()<8){
				if(tuijianList!=null){
					b = 8-tuijianList.size();
				}
				List list2 = db.queryForList(sqlall+" order by rand() limit "+b);
				tuijianList.addAll(list2);
			}else{

			}
			request.setAttribute("tuijianList", tuijianList);




		}else{
			//也就是说,如果网站用户未登录,则不能身份确认,所以用aprio算法
			//aprio推荐算法
			tuijiansuanfa(request);
		}




		return "/front/index";
	}


	/**
	 * 专门有个算法包
	 * 然后算法的逻辑也在这里,
	 * 而且把算法之外额逻辑也加了
	 * 注!为了应对一开始人员访问数据量不够推荐算法使用的情况,就进行了数据补足,这个业务逻辑就非常完美了。
	 *
	 * java推荐算法
	 * @param request
	 */
	public void tuijiansuanfa(HttpServletRequest request){
			Itemset originalItem = new Itemset();
			List<Map> lista = db.queryForList("select * from t_customer");
			for (int i = 0; i < lista.size(); i++) {
				TreeSet<String> itemset = new TreeSet<String>();
				List<Map> listb = db.queryForList("select * from t_productclick where customerId=?",new Object[]{lista.get(i).get("id")});
				for (int j = 0; j < listb.size(); j++) {
					itemset.add(listb.get(j).get("productId")+"");
				}
				originalItem.itemset.add(itemset);
			}
			Aprioti.originalItem=originalItem;
			List<Long> outList = Aprioti.aprioriProcess();
			String in ="";
			if(outList!=null&&outList.size()>0){
				for (int i = 0; i < outList.size(); i++) {
					in+=","+outList.get(i);
				}
			}
			String sqlall="select a.*  from t_product a where 1=1 ";
			String sql=sqlall;
			if(in!=null&&!"".equals(in)){
				sql+=" and id in ("+in.substring(1,in.length())+")";
			}
			sql+="  order by rand() limit 8 ";
			//以上推荐算法最总结果在根据随机安排推荐

			//注!为了应对一开始人员访问数据量不够推荐算法使用的情况,就进行了数据补足,这个业务逻辑就非常完美了。
			List tuijianList = db.queryForList(sql);
			int a = 8;
			int b = 0;
			if(tuijianList==null||tuijianList.size()<8){
				if(tuijianList!=null){
					b = 8-tuijianList.size();
				}
				List list2 = db.queryForList(sqlall+" order by rand() limit "+b);
				tuijianList.addAll(list2);
			}else{

			}
			request.setAttribute("tuijianList", tuijianList);
	}




	@RequestMapping(value = "/baidu1")
	public String baidu1(Model model, HttpServletRequest request)
			throws Exception {
		return "/front/baidu1";
	}

	@RequestMapping(value = "/baidu2")
	public String baidu2(Model model, HttpServletRequest request)
			throws Exception {
		return "/front/baidu2";
	}

	@RequestMapping(value = "/daohang1")
	public String daohang1(Model model, HttpServletRequest request,String id)
			throws Exception {
		Map map = db.queryForMap("select *from t_product where id="+id);
		model.addAttribute("map", map);
		return "/front/daohang1";
	}

	public String getjwd(HttpServletRequest request){
		Object jwdd= request.getSession().getAttribute("yhjwd");
		if(jwdd!=null){
			return jwdd.toString();
		}else{
			return "116.438189,39.9125";
		}
	}

	@RequestMapping(value = "/daohang2")
	public String daohang2(Model model, HttpServletRequest request,String id)
			throws Exception {
		Map map = db.queryForMap("select *from t_zx where id="+id);

		map = new HashMap();
		map.put("jwd", "116.661256,39.975119");


		model.addAttribute("map", map);



		String jwd = getjwd(request);
		System.out.println(jwd);
		System.out.println(map.get("jwd"));
		model.addAttribute("jwd", jwd);
		return "/front/daohang2";
	}






	@RequestMapping(value = "/login")
	public String login(Model model, HttpServletRequest request)
			throws Exception {
		return "/front/login";
	}

	public void saveClick(HttpServletRequest request,Long id){
		String sql="insert into t_productclick(productId,customerId,insertDate) values(?,?,now())";
		Map customer = getCustomer(request);
		if(customer!=null&&customer.size()>0){
			db.update(sql, new Object[]{id,getCustomer(request).get("id")});
		}
	}

	@RequestMapping(value = "/all")
	public String all(Model model, HttpServletRequest request,Long typesId,String productName,String px)
			throws Exception {

		String sql="select a.* from t_types a where 1=1";
			sql+=" order by id desc";
			List typesList = db.queryForList(sql);
			request.setAttribute("typesList", typesList);
			 sql="select a.*,(select typesName from t_types b where a.typesId=b.id) typesName  from t_product a where 1=1";

			 if(typesId!=null&&!"".equals(typesId)){
				 sql+=" and a.typesId="+typesId;
			 }
			 if(productName!=null&&!"".equals(productName)){
				 sql+=" and a.productName like '%"+productName+"%' ";
			 }
			 if("1".equals(px)){
				 sql+=" order by id desc";
			 }else  if("2".equals(px)){
				 sql+=" order by price asc";
			 }else  if("3".equals(px)){
				 sql+=" order by price desc";
			 }else  if("4".equals(px)){
				 sql+=" order by djl desc";
			 }

				List list = db.queryForList(sql);
				request.setAttribute("list", list);

		return "/front/all";
	}

	@RequestMapping(value = "/jfdh")
	public String jfdh(Model model, HttpServletRequest request)
			throws Exception {

		String sql="select a.* from t_jfdh a where 1=1";

			sql+=" order by id desc";
			List list = db.queryForList(sql);
			request.setAttribute("list", list);
		return "/front/jfdh";
	}
	@RequestMapping(value = "/dhjfSave")
	public ResponseEntity<String> dhjfSave(Model model,
			HttpServletRequest request,Long id) throws Exception {
		Map map = db.queryForMap("select * from t_jfdh where id="+id);
		String jf = map.get("jfCost").toString();
		String jfName = map.get("jfName").toString();
		//订单
		String sql = "insert into t_order(orderNum,customerId,productDetail,allPrice,status,insertDate) values(?,?,?,?,?,now())";
		int result = db.update(sql, new Object[] { System.currentTimeMillis()+"",
				getCustomer(request).get("id").toString(), jfName+"积分兑换["+jf+"]", 0+"", "兑换完成" });
		sql="update t_customer set jf = jf-"+jf+" where id="+getCustomer(request).get("id");
		db.update(sql);

		//积分减少
		return renderData(true, "操作成功", null);
	}


	@RequestMapping(value = "/register")
	public String register(Model model, HttpServletRequest request)
			throws Exception {
		System.out.println("112312312");
		return "/front/register";
	}


	@RequestMapping(value = "/detail")
	public String detail(Model model, HttpServletRequest request, Long id)
			throws Exception {
		//保存点击
		saveClick(request, id);


		String sql = "select a.*,(select typesName from t_types b where a.typesId=b.id) typesName " +
				" from t_product a where id=" + id;
		Map map = db.queryForMap(sql);
		request.setAttribute("map", map);
		String sql2="select a.*,(select max(customerName) from t_customer b where a.customerId=b.id) customerName from t_pinglun_product a where productId=? order by id desc";
		List<Map> list = db.queryForList(sql2,new Object[]{id});
		model.addAttribute("list", list);
		db.update("update t_product set djl=djl+1 where id="+id);

		int scNum = db.queryForInt("select count(1) from t_sc where productId="+id);
		model.addAttribute("scNum", scNum);



		return "/front/detail";
	}

	@RequestMapping(value = "/myOrder")
	public String myOrder(Model model, HttpServletRequest request)
			throws Exception {
		String sql = "select a.*,(select max(customerName) from t_customer b where a.customerId=b.id) customerName  from t_order a where 1=1 ";

		if (1 == 1) {
			sql += "and customerId=" + getCustomer(request).get("id") + " ";
		}
		sql += " order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("orderList", list);
		return "/front/myOrder";
	}


	@RequestMapping(value = "/deleteOneOrder")
	public ResponseEntity<String> deleteOneOrder(Model model,
			HttpServletRequest request,Long id) throws Exception {
		String sql="delete from t_order where id="+id;
		db.update(sql);
		return renderData(true, "操作成功", null);
	}

	@RequestMapping(value = "/pjSave")
	public ResponseEntity<String> pjSave(Model model,
			HttpServletRequest request,Long id,String pj) throws Exception {
		String sql="update t_order set pj='"+pj+"'  where id="+id;
		db.update(sql);
		return renderData(true, "操作成功", null);
	}



	@RequestMapping(value = "/deletesc")
	public ResponseEntity<String> deletesc(Model model,
			HttpServletRequest request,Long id) throws Exception {
		String sql="delete from t_sc where id="+id;
		db.update(sql);
		return renderData(true, "操作成功", null);
	}
	@RequestMapping(value = "/deletexiaoxi")
	public ResponseEntity<String> deletexiaoxi(Model model,
			HttpServletRequest request,Long id) throws Exception {
		String sql="delete from t_xiaoxi where id="+id;
		db.update(sql);
		return renderData(true, "操作成功", null);
	}

	@RequestMapping(value = "/addShopcar")
	public ResponseEntity<String> addShopcar(Model model,
			HttpServletRequest request, Long id, Integer num) throws Exception {
		int result = 0;
		db.update("delete from t_shopcar where customerId="+getCustomer(request).get("id"));
		String sql = "insert into t_shopcar(productId,num,customerId) values(?,?,?)";
		result = db.update(sql, new Object[] { id, 1,
				getCustomer(request).get("id").toString() });
		return renderData(true, "操作成功", null);
	}


	@RequestMapping(value = "/pay3")
	public ResponseEntity<String> pay3(Model model, HttpServletRequest request,Long address)
			throws Exception {
		String sql = "select a.*,(select productName from t_product b where a.productId=b.id) productName,"
				+ "(select price from t_product b where a.productId=b.id) price,(select jf from t_product b where a.productId=b.id) jf  from t_shopcar a where customerId="
				+ getCustomer(request).get("id");
		sql += " order by id desc";
		List<Map> list = db.queryForList(sql);
		int total = 0;
		int jf = 0;
		String productDetail = "";
		String productId="";
		for (int i = 0; i < list.size(); i++) {
			productId = list.get(i).get("productId").toString();
			productDetail += "," + list.get(i).get("productName") + "["
					+ list.get(i).get("num") + "]";
			total += Integer.parseInt(list.get(i).get("price").toString())
					* Integer.parseInt(list.get(i).get("num").toString());

//			jf+=Integer.parseInt(list.get(i).get("jf").toString())
//					* Integer.parseInt(list.get(i).get("num").toString());

			String sql2="update t_product set nums=nums-"+list.get(i).get("num").toString()+" where id="+list.get(i).get("productId").toString();
			db.update(sql2);
		}

		Map addressMap = db.queryForMap("select * from t_address where id=?",new Object[]{address});
		sql = "insert into t_order(orderNum,customerId,productDetail,allPrice,status,insertDate,lxr,lxfs,address,productId) values(?,?,?,?,?,now(),?,?,?,?)";
		int result = db.update(sql, new Object[] { System.currentTimeMillis()+"",
				getCustomer(request).get("id").toString(),  productDetail.subSequence(1, productDetail.length()), total+"", "等待处理",addressMap.get("lxr"),addressMap.get("phone"),addressMap.get("xxdz"),productId });

		sql = "delete from t_shopcar where customerId="
				+ getCustomer(request).get("id");
		db.update(sql);
		if (result == 1) {
			return renderData(true, "操作成功", null);
		} else {
			return renderData(false, "操作失败", null);
		}
	}

//	@RequestMapping(value = "/addShopcar")
//	public ResponseEntity<String> addShopcar(Model model,
//			HttpServletRequest request, Long id, Integer num) throws Exception {
//		int result = 0;
//		// 判断该用户是否
//		String sql = "select * from t_shopcar where  productId=? and customerId=?";
//		Map map = db.queryForMap(sql, new Object[] { id.toString(),
//				getCustomer(request).get("id").toString() });
//		if (map != null && map.size() > 0) {
//			sql = "update t_shopcar set productId=?,num=num+" + num
//					+ " where id=?";
//			result = db.update(sql, new Object[] { id, map.get("id") });
//		} else {
//			sql = "insert into t_shopcar(productId,num,customerId) values(?,?,?)";
//			result = db.update(sql, new Object[] { id, num,
//					getCustomer(request).get("id").toString() });
//		}
//		if (result == 1) {
//			return renderData(true, "操作成功", null);
//		} else {
//			return renderData(false, "操作失败", null);
//		}
//	}

	@RequestMapping(value = "/checkIsLogin")
	public ResponseEntity<String> checkIsLogin(Model model,
			HttpServletRequest request) throws Exception {
		Map customer = getCustomer(request);
		if (customer != null && customer.size() > 0) {
			return renderData(true, "操作成功", null);
		} else {
			return renderData(false, "操作失败", null);
		}
	}

	@RequestMapping(value = "/pay")
	public ResponseEntity<String> pay(Model model, HttpServletRequest request,Long address)
			throws Exception {
		String orderDate = request.getParameter("orderDate");
		String zffs = request.getParameter("zffs");
		String sql = "select a.*,(select productName from t_product b where a.productId=b.id) productName,"
				+ "(select price from t_product b where a.productId=b.id) price,(select jf from t_product b where a.productId=b.id) jf  from t_shopcar a where customerId="
				+ getCustomer(request).get("id");
		sql += " order by id desc";
		List<Map> list = db.queryForList(sql);
		int total = 0;
		int jf = 0;
		String productDetail = "";
		String productId="";
		for (int i = 0; i < list.size(); i++) {
			productId = list.get(i).get("productId").toString();
			productDetail = list.get(i).get("productName").toString() ;

			sql = "insert into t_order(orderNum,customerId,productDetail,allPrice,status,insertDate,lxr,lxfs,address,productId,orderDate,zffs) values(?,?,?,?,?,now(),?,?,?,?,?,?)";
			db.update(sql, new Object[] { System.currentTimeMillis()+"",
					getCustomer(request).get("id").toString(),  productDetail, list.get(i).get("price").toString()+"", "等待处理",null,null,null,productId ,orderDate,zffs});
		}
		sql = "delete from t_shopcar where customerId="
				+ getCustomer(request).get("id");
		db.update(sql);
		return renderData(true, "操作成功", null);
	}

	@RequestMapping(value = "/shopcar")
	public String shopcar(Model model, HttpServletRequest request)
			throws Exception {

		Map customer = getCustomer(request);
		if (customer != null && customer.size() > 0) {
		} else {
			return "redirect:/front/register.html";
		}
		String sql="select a.* from t_address a where 1=1";
		if(1==1){sql+=" and customerId="+getCustomer(request).get("id") +" ";}
		sql+=" order by id desc";
		List addressList = db.queryForList(sql);
		request.setAttribute("addressList", addressList);

		 sql = "select b.*,a.id ids,a.num num   from t_shopcar a left join t_product b on a.productId=b.id  where 1=1 and customerId="
				+ getCustomer(request).get("id");
		sql += " order by id desc";
		System.out.println(sql);
		List<Map> list = db.queryForList(sql);
		request.setAttribute("list", list);
		System.out.println(list);
		int total = 0;
		if(list!=null&&list.size()>0){
			for (int i = 0; i < list.size(); i++) {
				total += Integer.parseInt(list.get(i).get("price").toString())
						* Integer.parseInt(list.get(i).get("num").toString());
			}
		}

		request.setAttribute("total", total);
		return "/front/shopcar";
	}

	@RequestMapping(value = "/save")
	public ResponseEntity<String> loginSave(Model model,
			HttpServletRequest request, String username, String password)
			throws Exception {
		String sql = "select * from t_customer where username=?";
		List<Map> list = db.queryForList(sql, new Object[] { username });
		String result = "1";
		if (list != null && list.size() > 0) {
			Map map = list.get(0);
			if (StringHelper.get(map, "password").equals(password)) {
				request.getSession().setMaxInactiveInterval(60 * 60 * 24);
				request.getSession().setAttribute("customerBean", map);
				result = "1";
			} else {
				result = "0";
			}
		} else {
			result = "0";
		}
		return renderData(true, result, null);
	}


	@RequestMapping(value = "/deleteOneShopCar")
	public ResponseEntity<String> deleteOneShopCar(Model model,
			HttpServletRequest request,Long id)
			throws Exception {
		String sql="delete from t_shopcar where id="+id;
		db.update(sql);
		return renderData(true, "", null);
	}

	@RequestMapping(value = "/updateShopCar")
	public ResponseEntity<String> updateShopCar(Model model,
			HttpServletRequest request,Long id,Integer num)
			throws Exception {
		String sql="update t_shopcar set num="+num+" where id="+id;
		System.out.println(sql);
		db.update(sql);
		return renderData(true, "", null);
	}

	@RequestMapping(value = "/registerSave")
	public ResponseEntity<String> registerSave(Model model,
			HttpServletRequest request, Long id, String username,
			String password, String customerName, String sex, String address,String headPic,
			String phone) throws Exception {
		String yzm = request.getParameter("yzm");
		String yzmnow = request.getSession().getAttribute(RandomValidateCode.RANDOMCODEKEY).toString().toUpperCase();
		if(!yzmnow.equals(yzm.toUpperCase())){
			return renderData(false, "5", null);
		}
		int a = db.queryForInt("select count(1) from t_customer where username=?",new Object[]{username});
		if(a>0){
			return renderData(false, "1", null);
		}
		int result = 0;
		if(headPic==null||"".equals(headPic)){
			headPic ="resource/front4/123.jpg";
		}
		String sql = "insert into t_customer(username,password,customerName,sex,address,phone,headPic) values(?,?,?,?,?,?,?)";
		result = db.update(sql, new Object[] { username, password, customerName, sex,
				address, phone,headPic });
		sql = "select * from t_customer order by id desc limit 1";
		List<Map> list = db.queryForList(sql);
		request.getSession().setMaxInactiveInterval(60 * 60 * 24);
		request.getSession().setAttribute("customerBean", list.get(0));

		return renderData(true, "操作成功", null);
	}

	@RequestMapping(value = "/out")
	public String out(Model model, HttpServletRequest request) throws Exception {
		request.getSession().removeAttribute("customerBean");
		return "redirect:/front/login.html";
	}

	@RequestMapping(value = "/mine")
	public String mine(Model model, HttpServletRequest request)
			throws Exception {
		Map customer = getCustomer(request);
		Map map = db.queryForMap("select * from t_customer where id=?",
				new Object[] { customer.get("id") });
		model.addAttribute("customer", map);
		return "/front/mine";
	}

	@RequestMapping(value = "/mineSave")
	public ResponseEntity<String> mineSave(Model model,
			HttpServletRequest request, Long id, String username,
			String password, String customerName, String sex, String address,String headPic,
			String phone) throws Exception {
		int result = 0;
		String sql = "update t_customer set customerName=?,sex=?,address=?,phone=?,headPic=? where id=?";
		result = db.update(sql, new Object[] { customerName, sex, address, phone,headPic, id });


		sql = "select * from t_customer where id="+id;
		List<Map> list = db.queryForList(sql);
		request.getSession().setMaxInactiveInterval(60 * 60 * 24);
		request.getSession().setAttribute("customerBean", list.get(0));


		return renderData(true, "操作成功", null);
	}

	@RequestMapping(value = "/password")
	public String password(Model model, HttpServletRequest request)
			throws Exception {
		return "/front/password";
	}

	@RequestMapping(value = "/changePassword")
	public ResponseEntity<String> changePassword(Model model,
			HttpServletRequest request, String oldPassword, String newPassword)
			throws Exception {
		Map customer = getCustomer(request);
		if (oldPassword.equals(customer.get("password").toString())) {
			String sql = "update t_customer set password=? where id=?";
			db.update(sql, new Object[] { newPassword, customer.get("id") });
			return renderData(true, "1", null);
		} else {
			return renderData(false, "1", null);
		}
	}



	@RequestMapping(value = "/scSave")
	public ResponseEntity<String> scSave(Model model,
			HttpServletRequest request, Long id, String pl) throws Exception {
		int result = 0;
		String customerId = getCustomer(request).get("id").toString();
		db.update("delete from t_sc  where productId=? and customerId=? ", new Object[] {id,customerId });
		String sql = "insert into t_sc(productId,customerId,insertDate) values(?,?,now())";
		result = db.update(sql, new Object[] {id,customerId });
		return renderData(true, "操作成功", null);
	}

	@RequestMapping(value = "/plSave")
	public ResponseEntity<String> plSave(Model model,
			HttpServletRequest request, Long id, String pl) throws Exception {
		int result = 0;
		String sql = "update t_order set pl=? where id=?";
		result = db.update(sql, new Object[] { pl, id });
		if (result == 1) {
			return renderData(true, "操作成功", null);
		} else {
			return renderData(false, "操作失败", null);
		}
	}

	@RequestMapping(value = "/contact")
	public String fk(Model model, HttpServletRequest request) throws Exception {
		return "/front/contact";
	}

	@RequestMapping(value = "/contactSave")
	public ResponseEntity<String> contactSave(Model model,
			HttpServletRequest request, String content, String phone)
			throws Exception {
		int result = 0;
		String sql = "insert into t_contact(customerId,phone,content,insertDate) values(?,?,?,now())";
		result = db.update(sql, new Object[] { getCustomer(request).get("id"),
				phone, content });
		if (result == 1) {
			return renderData(true, "操作成功", null);
		} else {
			return renderData(false, "操作失败", null);
		}
	}

	@RequestMapping(value = "/message")
	public String message(Model model, HttpServletRequest request)
			throws Exception {

		String sql = "select a.*,(select max(name) from t_customer b where a.customerId=b.id) customerName  from t_message a where 1=1 ";
		sql += " and customerId=" + getCustomer(request).get("id") + " ";
		sql += " order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		System.out.println(list);
		return "/front/message";
	}

	@RequestMapping(value = "/saveMessageContent")
	public ResponseEntity<String> saveMessageContent(Model model,
			HttpServletRequest request, String messageContent) throws Exception {
		Map customer = getCustomer(request);

		String sql = "insert into t_message(customerId,messageContent,insertDate,types) values(?,?,now(),1)";//1代表我
		int result = db
				.update(sql, new Object[] { getCustomer(request).get("id"),
						messageContent });
		return renderData(true, "1", null);
	}

	///前端增删改查例子开始//
	@RequestMapping(value = "/test")
	public String test(Model model, HttpServletRequest request,String flag,String testName)throws Exception {
		String sql="select a.*,(select max(name) from t_customer b where a.customerId=b.id) customerName  from t_test a where 1=1";
		if(testName!=null&&!"".equals(testName)){
			sql+=" and testName like '%"+testName+"%' ";
		}
		sql+="  and customerId="+getCustomer(request).get("id");
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/front/test";
	}

	@RequestMapping(value = "/testaddSave")
	public ResponseEntity<String> testaddSave(Model model,HttpServletRequest request,Long id,String flag
		,Integer customerId,String testName,String testContent,String testSex,String testDay,String testPic,String insertDate) throws Exception{
		int result = 0;
		if(id!=null){
			String sql="update t_test set testName=?,testContent=?,testSex=?,testDay=?,testPic=? where id=?";
			result = db.update(sql, new Object[]{testName,testContent,testSex,testDay,testPic,id});
		}else{
			String sql="insert into t_test(customerId,testName,testContent,testSex,testDay,testPic,insertDate) values(?,?,?,?,?,?,now())";
			result = db.update(sql, new Object[]{getCustomer(request).get("id"),testName,testContent,testSex,testDay,testPic});
		}
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}

	@RequestMapping(value = "/testDelete")
	public ResponseEntity<String> testDelete(Model model,HttpServletRequest request,Long id,String flag) throws Exception {

		String sql="delete from t_test where id=?";
		int result = db.update(sql, new Object[]{id});
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}

	}

	@RequestMapping(value = "/testadd")
	public String testadd(Model model, HttpServletRequest request,Long id,String flag)throws Exception {
		if(id!=null){
			//修改
			String sql="select * from t_test where id=?";
			Map map = db.queryForMap(sql,new Object[]{id});
			model.addAttribute("map", map);
		}String sql="";
		return "/front/testadd";
	}



	///前端增删改查例子结束/

	@RequestMapping(value = "/find")
	public String find(Model model, HttpServletRequest request)
			throws Exception {
		return "/front/find";
	}


	@RequestMapping(value = "/findSave")
	public ResponseEntity<String> findSave(Model model,
			HttpServletRequest request, String username, String phone)
			throws Exception {
		String sql = "select * from t_customer where username=? and phone=?";
		List<Map> list = db.queryForList(sql, new Object[] { username,phone });
		System.out.println(list);
		String result = "1";
		if (list != null && list.size() > 0) {
			Map map = list.get(0);
			return renderData(true, result, null);
		} else {
			return renderData(false, result, null);
		}

	}

	@RequestMapping(value = "/findSaveConfirm")
	public ResponseEntity<String> findSaveConfirm(Model model,
			HttpServletRequest request, String username, String phone,String password)
			throws Exception {
		String sql = "update t_customer set password=? where  username=? and phone=?";
		db.update(sql, new Object[] {password, username,phone });
		return renderData(true, "", null);
	}


	@RequestMapping(value = "/lt")
	public String lt(Model model, HttpServletRequest request,String searchName,Long oneClassifyId)
			throws Exception {
		Map customer = getCustomer(request);


		String sql="select a.*,(select max(customerName) from t_customer b where b.id=a.customerId) customerName," +
				"(select count(1) from t_pinglun b where b.wdxxId=a.id) nums from t_wdxx a where 1=1  ";
		if(searchName !=null&&!"".equals(searchName)){
			sql+=" and a.title like '%"+searchName+"%'";
		}
		if(customer==null||customer.size()==0){
			sql+=" and a.nologin='是' ";
		}
		sql+=" order by id desc";
		List<Map> list = db.queryForList(sql);
		model.addAttribute("list", list);
		return "/front/lt";
	}

	@RequestMapping(value = "/wdxxList")
	public String wdxxList(Model model, HttpServletRequest request,String flag,String title)throws Exception {
		String sql="select a.*,(select max(customerName) from t_customer b where a.customerId=b.id) customerName  from t_wdxx a where 1=1";

		if(1==1){sql+=" and customerId="+getCustomer(request).get("id") +" ";}
	if(title!=null&&!"".equals(title)){
			sql+=" and title like '%"+title+"%'";
		}
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/front/wdxxList";
	}

	@RequestMapping(value = "/mineaddress")
	public String mineaddress(Model model, HttpServletRequest request,String flag,String title)throws Exception {
		String sql="select a.* from t_address a where 1=1";

		if(1==1){sql+=" and customerId="+getCustomer(request).get("id") +" ";}
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/front/mineaddress";
	}


	@RequestMapping(value = "/minesc")
	public String minesc(Model model, HttpServletRequest request,String flag,String title)throws Exception {
		String sql="select (select max(productName) from t_product b where b.id=a.productId) productName,(select max(productPic1) from t_product b where b.id=a.productId) productPic1,id,productId  from t_sc a where 1=1";
if(1==1){sql+=" and customerId="+getCustomer(request).get("id") +" ";}
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		System.out.println(sql);
		request.setAttribute("list", list);
		return "/front/minesc";
	}

	@RequestMapping(value = "/minexiaoxi")
	public String minexiaoxi(Model model, HttpServletRequest request,String flag,String title)throws Exception {
		String sql=" select * from t_xiaoxi a where 1=1";
if(1==1){sql+=" and customerId="+getCustomer(request).get("id") +" ";}
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/front/minexiaoxi";
	}

	@RequestMapping(value = "/hywdxxList")
	public String hywdxxList(Model model, HttpServletRequest request,String flag,String title)throws Exception {
		Map customer = getCustomer(request);
		String sql="select a.*,(select max(name) from t_customer b where a.customerId=b.id) customerName  from t_wdxx a where 1=1";
		sql+=" and exists(select 1 from t_wdhy b where a.customerId=b.hhId and b.customerId="+customer.get("id")+") ";
	if(title!=null&&!"".equals(title)){
			sql+=" and title like '%"+title+"%'";
		}
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/front/wdxxList";
	}

	@RequestMapping(value = "/wdxxEditSave")
	public ResponseEntity<String> editSave(Model model,HttpServletRequest request,Long id,String flag
		,Integer customerId,String title,String pic,String content,Integer zan,String insertDate,String nologin,Long bkId) throws Exception{
		int result = 0;
		if(id!=null){
			String sql="update t_wdxx set title=?,pic=?,content=?,nologin=?,bkId=? where id=?";
			result = db.update(sql, new Object[]{title,pic,content,nologin,bkId,id});
		}else{
			String sql="insert into t_wdxx(customerId,title,pic,content,zan,insertDate,nologin,bkId) values(?,?,?,?,?,now(),?,?)";
			result = db.update(sql, new Object[]{getCustomer(request).get("id"),title,pic,content,0,nologin,bkId});
		}
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}


	@RequestMapping(value = "/mineaddressEditSave")
	public ResponseEntity<String> mineaddressEditSave(Model model,HttpServletRequest request,Long id,String province,String city,String area,String phone,String lxr,String xxdz) throws Exception{
		int result = 0;
		if(id!=null){
			String sql="update t_address set province=?,city=?,area=?,phone=?,lxr=?,xxdz=? where id=?";
			result = db.update(sql, new Object[]{province,city,area,phone,lxr,xxdz,id});
		}else{
			String sql="insert into t_address(customerId,province,city,area,phone,lxr,xxdz) values(?,?,?,?,?,?,?)";
			result = db.update(sql, new Object[]{getCustomer(request).get("id"),province,city,area,phone,lxr,xxdz});
		}
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}

	@RequestMapping(value = "/wdxxEditDelete")
	public ResponseEntity<String> editDelete(Model model,HttpServletRequest request,Long id,String flag) throws Exception {

		String sql="delete from t_wdxx where id=?";
		int result = db.update(sql, new Object[]{id});
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}

	}

	@RequestMapping(value = "/wdxxEdit")
	public String wdxxEdit(Model model, HttpServletRequest request,Long id,String flag)throws Exception {
		if(id!=null){
			//修改
			String sql="select * from t_wdxx where id=?";
			Map map = db.queryForMap(sql,new Object[]{id});
			model.addAttribute("map", map);
		}String sql="";

		return "/front/wdxxEdit";
	}

	@RequestMapping(value = "/mineaddressEdit")
	public String mineaddressEdit(Model model, HttpServletRequest request,Long id,String flag)throws Exception {
		if(id!=null){
			//修改
			String sql="select * from t_address where id=?";
			Map map = db.queryForMap(sql,new Object[]{id});
			model.addAttribute("map", map);
		}String sql="";

		return "/front/mineaddressEdit";
	}

	@RequestMapping(value = "/wdxxShow")
	public String wdxxShow(Model model, HttpServletRequest request,Long id,String flag)throws Exception {
		if(id!=null){
			//修改
			String sql="select a.*,(select max(customerName) from t_customer b where a.customerId=b.id) customerName,(select count(1) from t_pinglun b where b.wdxxId=a.id) nums from t_wdxx a where id=?";
			Map map = db.queryForMap(sql,new Object[]{id});
			model.addAttribute("map", map);
		}
		String sql="select a.*,(select max(customerName) from t_customer b where a.customerId=b.id) customerName,(select max(headPic) from t_customer b where a.customerId=b.id) headPic from t_pinglun a where wdxxId=? order by id desc";
		List<Map> list = db.queryForList(sql,new Object[]{id});
		model.addAttribute("list", list);




		 sql="select a.*,(select max(customerName) from t_customer b where a.customerId=b.id) customerName  from t_wdxx a where 1=1 order by zan desc limit 4";
		List list3 = db.queryForList(sql);
		request.setAttribute("list3", list3);

		sql="select a.*,(select max(customerName) from t_customer b where a.customerId=b.id) customerName  from t_wdxx a where 1=1 order by id desc limit 4";
		List list4 = db.queryForList(sql);
		request.setAttribute("list4", list4);
		return "/front/wdxxShow";
	}

	@RequestMapping(value = "/wdxxDelete")
	public ResponseEntity<String> wdxxDelete(Model model,
			HttpServletRequest request, Long id) throws Exception {
		Map customer = getCustomer(request);
		String sql="delete from t_wdxx where  id=?";
		db.update(sql, new Object[]{id});
		return renderData(true, "操作成功", null);
	}

	@RequestMapping(value = "/addressDelete")
	public ResponseEntity<String> addressDelete(Model model,
			HttpServletRequest request, Long id) throws Exception {
		Map customer = getCustomer(request);
		String sql="delete from t_address where  id=?";
		db.update(sql, new Object[]{id});
		return renderData(true, "操作成功", null);
	}

	@RequestMapping(value = "/pinglunSave")
	public ResponseEntity<String> pinglunSave(Model model,HttpServletRequest request,Long id,String flag
		,String wdxxId,Integer customerId,String content,String insertDate) throws Exception{
		int result = 0;
		String sql="insert into t_pinglun(wdxxId,customerId,content,insertDate) values(?,?,?,now())";
		result = db.update(sql, new Object[]{wdxxId,getCustomer(request).get("id"),content});
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}


	@RequestMapping(value = "/productPinglunSave")
	public ResponseEntity<String> productPinglunSave(Model model,HttpServletRequest request,Long id,String flag
		,String productId,Integer customerId,String content,String insertDate) throws Exception{
		int result = 0;
		String sql="insert into t_pinglun_product(productId,customerId,content,insertDate) values(?,?,?,now())";
		result = db.update(sql, new Object[]{productId,getCustomer(request).get("id"),content});
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}

	@RequestMapping(value = "/zanSave")
	public ResponseEntity<String> zanSave(Model model,HttpServletRequest request,Long id) throws Exception{
		int result = 0;
		String sql="update t_wdxx set zan=zan+1 where id=?";
		result = db.update(sql, new Object[]{id});
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}


	@RequestMapping(value = "/zxList")
	public String zxList(Model model, HttpServletRequest request,String flag,String title)throws Exception {

		String sql="select a.* from t_zx a where 1=1 ";


	if(title!=null&&!"".equals(title)){
			sql+=" and title like '%"+title+"%'";
		}
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/front/zxList";
	}



	@RequestMapping(value = "/zxShow")
	public String zxShow(Model model, HttpServletRequest request,Long id,String flag)throws Exception {
		String sql="select * from t_zx where id=?";
		Map map = db.queryForMap(sql,new Object[]{id});
		model.addAttribute("map", map);
		 sql="select a.* from t_zx a where 1=1 ";
			sql+=" order by id desc limit 3";
			List list = db.queryForList(sql);
			request.setAttribute("list", list);
		return "/front/zxShow";
	}

	@RequestMapping(value = "/ltjlDelete")
	public ResponseEntity<String> ltjlDelete(Model model,HttpServletRequest request,Long id,String pl,String flag) throws Exception {
		System.out.println("getCustomer(request).get()==================="+getCustomer(request).get("id"));
		db.update("delete from t_liaotian where customerId=? or toId=?", new Object[]{getCustomer(request).get("id"),getCustomer(request).get("id")});
		return renderData(true,"操作成功",null);
	}

	@RequestMapping(value = "/liaotian")
	public String liaotian(Model model, HttpServletRequest request,Long id,String flag,Long toId)throws Exception {
		Map customer = getCustomer(request);
		if (customer != null && customer.size() > 0) {
		} else {
			return "redirect:/front/register.html";
		}


		String customerId = getCustomer(request).get("id").toString();
		String batchNum1 = customerId+"&&"+toId;
		String batchNum2 = toId+"&&"+customerId;
		List list = db.queryForList("select a.*,(select max(customerName) from t_customer b where a.customerId=b.id) customerName1," +
				"(select max(name) from t_user c where a.toId=c.id) customerName2 from t_liaotian a where batchNum in ('"+batchNum1+"','"+batchNum2+"') order by id asc");
		System.out.println("select a.*,(select max(customerName) from t_customer b where a.customerId=b.id) customerName1," +
				"(select max(name) from t_user c where a.toId=c.id) customerName2 from t_liaotian a where batchNum in ('"+batchNum1+"','"+batchNum2+"') order by id asc");
		model.addAttribute("list", list);


		System.out.println(list);
		return "/front/liaotian";
	}

	@RequestMapping(value = "/woxiaoxi")
	public String woxiaoxi(Model model, HttpServletRequest request,Long id,String flag,Long toId)throws Exception {
		String customerId = getCustomer(request).get("id").toString();
		String sql="select customerId,(select max(customerName) from t_customer b where b.id=a.customerId) customerName  from t_liaotian a where toId="+customerId+" group by customerId ";
		System.out.println(db.queryForList(sql));
		model.addAttribute("list", db.queryForList(sql));
		return "/front/woxiaoxi";
	}


	@RequestMapping(value = "/liaotianSave")
	public ResponseEntity<String> liaotianSave(Model model,HttpServletRequest request,Long toId,String content) throws Exception {
		String customerId = getCustomer(request).get("id").toString();
		String batchNum = customerId+"&&"+toId;
		db.update("insert into t_liaotian(customerId,toId,content,insertDate,batchNum,fq) values(?,?,?,now(),?,1)", new Object[]{customerId,toId,content,batchNum});
		return renderData(true,"操作成功",null);

	}


}

5. 関連作品の展示

Java開発、Python開発、PHP開発、C#開発等の関連言語をベースとした各種卒業設計業務

Nodejs、Vue等のフロントエンド技術をベースに開発・設計したフロントエンド卒業設計作品

WeChatアプレットおよびAndroid APPアプリケーション開発に基づく関連作品

51個のシングルチップマイコンをベースとした組み込みIoTの開発と応用

さまざまなアルゴリズムに基づくAIインテリジェントアプリケーション

ビッグデータを活用した各種データ管理・レコメンドシステム

最先端の技術、ワンストップサービス、丁寧なアフターサービスでお悩みを解決します

 

 

おすすめ

転載: blog.csdn.net/znzbs/article/details/131673426