基於SSM開發的企業進存銷系統 JAVA MySQL

我就是個憨憨發表於2020-10-27

10076基於SSM開發的企業進存銷系統

執行視訊、程式碼等:
連結:https://pan.baidu.com/s/1g1mo95iv6vFELMHI95OELA
提取碼:1589
複製這段內容後開啟百度網盤手機App,操作更方便哦

技術
Spring + SpringMVC + Mybatis

工具
eclipse + tomact + mysql + jdk

功能詳情

功能詳情
進貨管理:展示進貨詳情
銷售管理:展示銷售詳情
庫存管理:展示庫存情況
統計報表:對供應商、客戶、商品採集銷售情況進行統計
基礎資料:維護供應商、客戶和商品資訊
系統管理:系統相關設定

系統相關截圖

● 系統首頁

在這裡插入圖片描述

package servlet;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import dao.SimpleWordSegment;
import dao.WordSegment;
import org.apache.log4j.Logger;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;

@WebServlet(name = “WordSegmentServlet”, value = “/WordSegmentServlet”)
public class WordSegmentServlet extends HttpServlet {

private static Logger logger = Logger.getLogger(WordSegmentServlet.class);

private WordSegment wordSegment = new SimpleWordSegment();

private JsonObject json = new JsonObject();

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, IOException {

response.setCharacterEncoding(“utf-8”);
response.setContentType(“application/json”);
response.setHeader(“Access-Control-Allow-Origin”, “*”);

String returnType = “JSON”;

String string = request.getParameter(“text”);

switch (returnType) {
case “JSON”:
// 分詞結果轉換成JSON資料
segment2Json(string);
logger.debug(“要返回的JSON資料為:” + json.toString());
response.getWriter().write(json.toString());
break;
case “JSP”:

    break;
default:

    break;

}
}

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, IOException {
logger.debug(“使用do get方法”);
doPost(request, response);
}

/**

分詞演算法

@param text
*/
public void segment2Json(String text) {

String[] methods = {“MM”, “RMM”, “BM”, “MC”};

if (text == null || text.equals("")) {
json.addProperty(“status”, false);
json.addProperty(“error”, “分詞字串為空!”);
return ;
}

JsonArray array = new JsonArray();

for (String method : methods) {
JsonObject result = new JsonObject();
// 演算法的名稱
result.addProperty(“name”, method);
long start = System.currentTimeMillis();
List data = string2dataSegment(method, text);
long end = System.currentTimeMillis();
JsonArray dataSegment = new JsonArray();
if (data != null && data.size() != 0) {
StringBuffer log = new StringBuffer("");
for (String s : data) {
log.append(s + " / ");
dataSegment.add(new JsonPrimitive(s));
}
logger.debug(“分詞結果為:” + log);
}
// 演算法的分詞結果
result.add(“dataSegment”, dataSegment);
// 演算法的執行時間
result.addProperty(“time”, end - start);

array.add(result);
1
}

json.addProperty(“status”, true);
// 所有演算法的分詞結果
json.add(“result”, array);
}

/**

得到對應的分詞方法的結果

@param method

@param text

@return
*/
public List string2dataSegment(String method, String text) {
List dataSegment = null;

try {
Method[] methods = wordSegment.getClass().getDeclaredMethods();
for (Method m : methods) {
if (m.getName().equals(method)) {
dataSegment = (List) m.invoke(wordSegment, text);
break;
}
}

} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}

return dataSegment;
}

public JsonObject getJson() {
return json;
}
}
package weibo4j;

import java.util.List;

import weibo4j.model.Favorites;
import weibo4j.model.FavoritesTag;
import weibo4j.model.Paging;
import weibo4j.model.PostParameter;
import weibo4j.model.Tag;
import weibo4j.model.WeiboException;
import weibo4j.org.json.JSONException;
import weibo4j.org.json.JSONObject;
import weibo4j.util.WeiboConfig;

public class Favorite extends Weibo{
/**
*
*/
private static final long serialVersionUID = 2298934944028795652L;

/**

獲取當前登入使用者的收藏列表
@return list of the Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites
@since JDK 1.5
/
public List getFavorites() throws WeiboException {
return Favorites.constructFavorites(client.get(WeiboConfig
.getValue(“baseURL”) + “favorites.json”));
}
/
*

獲取當前登入使用者的收藏列表
@param page
、count
1
@return list of the Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites
@since JDK 1.5
/
public List getFavorites(Paging page) throws WeiboException {
return Favorites.constructFavorites(client.get(
WeiboConfig.getValue(“baseURL”) + “favorites.json”,
null, page));
}
/*
獲取當前登入使用者的收藏列表ID
@return list of the Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites
@since JDK 1.5
/
public JSONObject getFavoritesIds() throws WeiboException {
return client.get(WeiboConfig
.getValue(“baseURL”) + “favorites/ids.json”).asJSONObject();
}
/*
獲取當前登入使用者的收藏列表ID
@return list of the Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites
@since JDK 1.5
/
public JSONObject getFavoritesIds(Paging page) throws WeiboException {
return client.get(WeiboConfig
.getValue(“baseURL”) + “favorites/ids.json”,null,page).asJSONObject();
}
/*
根據收藏ID獲取指定的收藏資訊
@param id
@return Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites/show
1
@since JDK 1.5
*/
public Favorites showFavorites(String id) throws WeiboException {
return new Favorites(client.get(WeiboConfig.getValue(“baseURL”)

  • “favorites/show.json”,
    new PostParameter[] { new PostParameter(“id”, id) }));
    }
    /**

根據標籤獲取當前登入使用者該標籤下的收藏列表
@param tid
@return list of the favorite Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites/by_tags
1
@since JDK 1.5
/
public List getFavoritesByTags(String tid) throws WeiboException {
return Favorites.constructFavorites(client.get(
WeiboConfig.getValue(“baseURL”) + “favorites/by_tags.json”,
new PostParameter[] { new PostParameter(“tid”, tid) }));
}
/
*

根據標籤獲取當前登入使用者該標籤下的收藏列表
@param tid
@param page
@return list of the favorite Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/show
1
@since JDK 1.5
/
public List getFavoritesByTags(String tid, Paging page)
throws WeiboException {
return Favorites.constructFavorites(client.get(
WeiboConfig.getValue(“baseURL”) + “favorites/by_tags.json”,
new PostParameter[] { new PostParameter(“tid”, tid) }, page));
}
/
*

獲取當前登入使用者的收藏標籤列表
@param page
@return list of the favorite tags
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites/tags
1
@since JDK 1.5
*/
public List getFavoritesTags() throws WeiboException {
return Tag.constructTag(client.get(WeiboConfig
.getValue(“baseURL”) + “favorites/tags.json”));
}

/**

@param 要收藏的微博ID

1
@return Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/create
1
@since JDK 1.5
*/
public Favorites createFavorites(String id) throws WeiboException {
return new Favorites(client.post(WeiboConfig.getValue(“baseURL”)

  • “favorites/create.json”,
    new PostParameter[] { new PostParameter(“id”, id) }));
    }
    /**

@param 要取消收藏的微博ID

1
@return Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/destroy
1
@since JDK 1.5
*/
public Favorites destroyFavorites(String id) throws WeiboException {
return new Favorites(client.post(WeiboConfig.getValue(“baseURL”)

  • “favorites/destroy.json”,
    new PostParameter[] { new PostParameter(“id”, id) }));
    }
    /**

批量刪除收藏
@param ids
要取消收藏的收藏ID,用半形逗號分隔,最多不超過10個。
1
@return destroy list of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/destroy_batch
1
@since JDK 1.5
*/
public Boolean destroyFavoritesBatch(String ids) throws WeiboException {
try {
return client
.post(WeiboConfig.getValue(“baseURL”)

  • “favorites/destroy_batch.json”,
    new PostParameter[] { new PostParameter(“ids”, ids) })
    .asJSONObject().getBoolean(“result”);
    } catch (JSONException e) {
    throw new WeiboException(e);
    }
    }
    /**

更新一條收藏的收藏標籤
@param id
要需要更新的收藏ID
1
@return update tag of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/tags/update
1
@since JDK 1.5
*/
public Favorites updateFavoritesTags(String id) throws WeiboException {
return new Favorites(client.post(WeiboConfig.getValue(“baseURL”)

  • “favorites/tags/update.json”,
    new PostParameter[] { new PostParameter(“id”, id) }));
    }
    /**

更新一條收藏的收藏標籤
@param id
要需要更新的收藏ID
1
@param tags
需要更新的標籤內容,必須做URLencode,用半形逗號分隔,最多不超過2條。
1
@return update tag of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/tags/update
1
@since JDK 1.5
*/
public Favorites updateFavoritesTags(String id, String tags)
throws WeiboException {
return new Favorites(client.post(WeiboConfig.getValue(“baseURL”)

  • “favorites/tags/update.json”, new PostParameter[] {
    new PostParameter(“id”, id), new PostParameter(“tags”, tags) }));
    }
    /**

更新當前登入使用者所有收藏下的指定標籤
@param id
需要更新的標籤ID。
1
@return update tags of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/tags/update_batch
1
@since JDK 1.5
*/
public JSONObject updateFavoritesTagsBatch(String tid, String tag)
throws WeiboException {
return client.post(
WeiboConfig.getValue(“baseURL”)

  • “favorites/tags/update_batch.json”,
    new PostParameter[] { new PostParameter(“tid”, tid),
    new PostParameter(“tag”, tag) }).asJSONObject();
    }
    /**

刪除當前登入使用者所有收藏下的指定標籤
@param id
需要刪除的標籤ID。。
1
@return destroy tags of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/tags/destroy_batch
1
@since JDK 1.5
*/
public Boolean destroyFavoritesTagsBatch(String ids) throws WeiboException {
try {
return client
.post(WeiboConfig.getValue(“baseURL”)

  • “favorites/destroy_batch.json”,
    new PostParameter[] { new PostParameter(“ids”, ids) })
    .asJSONObject().getBoolean(“result”);
    } catch (JSONException e) {
    throw new WeiboException(e);
    }
    }

相關文章