Commit 07259995 authored by AlanGao's avatar AlanGao
Browse files

update

parent 458409b4
package com.jsh.action.materials;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.dao.DataAccessException;
import com.jsh.base.BaseAction;
import com.jsh.base.Log;
import com.jsh.model.po.MaterialCategory;
import com.jsh.model.po.Logdetails;
import com.jsh.model.po.MaterialCategory;
import com.jsh.model.vo.materials.MaterialCategoryModel;
import com.jsh.service.materials.MaterialCategoryIService;
import com.jsh.util.PageUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.dao.DataAccessException;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/*
* 商品类型管理
* @author jishenghua qq:752718920
*/
*/
@SuppressWarnings("serial")
public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
{
public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel> {
private MaterialCategoryIService materialCategoryService;
private MaterialCategoryModel model = new MaterialCategoryModel();
@SuppressWarnings({ "rawtypes", "unchecked" })
public String getBasicData()
{
Map<String,List> mapData = model.getShowModel().getMap();
PageUtil pageUtil = new PageUtil();
@SuppressWarnings({"rawtypes", "unchecked"})
public String getBasicData() {
Map<String, List> mapData = model.getShowModel().getMap();
PageUtil pageUtil = new PageUtil();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
try
{
Map<String,Object> condition = pageUtil.getAdvSearch();
try {
Map<String, Object> condition = pageUtil.getAdvSearch();
condition.put("ParentId_n_eq", model.getParentId());
condition.put("Id_n_neq", 1);
condition.put("Id_s_order", "asc");
materialCategoryService.find(pageUtil);
mapData.put("materialCategoryList", pageUtil.getPageList());
}
catch (Exception e)
{
} catch (Exception e) {
Log.errorFileSync(">>>>>>>>>>>>>查找商品类别信息异常", e);
model.getShowModel().setMsgTip("exceptoin");
}
return SUCCESS;
}
/**
* 增加商品类别
* @return
*/
public void create()
{
Log.infoFileSync("==================开始调用增加商品类别信息方法create()===================");
Boolean flag = false;
try
{
MaterialCategory materialCategory = new MaterialCategory();
materialCategory.setMaterialCategory(new MaterialCategory(model.getParentId()));
materialCategory.setCategoryLevel(model.getCategoryLevel());
materialCategory.setName(model.getName());
materialCategoryService.create(materialCategory);
//========标识位===========
flag = true;
//记录操作日志使用
tipMsg = "成功";
/**
* 增加商品类别
*
* @return
*/
public void create() {
Log.infoFileSync("==================开始调用增加商品类别信息方法create()===================");
Boolean flag = false;
try {
MaterialCategory materialCategory = new MaterialCategory();
materialCategory.setMaterialCategory(new MaterialCategory(model.getParentId()));
materialCategory.setCategoryLevel(model.getCategoryLevel());
materialCategory.setName(model.getName());
materialCategoryService.create(materialCategory);
//========标识位===========
flag = true;
//记录操作日志使用
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加商品类别信息异常", e);
flag = false;
tipMsg = "失败";
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加商品类别信息异常", e);
flag = false;
tipMsg = "失败";
tipType = 1;
}
finally
{
try
{
} finally {
try {
toClient(flag.toString());
}
catch (IOException e)
{
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>增加商品类别信息回写客户端结果异常", e);
}
}
logService.create(new Logdetails(getUser(), "增加商品类别", model.getClientIp(),
}
logService.create(new Logdetails(getUser(), "增加商品类别", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "增加商品类别名称为 "+ model.getName() + " " + tipMsg + "!", "增加商品类别" + tipMsg));
Log.infoFileSync("==================结束调用增加商品类别方法create()===================");
}
/**
* 删除商品类别
* @return
*/
public String delete()
{
Log.infoFileSync("====================开始调用删除商品类别信息方法delete()================");
try
{
materialCategoryService.delete(model.getMaterialCategoryID());
, tipType, "增加商品类别名称为 " + model.getName() + " " + tipMsg + "!", "增加商品类别" + tipMsg));
Log.infoFileSync("==================结束调用增加商品类别方法create()===================");
}
/**
* 删除商品类别
*
* @return
*/
public String delete() {
Log.infoFileSync("====================开始调用删除商品类别信息方法delete()================");
try {
materialCategoryService.delete(model.getMaterialCategoryID());
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getMaterialCategoryID() + " 的商品类别异常", e);
tipMsg = "失败";
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getMaterialCategoryID() + " 的商品类别异常", e);
tipMsg = "失败";
tipType = 1;
}
model.getShowModel().setMsgTip(tipMsg);
logService.create(new Logdetails(getUser(), "删除商品类别", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "删除商品类别ID为 "+ model.getMaterialCategoryID() + " " + tipMsg + "!", "删除商品类别" + tipMsg));
Log.infoFileSync("====================结束调用删除商品类别信息方法delete()================");
return SUCCESS;
}
/**
* 更新商品类别
* @return
*/
public void update()
{
Boolean flag = false;
try
{
MaterialCategory materialCategory = materialCategoryService.get(model.getMaterialCategoryID());
materialCategory.setMaterialCategory(new MaterialCategory(model.getParentId()));
materialCategory.setCategoryLevel(model.getCategoryLevel());
materialCategory.setName(model.getName());
materialCategoryService.update(materialCategory);
model.getShowModel().setMsgTip(tipMsg);
logService.create(new Logdetails(getUser(), "删除商品类别", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "删除商品类别ID为 " + model.getMaterialCategoryID() + " " + tipMsg + "!", "删除商品类别" + tipMsg));
Log.infoFileSync("====================结束调用删除商品类别信息方法delete()================");
return SUCCESS;
}
/**
* 更新商品类别
*
* @return
*/
public void update() {
Boolean flag = false;
try {
MaterialCategory materialCategory = materialCategoryService.get(model.getMaterialCategoryID());
materialCategory.setMaterialCategory(new MaterialCategory(model.getParentId()));
materialCategory.setCategoryLevel(model.getCategoryLevel());
materialCategory.setName(model.getName());
materialCategoryService.update(materialCategory);
flag = true;
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e)
{
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>修改商品类别ID为 : " + model.getMaterialCategoryID() + "信息失败", e);
flag = false;
tipMsg = "失败";
tipType = 1;
}
finally
{
try
{
} finally {
try {
toClient(flag.toString());
}
catch (IOException e)
{
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>修改商品类别回写客户端结果异常", e);
}
}
logService.create(new Logdetails(getUser(), "更新商品类别", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "更新商品类别ID为 "+ model.getMaterialCategoryID() + " " + tipMsg + "!", "更新商品类别" + tipMsg));
}
/**
* 批量删除指定ID商品类别
* @return
*/
public String batchDelete()
{
try
{
materialCategoryService.batchDelete(model.getMaterialCategoryIDs());
, tipType, "更新商品类别ID为 " + model.getMaterialCategoryID() + " " + tipMsg + "!", "更新商品类别" + tipMsg));
}
/**
* 批量删除指定ID商品类别
*
* @return
*/
public String batchDelete() {
try {
materialCategoryService.batchDelete(model.getMaterialCategoryIDs());
model.getShowModel().setMsgTip("成功");
//记录操作日志使用
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>批量删除商品类别ID为:" + model.getMaterialCategoryIDs() + "信息异常", e);
tipMsg = "失败";
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>批量删除商品类别ID为:" + model.getMaterialCategoryIDs() + "信息异常", e);
tipMsg = "失败";
tipType = 1;
}
logService.create(new Logdetails(getUser(), "批量删除商品类别", model.getClientIp(),
logService.create(new Logdetails(getUser(), "批量删除商品类别", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "批量删除商品类别ID为 "+ model.getMaterialCategoryIDs() + " " + tipMsg + "!", "批量删除商品类别" + tipMsg));
return SUCCESS;
}
/**
* 查找商品类别信息
* @return
*/
public void findBy()
{
try
{
PageUtil<MaterialCategory> pageUtil = new PageUtil<MaterialCategory>();
, tipType, "批量删除商品类别ID为 " + model.getMaterialCategoryIDs() + " " + tipMsg + "!", "批量删除商品类别" + tipMsg));
return SUCCESS;
}
/**
* 查找商品类别信息
*
* @return
*/
public void findBy() {
try {
PageUtil<MaterialCategory> pageUtil = new PageUtil<MaterialCategory>();
pageUtil.setPageSize(model.getPageSize());
pageUtil.setCurPage(model.getPageNo());
pageUtil.setAdvSearch(getCondition());
materialCategoryService.find(pageUtil);
List<MaterialCategory> dataList = pageUtil.getPageList();
//开始拼接json数据
// {"total":28,"rows":[
// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
......@@ -218,10 +192,8 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
outer.put("total", pageUtil.getTotalCount());
//存放数据json数组
JSONArray dataArray = new JSONArray();
if(null != dataList)
{
for(MaterialCategory materialCategory:dataList)
{
if (null != dataList) {
for (MaterialCategory materialCategory : dataList) {
JSONObject item = new JSONObject();
item.put("Id", materialCategory.getId());
item.put("ParentId", materialCategory.getMaterialCategory().getId());
......@@ -235,19 +207,16 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
outer.put("rows", dataArray);
//回写查询结果
toClient(outer.toString());
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品类别信息异常", e);
}
catch (IOException e)
{
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品类别信息异常", e);
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品类别信息结果异常", e);
}
}
}
/**
* 根据id来查询商品名称
*
* @return
*/
public void findById() {
......@@ -257,35 +226,31 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
materialCategoryService.find(pageUtil);
List<MaterialCategory> dataList = pageUtil.getPageList();
JSONObject outer = new JSONObject();
if(null != dataList) {
for(MaterialCategory materialCategory : dataList) {
if (null != dataList) {
for (MaterialCategory materialCategory : dataList) {
outer.put("name", materialCategory.getName());
outer.put("parentId", materialCategory.getMaterialCategory().getId());
}
}
//回写查询结果
toClient(outer.toString());
}
catch (DataAccessException e)
{
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品类别信息异常", e);
}
catch (IOException e)
{
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品类别信息结果异常", e);
}
}
/**
* 拼接搜索条件
* @return
*/
private Map<String,Object> getCondition()
{
/**
* 拼接搜索条件
*
* @return
*/
private Map<String, Object> getCondition() {
/**
* 拼接搜索条件
*/
Map<String,Object> condition = new HashMap<String,Object>();
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("Name_s_like", model.getName());
condition.put("ParentId_n_eq", model.getParentId());
condition.put("Id_n_neq", 1);
......@@ -295,25 +260,25 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
/**
* 拼接搜索条件
*
* @return
*/
private Map<String,Object> getConditionById(){
private Map<String, Object> getConditionById() {
/**
* 拼接搜索条件
*/
Map<String,Object> condition = new HashMap<String,Object>();
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("Id_n_eq", model.getMaterialCategoryID());
return condition;
}
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override
public MaterialCategoryModel getModel()
{
return model;
}
public void setMaterialCategoryService(MaterialCategoryIService materialCategoryService)
{
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override
public MaterialCategoryModel getModel() {
return model;
}
public void setMaterialCategoryService(MaterialCategoryIService materialCategoryService) {
this.materialCategoryService = materialCategoryService;
}
}
......@@ -20,19 +20,19 @@ import java.util.Map;
/*
* 商品属性
* @author ji s h e n g hua qq:75 27 18 920
*/
*/
@SuppressWarnings("serial")
public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
{
public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel> {
private MaterialPropertyIService materialPropertyService;
private MaterialPropertyModel model = new MaterialPropertyModel();
/**
* 更新商品属性
* @return
*/
public void update() {
Boolean flag = false;
/**
* 更新商品属性
*
* @return
*/
public void update() {
Boolean flag = false;
try {
MaterialProperty materialProperty = materialPropertyService.get(model.getId());
materialProperty.setNativeName(model.getNativeName());
......@@ -40,37 +40,35 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
materialProperty.setSort(model.getSort());
materialProperty.setAnotherName(model.getAnotherName());
materialPropertyService.update(materialProperty);
flag = true;
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e) {
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>修改商品属性ID为 : " + model.getId() + "失败", e);
flag = false;
tipMsg = "失败";
tipType = 1;
}
finally {
} finally {
try {
toClient(flag.toString());
}
catch (IOException e) {
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>修改商品属性回写客户端结果异常", e);
}
}
logService.create(new Logdetails(getUser(), "更新商品属性", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "更新商品属性ID为 "+ model.getId() + " " + tipMsg + "!", "更新商品属性" + tipMsg));
}
/**
* 查找商品属性
* @return
*/
, tipType, "更新商品属性ID为 " + model.getId() + " " + tipMsg + "!", "更新商品属性" + tipMsg));
}
/**
* 查找商品属性
*
* @return
*/
public void findBy() {
try {
PageUtil<MaterialProperty> pageUtil = new PageUtil<MaterialProperty>();
try {
PageUtil<MaterialProperty> pageUtil = new PageUtil<MaterialProperty>();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
pageUtil.setAdvSearch(getCondition());
......@@ -81,8 +79,8 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
outer.put("total", pageUtil.getTotalCount());
//存放数据json数组
JSONArray dataArray = new JSONArray();
if(null != dataList) {
for(MaterialProperty materialProperty:dataList) {
if (null != dataList) {
for (MaterialProperty materialProperty : dataList) {
JSONObject item = new JSONObject();
item.put("id", materialProperty.getId());
item.put("nativeName", materialProperty.getNativeName());
......@@ -95,38 +93,35 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
outer.put("rows", dataArray);
//回写查询结果
toClient(outer.toString());
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品属性异常", e);
}
catch (IOException e)
{
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品属性异常", e);
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品属性结果异常", e);
}
}
/**
* 拼接搜索条件
* @return
*/
private Map<String,Object> getCondition()
{
}
/**
* 拼接搜索条件
*
* @return
*/
private Map<String, Object> getCondition() {
/**
* 拼接搜索条件
*/
Map<String,Object> condition = new HashMap<String,Object>();
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("nativeName_s_like", model.getNativeName());
condition.put("sort_s_order", "asc");
return condition;
}
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override
public MaterialPropertyModel getModel() {
return model;
}
public void setMaterialPropertyService(MaterialPropertyIService materialPropertyService) {
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override
public MaterialPropertyModel getModel() {
return model;
}
public void setMaterialPropertyService(MaterialPropertyIService materialPropertyService) {
this.materialPropertyService = materialPropertyService;
}
}
package com.jsh.action.materials;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.dao.DataAccessException;
import com.jsh.base.BaseAction;
import com.jsh.base.Log;
import com.jsh.model.po.Depot;
import com.jsh.model.po.Person;
import com.jsh.model.po.Logdetails;
import com.jsh.model.po.Person;
import com.jsh.model.vo.materials.PersonModel;
import com.jsh.service.materials.PersonIService;
import com.jsh.util.PageUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.dao.DataAccessException;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/*
* 经手人管理
* @author jishenghua qq:752718920
*/
*/
@SuppressWarnings("serial")
public class PersonAction extends BaseAction<PersonModel>
{
public class PersonAction extends BaseAction<PersonModel> {
private PersonIService personService;
private PersonModel model = new PersonModel();
@SuppressWarnings({ "rawtypes", "unchecked" })
public String getBasicData()
{
Map<String,List> mapData = model.getShowModel().getMap();
PageUtil pageUtil = new PageUtil();
@SuppressWarnings({"rawtypes", "unchecked"})
public String getBasicData() {
Map<String, List> mapData = model.getShowModel().getMap();
PageUtil pageUtil = new PageUtil();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
try
{
Map<String,Object> condition = pageUtil.getAdvSearch();
try {
Map<String, Object> condition = pageUtil.getAdvSearch();
condition.put("Id_s_order", "asc");
personService.find(pageUtil);
mapData.put("personList", pageUtil.getPageList());
}
catch (Exception e)
{
} catch (Exception e) {
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
model.getShowModel().setMsgTip("exceptoin");
}
return SUCCESS;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
public String getPersonByType()
{
Map<String,List> mapData = model.getShowModel().getMap();
PageUtil pageUtil = new PageUtil();
@SuppressWarnings({"rawtypes", "unchecked"})
public String getPersonByType() {
Map<String, List> mapData = model.getShowModel().getMap();
PageUtil pageUtil = new PageUtil();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
try
{
Map<String,Object> condition = pageUtil.getAdvSearch();
try {
Map<String, Object> condition = pageUtil.getAdvSearch();
condition.put("Type_s_eq", model.getType());
condition.put("Id_s_order", "asc");
personService.find(pageUtil);
mapData.put("personList", pageUtil.getPageList());
}
catch (Exception e)
{
} catch (Exception e) {
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
model.getShowModel().setMsgTip("exceptoin");
}
......@@ -73,31 +65,30 @@ public class PersonAction extends BaseAction<PersonModel>
/**
* 根据类型获取经手人信息 1-业务员,2-仓管员,3-财务员
*
* @return
*/
public void getPersonByNumType() {
try {
PageUtil<Person> pageUtil = new PageUtil<Person>();
PageUtil<Person> pageUtil = new PageUtil<Person>();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
Map<String,Object> condition = pageUtil.getAdvSearch();
Map<String, Object> condition = pageUtil.getAdvSearch();
String type = "";
if(model.getType().equals("1")){
if (model.getType().equals("1")) {
type = "业务员";
}
else if(model.getType().equals("2")){
} else if (model.getType().equals("2")) {
type = "仓管员";
}
else if(model.getType().equals("3")){
} else if (model.getType().equals("3")) {
type = "财务员";
}
condition.put("Type_s_eq",type);
condition.put("Type_s_eq", type);
condition.put("Id_s_order", "asc");
personService.find(pageUtil);
List<Person> dataList = pageUtil.getPageList();
JSONArray dataArray = new JSONArray();
if(null != dataList) {
for(Person person:dataList){
if (null != dataList) {
for (Person person : dataList) {
JSONObject item = new JSONObject();
item.put("id", person.getId());
item.put("name", person.getName());
......@@ -106,212 +97,184 @@ public class PersonAction extends BaseAction<PersonModel>
}
//回写查询结果
toClient(dataArray.toString());
}
catch (DataAccessException e) {
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
}
catch (IOException e) {
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>回写查询信息结果异常", e);
}
}
/**
* 根据Id获取经手人信息
*
* @return
*/
public void getPersonByIds() {
try {
PageUtil<Person> pageUtil = new PageUtil<Person>();
PageUtil<Person> pageUtil = new PageUtil<Person>();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
Map<String,Object> condition = pageUtil.getAdvSearch();
Map<String, Object> condition = pageUtil.getAdvSearch();
condition.put("Id_s_in", model.getPersonIDs());
condition.put("Id_s_order", "asc");
personService.find(pageUtil);
List<Person> dataList = pageUtil.getPageList();
StringBuffer sb = new StringBuffer();
if(null != dataList) {
for(Person person:dataList){
if (null != dataList) {
for (Person person : dataList) {
sb.append(person.getName() + " ");
}
}
//回写查询结果
toClient(sb.toString());
}
catch (DataAccessException e) {
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
}
catch (IOException e) {
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>回写查询信息结果异常", e);
}
}
/**
* 增加经手人
* @return
*/
public void create()
{
Log.infoFileSync("==================开始调用增加经手人信息方法create()===================");
Boolean flag = false;
try
{
Person person = new Person();
person.setType(model.getType());
person.setName(model.getName());
personService.create(person);
//========标识位===========
flag = true;
//记录操作日志使用
tipMsg = "成功";
/**
* 增加经手人
*
* @return
*/
public void create() {
Log.infoFileSync("==================开始调用增加经手人信息方法create()===================");
Boolean flag = false;
try {
Person person = new Person();
person.setType(model.getType());
person.setName(model.getName());
personService.create(person);
//========标识位===========
flag = true;
//记录操作日志使用
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加经手人信息异常", e);
flag = false;
tipMsg = "失败";
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加经手人信息异常", e);
flag = false;
tipMsg = "失败";
tipType = 1;
}
finally
{
try
{
} finally {
try {
toClient(flag.toString());
}
catch (IOException e)
{
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>增加经手人信息回写客户端结果异常", e);
}
}
logService.create(new Logdetails(getUser(), "增加经手人", model.getClientIp(),
}
logService.create(new Logdetails(getUser(), "增加经手人", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "增加经手人名称为 "+ model.getName() + " " + tipMsg + "!", "增加经手人" + tipMsg));
Log.infoFileSync("==================结束调用增加经手人方法create()===================");
}
/**
* 删除经手人
* @return
*/
public String delete()
{
Log.infoFileSync("====================开始调用删除经手人信息方法delete()================");
try
{
personService.delete(model.getPersonID());
, tipType, "增加经手人名称为 " + model.getName() + " " + tipMsg + "!", "增加经手人" + tipMsg));
Log.infoFileSync("==================结束调用增加经手人方法create()===================");
}
/**
* 删除经手人
*
* @return
*/
public String delete() {
Log.infoFileSync("====================开始调用删除经手人信息方法delete()================");
try {
personService.delete(model.getPersonID());
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getPersonID() + " 的经手人异常", e);
tipMsg = "失败";
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getPersonID() + " 的经手人异常", e);
tipMsg = "失败";
tipType = 1;
}
model.getShowModel().setMsgTip(tipMsg);
logService.create(new Logdetails(getUser(), "删除经手人", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "删除经手人ID为 "+ model.getPersonID() + " " + tipMsg + "!", "删除经手人" + tipMsg));
Log.infoFileSync("====================结束调用删除经手人信息方法delete()================");
return SUCCESS;
}
/**
* 更新经手人
* @return
*/
public void update()
{
Boolean flag = false;
try
{
Person person = personService.get(model.getPersonID());
person.setType(model.getType());
person.setName(model.getName());
personService.update(person);
model.getShowModel().setMsgTip(tipMsg);
logService.create(new Logdetails(getUser(), "删除经手人", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "删除经手人ID为 " + model.getPersonID() + " " + tipMsg + "!", "删除经手人" + tipMsg));
Log.infoFileSync("====================结束调用删除经手人信息方法delete()================");
return SUCCESS;
}
/**
* 更新经手人
*
* @return
*/
public void update() {
Boolean flag = false;
try {
Person person = personService.get(model.getPersonID());
person.setType(model.getType());
person.setName(model.getName());
personService.update(person);
flag = true;
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e)
{
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>修改经手人ID为 : " + model.getPersonID() + "信息失败", e);
flag = false;
tipMsg = "失败";
tipType = 1;
}
finally
{
try
{
} finally {
try {
toClient(flag.toString());
}
catch (IOException e)
{
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>修改经手人回写客户端结果异常", e);
}
}
logService.create(new Logdetails(getUser(), "更新经手人", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "更新经手人ID为 "+ model.getPersonID() + " " + tipMsg + "!", "更新经手人" + tipMsg));
}
/**
* 批量删除指定ID经手人
* @return
*/
public String batchDelete()
{
try
{
personService.batchDelete(model.getPersonIDs());
, tipType, "更新经手人ID为 " + model.getPersonID() + " " + tipMsg + "!", "更新经手人" + tipMsg));
}
/**
* 批量删除指定ID经手人
*
* @return
*/
public String batchDelete() {
try {
personService.batchDelete(model.getPersonIDs());
model.getShowModel().setMsgTip("成功");
//记录操作日志使用
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>批量删除经手人ID为:" + model.getPersonIDs() + "信息异常", e);
tipMsg = "失败";
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>批量删除经手人ID为:" + model.getPersonIDs() + "信息异常", e);
tipMsg = "失败";
tipType = 1;
}
logService.create(new Logdetails(getUser(), "批量删除经手人", model.getClientIp(),
logService.create(new Logdetails(getUser(), "批量删除经手人", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "批量删除经手人ID为 "+ model.getPersonIDs() + " " + tipMsg + "!", "批量删除经手人" + tipMsg));
return SUCCESS;
}
/**
* 查找经手人信息
* @return
*/
public void findBy()
{
try
{
PageUtil<Person> pageUtil = new PageUtil<Person>();
, tipType, "批量删除经手人ID为 " + model.getPersonIDs() + " " + tipMsg + "!", "批量删除经手人" + tipMsg));
return SUCCESS;
}
/**
* 查找经手人信息
*
* @return
*/
public void findBy() {
try {
PageUtil<Person> pageUtil = new PageUtil<Person>();
pageUtil.setPageSize(model.getPageSize());
pageUtil.setCurPage(model.getPageNo());
pageUtil.setAdvSearch(getCondition());
personService.find(pageUtil);
List<Person> dataList = pageUtil.getPageList();
JSONObject outer = new JSONObject();
outer.put("total", pageUtil.getTotalCount());
//存放数据json数组
JSONArray dataArray = new JSONArray();
if(null != dataList)
{
for(Person person:dataList)
{
if (null != dataList) {
for (Person person : dataList) {
JSONObject item = new JSONObject();
item.put("Id", person.getId());
item.put("Type", person.getType());
......@@ -323,40 +286,35 @@ public class PersonAction extends BaseAction<PersonModel>
outer.put("rows", dataArray);
//回写查询结果
toClient(outer.toString());
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找经手人信息异常", e);
}
catch (IOException e)
{
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找经手人信息异常", e);
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询经手人信息结果异常", e);
}
}
/**
* 拼接搜索条件
* @return
*/
private Map<String,Object> getCondition()
{
}
/**
* 拼接搜索条件
*
* @return
*/
private Map<String, Object> getCondition() {
/**
* 拼接搜索条件
*/
Map<String,Object> condition = new HashMap<String,Object>();
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("Name_s_like", model.getName());
condition.put("Type_s_eq", model.getType());
return condition;
}
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override
public PersonModel getModel()
{
return model;
}
public void setPersonService(PersonIService personService)
{
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override
public PersonModel getModel() {
return model;
}
public void setPersonService(PersonIService personService) {
this.personService = personService;
}
}
package com.jsh.base;
import java.io.IOException;
import java.util.Map;
import com.jsh.model.po.Basicuser;
import com.jsh.service.basic.LogIService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import org.apache.struts2.ServletActionContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.jsh.model.po.Basicuser;
import com.jsh.service.basic.LogIService;
/**
* struts2工具类
*
* @author jishenghua qq752718920
* struts2 base action 一些常用方法获取
*/
@SuppressWarnings("serial")
public abstract class BaseAction<T> extends ActionSupport implements ModelDriven<T>
{
public LogIService logService;
/**
* 操作日志使用 是否成功表示
*/
public abstract class BaseAction<T> extends ActionSupport implements ModelDriven<T> {
public LogIService logService;
/**
* 操作日志使用 是否成功表示
*/
public String tipMsg = "成功";
/**
* 操作日志使用 是否成功表示 0 ==成功 1==失败
*/
public short tipType = 0;
public void setLogService(LogIService logService)
{
this.logService = logService;
}
/**
* 获取session
* @return
*/
public static Map<String,Object> getSession()
{
return ActionContext.getContext().getSession();
}
/**
* 获取request
* @return
*/
public static HttpServletRequest getRequest()
{
return ServletActionContext.getRequest();
}
/**
* 获取response
* @return response
*/
public static HttpServletResponse getResponse()
{
return ServletActionContext.getResponse();
}
/**
/**
* 获取session
*
* @return
*/
public static Map<String, Object> getSession() {
return ActionContext.getContext().getSession();
}
/**
* 获取request
*
* @return
*/
public static HttpServletRequest getRequest() {
return ServletActionContext.getRequest();
}
/**
* 获取response
*
* @return response
*/
public static HttpServletResponse getResponse() {
return ServletActionContext.getResponse();
}
public void setLogService(LogIService logService) {
this.logService = logService;
}
/**
* 添加错误信息
*
* @param anErrorMessage
*/
public void addActionError(String anErrorMessage)
{
public void addActionError(String anErrorMessage) {
super.addActionError(anErrorMessage);
}
/**
* 添加消息
*
* @param aMessage
*/
public void addActionMessage(String aMessage)
{
public void addActionMessage(String aMessage) {
clearErrorsAndMessages();
super.addActionMessage(aMessage);
}
/**
* 添加字段错误
*
* @param fieldName
* @param errorMessage
*/
public void addFieldError(String fieldName, String errorMessage)
{
public void addFieldError(String fieldName, String errorMessage) {
clearErrorsAndMessages();
super.addFieldError(fieldName, errorMessage);
}
/**
* 登录用户信息
* 登录用户信息
*
* @return 登录用户对象
*/
public Basicuser getUser()
{
return (Basicuser)getSession().get("user");
public Basicuser getUser() {
return (Basicuser) getSession().get("user");
}
/**
* 回写客户端数据
* @throws IOException
*
* @throws IOException
*/
public void toClient(String jsonData) throws IOException
{
public void toClient(String jsonData) throws IOException {
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("text/html;charset=utf-8");
response.getWriter().print(jsonData);
......
package com.jsh.base;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import com.jsh.util.PageUtil;
import com.jsh.util.SearchConditionUtil;
import org.hibernate.Query;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.jsh.util.PageUtil;
import com.jsh.util.SearchConditionUtil;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* 基础dao
*
* @author ji_sheng_hua qq:752718920
*/
public class BaseDAO<T> extends HibernateDaoSupport implements BaseIDAO<T>
{
protected Class<T> entityClass;
public void setPoJoClass(Class<T> c)
{
this.entityClass = c;
}
protected Class<T> getEntityClass()
{
return this.entityClass;
}
@Override
public Serializable create(T t) throws DataAccessException
{
return this.getHibernateTemplate().save(t);
}
@Override
public void delete(T t) throws DataAccessException
{
this.getHibernateTemplate().delete(t);
}
@Override
public T get(Long objID) throws DataAccessException
{
return (T) this.getHibernateTemplate().get(getEntityClass(), objID);
}
@Override
public void update(T t) throws DataAccessException
{
this.getHibernateTemplate().update(t);
}
@Override
public void batchDelete(String objIDs) throws DataAccessException
{
this.getHibernateTemplate().bulkUpdate("delete from " + getEntityClass().getName() + " where id in ("+ objIDs + ")");
}
@SuppressWarnings("unchecked")
@Override
public void find(PageUtil<T> pageUtil) throws DataAccessException
{
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+
SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size());
// 分页查询
int pageNo = pageUtil.getCurPage();
int pageSize = pageUtil.getPageSize();
if (0 != pageNo && 0 != pageSize)
{
query.setFirstResult((pageNo - 1) * pageSize);
query.setMaxResults(pageSize);
}
pageUtil.setPageList(query.list());
}
public class BaseDAO<T> extends HibernateDaoSupport implements BaseIDAO<T> {
protected Class<T> entityClass;
public void setPoJoClass(Class<T> c) {
this.entityClass = c;
}
protected Class<T> getEntityClass() {
return this.entityClass;
}
@Override
public Serializable create(T t) throws DataAccessException {
return this.getHibernateTemplate().save(t);
}
@Override
public void delete(T t) throws DataAccessException {
this.getHibernateTemplate().delete(t);
}
@Override
public T get(Long objID) throws DataAccessException {
return (T) this.getHibernateTemplate().get(getEntityClass(), objID);
}
@Override
public void update(T t) throws DataAccessException {
this.getHibernateTemplate().update(t);
}
@Override
public void batchDelete(String objIDs) throws DataAccessException {
this.getHibernateTemplate().bulkUpdate("delete from " + getEntityClass().getName() + " where id in (" + objIDs + ")");
}
@SuppressWarnings("unchecked")
@Override
public void find(PageUtil<T> pageUtil) throws DataAccessException {
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " +
SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size());
// 分页查询
int pageNo = pageUtil.getCurPage();
int pageSize = pageUtil.getPageSize();
if (0 != pageNo && 0 != pageSize) {
query.setFirstResult((pageNo - 1) * pageSize);
query.setMaxResults(pageSize);
}
pageUtil.setPageList(query.list());
}
// @SuppressWarnings("unchecked")
// @Override
......@@ -92,49 +83,44 @@ public class BaseDAO<T> extends HibernateDaoSupport implements BaseIDAO<T>
// return this.getHibernateTemplate().find(" from " + getEntityClass().getName() + " where 1=1 "+ hql);
// }
@SuppressWarnings("unchecked")
@Override
public List<T> find(Map<String, Object> conditon, int pageSize, int pageNo)throws DataAccessException
{
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+ SearchConditionUtil.getCondition(conditon));
query.setFirstResult((pageNo - 1) * pageSize);
query.setMaxResults(pageSize);
return query.list();
}
@SuppressWarnings("unchecked")
@Override
public List<T> find(String hql, int pageSize, int pageNo)throws DataAccessException
{
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+ hql);
query.setFirstResult((pageNo - 1) * pageSize);
query.setMaxResults(pageSize);
return query.list();
}
@SuppressWarnings("unchecked")
@Override
public Integer countSum(Map<String, Object> conditon)throws DataAccessException
{
List<T> dataList = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+ SearchConditionUtil.getCondition(conditon)).list();
return dataList ==null?0:dataList.size();
}
@SuppressWarnings("unchecked")
@Override
public Integer countSum(String hql) throws DataAccessException
{
List<T> dataList = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+ hql).list();
return dataList ==null?0:dataList.size();
}
@SuppressWarnings("unchecked")
@Override
public List<T> find(Map<String, Object> conditon, int pageSize, int pageNo) throws DataAccessException {
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " + SearchConditionUtil.getCondition(conditon));
query.setFirstResult((pageNo - 1) * pageSize);
query.setMaxResults(pageSize);
return query.list();
}
@SuppressWarnings("unchecked")
@Override
public List<T> find(String hql, int pageSize, int pageNo) throws DataAccessException {
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " + hql);
query.setFirstResult((pageNo - 1) * pageSize);
query.setMaxResults(pageSize);
return query.list();
}
@SuppressWarnings("unchecked")
@Override
public Integer countSum(Map<String, Object> conditon) throws DataAccessException {
List<T> dataList = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " + SearchConditionUtil.getCondition(conditon)).list();
return dataList == null ? 0 : dataList.size();
}
@SuppressWarnings("unchecked")
@Override
public Integer countSum(String hql) throws DataAccessException {
List<T> dataList = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " + hql).list();
return dataList == null ? 0 : dataList.size();
}
@Override
public void save(T t) throws DataAccessException
{
public void save(T t) throws DataAccessException {
this.getHibernateTemplate().save(t);
}
}
package com.jsh.base;
import com.jsh.util.PageUtil;
import org.springframework.dao.DataAccessException;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import org.springframework.dao.DataAccessException;
import com.jsh.util.PageUtil;
/**
* 常用增删改查操作
* @author ji-sheng-hua qq752718920
*
* @param <T>
* @author ji-sheng-hua qq752718920
*/
public interface BaseIDAO<T>
{
/**
* 设置操作类对象
* @param paramClass
*/
void setPoJoClass(Class<T> paramClass);
/**
* 增加
* @param t 对象
* @throws DataAccessException
*/
Serializable create(T t)throws DataAccessException;
/**
public interface BaseIDAO<T> {
/**
* 设置操作类对象
*
* @param paramClass
*/
void setPoJoClass(Class<T> paramClass);
/**
* 增加
*
* @param t 对象
* @throws DataAccessException
*/
void save(T t)throws DataAccessException;
/**
* 删除
* @param t 对象
* @throws DataAccessException
*/
void delete(T t)throws DataAccessException;
/**
* 获取
* @param objID ID
* @return 对象
* @throws DataAccessException
*/
T get(Long objID)throws DataAccessException;
/**
* 修改信息
* @param t 要修改的对象
* @throws DataAccessException
*/
void update(T t)throws DataAccessException;
/**
* 批量删除信息
* @param 以逗号分割的ID
* @throws DataAccessException
*/
void batchDelete(String objIDs)throws DataAccessException;
/**
* 查找列表
* @param pageUtil 分页工具类
* @throws DataAccessException
*/
void find(PageUtil<T> pageUtil)throws DataAccessException;
/**
* 根据条件查询列表--没有分页信息
* @param conditon 查询条件
* @return 查询列表数据
*/
Serializable create(T t) throws DataAccessException;
/**
* 增加
*
* @param t 对象
* @throws DataAccessException
*/
void save(T t) throws DataAccessException;
/**
* 删除
*
* @param t 对象
* @throws DataAccessException
*/
void delete(T t) throws DataAccessException;
/**
* 获取
*
* @param objID ID
* @return 对象
* @throws DataAccessException
*/
T get(Long objID) throws DataAccessException;
/**
* 修改信息
*
* @param t 要修改的对象
* @throws DataAccessException
*/
void update(T t) throws DataAccessException;
/**
* 批量删除信息
*
* @param 以逗号分割的ID
* @throws DataAccessException
*/
void batchDelete(String objIDs) throws DataAccessException;
/**
* 查找列表
*
* @param pageUtil 分页工具类
* @throws DataAccessException
*/
void find(PageUtil<T> pageUtil) throws DataAccessException;
/**
* 根据条件查询列表--没有分页信息
* @param conditon 查询条件
* @return 查询列表数据
*/
// List<T> find(Map<String,Object> conditon)throws DataAccessException;
/**
* 根据hql查询 --没有分页信息
* @param hql hibernate查询
* @return 查询列表数据
*/
/**
* 根据hql查询 --没有分页信息
* @param hql hibernate查询
* @return 查询列表数据
*/
// List<T> find(String hql)throws DataAccessException;
/**
* 根据搜索条件查询--分页
* @param conditon 查询条件
* @param pageSize 每页个数
* @param pageNo 页码
* @return 查询列表数据
* @throws DataAccessException
*/
List<T> find(Map<String,Object> conditon,int pageSize,int pageNo)throws DataAccessException;
/**
* 根据hql查询--分页
* @param hql hibernate查询语句
* @param pageSize 每页个数
* @param pageNo 页码
* @return 查询列表数据
* @throws DataAccessException
*/
List<T> find(String hql,int pageSize,int pageNo)throws DataAccessException;
/**
* 查找符合条件的总数
* @param conditon
* @return
* @throws DataAccessException
*/
Integer countSum(Map<String,Object> conditon)throws DataAccessException;
/**
* 查找符合条件的总数
* @param hql
* @return
* @throws DataAccessException
*/
Integer countSum(String hql)throws DataAccessException;
/**
* 根据搜索条件查询--分页
*
* @param conditon 查询条件
* @param pageSize 每页个数
* @param pageNo 页码
* @return 查询列表数据
* @throws DataAccessException
*/
List<T> find(Map<String, Object> conditon, int pageSize, int pageNo) throws DataAccessException;
/**
* 根据hql查询--分页
*
* @param hql hibernate查询语句
* @param pageSize 每页个数
* @param pageNo 页码
* @return 查询列表数据
* @throws DataAccessException
*/
List<T> find(String hql, int pageSize, int pageNo) throws DataAccessException;
/**
* 查找符合条件的总数
*
* @param conditon
* @return
* @throws DataAccessException
*/
Integer countSum(Map<String, Object> conditon) throws DataAccessException;
/**
* 查找符合条件的总数
*
* @param hql
* @return
* @throws DataAccessException
*/
Integer countSum(String hql) throws DataAccessException;
}
package com.jsh.base;
import java.io.Serializable;
import com.jsh.util.PageUtil;
import org.springframework.dao.DataAccessException;
import com.jsh.util.PageUtil;
import java.io.Serializable;
/**
* 服务层底层接口
* @author ji-sheng-hua qq752718920
*
* @param <T>
* @author ji-sheng-hua qq752718920
*/
public interface BaseIService<T>
{
/**
* 增加
* @param t 对象
* @throws DataAccessException
*/
Serializable create(T t)throws DataAccessException;
/**
public interface BaseIService<T> {
/**
* 增加
*
* @param t 对象
* @throws DataAccessException
*/
Serializable create(T t) throws DataAccessException;
/**
* 增加
*
* @param t 对象
* @throws DataAccessException
*/
void save(T t) throws DataAccessException;
/**
* 删除
*
* @param t 对象
* @throws DataAccessException
*/
void save(T t)throws DataAccessException;
/**
* 删除
* @param t 对象
* @throws DataAccessException
*/
void delete(T t)throws DataAccessException;
/**
* 删除
* @param id 对象ID
* @throws DataAccessException
*/
void delete(Long id)throws DataAccessException;
/**
* 获取
* @param objID ID
* @return 对象
* @throws DataAccessException
*/
T get(Long objID)throws DataAccessException;
/**
* 修改信息
* @param t 要修改的对象
* @throws DataAccessException
*/
void update(T t)throws DataAccessException;
/**
* 批量删除信息
* @param 以逗号分割的ID
* @throws DataAccessException
*/
void batchDelete(String objIDs)throws DataAccessException;
/**
* 查找列表
* @param pageUtil 分页工具类
* @throws DataAccessException
*/
void find(PageUtil<T> pageUtil) throws DataAccessException;
/**
* 检查名称是否存在,页面唯一性效验使用
* @param filedName 效验的字段名称
* @param filedVale 校验值
* @param idFiled ID字段名称
* @param objectID 修改时对象ID
* @return true==存在 false==不存在
* @throws DataAccessException
*/
Boolean checkIsNameExist(String filedName,String filedVale,String idFiled,Long objectID) throws DataAccessException;
/**
* 检查UserBusiness是否存在,页面唯一性效验使用
* @param TypeName 类型名称
* @param TypeVale 类型值
* @param KeyIdName 关键id
* @param KeyIdValue 关键值
* @param UBName 关系名称
* @param UBValue 关系值
* @return true==存在 false==不存在
* @throws DataAccessException
*/
Boolean checkIsUserBusinessExist(String TypeName,String TypeVale,String KeyIdName,String KeyIdValue,String UBName,String UBValue) throws DataAccessException;
/**
* 检查UserBusiness是否存在,页面唯一性效验使用
* @param TypeName 类型名称
* @param TypeVale 类型
* @param KeyIdName 关键id
* @param KeyIdValue 关键
* @return true==存在 false==不存在
* @throws DataAccessException
*/
Boolean checkIsValueExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue) throws DataAccessException;
void delete(T t) throws DataAccessException;
/**
* 删除
*
* @param id 对象ID
* @throws DataAccessException
*/
void delete(Long id) throws DataAccessException;
/**
* 获取
*
* @param objID ID
* @return 对象
* @throws DataAccessException
*/
T get(Long objID) throws DataAccessException;
/**
* 修改信息
*
* @param t 要修改的对象
* @throws DataAccessException
*/
void update(T t) throws DataAccessException;
/**
* 批量删除信息
*
* @param 以逗号分割的ID
* @throws DataAccessException
*/
void batchDelete(String objIDs) throws DataAccessException;
/**
* 查找列表
*
* @param pageUtil 分页工具类
* @throws DataAccessException
*/
void find(PageUtil<T> pageUtil) throws DataAccessException;
/**
* 检查名称是否存在,页面唯一性效验使用
*
* @param filedName 效验的字段名称
* @param filedVale 校验值
* @param idFiled ID字段名称
* @param objectID 修改时对象ID
* @return true==存在 false==不存在
* @throws DataAccessException
*/
Boolean checkIsNameExist(String filedName, String filedVale, String idFiled, Long objectID) throws DataAccessException;
/**
* 检查UserBusiness是否存在,页面唯一性效验使用
*
* @param TypeName 类型名称
* @param TypeVale 类型值
* @param KeyIdName 关键id
* @param KeyIdValue 关键值
* @param UBName 关系名称
* @param UBValue 关系值
* @return true==存在 false==不存在
* @throws DataAccessException
*/
Boolean checkIsUserBusinessExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue, String UBName, String UBValue) throws DataAccessException;
/**
* 检查UserBusiness是否存在,页面唯一性效验使用
*
* @param TypeName 类型名称
* @param TypeVale 类型值
* @param KeyIdName 关键id
* @param KeyIdValue 关键值
* @return true==存在 false==不存在
* @throws DataAccessException
*/
Boolean checkIsValueExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue) throws DataAccessException;
}
package com.jsh.base;
import com.jsh.util.PageUtil;
import org.springframework.dao.DataAccessException;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.dao.DataAccessException;
import com.jsh.util.JshException;
import com.jsh.model.po.Basicuser;
import com.jsh.util.PageUtil;
/**
* 底层服务层
* @author ji-sheng-hua qq752718920
*
* @param <T>
* @author ji-sheng-hua qq752718920
*/
public abstract class BaseService<T> implements BaseIService<T>
{
/**
* Dao对象
*/
private BaseIDAO<T> baseDao;
protected Class<T> entityClass;
public void setBaseDao(BaseIDAO<T> baseDao)
{
this.baseDao = baseDao;
setPoJoClass(getEntityClass());
}
protected BaseIDAO<T> getBaseDao()
{
return this.baseDao;
}
private void setPoJoClass(Class<T> c)
{
this.baseDao.setPoJoClass(c);
}
protected abstract Class<T> getEntityClass();
@Override
public Serializable create(T t) throws DataAccessException
{
return baseDao.create(t);
}
@Override
public void save(T t) throws DataAccessException
{
public abstract class BaseService<T> implements BaseIService<T> {
protected Class<T> entityClass;
/**
* Dao对象
*/
private BaseIDAO<T> baseDao;
protected BaseIDAO<T> getBaseDao() {
return this.baseDao;
}
public void setBaseDao(BaseIDAO<T> baseDao) {
this.baseDao = baseDao;
setPoJoClass(getEntityClass());
}
private void setPoJoClass(Class<T> c) {
this.baseDao.setPoJoClass(c);
}
protected abstract Class<T> getEntityClass();
@Override
public Serializable create(T t) throws DataAccessException {
return baseDao.create(t);
}
@Override
public void save(T t) throws DataAccessException {
baseDao.save(t);
}
@Override
public void delete(T t) throws DataAccessException
{
baseDao.delete(t);
}
@Override
public void delete(Long id) throws DataAccessException
{
baseDao.batchDelete(id.toString());
}
@Override
public T get(Long objID) throws DataAccessException
{
return baseDao.get(objID);
}
@Override
public void update(T t) throws DataAccessException
{
baseDao.update(t);
}
@Override
public void batchDelete(String objIDs) throws DataAccessException
{
baseDao.batchDelete(objIDs);
}
@Override
public void find(PageUtil<T> pageUtil) throws DataAccessException
{
baseDao.find(pageUtil);
}
@Override
public Boolean checkIsNameExist(String filedName, String filedVale,String idFiled,Long objectID) throws DataAccessException
{
PageUtil<T> pageUtil = new PageUtil<T>();
Map<String,Object> condition = new HashMap<String,Object>();
@Override
public void delete(T t) throws DataAccessException {
baseDao.delete(t);
}
@Override
public void delete(Long id) throws DataAccessException {
baseDao.batchDelete(id.toString());
}
@Override
public T get(Long objID) throws DataAccessException {
return baseDao.get(objID);
}
@Override
public void update(T t) throws DataAccessException {
baseDao.update(t);
}
@Override
public void batchDelete(String objIDs) throws DataAccessException {
baseDao.batchDelete(objIDs);
}
@Override
public void find(PageUtil<T> pageUtil) throws DataAccessException {
baseDao.find(pageUtil);
}
@Override
public Boolean checkIsNameExist(String filedName, String filedVale, String idFiled, Long objectID) throws DataAccessException {
PageUtil<T> pageUtil = new PageUtil<T>();
Map<String, Object> condition = new HashMap<String, Object>();
condition.put(filedName + "_s_eq", filedVale);
condition.put(idFiled + "_n_neq", objectID);
pageUtil.setAdvSearch(condition);
baseDao.find(pageUtil);
List<T> dataList = pageUtil.getPageList();
if(null != dataList && dataList.size() > 0)
if (null != dataList && dataList.size() > 0)
return true;
return false;
}
@Override
public Boolean checkIsUserBusinessExist(String TypeName,String TypeVale,String KeyIdName,String KeyIdValue,String UBName,String UBValue) throws DataAccessException
{
PageUtil<T> pageUtil = new PageUtil<T>();
Map<String,Object> condition = new HashMap<String,Object>();
}
@Override
public Boolean checkIsUserBusinessExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue, String UBName, String UBValue) throws DataAccessException {
PageUtil<T> pageUtil = new PageUtil<T>();
Map<String, Object> condition = new HashMap<String, Object>();
condition.put(TypeName + "_s_eq", TypeVale);
condition.put(KeyIdName + "_s_eq", KeyIdValue);
condition.put(UBName + "_s_like", UBValue);
pageUtil.setAdvSearch(condition);
baseDao.find(pageUtil);
List<T> dataList = pageUtil.getPageList();
if(null != dataList && dataList.size() > 0)
if (null != dataList && dataList.size() > 0)
return true;
return false;
}
@Override
public Boolean checkIsValueExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue) throws DataAccessException
{
PageUtil<T> pageUtil = new PageUtil<T>();
Map<String,Object> condition = new HashMap<String,Object>();
}
@Override
public Boolean checkIsValueExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue) throws DataAccessException {
PageUtil<T> pageUtil = new PageUtil<T>();
Map<String, Object> condition = new HashMap<String, Object>();
condition.put(TypeName + "_s_eq", TypeVale);
condition.put(KeyIdName + "_s_eq", KeyIdValue);
pageUtil.setAdvSearch(condition);
baseDao.find(pageUtil);
List<T> dataList = pageUtil.getPageList();
if(null != dataList && dataList.size() > 0)
if (null != dataList && dataList.size() > 0)
return true;
return false;
}
}
}
......@@ -4,171 +4,162 @@ import org.apache.log4j.Logger;
/**
* 封装log4j日志信息,打印日志信息类
*
* @author ji/sheng/hua qq_7527.18920
* @since 2014-01-22
*/
public class Log
{
/**
* 根据异常信息获取调用类的信息
*/
private static final Exception ex = new Exception();
/**
* 获取Log4j实例
*/
private static final Logger log = Logger.getLogger("jsh");
/**
* Info级别日志前缀
*/
public static final String LOG_INFO_PREFIX = "==========";
/**
* error级别日志前缀
*/
public static final String LOG_ERROR_PREFIX = ">>>>>>>>>>";
/**
* debug级别日志前缀
*/
public static final String LOG_DEBUG_PREFIX = "-----------";
/**
* fatal级别日志前缀
*/
public static final String LOG_FATAL_PREFIX = "$$$$$$$$$$";
/**
* warn级别日志前缀
*/
public static final String LOG_WARN_PREFIX = "##########";
/**
* 打印deug日期信息
* @param msg 日志信息
*/
public static void debugFileSync(Object msg)
{
log.debug(getLogDetail(msg));
}
public class Log {
/**
* Info级别日志前缀
*/
public static final String LOG_INFO_PREFIX = "==========";
/**
* error级别日志前缀
*/
public static final String LOG_ERROR_PREFIX = ">>>>>>>>>>";
/**
* debug级别日志前缀
*/
public static final String LOG_DEBUG_PREFIX = "-----------";
/**
* fatal级别日志前缀
*/
public static final String LOG_FATAL_PREFIX = "$$$$$$$$$$";
/**
* warn级别日志前缀
*/
public static final String LOG_WARN_PREFIX = "##########";
/**
* 根据异常信息获取调用类的信息
*/
private static final Exception ex = new Exception();
/**
* 获取Log4j实例
*/
private static final Logger log = Logger.getLogger("jsh");
/**
* 打印debug异常信息
* @param msg 日志信息
* @param e 异常堆栈
*/
public static void debugFileSync(Object msg, Throwable e)
{
log.debug(getLogDetail(msg), e);
}
/**
* 打印deug日期信息
*
* @param msg 日志信息
*/
public static void debugFileSync(Object msg) {
log.debug(getLogDetail(msg));
}
/**
* 打印info日志信息
* @param msg 日志信息
*/
public static void infoFileSync(Object msg)
{
log.info(getLogDetail(msg));
}
/**
* 打印debug异常信息
*
* @param msg 日志信息
* @param e 异常堆栈
*/
public static void debugFileSync(Object msg, Throwable e) {
log.debug(getLogDetail(msg), e);
}
/**
* 打印 info日志带异常信息
* @param msg 日志信息
* @param e 异常堆栈
*/
public static void infoFileSync(Object msg, Throwable e)
{
log.info(getLogDetail(msg), e);
}
/**
* 打印info日志信息
*
* @param msg 日志信息
*/
public static void infoFileSync(Object msg) {
log.info(getLogDetail(msg));
}
/**
* 打印warn日期信息
* @param msg 日志信息
*/
public static void warnFileSync(Object msg)
{
log.warn(getLogDetail(msg));
}
/**
* 打印 info日志带异常信息
*
* @param msg 日志信息
* @param e 异常堆栈
*/
public static void infoFileSync(Object msg, Throwable e) {
log.info(getLogDetail(msg), e);
}
/**
* 打印warn日志信息带异常
* @param msg日志信息
* @param e 异常堆栈
*/
public static void warnFileSync(Object msg, Throwable e)
{
log.warn(getLogDetail(msg), e);
}
/**
* 打印warn日期信息
*
* @param msg 日志信息
*/
public static void warnFileSync(Object msg) {
log.warn(getLogDetail(msg));
}
/**
* 打印error日志信息
* @param msg 日志信息
*/
public static void errorFileSync(Object msg)
{
log.error(getLogDetail(msg));
}
/**
* 打印warn日志信息带异常
*
* @param msg日志信息
* @param e 异常堆栈
*/
public static void warnFileSync(Object msg, Throwable e) {
log.warn(getLogDetail(msg), e);
}
/**
* 打印error日志信息带异常
* @param msg 日志信息
* @param e 异常堆栈
*/
public static void errorFileSync(Object msg, Throwable e)
{
log.error(getLogDetail(msg), e);
}
/**
* 打印error日志信息
*
* @param msg 日志信息
*/
public static void errorFileSync(Object msg) {
log.error(getLogDetail(msg));
}
/**
* 打印fatal日志信息
* @param msg 日志信息
*/
public static void fatalFileSync(Object msg)
{
log.fatal(getLogDetail(msg));
}
/**
* 打印error日志信息带异常
*
* @param msg 日志信息
* @param e 异常堆栈
*/
public static void errorFileSync(Object msg, Throwable e) {
log.error(getLogDetail(msg), e);
}
/**
* 打印fatal日志信息带异常
* @param msg 日志信息
* @param e 异常堆栈
*/
public static void fatalFileSync(Object msg, Throwable e)
{
log.fatal(getLogDetail(msg), e);
}
/**
* 拼装日志详细信息
* @param message 要打印的日志信息
* @return 封装后的日志详细信息
*/
private static synchronized String getLogDetail(Object message)
{
String msg = "";
if (null != message)
msg = message.toString();
StringBuffer bf = new StringBuffer();
try
{
ex.fillInStackTrace();
throw ex;
}
catch (Exception ex)
{
StackTraceElement[] trace = ex.getStackTrace();
//获取异常堆栈中的调用类信息
final int pos = 2;
bf.append(msg);
bf.append(" [class:");
bf.append(trace[pos].getClassName());
bf.append(" method:");
bf.append(trace[pos].getMethodName());
bf.append(" line:");
bf.append(trace[pos].getLineNumber());
bf.append("]");
}
return bf.toString();
}
/**
* 打印fatal日志信息
*
* @param msg 日志信息
*/
public static void fatalFileSync(Object msg) {
log.fatal(getLogDetail(msg));
}
/**
* 打印fatal日志信息带异常
*
* @param msg 日志信息
* @param e 异常堆栈
*/
public static void fatalFileSync(Object msg, Throwable e) {
log.fatal(getLogDetail(msg), e);
}
/**
* 拼装日志详细信息
*
* @param message 要打印的日志信息
* @return 封装后的日志详细信息
*/
private static synchronized String getLogDetail(Object message) {
String msg = "";
if (null != message)
msg = message.toString();
StringBuffer bf = new StringBuffer();
try {
ex.fillInStackTrace();
throw ex;
} catch (Exception ex) {
StackTraceElement[] trace = ex.getStackTrace();
//获取异常堆栈中的调用类信息
final int pos = 2;
bf.append(msg);
bf.append(" [class:");
bf.append(trace[pos].getClassName());
bf.append(" method:");
bf.append(trace[pos].getMethodName());
bf.append(" line:");
bf.append(trace[pos].getLineNumber());
bf.append("]");
}
return bf.toString();
}
}
......@@ -3,15 +3,14 @@ package com.jsh.dao.asset;
import com.jsh.base.BaseDAO;
import com.jsh.model.po.Asset;
public class AssetDAO extends BaseDAO<Asset> implements AssetIDAO
{
/**
public class AssetDAO extends BaseDAO<Asset> implements AssetIDAO {
/**
* 设置dao映射基类
*
* @return
*/
@Override
public Class<Asset> getEntityClass()
{
@Override
public Class<Asset> getEntityClass() {
return Asset.class;
}
}
......@@ -3,7 +3,6 @@ package com.jsh.dao.asset;
import com.jsh.base.BaseIDAO;
import com.jsh.model.po.Asset;
public interface AssetIDAO extends BaseIDAO<Asset>
{
public interface AssetIDAO extends BaseIDAO<Asset> {
}
package com.jsh.dao.asset;
import org.hibernate.Query;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.jsh.util.JshException;
import com.jsh.model.po.Asset;
import com.jsh.util.JshException;
import com.jsh.util.PageUtil;
import com.jsh.util.SearchConditionUtil;
import org.hibernate.Query;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
public class ReportDAO extends HibernateDaoSupport implements ReportIDAO
{
public class ReportDAO extends HibernateDaoSupport implements ReportIDAO {
@SuppressWarnings("unchecked")
@Override
public void find(PageUtil<Asset> pageUtil,String reportType,String reportName) throws JshException
{
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select count(" + reportType +") as dataSum, " + reportName + " from Asset asset where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
public void find(PageUtil<Asset> pageUtil, String reportType, String reportName) throws JshException {
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select count(" + reportType + ") as dataSum, " + reportName + " from Asset asset where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size());
pageUtil.setPageList(query.list());
}
......
package com.jsh.dao.asset;
import com.jsh.util.JshException;
import com.jsh.model.po.Asset;
import com.jsh.util.JshException;
import com.jsh.util.PageUtil;
public interface ReportIDAO
{
public interface ReportIDAO {
/**
* 查找资产列表
* @param pageUtil 分页工具类
*
* @param pageUtil 分页工具类
* @param reportType 报表统计字段
* @throws JshException
*/
void find(PageUtil<Asset> pageUtil,String reportType,String reportName) throws JshException;
void find(PageUtil<Asset> pageUtil, String reportType, String reportName) throws JshException;
}
......@@ -7,15 +7,14 @@ import com.jsh.util.PageUtil;
import com.jsh.util.SearchConditionUtil;
import org.hibernate.Query;
public class AccountDAO extends BaseDAO<Account> implements AccountIDAO
{
public class AccountDAO extends BaseDAO<Account> implements AccountIDAO {
/**
* 设置dao映射基类
*
* @return
*/
@Override
public Class<Account> getEntityClass()
{
public Class<Account> getEntityClass() {
return Account.class;
}
......@@ -25,15 +24,15 @@ public class AccountDAO extends BaseDAO<Account> implements AccountIDAO
//主表出入库涉及的账户
queryString.append("select dh.Number,concat(dh.SubType,dh.Type) as newType,s.supplier,dh.ChangeAmount,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList " +
" from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id where 1=1 ");
if(accountId!=null && !accountId.equals("")) {
queryString.append(" and dh.AccountId='"+ accountId +"' ");
if (accountId != null && !accountId.equals("")) {
queryString.append(" and dh.AccountId='" + accountId + "' ");
}
//主表收入和支出涉及的账户
queryString.append("UNION ALL " +
"select ah.BillNo,ah.Type as newType,s.supplier,ah.ChangeAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList " +
" from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id where 1=1 ");
if(accountId!=null && !accountId.equals("")) {
queryString.append(" and ah.AccountId='"+ accountId +"' ");
if (accountId != null && !accountId.equals("")) {
queryString.append(" and ah.AccountId='" + accountId + "' ");
}
//明细中涉及的账户(收款,付款,收预付款)
queryString.append("UNION ALL " +
......@@ -41,31 +40,31 @@ public class AccountDAO extends BaseDAO<Account> implements AccountIDAO
" from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id " +
" inner join jsh_accountitem ai on ai.HeaderId=ah.Id " +
" where ah.Type in ('收款','付款','收预付款') ");
if(accountId!=null && !accountId.equals("")) {
queryString.append(" and ai.AccountId='"+ accountId +"' ");
if (accountId != null && !accountId.equals("")) {
queryString.append(" and ai.AccountId='" + accountId + "' ");
}
//主表中转出的账户
queryString.append("UNION ALL " +
"select ah.BillNo,ah.Type as newType, '' as sName,ah.ChangeAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList " +
" from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id " +
" where ah.Type='转账' ");
if(accountId!=null && !accountId.equals("")) {
queryString.append(" and ah.AccountId='"+ accountId +"' ");
if (accountId != null && !accountId.equals("")) {
queryString.append(" and ah.AccountId='" + accountId + "' ");
}
//明细中被转入的账户
queryString.append("UNION ALL " +
"select ah.BillNo,ah.Type as newType, '' as sName,ai.EachAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList " +
" from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id " +
" where ah.Type='转账' ");
if(accountId!=null && !accountId.equals("")) {
queryString.append(" and ai.AccountId='"+ accountId +"' ");
if (accountId != null && !accountId.equals("")) {
queryString.append(" and ai.AccountId='" + accountId + "' ");
}
//多账户的情况
queryString.append("UNION ALL " +
"select dh.Number,concat(dh.SubType,dh.Type) as newType,s.supplier,dh.ChangeAmount,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,dh.AccountIdList,dh.AccountMoneyList" +
" from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id where 1=1 ");
if(accountId!=null && !accountId.equals("")) {
queryString.append(" and dh.AccountIdList like '%\""+ accountId +"\"%' ");
if (accountId != null && !accountId.equals("")) {
queryString.append(" and dh.AccountIdList like '%\"" + accountId + "\"%' ");
}
queryString.append(" ORDER BY oTime desc");
Query query;
......
......@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
import com.jsh.base.BaseDAO;
import com.jsh.model.po.App;
public class AppDAO extends BaseDAO<App> implements AppIDAO
{
/**
public class AppDAO extends BaseDAO<App> implements AppIDAO {
/**
* 设置dao映射基类
*
* @return
*/
@Override
public Class<App> getEntityClass()
{
@Override
public Class<App> getEntityClass() {
return App.class;
}
}
......@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
import com.jsh.base.BaseIDAO;
import com.jsh.model.po.App;
public interface AppIDAO extends BaseIDAO<App>
{
public interface AppIDAO extends BaseIDAO<App> {
}
......@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
import com.jsh.base.BaseDAO;
import com.jsh.model.po.Assetname;
public class AssetNameDAO extends BaseDAO<Assetname> implements AssetNameIDAO
{
/**
public class AssetNameDAO extends BaseDAO<Assetname> implements AssetNameIDAO {
/**
* 设置dao映射基类
*
* @return
*/
@Override
public Class<Assetname> getEntityClass()
{
@Override
public Class<Assetname> getEntityClass() {
return Assetname.class;
}
}
......@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
import com.jsh.base.BaseIDAO;
import com.jsh.model.po.Assetname;
public interface AssetNameIDAO extends BaseIDAO<Assetname>
{
public interface AssetNameIDAO extends BaseIDAO<Assetname> {
}
......@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
import com.jsh.base.BaseDAO;
import com.jsh.model.po.Category;
public class CategoryDAO extends BaseDAO<Category> implements CategoryIDAO
{
/**
public class CategoryDAO extends BaseDAO<Category> implements CategoryIDAO {
/**
* 设置dao映射基类
*
* @return
*/
@Override
public Class<Category> getEntityClass()
{
@Override
public Class<Category> getEntityClass() {
return Category.class;
}
}
......@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
import com.jsh.base.BaseIDAO;
import com.jsh.model.po.Category;
public interface CategoryIDAO extends BaseIDAO<Category>
{
public interface CategoryIDAO extends BaseIDAO<Category> {
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment