3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,6 +3,7 @@
|
|||||||
# Mobile Tools for Java (J2ME)
|
# Mobile Tools for Java (J2ME)
|
||||||
.mtj.tmp/
|
.mtj.tmp/
|
||||||
|
|
||||||
|
*.iml
|
||||||
# Package Files #
|
# Package Files #
|
||||||
*.jar
|
*.jar
|
||||||
*.war
|
*.war
|
||||||
@@ -12,5 +13,7 @@
|
|||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
|
/target
|
||||||
|
|
||||||
|
**/*.iml
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +1,33 @@
|
|||||||
package com.jsh.action.asset;
|
package com.jsh.action.asset;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
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.BaseAction;
|
||||||
import com.jsh.base.Log;
|
import com.jsh.base.Log;
|
||||||
import com.jsh.util.AssetConstants;
|
import com.jsh.model.po.*;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.Asset;
|
|
||||||
import com.jsh.model.po.Assetname;
|
|
||||||
import com.jsh.model.po.Basicuser;
|
|
||||||
import com.jsh.model.po.Logdetails;
|
|
||||||
import com.jsh.model.po.Supplier;
|
|
||||||
import com.jsh.model.vo.asset.AssetModel;
|
import com.jsh.model.vo.asset.AssetModel;
|
||||||
import com.jsh.service.asset.AssetIService;
|
import com.jsh.service.asset.AssetIService;
|
||||||
import com.jsh.service.basic.AssetNameIService;
|
import com.jsh.service.basic.AssetNameIService;
|
||||||
import com.jsh.service.basic.CategoryIService;
|
import com.jsh.service.basic.CategoryIService;
|
||||||
import com.jsh.service.basic.SupplierIService;
|
import com.jsh.service.basic.SupplierIService;
|
||||||
import com.jsh.service.basic.UserIService;
|
import com.jsh.service.basic.UserIService;
|
||||||
|
import com.jsh.util.AssetConstants;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
import com.jsh.util.Tools;
|
import com.jsh.util.Tools;
|
||||||
|
import net.sf.json.JSONArray;
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class AssetAction extends BaseAction<AssetModel>
|
public class AssetAction extends BaseAction<AssetModel> {
|
||||||
{
|
|
||||||
private AssetModel model = new AssetModel();
|
private AssetModel model = new AssetModel();
|
||||||
private AssetIService assetService;
|
private AssetIService assetService;
|
||||||
private CategoryIService categoryService;
|
private CategoryIService categoryService;
|
||||||
@@ -43,16 +35,14 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
private UserIService userService;
|
private UserIService userService;
|
||||||
private AssetNameIService assetnameService;
|
private AssetNameIService assetnameService;
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getBasicData()
|
public String getBasicData() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
categoryService.find(pageUtil);
|
categoryService.find(pageUtil);
|
||||||
mapData.put("categoryList", pageUtil.getPageList());
|
mapData.put("categoryList", pageUtil.getPageList());
|
||||||
@@ -69,9 +59,7 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
|
|
||||||
assetnameService.find(pageUtil);
|
assetnameService.find(pageUtil);
|
||||||
mapData.put("assetnameList", pageUtil.getPageList());
|
mapData.put("assetnameList", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exceptoin");
|
model.getShowModel().setMsgTip("exceptoin");
|
||||||
}
|
}
|
||||||
@@ -80,14 +68,13 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加资产
|
* 增加资产
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加资产方法===================");
|
Log.infoFileSync("==================开始调用增加资产方法===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Asset asset = new Asset();
|
Asset asset = new Asset();
|
||||||
//添加设置
|
//添加设置
|
||||||
asset.setAssetname(new Assetname(model.getAssetNameID()));
|
asset.setAssetname(new Assetname(model.getAssetNameID()));
|
||||||
@@ -96,128 +83,17 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
asset.setStatus(model.getStatus());
|
asset.setStatus(model.getStatus());
|
||||||
asset.setPrice(model.getPrice());
|
asset.setPrice(model.getPrice());
|
||||||
|
|
||||||
if(null != model.getUserID())
|
if (null != model.getUserID()) {
|
||||||
{
|
|
||||||
asset.setUser( new Basicuser(model.getUserID()));
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//购买日期
|
|
||||||
asset.setPurchasedate(new Timestamp(Tools.parse(model.getPurchasedate(), "yyyy-MM-dd").getTime()));
|
|
||||||
//有效日期
|
|
||||||
asset.setPeriodofvalidity(new Timestamp(Tools.parse(model.getPeriodofvalidity(), "yyyy-MM-dd").getTime()));
|
|
||||||
//保修日期
|
|
||||||
asset.setWarrantydate(new Timestamp(Tools.parse(model.getWarrantydate(), "yyyy-MM-dd").getTime()));
|
|
||||||
}
|
|
||||||
catch (ParseException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
asset.setAssetnum(model.getAssetnum());
|
|
||||||
asset.setSerialnum(model.getSerialnum());
|
|
||||||
asset.setLabels(model.getLabels());
|
|
||||||
|
|
||||||
asset.setSupplier( new Supplier(model.getSupplierID()));
|
|
||||||
asset.setDescription(model.getDescription());
|
|
||||||
|
|
||||||
asset.setCreatetime(new Timestamp(new Date().getTime()));
|
|
||||||
asset.setCreator(getUser());
|
|
||||||
asset.setUpdatetime(new Timestamp(new Date().getTime()));
|
|
||||||
asset.setUpdator(getUser());
|
|
||||||
asset.setAddMonth(Tools.getCurrentMonth());
|
|
||||||
assetService.create(asset);
|
|
||||||
//========标识位===========
|
|
||||||
flag = true;
|
|
||||||
//记录操作日志使用
|
|
||||||
tipMsg = "成功";
|
|
||||||
tipType = 0;
|
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加资产异常", e);
|
|
||||||
flag = false;
|
|
||||||
tipMsg = "失败";
|
|
||||||
tipType = 1;
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加资产回写客户端结果异常", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加资产", model.getClientIp(),
|
|
||||||
new Timestamp(System.currentTimeMillis())
|
|
||||||
, tipType, "增加资产名称ID为 "+ model.getAssetNameID() + " " + tipMsg + "!", "增加资产" + tipMsg));
|
|
||||||
Log.infoFileSync("==================结束调用增加资产方法===================");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除资产
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String delete()
|
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除资产信息方法delete()================");
|
|
||||||
try
|
|
||||||
{
|
|
||||||
assetService.delete(model.getAssetID());
|
|
||||||
tipMsg = "成功";
|
|
||||||
tipType = 0;
|
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAssetID() + " 的资产异常", e);
|
|
||||||
tipMsg = "失败";
|
|
||||||
tipType = 1;
|
|
||||||
}
|
|
||||||
model.getShowModel().setMsgTip(tipMsg);
|
|
||||||
logService.create(new Logdetails(getUser(), "删除资产", model.getClientIp(),
|
|
||||||
new Timestamp(System.currentTimeMillis())
|
|
||||||
, tipType, "删除资产ID为 "+ model.getAssetID() + " " + tipMsg + "!", "删除资产" + tipMsg));
|
|
||||||
Log.infoFileSync("====================结束调用删除资产信息方法delete()================");
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新资产
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public void update()
|
|
||||||
{
|
|
||||||
Boolean flag = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Asset asset = assetService.get(model.getAssetID());
|
|
||||||
|
|
||||||
//设置要更新的熟悉值
|
|
||||||
asset.setAssetname(new Assetname(model.getAssetNameID()));
|
|
||||||
|
|
||||||
asset.setLocation(model.getLocation());
|
|
||||||
asset.setStatus(model.getStatus());
|
|
||||||
asset.setPrice(model.getPrice());
|
|
||||||
|
|
||||||
if(null != model.getUserID())
|
|
||||||
asset.setUser(new Basicuser(model.getUserID()));
|
asset.setUser(new Basicuser(model.getUserID()));
|
||||||
else
|
}
|
||||||
asset.setUser(null);
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
//购买日期
|
//购买日期
|
||||||
asset.setPurchasedate(new Timestamp(Tools.parse(model.getPurchasedate(), "yyyy-MM-dd").getTime()));
|
asset.setPurchasedate(new Timestamp(Tools.parse(model.getPurchasedate(), "yyyy-MM-dd").getTime()));
|
||||||
//有效日期
|
//有效日期
|
||||||
asset.setPeriodofvalidity(new Timestamp(Tools.parse(model.getPeriodofvalidity(), "yyyy-MM-dd").getTime()));
|
asset.setPeriodofvalidity(new Timestamp(Tools.parse(model.getPeriodofvalidity(), "yyyy-MM-dd").getTime()));
|
||||||
//保修日期
|
//保修日期
|
||||||
asset.setWarrantydate(new Timestamp(Tools.parse(model.getWarrantydate(), "yyyy-MM-dd").getTime()));
|
asset.setWarrantydate(new Timestamp(Tools.parse(model.getWarrantydate(), "yyyy-MM-dd").getTime()));
|
||||||
}
|
} catch (ParseException e) {
|
||||||
catch (ParseException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,52 +104,136 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
asset.setSupplier(new Supplier(model.getSupplierID()));
|
asset.setSupplier(new Supplier(model.getSupplierID()));
|
||||||
asset.setDescription(model.getDescription());
|
asset.setDescription(model.getDescription());
|
||||||
|
|
||||||
asset.setUpdatetime(new Timestamp(new Date().getTime()));
|
asset.setCreatetime(new Timestamp(System.currentTimeMillis()));
|
||||||
|
asset.setCreator(getUser());
|
||||||
|
asset.setUpdatetime(new Timestamp(System.currentTimeMillis()));
|
||||||
|
asset.setUpdator(getUser());
|
||||||
|
asset.setAddMonth(Tools.getCurrentMonth());
|
||||||
|
assetService.create(asset);
|
||||||
|
//========标识位===========
|
||||||
|
flag = true;
|
||||||
|
//记录操作日志使用
|
||||||
|
tipMsg = "成功";
|
||||||
|
tipType = 0;
|
||||||
|
} catch (DataAccessException e) {
|
||||||
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加资产异常", e);
|
||||||
|
flag = false;
|
||||||
|
tipMsg = "失败";
|
||||||
|
tipType = 1;
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
toClient(flag.toString());
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.errorFileSync(">>>>>>>>>>>>增加资产回写客户端结果异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logService.create(new Logdetails(getUser(), "增加资产", model.getClientIp(),
|
||||||
|
new Timestamp(System.currentTimeMillis())
|
||||||
|
, tipType, "增加资产名称ID为 " + model.getAssetNameID() + " " + tipMsg + "!", "增加资产" + tipMsg));
|
||||||
|
Log.infoFileSync("==================结束调用增加资产方法===================");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资产
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String delete() {
|
||||||
|
Log.infoFileSync("====================开始调用删除资产信息方法delete()================");
|
||||||
|
try {
|
||||||
|
assetService.delete(model.getAssetID());
|
||||||
|
tipMsg = "成功";
|
||||||
|
tipType = 0;
|
||||||
|
} catch (DataAccessException e) {
|
||||||
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAssetID() + " 的资产异常", e);
|
||||||
|
tipMsg = "失败";
|
||||||
|
tipType = 1;
|
||||||
|
}
|
||||||
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
|
logService.create(new Logdetails(getUser(), "删除资产", model.getClientIp(),
|
||||||
|
new Timestamp(System.currentTimeMillis())
|
||||||
|
, tipType, "删除资产ID为 " + model.getAssetID() + " " + tipMsg + "!", "删除资产" + tipMsg));
|
||||||
|
Log.infoFileSync("====================结束调用删除资产信息方法delete()================");
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新资产
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void update() {
|
||||||
|
Boolean flag = false;
|
||||||
|
try {
|
||||||
|
Asset asset = assetService.get(model.getAssetID());
|
||||||
|
|
||||||
|
//设置要更新的熟悉值
|
||||||
|
asset.setAssetname(new Assetname(model.getAssetNameID()));
|
||||||
|
|
||||||
|
asset.setLocation(model.getLocation());
|
||||||
|
asset.setStatus(model.getStatus());
|
||||||
|
asset.setPrice(model.getPrice());
|
||||||
|
|
||||||
|
if (null != model.getUserID()) {
|
||||||
|
asset.setUser(new Basicuser(model.getUserID()));
|
||||||
|
} else {
|
||||||
|
asset.setUser(null);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
//购买日期
|
||||||
|
asset.setPurchasedate(new Timestamp(Tools.parse(model.getPurchasedate(), "yyyy-MM-dd").getTime()));
|
||||||
|
//有效日期
|
||||||
|
asset.setPeriodofvalidity(new Timestamp(Tools.parse(model.getPeriodofvalidity(), "yyyy-MM-dd").getTime()));
|
||||||
|
//保修日期
|
||||||
|
asset.setWarrantydate(new Timestamp(Tools.parse(model.getWarrantydate(), "yyyy-MM-dd").getTime()));
|
||||||
|
} catch (ParseException e) {
|
||||||
|
Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
asset.setAssetnum(model.getAssetnum());
|
||||||
|
asset.setSerialnum(model.getSerialnum());
|
||||||
|
asset.setLabels(model.getLabels());
|
||||||
|
|
||||||
|
asset.setSupplier(new Supplier(model.getSupplierID()));
|
||||||
|
asset.setDescription(model.getDescription());
|
||||||
|
|
||||||
|
asset.setUpdatetime(new Timestamp(System.currentTimeMillis()));
|
||||||
asset.setUpdator(getUser());
|
asset.setUpdator(getUser());
|
||||||
assetService.update(asset);
|
assetService.update(asset);
|
||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改资产ID为 : " + model.getAssetID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改资产ID为 : " + model.getAssetID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改资产回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改资产回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新资产", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新资产", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新资产ID为 "+ model.getAssetID() + " " + tipMsg + "!", "更新资产" + tipMsg));
|
, tipType, "更新资产ID为 " + model.getAssetID() + " " + tipMsg + "!", "更新资产" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID资产
|
* 批量删除指定ID资产
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
assetService.batchDelete(model.getAssetIDs());
|
assetService.batchDelete(model.getAssetIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除资产ID为:" + model.getAssetIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除资产ID为:" + model.getAssetIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -281,18 +241,17 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除资产", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除资产", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除资产ID为 "+ model.getAssetIDs() + " " + tipMsg + "!", "批量删除资产" + tipMsg));
|
, tipType, "批量删除资产ID为 " + model.getAssetIDs() + " " + tipMsg + "!", "批量删除资产" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找资产信息
|
* 查找资产信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Asset> pageUtil = new PageUtil<Asset>();
|
PageUtil<Asset> pageUtil = new PageUtil<Asset>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -310,10 +269,8 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Asset asset : dataList) {
|
||||||
for(Asset asset:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", asset.getId());
|
item.put("id", asset.getId());
|
||||||
//添加资产属性
|
//添加资产属性
|
||||||
@@ -328,25 +285,25 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
item.put("status", getStatusInfo(asset.getStatus()));
|
item.put("status", getStatusInfo(asset.getStatus()));
|
||||||
item.put("statushort", asset.getStatus());
|
item.put("statushort", asset.getStatus());
|
||||||
//在用用户名称
|
//在用用户名称
|
||||||
item.put("username", asset.getUser()==null?"":asset.getUser().getUsername());
|
item.put("username", asset.getUser() == null ? "" : asset.getUser().getUsername());
|
||||||
item.put("userID", asset.getUser()==null?"":asset.getUser().getId());
|
item.put("userID", asset.getUser() == null ? "" : asset.getUser().getId());
|
||||||
//位置
|
//位置
|
||||||
item.put("location", Tools.dealNullStr(asset.getLocation()));
|
item.put("location", Tools.dealNullStr(asset.getLocation()));
|
||||||
|
|
||||||
//购买日期
|
//购买日期
|
||||||
item.put("purchasedate", asset.getPurchasedate()==null?"":Tools.getCurrentMonth(asset.getPurchasedate()));
|
item.put("purchasedate", asset.getPurchasedate() == null ? "" : Tools.getCurrentMonth(asset.getPurchasedate()));
|
||||||
//有效日期
|
//有效日期
|
||||||
item.put("periodofvalidity", asset.getPeriodofvalidity()==null?"":Tools.getCurrentMonth(asset.getPeriodofvalidity()));
|
item.put("periodofvalidity", asset.getPeriodofvalidity() == null ? "" : Tools.getCurrentMonth(asset.getPeriodofvalidity()));
|
||||||
//保修日期
|
//保修日期
|
||||||
item.put("warrantydate", asset.getWarrantydate()==null?"":Tools.getCurrentMonth(asset.getWarrantydate()));
|
item.put("warrantydate", asset.getWarrantydate() == null ? "" : Tools.getCurrentMonth(asset.getWarrantydate()));
|
||||||
//资产编号
|
//资产编号
|
||||||
item.put("assetnum", Tools.dealNullStr(asset.getAssetnum()));
|
item.put("assetnum", Tools.dealNullStr(asset.getAssetnum()));
|
||||||
//资产序列号
|
//资产序列号
|
||||||
item.put("serialnum", Tools.dealNullStr(asset.getSerialnum()));
|
item.put("serialnum", Tools.dealNullStr(asset.getSerialnum()));
|
||||||
//供应商
|
//供应商
|
||||||
item.put("supplier", asset.getSupplier()==null?"":asset.getSupplier().getSupplier());
|
item.put("supplier", asset.getSupplier() == null ? "" : asset.getSupplier().getSupplier());
|
||||||
//供应商
|
//供应商
|
||||||
item.put("supplierID", asset.getSupplier()==null?"":asset.getSupplier().getId());
|
item.put("supplierID", asset.getSupplier() == null ? "" : asset.getSupplier().getId());
|
||||||
//标签
|
//标签
|
||||||
item.put("labels", Tools.dealNullStr(asset.getLabels()));
|
item.put("labels", Tools.dealNullStr(asset.getLabels()));
|
||||||
item.put("description", Tools.dealNullStr(asset.getDescription()));
|
item.put("description", Tools.dealNullStr(asset.getDescription()));
|
||||||
@@ -357,39 +314,32 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询资产信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询资产信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel表格
|
* 导出excel表格
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public String exportExcel()
|
public String exportExcel() {
|
||||||
{
|
|
||||||
Log.infoFileSync("===================调用导出资产信息action方法exportExcel开始=======================");
|
Log.infoFileSync("===================调用导出资产信息action方法exportExcel开始=======================");
|
||||||
try
|
try {
|
||||||
{
|
PageUtil<Asset> pageUtil = (PageUtil<Asset>) getSession().get("pageUtil");
|
||||||
PageUtil<Asset> pageUtil = (PageUtil<Asset>)getSession().get("pageUtil");
|
|
||||||
|
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
//pageUtil.setAdvSearch(getCondition());
|
//pageUtil.setAdvSearch(getCondition());
|
||||||
String isCurrentPage = model.getIsAllData();
|
String isCurrentPage = model.getIsAllData();
|
||||||
model.setFileName(Tools.changeUnicode(model.getFileName() + ".xls",model.getBrowserType()));
|
model.setFileName(Tools.changeUnicode(model.getFileName() + ".xls", model.getBrowserType()));
|
||||||
model.setExcelStream(assetService.exmportExcel(isCurrentPage,pageUtil));
|
model.setExcelStream(assetService.exmportExcel(isCurrentPage, pageUtil));
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出资产信息action方法exportExcel异常", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出资产信息action方法exportExcel异常",e);
|
|
||||||
model.getShowModel().setMsgTip("export excel exception");
|
model.getShowModel().setMsgTip("export excel exception");
|
||||||
}
|
}
|
||||||
Log.infoFileSync("===================调用导出资产信息action方法exportExcel结束==================");
|
Log.infoFileSync("===================调用导出资产信息action方法exportExcel结束==================");
|
||||||
@@ -400,39 +350,29 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
/**
|
/**
|
||||||
* 导入资产excel表格内容
|
* 导入资产excel表格内容
|
||||||
*/
|
*/
|
||||||
public String importExcel()
|
public String importExcel() {
|
||||||
{
|
|
||||||
//资产excel表格file
|
//资产excel表格file
|
||||||
Boolean result = false;
|
Boolean result = false;
|
||||||
String returnStr = "";
|
String returnStr = "";
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
InputStream in = assetService.importExcel(model.getAssetFile(), model.getIsCheck());
|
InputStream in = assetService.importExcel(model.getAssetFile(), model.getIsCheck());
|
||||||
|
|
||||||
if(null != in)
|
if (null != in) {
|
||||||
{
|
|
||||||
model.setFileName(Tools.getRandomChar() + Tools.getNow2(Calendar.getInstance().getTime()) + "_wrong.xls");
|
model.setFileName(Tools.getRandomChar() + Tools.getNow2(Calendar.getInstance().getTime()) + "_wrong.xls");
|
||||||
model.setExcelStream(in);
|
model.setExcelStream(in);
|
||||||
returnStr = AssetConstants.BusinessForExcel.EXCEL;
|
returnStr = AssetConstants.BusinessForExcel.EXCEL;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
result = true;
|
result = true;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
toClient(result.toString());
|
toClient(result.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写导入资产信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写导入资产信息结果异常", e);
|
||||||
}
|
}
|
||||||
//导入数据成功
|
//导入数据成功
|
||||||
returnStr = SUCCESS;
|
returnStr = SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} catch (JshException e) {
|
||||||
catch (JshException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e);
|
||||||
}
|
}
|
||||||
return returnStr;
|
return returnStr;
|
||||||
@@ -440,14 +380,14 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("assetname.id_n_eq", model.getAssetNameID());
|
condition.put("assetname.id_n_eq", model.getAssetNameID());
|
||||||
condition.put("assetname.category.id_n_eq", model.getAssetCategoryID());
|
condition.put("assetname.category.id_n_eq", model.getAssetCategoryID());
|
||||||
condition.put("user.id_n_eq", model.getUserID());
|
condition.put("user.id_n_eq", model.getUserID());
|
||||||
@@ -460,14 +400,13 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
/**
|
/**
|
||||||
* 根据状态码转化成说明字符串
|
* 根据状态码转化成说明字符串
|
||||||
* 资产的状态:0==在库,1==在用,2==消费
|
* 资产的状态:0==在库,1==在用,2==消费
|
||||||
|
*
|
||||||
* @param statusCode
|
* @param statusCode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String getStatusInfo(short statusCode)
|
private String getStatusInfo(short statusCode) {
|
||||||
{
|
|
||||||
String statusInfo = "";
|
String statusInfo = "";
|
||||||
switch(statusCode)
|
switch (statusCode) {
|
||||||
{
|
|
||||||
case AssetConstants.BusinessForExcel.EXCEl_STATUS_ZAIKU:
|
case AssetConstants.BusinessForExcel.EXCEl_STATUS_ZAIKU:
|
||||||
statusInfo = "在库";
|
statusInfo = "在库";
|
||||||
break;
|
break;
|
||||||
@@ -479,39 +418,35 @@ public class AssetAction extends BaseAction<AssetModel>
|
|||||||
case AssetConstants.BusinessForExcel.EXCEl_STATUS_CONSUME:
|
case AssetConstants.BusinessForExcel.EXCEl_STATUS_CONSUME:
|
||||||
statusInfo = "消费";
|
statusInfo = "消费";
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return statusInfo;
|
return statusInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========Spring注入以及model驱动公共方法===========
|
//=========Spring注入以及model驱动公共方法===========
|
||||||
public void setAssetService(AssetIService assetService)
|
public void setAssetService(AssetIService assetService) {
|
||||||
{
|
|
||||||
this.assetService = assetService;
|
this.assetService = assetService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCategoryService(CategoryIService categoryService)
|
public void setCategoryService(CategoryIService categoryService) {
|
||||||
{
|
|
||||||
this.categoryService = categoryService;
|
this.categoryService = categoryService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSupplierService(SupplierIService supplierService)
|
public void setSupplierService(SupplierIService supplierService) {
|
||||||
{
|
|
||||||
this.supplierService = supplierService;
|
this.supplierService = supplierService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserService(UserIService userService)
|
public void setUserService(UserIService userService) {
|
||||||
{
|
|
||||||
this.userService = userService;
|
this.userService = userService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAssetnameService(AssetNameIService assetnameService)
|
public void setAssetnameService(AssetNameIService assetnameService) {
|
||||||
{
|
|
||||||
this.assetnameService = assetnameService;
|
this.assetnameService = assetnameService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AssetModel getModel()
|
public AssetModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,36 @@
|
|||||||
package com.jsh.action.asset;
|
package com.jsh.action.asset;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
import com.jsh.model.po.Asset;
|
||||||
|
import com.jsh.model.vo.asset.ReportModel;
|
||||||
|
import com.jsh.service.asset.ReportIService;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.jsh.base.BaseAction;
|
|
||||||
import com.jsh.base.Log;
|
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.Asset;
|
|
||||||
import com.jsh.model.vo.asset.ReportModel;
|
|
||||||
import com.jsh.service.asset.ReportIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ReportAction extends BaseAction<ReportModel>
|
public class ReportAction extends BaseAction<ReportModel> {
|
||||||
{
|
|
||||||
private ReportModel model = new ReportModel();
|
private ReportModel model = new ReportModel();
|
||||||
private ReportIService reportService;
|
private ReportIService reportService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找资产信息
|
* 查找资产信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String find()
|
public String find() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Asset> pageUtil = new PageUtil<Asset>();
|
PageUtil<Asset> pageUtil = new PageUtil<Asset>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
pageUtil.setAdvSearch(getCondition());
|
pageUtil.setAdvSearch(getCondition());
|
||||||
String reportType = getReportType(new HashMap<String,Object>());
|
String reportType = getReportType(new HashMap<String, Object>());
|
||||||
reportService.find(pageUtil,reportType.split("_")[0],reportType.split("_")[1]);
|
reportService.find(pageUtil, reportType.split("_")[0], reportType.split("_")[1]);
|
||||||
model.getShowModel().setReportData(pageUtil.getPageList());
|
model.getShowModel().setReportData(pageUtil.getPageList());
|
||||||
}
|
} catch (JshException e) {
|
||||||
catch (JshException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
|
||||||
model.getShowModel().setMsgTip("get report data exception");
|
model.getShowModel().setMsgTip("get report data exception");
|
||||||
}
|
}
|
||||||
@@ -43,20 +39,20 @@ public class ReportAction extends BaseAction<ReportModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("assetname.id_n_eq", model.getAssetNameID());
|
condition.put("assetname.id_n_eq", model.getAssetNameID());
|
||||||
condition.put("assetname.category.id_n_eq", model.getAssetCategoryID());
|
condition.put("assetname.category.id_n_eq", model.getAssetCategoryID());
|
||||||
condition.put("user.id_n_eq", model.getUsernameID());
|
condition.put("user.id_n_eq", model.getUsernameID());
|
||||||
condition.put("status_n_eq", model.getStatus());
|
condition.put("status_n_eq", model.getStatus());
|
||||||
condition.put("supplier.id_n_eq", model.getSupplierID());
|
condition.put("supplier.id_n_eq", model.getSupplierID());
|
||||||
condition.put("dataSum_s_order","desc");
|
condition.put("dataSum_s_order", "desc");
|
||||||
//拼接统计数据条件
|
//拼接统计数据条件
|
||||||
getReportType(condition);
|
getReportType(condition);
|
||||||
return condition;
|
return condition;
|
||||||
@@ -64,10 +60,10 @@ public class ReportAction extends BaseAction<ReportModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取统计条件
|
* 获取统计条件
|
||||||
|
*
|
||||||
* @param condition
|
* @param condition
|
||||||
*/
|
*/
|
||||||
private String getReportType(Map<String,Object> condition)
|
private String getReportType(Map<String, Object> condition) {
|
||||||
{
|
|
||||||
// <option value="0">资产状态</option>
|
// <option value="0">资产状态</option>
|
||||||
// <option value="1">资产类型</option>
|
// <option value="1">资产类型</option>
|
||||||
// <option value="2">供应商</option>
|
// <option value="2">供应商</option>
|
||||||
@@ -76,8 +72,7 @@ public class ReportAction extends BaseAction<ReportModel>
|
|||||||
int reportType = model.getReportType();
|
int reportType = model.getReportType();
|
||||||
String reportTypeInfo = "";
|
String reportTypeInfo = "";
|
||||||
String reportTypeName = "";
|
String reportTypeName = "";
|
||||||
switch(reportType)
|
switch (reportType) {
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
condition.put("status_s_gb", "group");
|
condition.put("status_s_gb", "group");
|
||||||
reportTypeInfo = "status";
|
reportTypeInfo = "status";
|
||||||
@@ -103,18 +98,19 @@ public class ReportAction extends BaseAction<ReportModel>
|
|||||||
reportTypeInfo = "user.id";
|
reportTypeInfo = "user.id";
|
||||||
reportTypeName = "user.username";
|
reportTypeName = "user.username";
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return reportTypeInfo + "_" + reportTypeName;
|
return reportTypeInfo + "_" + reportTypeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========Spring注入以及model驱动公共方法===========
|
//=========Spring注入以及model驱动公共方法===========
|
||||||
public void setReportService(ReportIService reportService)
|
public void setReportService(ReportIService reportService) {
|
||||||
{
|
|
||||||
this.reportService = reportService;
|
this.reportService = reportService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ReportModel getModel()
|
public ReportModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,59 +1,52 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
import java.io.IOException;
|
import com.jsh.base.BaseAction;
|
||||||
import java.sql.Timestamp;
|
import com.jsh.base.Log;
|
||||||
import java.util.HashMap;
|
import com.jsh.model.po.*;
|
||||||
import java.util.List;
|
import com.jsh.model.vo.basic.AccountModel;
|
||||||
import java.util.Map;
|
import com.jsh.service.basic.AccountIService;
|
||||||
import java.text.*;
|
import com.jsh.service.materials.AccountHeadIService;
|
||||||
|
import com.jsh.service.materials.AccountItemIService;
|
||||||
import com.jsh.model.po.AccountHead;
|
import com.jsh.service.materials.DepotHeadIService;
|
||||||
import com.jsh.model.po.AccountItem;
|
|
||||||
import com.jsh.util.JshException;
|
import com.jsh.util.JshException;
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
import com.jsh.util.Tools;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
import com.jsh.base.BaseAction;
|
|
||||||
import com.jsh.base.Log;
|
import java.io.IOException;
|
||||||
import com.jsh.model.po.DepotHead;
|
import java.sql.Timestamp;
|
||||||
import com.jsh.model.po.Logdetails;
|
import java.text.DecimalFormat;
|
||||||
import com.jsh.model.po.Account;
|
import java.util.HashMap;
|
||||||
import com.jsh.model.vo.basic.AccountModel;
|
import java.util.List;
|
||||||
import com.jsh.service.basic.AccountIService;
|
import java.util.Map;
|
||||||
import com.jsh.service.materials.DepotHeadIService;
|
|
||||||
import com.jsh.service.materials.AccountHeadIService;
|
|
||||||
import com.jsh.service.materials.AccountItemIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
import com.jsh.util.Tools;
|
|
||||||
/**
|
/**
|
||||||
* 结算账户
|
* 结算账户
|
||||||
|
*
|
||||||
* @author ji sheng hua qq7527-18920
|
* @author ji sheng hua qq7527-18920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class AccountAction extends BaseAction<AccountModel>
|
public class AccountAction extends BaseAction<AccountModel> {
|
||||||
{
|
|
||||||
private AccountIService accountService;
|
private AccountIService accountService;
|
||||||
private DepotHeadIService depotHeadService;
|
private DepotHeadIService depotHeadService;
|
||||||
private AccountHeadIService accountHeadService;
|
private AccountHeadIService accountHeadService;
|
||||||
private AccountItemIService accountItemService;
|
private AccountItemIService accountItemService;
|
||||||
private AccountModel model = new AccountModel();
|
private AccountModel model = new AccountModel();
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getAccount()
|
public String getAccount() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
|
||||||
condition.put("Id_s_order", "asc");
|
condition.put("Id_s_order", "asc");
|
||||||
accountService.find(pageUtil);
|
accountService.find(pageUtil);
|
||||||
mapData.put("accountList", pageUtil.getPageList());
|
mapData.put("accountList", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找账户信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找账户信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exception");
|
model.getShowModel().setMsgTip("exception");
|
||||||
}
|
}
|
||||||
@@ -62,18 +55,17 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加结算账户
|
* 增加结算账户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加结算账户方法===================");
|
Log.infoFileSync("==================开始调用增加结算账户方法===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Account Account = new Account();
|
Account Account = new Account();
|
||||||
Account.setName(model.getName());
|
Account.setName(model.getName());
|
||||||
Account.setSerialNo(model.getSerialNo());
|
Account.setSerialNo(model.getSerialNo());
|
||||||
Account.setInitialAmount(model.getInitialAmount()!=null ? model.getInitialAmount() : 0);
|
Account.setInitialAmount(model.getInitialAmount() != null ? model.getInitialAmount() : 0);
|
||||||
Account.setCurrentAmount(model.getCurrentAmount());
|
Account.setCurrentAmount(model.getCurrentAmount());
|
||||||
Account.setRemark(model.getRemark());
|
Account.setRemark(model.getRemark());
|
||||||
accountService.create(Account);
|
accountService.create(Account);
|
||||||
@@ -83,47 +75,37 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加结算账户异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加结算账户异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加结算账户回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加结算账户回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加结算账户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加结算账户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加结算账户名称为 "+ model.getName() + " " + tipMsg + "!", "增加结算账户" + tipMsg));
|
, tipType, "增加结算账户名称为 " + model.getName() + " " + tipMsg + "!", "增加结算账户" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加结算账户方法===================");
|
Log.infoFileSync("==================结束调用增加结算账户方法===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除结算账户
|
* 删除结算账户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除结算账户信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除结算账户信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
accountService.delete(model.getAccountID());
|
accountService.delete(model.getAccountID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAccountID() + " 的结算账户异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAccountID() + " 的结算账户异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -131,24 +113,23 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除结算账户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除结算账户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除结算账户ID为 "+ model.getAccountID() + ",名称为 " + model.getName() + tipMsg + "!", "删除结算账户" + tipMsg));
|
, tipType, "删除结算账户ID为 " + model.getAccountID() + ",名称为 " + model.getName() + tipMsg + "!", "删除结算账户" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除结算账户信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除结算账户信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新结算账户
|
* 更新结算账户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Account Account = accountService.get(model.getAccountID());
|
Account Account = accountService.get(model.getAccountID());
|
||||||
Account.setName(model.getName());
|
Account.setName(model.getName());
|
||||||
Account.setSerialNo(model.getSerialNo());
|
Account.setSerialNo(model.getSerialNo());
|
||||||
Account.setInitialAmount(model.getInitialAmount()!=null ? model.getInitialAmount() : 0);
|
Account.setInitialAmount(model.getInitialAmount() != null ? model.getInitialAmount() : 0);
|
||||||
Account.setCurrentAmount(model.getCurrentAmount());
|
Account.setCurrentAmount(model.getCurrentAmount());
|
||||||
Account.setRemark(model.getRemark());
|
Account.setRemark(model.getRemark());
|
||||||
accountService.update(Account);
|
accountService.update(Account);
|
||||||
@@ -156,39 +137,31 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改结算账户ID为 : " + model.getAccountID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改结算账户ID为 : " + model.getAccountID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改结算账户回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改结算账户回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新结算账户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新结算账户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新结算账户ID为 "+ model.getAccountID() + " " + tipMsg + "!", "更新结算账户" + tipMsg));
|
, tipType, "更新结算账户ID为 " + model.getAccountID() + " " + tipMsg + "!", "更新结算账户" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新结算账户金额
|
* 更新结算账户金额
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void updateAmount()
|
public void updateAmount() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Account Account = accountService.get(model.getAccountID());
|
Account Account = accountService.get(model.getAccountID());
|
||||||
Account.setCurrentAmount(model.getCurrentAmount());
|
Account.setCurrentAmount(model.getCurrentAmount());
|
||||||
accountService.update(Account);
|
accountService.update(Account);
|
||||||
@@ -196,32 +169,26 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改结算账户ID为 : " + model.getAccountID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改结算账户ID为 : " + model.getAccountID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改结算账户回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改结算账户回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新结算账户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新结算账户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新结算账户ID为 "+ model.getAccountID() + " " + tipMsg + "!", "更新结算账户" + tipMsg));
|
, tipType, "更新结算账户ID为 " + model.getAccountID() + " " + tipMsg + "!", "更新结算账户" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新结算账户-设置是否默认
|
* 更新结算账户-设置是否默认
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void updateAmountIsDefault() {
|
public void updateAmountIsDefault() {
|
||||||
@@ -233,44 +200,38 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改结算账户ID为 : " + model.getAccountID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改结算账户ID为 : " + model.getAccountID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
try {
|
try {
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改结算账户回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改结算账户回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//如果改为默认账户时记录日志
|
//如果改为默认账户时记录日志
|
||||||
if(model.getIsDefault()) {
|
if (model.getIsDefault()) {
|
||||||
logService.create(new Logdetails(getUser(), "更新默认账户", model.getClientIp(), new Timestamp(System.currentTimeMillis()),
|
logService.create(new Logdetails(getUser(), "更新默认账户", model.getClientIp(), new Timestamp(System.currentTimeMillis()),
|
||||||
tipType, "更新账户ID"+ model.getAccountID() + "为默认账户" + tipMsg + "!", "更新默认账户" + tipMsg));
|
tipType, "更新账户ID" + model.getAccountID() + "为默认账户" + tipMsg + "!", "更新默认账户" + tipMsg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID结算账户
|
* 批量删除指定ID结算账户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
accountService.batchDelete(model.getAccountIDs());
|
accountService.batchDelete(model.getAccountIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除结算账户ID为:" + model.getAccountIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除结算账户ID为:" + model.getAccountIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -278,45 +239,35 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除结算账户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除结算账户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除结算账户ID为 "+ model.getAccountIDs() + " " + tipMsg + "!", "批量删除结算账户" + tipMsg));
|
, tipType, "批量删除结算账户ID为 " + model.getAccountIDs() + " " + tipMsg + "!", "批量删除结算账户" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
flag = accountService.checkIsNameExist("name", model.getName(), "id", model.getAccountID());
|
flag = accountService.checkIsNameExist("name", model.getName(), "id", model.getAccountID());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查结算账户名称为:" + model.getName() + " ID为: " + model.getAccountID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查结算账户名称为:" + model.getName() + " ID为: " + model.getAccountID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查结算账户名称为:" + model.getName() + " ID为: " + model.getAccountID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查结算账户名称为:" + model.getName() + " ID为: " + model.getAccountID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找结算账户信息
|
* 查找结算账户信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Account> pageUtil = new PageUtil<Account>();
|
PageUtil<Account> pageUtil = new PageUtil<Account>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -328,11 +279,9 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Account account : dataList) {
|
||||||
for(Account account:dataList)
|
DecimalFormat df = new DecimalFormat(".##");
|
||||||
{
|
|
||||||
DecimalFormat df =new DecimalFormat(".##");
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", account.getId());
|
item.put("id", account.getId());
|
||||||
//结算账户名称
|
//结算账户名称
|
||||||
@@ -340,14 +289,14 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
item.put("serialNo", account.getSerialNo());
|
item.put("serialNo", account.getSerialNo());
|
||||||
item.put("initialAmount", account.getInitialAmount());
|
item.put("initialAmount", account.getInitialAmount());
|
||||||
String timeStr = Tools.getCurrentMonth();
|
String timeStr = Tools.getCurrentMonth();
|
||||||
Double thisMonthAmount = getAccountSum(account.getId(), timeStr, "month") + getAccountSumByHead(account.getId(), timeStr, "month") +getAccountSumByDetail(account.getId(), timeStr, "month") + getManyAccountSum(account.getId(), timeStr, "month");
|
Double thisMonthAmount = getAccountSum(account.getId(), timeStr, "month") + getAccountSumByHead(account.getId(), timeStr, "month") + getAccountSumByDetail(account.getId(), timeStr, "month") + getManyAccountSum(account.getId(), timeStr, "month");
|
||||||
String thisMonthAmountFmt = "0";
|
String thisMonthAmountFmt = "0";
|
||||||
if(thisMonthAmount!=0){
|
if (thisMonthAmount != 0) {
|
||||||
thisMonthAmountFmt = df.format(thisMonthAmount);
|
thisMonthAmountFmt = df.format(thisMonthAmount);
|
||||||
}
|
}
|
||||||
item.put("thisMonthAmount", thisMonthAmountFmt); //本月发生额
|
item.put("thisMonthAmount", thisMonthAmountFmt); //本月发生额
|
||||||
Double currentAmount = getAccountSum(account.getId(),"", "month") + getAccountSumByHead(account.getId(), "", "month") + getAccountSumByDetail(account.getId(), "", "month") + getManyAccountSum(account.getId(), "", "month") + account.getInitialAmount();
|
Double currentAmount = getAccountSum(account.getId(), "", "month") + getAccountSumByHead(account.getId(), "", "month") + getAccountSumByDetail(account.getId(), "", "month") + getManyAccountSum(account.getId(), "", "month") + account.getInitialAmount();
|
||||||
String currentAmountFmt=df.format(currentAmount);
|
String currentAmountFmt = df.format(currentAmount);
|
||||||
item.put("currentAmount", currentAmountFmt); //当前余额
|
item.put("currentAmount", currentAmountFmt); //当前余额
|
||||||
item.put("isDefault", account.getIsDefault()); //是否默认
|
item.put("isDefault", account.getIsDefault()); //是否默认
|
||||||
item.put("remark", account.getRemark());
|
item.put("remark", account.getRemark());
|
||||||
@@ -358,37 +307,34 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找结算账户信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找结算账户信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询结算账户信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询结算账户信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单个账户的金额求和-入库和出库
|
* 单个账户的金额求和-入库和出库
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Double getAccountSum(Long id,String timeStr,String type){
|
public Double getAccountSum(Long id, String timeStr, String type) {
|
||||||
Double accountSum = 0.0;
|
Double accountSum = 0.0;
|
||||||
try{
|
try {
|
||||||
PageUtil<DepotHead> pageUtil = new PageUtil<DepotHead>();
|
PageUtil<DepotHead> pageUtil = new PageUtil<DepotHead>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
pageUtil.setAdvSearch(getCondition_getSum(id,timeStr,type));
|
pageUtil.setAdvSearch(getCondition_getSum(id, timeStr, type));
|
||||||
depotHeadService.find(pageUtil);
|
depotHeadService.find(pageUtil);
|
||||||
List<DepotHead> dataList = pageUtil.getPageList();
|
List<DepotHead> dataList = pageUtil.getPageList();
|
||||||
if(dataList!= null){
|
if (dataList != null) {
|
||||||
for(DepotHead depotHead:dataList){
|
for (DepotHead depotHead : dataList) {
|
||||||
accountSum = accountSum + depotHead.getChangeAmount();
|
accountSum = accountSum + depotHead.getChangeAmount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e){
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找进销存信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找进销存信息异常", e);
|
||||||
}
|
}
|
||||||
return accountSum;
|
return accountSum;
|
||||||
@@ -396,25 +342,25 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 单个账户的金额求和-收入、支出、转账的单据表头的合计
|
* 单个账户的金额求和-收入、支出、转账的单据表头的合计
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Double getAccountSumByHead(Long id,String timeStr,String type){
|
public Double getAccountSumByHead(Long id, String timeStr, String type) {
|
||||||
Double accountSum = 0.0;
|
Double accountSum = 0.0;
|
||||||
try{
|
try {
|
||||||
PageUtil<AccountHead> pageUtil = new PageUtil<AccountHead>();
|
PageUtil<AccountHead> pageUtil = new PageUtil<AccountHead>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
pageUtil.setAdvSearch(getCondition_getSumByHead(id, timeStr, type));
|
pageUtil.setAdvSearch(getCondition_getSumByHead(id, timeStr, type));
|
||||||
accountHeadService.find(pageUtil);
|
accountHeadService.find(pageUtil);
|
||||||
List<AccountHead> dataList = pageUtil.getPageList();
|
List<AccountHead> dataList = pageUtil.getPageList();
|
||||||
if(dataList!= null){
|
if (dataList != null) {
|
||||||
for(AccountHead accountHead:dataList){
|
for (AccountHead accountHead : dataList) {
|
||||||
accountSum = accountSum + accountHead.getChangeAmount();
|
accountSum = accountSum + accountHead.getChangeAmount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e){
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找进销存信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找进销存信息异常", e);
|
||||||
}
|
}
|
||||||
return accountSum;
|
return accountSum;
|
||||||
@@ -422,25 +368,26 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 单个账户的金额求和-收款、付款、转账、收预付款的单据明细的合计
|
* 单个账户的金额求和-收款、付款、转账、收预付款的单据明细的合计
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Double getAccountSumByDetail(Long id,String timeStr, String type){
|
public Double getAccountSumByDetail(Long id, String timeStr, String type) {
|
||||||
Double accountSum = 0.0;
|
Double accountSum = 0.0;
|
||||||
try{
|
try {
|
||||||
PageUtil<AccountHead> pageUtil = new PageUtil<AccountHead>();
|
PageUtil<AccountHead> pageUtil = new PageUtil<AccountHead>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
pageUtil.setAdvSearch(getCondition_getSumByHead(timeStr, type));
|
pageUtil.setAdvSearch(getCondition_getSumByHead(timeStr, type));
|
||||||
accountHeadService.find(pageUtil);
|
accountHeadService.find(pageUtil);
|
||||||
List<AccountHead> dataList = pageUtil.getPageList();
|
List<AccountHead> dataList = pageUtil.getPageList();
|
||||||
if(dataList!= null){
|
if (dataList != null) {
|
||||||
String ids = "";
|
String ids = "";
|
||||||
for(AccountHead accountHead:dataList){
|
for (AccountHead accountHead : dataList) {
|
||||||
ids = ids + accountHead.getId() +",";
|
ids = ids + accountHead.getId() + ",";
|
||||||
}
|
}
|
||||||
if(!ids.equals("")) {
|
if (!ids.equals("")) {
|
||||||
ids = ids.substring(0,ids.length() -1);
|
ids = ids.substring(0, ids.length() - 1);
|
||||||
}
|
}
|
||||||
PageUtil<AccountItem> pageUtilOne = new PageUtil<AccountItem>();
|
PageUtil<AccountItem> pageUtilOne = new PageUtil<AccountItem>();
|
||||||
pageUtilOne.setPageSize(0);
|
pageUtilOne.setPageSize(0);
|
||||||
@@ -448,17 +395,15 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
pageUtilOne.setAdvSearch(getCondition_getSumByDetail(id, ids));
|
pageUtilOne.setAdvSearch(getCondition_getSumByDetail(id, ids));
|
||||||
accountItemService.find(pageUtilOne);
|
accountItemService.find(pageUtilOne);
|
||||||
List<AccountItem> dataListOne = pageUtilOne.getPageList();
|
List<AccountItem> dataListOne = pageUtilOne.getPageList();
|
||||||
if(dataListOne!= null){
|
if (dataListOne != null) {
|
||||||
for(AccountItem accountItem:dataListOne){
|
for (AccountItem accountItem : dataListOne) {
|
||||||
accountSum = accountSum + accountItem.getEachAmount();
|
accountSum = accountSum + accountItem.getEachAmount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e){
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找进销存信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找进销存信息异常", e);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e){
|
|
||||||
Log.errorFileSync(">>>>>>>>>异常信息:", e);
|
Log.errorFileSync(">>>>>>>>>异常信息:", e);
|
||||||
}
|
}
|
||||||
return accountSum;
|
return accountSum;
|
||||||
@@ -466,35 +411,35 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 单个账户的金额求和-多账户的明细合计
|
* 单个账户的金额求和-多账户的明细合计
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Double getManyAccountSum(Long id,String timeStr, String type){
|
public Double getManyAccountSum(Long id, String timeStr, String type) {
|
||||||
Double accountSum = 0.0;
|
Double accountSum = 0.0;
|
||||||
try{
|
try {
|
||||||
PageUtil<DepotHead> pageUtil = new PageUtil<DepotHead>();
|
PageUtil<DepotHead> pageUtil = new PageUtil<DepotHead>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
pageUtil.setAdvSearch(getCondition_getManyAccountSum(id,timeStr,type));
|
pageUtil.setAdvSearch(getCondition_getManyAccountSum(id, timeStr, type));
|
||||||
depotHeadService.find(pageUtil);
|
depotHeadService.find(pageUtil);
|
||||||
List<DepotHead> dataList = pageUtil.getPageList();
|
List<DepotHead> dataList = pageUtil.getPageList();
|
||||||
if(dataList!= null){
|
if (dataList != null) {
|
||||||
for(DepotHead depotHead:dataList){
|
for (DepotHead depotHead : dataList) {
|
||||||
String accountIdList = depotHead.getAccountIdList();
|
String accountIdList = depotHead.getAccountIdList();
|
||||||
String accountMoneyList = depotHead.getAccountMoneyList();
|
String accountMoneyList = depotHead.getAccountMoneyList();
|
||||||
accountIdList = accountIdList.replace("[","").replace("]", "").replace("\"","");
|
accountIdList = accountIdList.replace("[", "").replace("]", "").replace("\"", "");
|
||||||
accountMoneyList = accountMoneyList.replace("[","").replace("]", "").replace("\"","");
|
accountMoneyList = accountMoneyList.replace("[", "").replace("]", "").replace("\"", "");
|
||||||
String[] aList = accountIdList.split(",");
|
String[] aList = accountIdList.split(",");
|
||||||
String[] amList = accountMoneyList.split(",");
|
String[] amList = accountMoneyList.split(",");
|
||||||
for(int i=0; i<aList.length; i++){
|
for (int i = 0; i < aList.length; i++) {
|
||||||
if(aList[i].toString().equals(id.toString())){
|
if (aList[i].toString().equals(id.toString())) {
|
||||||
accountSum = accountSum + Double.parseDouble(amList[i].toString());
|
accountSum = accountSum + Double.parseDouble(amList[i].toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e){
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
|
||||||
}
|
}
|
||||||
return accountSum;
|
return accountSum;
|
||||||
@@ -502,12 +447,11 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找结算账户信息-下拉框
|
* 查找结算账户信息-下拉框
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBySelect()
|
public void findBySelect() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Account> pageUtil = new PageUtil<Account>();
|
PageUtil<Account> pageUtil = new PageUtil<Account>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
@@ -516,10 +460,8 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
List<Account> dataList = pageUtil.getPageList();
|
List<Account> dataList = pageUtil.getPageList();
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Account account : dataList) {
|
||||||
for(Account account:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", account.getId());
|
item.put("Id", account.getId());
|
||||||
//结算账户名称
|
//结算账户名称
|
||||||
@@ -529,13 +471,9 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找结算账户信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找结算账户信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询结算账户信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询结算账户信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -543,21 +481,21 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
/**
|
/**
|
||||||
* 账户流水信息
|
* 账户流水信息
|
||||||
*/
|
*/
|
||||||
public void findAccountInOutList(){
|
public void findAccountInOutList() {
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
Long accountId = model.getAccountID();
|
Long accountId = model.getAccountID();
|
||||||
Double initialAmount = model.getInitialAmount();
|
Double initialAmount = model.getInitialAmount();
|
||||||
try{
|
try {
|
||||||
accountService.findAccountInOutList(pageUtil, accountId);
|
accountService.findAccountInOutList(pageUtil, accountId);
|
||||||
List dataList = pageUtil.getPageList();
|
List dataList = pageUtil.getPageList();
|
||||||
JSONObject outer = new JSONObject();
|
JSONObject outer = new JSONObject();
|
||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(dataList!=null){
|
if (dataList != null) {
|
||||||
for(Integer i=0; i<dataList.size(); i++){
|
for (Integer i = 0; i < dataList.size(); i++) {
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
Object dl = dataList.get(i); //获取对象
|
Object dl = dataList.get(i); //获取对象
|
||||||
Object[] arr = (Object[]) dl; //转为数组
|
Object[] arr = (Object[]) dl; //转为数组
|
||||||
@@ -578,25 +516,23 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (JshException e) {
|
||||||
catch (JshException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
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("name_s_like", model.getName());
|
||||||
condition.put("serialNo_s_like", model.getSerialNo());
|
condition.put("serialNo_s_like", model.getSerialNo());
|
||||||
condition.put("remark_s_like", model.getRemark());
|
condition.put("remark_s_like", model.getRemark());
|
||||||
@@ -606,36 +542,35 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-下拉框-结算账户
|
* 拼接搜索条件-下拉框-结算账户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_select()
|
private Map<String, Object> getCondition_select() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_getSum(Long id,String timeStr,String type)
|
private Map<String, Object> getCondition_getSum(Long id, String timeStr, String type) {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("AccountId_n_eq", id);
|
condition.put("AccountId_n_eq", id);
|
||||||
condition.put("PayType_s_neq", "预付款");
|
condition.put("PayType_s_neq", "预付款");
|
||||||
if(!timeStr.equals("")){
|
if (!timeStr.equals("")) {
|
||||||
if(type.equals("month")){
|
if (type.equals("month")) {
|
||||||
condition.put("OperTime_s_gteq", timeStr + "-01 00:00:00");
|
condition.put("OperTime_s_gteq", timeStr + "-01 00:00:00");
|
||||||
condition.put("OperTime_s_lteq", timeStr + "-31 00:00:00");
|
condition.put("OperTime_s_lteq", timeStr + "-31 00:00:00");
|
||||||
}
|
} else if (type.equals("date")) {
|
||||||
else if(type.equals("date")){
|
|
||||||
condition.put("OperTime_s_lteq", timeStr);
|
condition.put("OperTime_s_lteq", timeStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -644,21 +579,20 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_getManyAccountSum(Long id,String timeStr,String type)
|
private Map<String, Object> getCondition_getManyAccountSum(Long id, String timeStr, String type) {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("AccountIdList_s_like", "\"" + id.toString() + "\"");
|
condition.put("AccountIdList_s_like", "\"" + id.toString() + "\"");
|
||||||
if(!timeStr.equals("")){
|
if (!timeStr.equals("")) {
|
||||||
if(type.equals("month")){
|
if (type.equals("month")) {
|
||||||
condition.put("OperTime_s_gteq", timeStr + "-01 00:00:00");
|
condition.put("OperTime_s_gteq", timeStr + "-01 00:00:00");
|
||||||
condition.put("OperTime_s_lteq", timeStr + "-31 00:00:00");
|
condition.put("OperTime_s_lteq", timeStr + "-31 00:00:00");
|
||||||
}
|
} else if (type.equals("date")) {
|
||||||
else if(type.equals("date")){
|
|
||||||
condition.put("OperTime_s_lteq", timeStr);
|
condition.put("OperTime_s_lteq", timeStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -667,21 +601,20 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_getSumByHead(Long id,String timeStr, String type)
|
private Map<String, Object> getCondition_getSumByHead(Long id, String timeStr, String type) {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("AccountId_n_eq", id);
|
condition.put("AccountId_n_eq", id);
|
||||||
if(!timeStr.equals("")){
|
if (!timeStr.equals("")) {
|
||||||
if(type.equals("month")) {
|
if (type.equals("month")) {
|
||||||
condition.put("BillTime_s_gteq", timeStr + "-01 00:00:00");
|
condition.put("BillTime_s_gteq", timeStr + "-01 00:00:00");
|
||||||
condition.put("BillTime_s_lteq", timeStr + "-31 00:00:00");
|
condition.put("BillTime_s_lteq", timeStr + "-31 00:00:00");
|
||||||
}
|
} else if (type.equals("date")) {
|
||||||
else if(type.equals("date")) {
|
|
||||||
condition.put("BillTime_s_lteq", timeStr);
|
condition.put("BillTime_s_lteq", timeStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -690,20 +623,19 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_getSumByHead(String timeStr, String type)
|
private Map<String, Object> getCondition_getSumByHead(String timeStr, String type) {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
if(!timeStr.equals("")){
|
if (!timeStr.equals("")) {
|
||||||
if(type.equals("month")) {
|
if (type.equals("month")) {
|
||||||
condition.put("BillTime_s_gteq", timeStr + "-01 00:00:00");
|
condition.put("BillTime_s_gteq", timeStr + "-01 00:00:00");
|
||||||
condition.put("BillTime_s_lteq", timeStr + "-31 00:00:00");
|
condition.put("BillTime_s_lteq", timeStr + "-31 00:00:00");
|
||||||
}
|
} else if (type.equals("date")) {
|
||||||
else if(type.equals("date")) {
|
|
||||||
condition.put("BillTime_s_lteq", timeStr);
|
condition.put("BillTime_s_lteq", timeStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -712,16 +644,16 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_getSumByDetail(Long id, String ids)
|
private Map<String, Object> getCondition_getSumByDetail(Long id, String ids) {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("AccountId_n_eq", id);
|
condition.put("AccountId_n_eq", id);
|
||||||
if(!ids.equals("")){
|
if (!ids.equals("")) {
|
||||||
condition.put("HeaderId_s_in", ids);
|
condition.put("HeaderId_s_in", ids);
|
||||||
}
|
}
|
||||||
return condition;
|
return condition;
|
||||||
@@ -729,20 +661,22 @@ public class AccountAction extends BaseAction<AccountModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public AccountModel getModel()
|
public AccountModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setAccountService(AccountIService accountService)
|
|
||||||
{
|
public void setAccountService(AccountIService accountService) {
|
||||||
this.accountService = accountService;
|
this.accountService = accountService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDepotHeadService(DepotHeadIService depotHeadService) {
|
public void setDepotHeadService(DepotHeadIService depotHeadService) {
|
||||||
this.depotHeadService = depotHeadService;
|
this.depotHeadService = depotHeadService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAccountHeadService(AccountHeadIService accountHeadService) {
|
public void setAccountHeadService(AccountHeadIService accountHeadService) {
|
||||||
this.accountHeadService = accountHeadService;
|
this.accountHeadService = accountHeadService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAccountItemService(AccountItemIService accountItemService) {
|
public void setAccountItemService(AccountItemIService accountItemService) {
|
||||||
this.accountItemService = accountItemService;
|
this.accountItemService = accountItemService;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,31 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
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.apache.struts2.ServletActionContext;
|
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
import com.jsh.base.BaseAction;
|
import com.jsh.base.BaseAction;
|
||||||
import com.jsh.base.Log;
|
import com.jsh.base.Log;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.App;
|
import com.jsh.model.po.App;
|
||||||
import com.jsh.model.po.Logdetails;
|
import com.jsh.model.po.Logdetails;
|
||||||
import com.jsh.model.vo.basic.AppModel;
|
import com.jsh.model.vo.basic.AppModel;
|
||||||
import com.jsh.service.basic.AppIService;
|
import com.jsh.service.basic.AppIService;
|
||||||
import com.jsh.service.basic.UserBusinessIService;
|
import com.jsh.service.basic.UserBusinessIService;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
|
import net.sf.json.JSONArray;
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
import org.apache.struts2.ServletActionContext;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用
|
* 应用
|
||||||
|
*
|
||||||
* @author ji_sheng_hua qq752 718 920
|
* @author ji_sheng_hua qq752 718 920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class AppAction extends BaseAction<AppModel>
|
public class AppAction extends BaseAction<AppModel> {
|
||||||
{
|
|
||||||
private AppIService appService;
|
private AppIService appService;
|
||||||
private UserBusinessIService userBusinessService;
|
private UserBusinessIService userBusinessService;
|
||||||
private AppModel model = new AppModel();
|
private AppModel model = new AppModel();
|
||||||
@@ -38,13 +33,12 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
/**
|
/**
|
||||||
* 上传图片
|
* 上传图片
|
||||||
*/
|
*/
|
||||||
public void uploadImg()
|
public void uploadImg() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用上传图片方法uploadImg()===================");
|
Log.infoFileSync("==================开始调用上传图片方法uploadImg()===================");
|
||||||
File fileInfo = model.getFileInfo();
|
File fileInfo = model.getFileInfo();
|
||||||
String fileName = model.getFileInfoName(); //获取文件名
|
String fileName = model.getFileInfoName(); //获取文件名
|
||||||
try {
|
try {
|
||||||
if(fileInfo != null ){
|
if (fileInfo != null) {
|
||||||
String path = ServletActionContext.getServletContext().getRealPath("/upload/images/deskIcon");
|
String path = ServletActionContext.getServletContext().getRealPath("/upload/images/deskIcon");
|
||||||
InputStream is = new FileInputStream(fileInfo);
|
InputStream is = new FileInputStream(fileInfo);
|
||||||
File file = new File(path, fileName);
|
File file = new File(path, fileName);
|
||||||
@@ -57,12 +51,10 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
is.close();
|
is.close();
|
||||||
os.close();
|
os.close();
|
||||||
}
|
}
|
||||||
}
|
} catch (FileNotFoundException e) {
|
||||||
catch (FileNotFoundException e) {
|
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -71,14 +63,13 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加应用
|
* 增加应用
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加应用方法create()===================");
|
Log.infoFileSync("==================开始调用增加应用方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
App app = new App();
|
App app = new App();
|
||||||
app.setNumber(model.getNumber());
|
app.setNumber(model.getNumber());
|
||||||
app.setName(model.getName());
|
app.setName(model.getName());
|
||||||
@@ -101,47 +92,37 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加应用异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加应用异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加应用回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加应用回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加应用", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加应用", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加应用名称为 "+ model.getName() + " " + tipMsg + "!", "增加应用" + tipMsg));
|
, tipType, "增加应用名称为 " + model.getName() + " " + tipMsg + "!", "增加应用" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加应用方法create()===================");
|
Log.infoFileSync("==================结束调用增加应用方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除应用
|
* 删除应用
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除应用方法delete()================");
|
Log.infoFileSync("====================开始调用删除应用方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
appService.delete(model.getAppID());
|
appService.delete(model.getAppID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAppID() + " 的应用异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAppID() + " 的应用异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -149,20 +130,19 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除应用", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除应用", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除应用ID为 "+ model.getAppID() + " " + tipMsg + "!", "删除应用" + tipMsg));
|
, tipType, "删除应用ID为 " + model.getAppID() + " " + tipMsg + "!", "删除应用" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除应用方法delete()================");
|
Log.infoFileSync("====================结束调用删除应用方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新仓库
|
* 更新仓库
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
App app = appService.get(model.getAppID());
|
App app = appService.get(model.getAppID());
|
||||||
app.setNumber(model.getNumber());
|
app.setNumber(model.getNumber());
|
||||||
app.setName(model.getName());
|
app.setName(model.getName());
|
||||||
@@ -183,46 +163,36 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改应用ID为 : " + model.getAppID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改应用ID为 : " + model.getAppID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改应用回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改应用回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新应用", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新应用", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新应用ID为 "+ model.getAppID() + " " + tipMsg + "!", "更新应用" + tipMsg));
|
, tipType, "更新应用ID为 " + model.getAppID() + " " + tipMsg + "!", "更新应用" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID应用
|
* 批量删除指定ID应用
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
appService.batchDelete(model.getAppIDs());
|
appService.batchDelete(model.getAppIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除应用ID为:" + model.getAppIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除应用ID为:" + model.getAppIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -230,45 +200,35 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除应用", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除应用", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除应用ID为 "+ model.getAppIDs() + " " + tipMsg + "!", "批量删除应用" + tipMsg));
|
, tipType, "批量删除应用ID为 " + model.getAppIDs() + " " + tipMsg + "!", "批量删除应用" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = appService.checkIsNameExist("name", model.getName(), "Id", model.getAppID());
|
||||||
flag = appService.checkIsNameExist("name",model.getName(),"Id", model.getAppID());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查应用名称为:" + model.getName() + " ID为: " + model.getAppID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查应用名称为:" + model.getName() + " ID为: " + model.getAppID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查应用名称为:" + model.getName() + " ID为: " + model.getAppID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查应用名称为:" + model.getName() + " ID为: " + model.getAppID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找应用信息
|
* 查找应用信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<App> pageUtil = new PageUtil<App>();
|
PageUtil<App> pageUtil = new PageUtil<App>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -284,10 +244,8 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (App app : dataList) {
|
||||||
for(App app:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", app.getId());
|
item.put("Id", app.getId());
|
||||||
//应用名称
|
//应用名称
|
||||||
@@ -312,25 +270,20 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 桌面应用显示
|
* 桌面应用显示
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findDesk()
|
public void findDesk() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<App> pageUtil = new PageUtil<App>();
|
PageUtil<App> pageUtil = new PageUtil<App>();
|
||||||
pageUtil.setPageSize(100);
|
pageUtil.setPageSize(100);
|
||||||
//pageUtil.setCurPage(model.getPageNo());
|
//pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -345,15 +298,13 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
//开始拼接json数据
|
//开始拼接json数据
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray1 = new JSONArray();
|
JSONArray dataArray1 = new JSONArray();
|
||||||
if(null != dataList1)
|
if (null != dataList1) {
|
||||||
{
|
for (App app : dataList1) {
|
||||||
for(App app:dataList1)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", app.getId());
|
item.put("id", app.getId());
|
||||||
item.put("title", app.getName());
|
item.put("title", app.getName());
|
||||||
item.put("type", app.getType());
|
item.put("type", app.getType());
|
||||||
item.put("icon", "../../upload/images/deskIcon/"+app.getIcon());
|
item.put("icon", "../../upload/images/deskIcon/" + app.getIcon());
|
||||||
item.put("url", app.getURL());
|
item.put("url", app.getURL());
|
||||||
item.put("width", app.getWidth());
|
item.put("width", app.getWidth());
|
||||||
item.put("height", app.getHeight());
|
item.put("height", app.getHeight());
|
||||||
@@ -373,16 +324,14 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
//开始拼接json数据
|
//开始拼接json数据
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray2 = new JSONArray();
|
JSONArray dataArray2 = new JSONArray();
|
||||||
if(null != dataList2)
|
if (null != dataList2) {
|
||||||
{
|
for (App app : dataList2) {
|
||||||
for(App app:dataList2)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", app.getId());
|
item.put("id", app.getId());
|
||||||
item.put("title", app.getName());
|
item.put("title", app.getName());
|
||||||
item.put("type", app.getType());
|
item.put("type", app.getType());
|
||||||
item.put("icon", "../../upload/images/deskIcon/"+app.getIcon());
|
item.put("icon", "../../upload/images/deskIcon/" + app.getIcon());
|
||||||
item.put("url", "../../pages/common/menu.jsp?appID="+app.getNumber()+"&id="+app.getId());
|
item.put("url", "../../pages/common/menu.jsp?appID=" + app.getNumber() + "&id=" + app.getId());
|
||||||
item.put("width", app.getWidth());
|
item.put("width", app.getWidth());
|
||||||
item.put("height", app.getHeight());
|
item.put("height", app.getHeight());
|
||||||
item.put("isresize", app.getReSize());
|
item.put("isresize", app.getReSize());
|
||||||
@@ -394,13 +343,9 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
outer.put("desk", dataArray2);
|
outer.put("desk", dataArray2);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -408,12 +353,11 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色对应应用显示
|
* 角色对应应用显示
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findRoleAPP()
|
public void findRoleAPP() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<App> pageUtil = new PageUtil<App>();
|
PageUtil<App> pageUtil = new PageUtil<App>();
|
||||||
pageUtil.setPageSize(100);
|
pageUtil.setPageSize(100);
|
||||||
//pageUtil.setCurPage(model.getPageNo());
|
//pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -429,52 +373,45 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
outer.put("state", "open");
|
outer.put("state", "open");
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (App app : dataList) {
|
||||||
for(App app:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", app.getId());
|
item.put("id", app.getId());
|
||||||
item.put("text", app.getName());
|
item.put("text", app.getName());
|
||||||
//勾选判断1
|
//勾选判断1
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + app.getId().toString() + "]");
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+app.getId().toString()+"]");
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的应用:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的应用:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){item.put("checked", true);}
|
if (flag == true) {
|
||||||
|
item.put("checked", true);
|
||||||
|
}
|
||||||
//结束
|
//结束
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outer.put("children", dataArray);
|
outer.put("children", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient("["+outer.toString()+"]");
|
toClient("[" + outer.toString() + "]");
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
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("Name_s_like", model.getName());
|
||||||
condition.put("Type_s_like", model.getType());
|
condition.put("Type_s_like", model.getType());
|
||||||
condition.put("Sort_s_order", "asc");
|
condition.put("Sort_s_order", "asc");
|
||||||
@@ -483,14 +420,14 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-桌面dock
|
* 拼接搜索条件-桌面dock
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_dock()
|
private Map<String, Object> getCondition_dock() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("ZL_s_eq", "dock");
|
condition.put("ZL_s_eq", "dock");
|
||||||
condition.put("Enabled_n_eq", 1);
|
condition.put("Enabled_n_eq", 1);
|
||||||
condition.put("Sort_s_order", "asc");
|
condition.put("Sort_s_order", "asc");
|
||||||
@@ -499,14 +436,14 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-桌面desk
|
* 拼接搜索条件-桌面desk
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_desk()
|
private Map<String, Object> getCondition_desk() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("ZL_s_eq", "desk");
|
condition.put("ZL_s_eq", "desk");
|
||||||
condition.put("Enabled_n_eq", 1);
|
condition.put("Enabled_n_eq", 1);
|
||||||
condition.put("Sort_s_order", "asc");
|
condition.put("Sort_s_order", "asc");
|
||||||
@@ -515,14 +452,14 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-角色对应应用
|
* 拼接搜索条件-角色对应应用
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_RoleAPP()
|
private Map<String, Object> getCondition_RoleAPP() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("Enabled_n_eq", 1);
|
condition.put("Enabled_n_eq", 1);
|
||||||
condition.put("Sort_s_order", "asc");
|
condition.put("Sort_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
@@ -530,12 +467,11 @@ public class AppAction extends BaseAction<AppModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public AppModel getModel()
|
public AppModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setAppService(AppIService appService)
|
|
||||||
{
|
public void setAppService(AppIService appService) {
|
||||||
this.appService = appService;
|
this.appService = appService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
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.BaseAction;
|
||||||
import com.jsh.base.Log;
|
import com.jsh.base.Log;
|
||||||
import com.jsh.model.po.Assetname;
|
import com.jsh.model.po.Assetname;
|
||||||
@@ -16,29 +8,37 @@ import com.jsh.model.po.Logdetails;
|
|||||||
import com.jsh.model.vo.basic.AssetNameModel;
|
import com.jsh.model.vo.basic.AssetNameModel;
|
||||||
import com.jsh.service.basic.AssetNameIService;
|
import com.jsh.service.basic.AssetNameIService;
|
||||||
import com.jsh.util.PageUtil;
|
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;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class AssetNameAction extends BaseAction<AssetNameModel>
|
public class AssetNameAction extends BaseAction<AssetNameModel> {
|
||||||
{
|
|
||||||
private AssetNameModel model = new AssetNameModel();
|
private AssetNameModel model = new AssetNameModel();
|
||||||
|
|
||||||
private AssetNameIService assetnameService;
|
private AssetNameIService assetnameService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加资产名称
|
* 增加资产名称
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加资产名称方法create()===================");
|
Log.infoFileSync("==================开始调用增加资产名称方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Assetname assetname = new Assetname();
|
Assetname assetname = new Assetname();
|
||||||
assetname.setAssetname(model.getAssetName());
|
assetname.setAssetname(model.getAssetName());
|
||||||
//增加资产类型
|
//增加资产类型
|
||||||
assetname.setCategory(new Category(model.getCategoryID()));
|
assetname.setCategory(new Category(model.getCategoryID()));
|
||||||
|
|
||||||
assetname.setIsystem((short)1);
|
assetname.setIsystem((short) 1);
|
||||||
assetname.setIsconsumables(model.getConsumable());
|
assetname.setIsconsumables(model.getConsumable());
|
||||||
assetname.setDescription(model.getDescription());
|
assetname.setDescription(model.getDescription());
|
||||||
assetnameService.create(assetname);
|
assetnameService.create(assetname);
|
||||||
@@ -48,47 +48,37 @@ public class AssetNameAction extends BaseAction<AssetNameModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加资产名称异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加资产名称异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加资产名称回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加资产名称回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加资产名称", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加资产名称", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加资产名称名称为 "+ model.getAssetName() + " " + tipMsg + "!", "增加资产名称" + tipMsg));
|
, tipType, "增加资产名称名称为 " + model.getAssetName() + " " + tipMsg + "!", "增加资产名称" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加资产名称方法create()===================");
|
Log.infoFileSync("==================结束调用增加资产名称方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除资产名称
|
* 删除资产名称
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除资产名称信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除资产名称信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
assetnameService.delete(model.getAssetNameID());
|
assetnameService.delete(model.getAssetNameID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAssetNameID() + " 的资产名称异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAssetNameID() + " 的资产名称异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -96,20 +86,19 @@ public class AssetNameAction extends BaseAction<AssetNameModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除资产名称", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除资产名称", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除资产名称ID为 "+ model.getAssetNameID() + " " + tipMsg + "!", "删除资产名称" + tipMsg));
|
, tipType, "删除资产名称ID为 " + model.getAssetNameID() + " " + tipMsg + "!", "删除资产名称" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除资产名称信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除资产名称信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新资产名称
|
* 更新资产名称
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Assetname assetname = assetnameService.get(model.getAssetNameID());
|
Assetname assetname = assetnameService.get(model.getAssetNameID());
|
||||||
//增加资产类型
|
//增加资产类型
|
||||||
assetname.setCategory(new Category(model.getCategoryID()));
|
assetname.setCategory(new Category(model.getCategoryID()));
|
||||||
@@ -121,46 +110,36 @@ public class AssetNameAction extends BaseAction<AssetNameModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改资产名称ID为 : " + model.getAssetNameID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改资产名称ID为 : " + model.getAssetNameID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改资产名称回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改资产名称回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新资产名称", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新资产名称", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新资产名称ID为 "+ model.getAssetNameID() + " " + tipMsg + "!", "更新资产名称" + tipMsg));
|
, tipType, "更新资产名称ID为 " + model.getAssetNameID() + " " + tipMsg + "!", "更新资产名称" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID资产名称
|
* 批量删除指定ID资产名称
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
assetnameService.batchDelete(model.getAssetNameIDs());
|
assetnameService.batchDelete(model.getAssetNameIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除资产名称ID为:" + model.getAssetNameIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除资产名称ID为:" + model.getAssetNameIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -168,45 +147,35 @@ public class AssetNameAction extends BaseAction<AssetNameModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除资产名称", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除资产名称", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除资产名称ID为 "+ model.getAssetNameIDs() + " " + tipMsg + "!", "批量删除资产名称" + tipMsg));
|
, tipType, "批量删除资产名称ID为 " + model.getAssetNameIDs() + " " + tipMsg + "!", "批量删除资产名称" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = assetnameService.checkIsNameExist("assetname", model.getAssetName(), "id", model.getAssetNameID());
|
||||||
flag = assetnameService.checkIsNameExist("assetname",model.getAssetName(),"id", model.getAssetNameID());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查资产名称名称为:" + model.getAssetName() + " ID为: " + model.getAssetNameID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查资产名称名称为:" + model.getAssetName() + " ID为: " + model.getAssetNameID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查资产名称名称为:" + model.getAssetName() + " ID为: " + model.getAssetNameID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查资产名称名称为:" + model.getAssetName() + " ID为: " + model.getAssetNameID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找供应商信息
|
* 查找供应商信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Assetname> pageUtil = new PageUtil<Assetname>();
|
PageUtil<Assetname> pageUtil = new PageUtil<Assetname>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -222,16 +191,14 @@ public class AssetNameAction extends BaseAction<AssetNameModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Assetname assetname : dataList) {
|
||||||
for(Assetname assetname:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", assetname.getId());
|
item.put("id", assetname.getId());
|
||||||
//供应商名称
|
//供应商名称
|
||||||
item.put("assetname", assetname.getAssetname());
|
item.put("assetname", assetname.getAssetname());
|
||||||
item.put("isystem", assetname.getIsystem() == (short)0?"是":"否");
|
item.put("isystem", assetname.getIsystem() == (short) 0 ? "是" : "否");
|
||||||
item.put("consumable", assetname.getIsconsumables() == (short)0?"是":"否");
|
item.put("consumable", assetname.getIsconsumables() == (short) 0 ? "是" : "否");
|
||||||
item.put("consumableStatus", assetname.getIsconsumables());
|
item.put("consumableStatus", assetname.getIsconsumables());
|
||||||
item.put("description", assetname.getDescription());
|
item.put("description", assetname.getDescription());
|
||||||
item.put("categoryID", assetname.getCategory().getId());
|
item.put("categoryID", assetname.getCategory().getId());
|
||||||
@@ -243,27 +210,23 @@ public class AssetNameAction extends BaseAction<AssetNameModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找资产名称信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找资产名称信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询资产名称信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询资产名称信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("assetname_s_like", model.getAssetName());
|
condition.put("assetname_s_like", model.getAssetName());
|
||||||
condition.put("isconsumables_n_eq", model.getConsumable());
|
condition.put("isconsumables_n_eq", model.getConsumable());
|
||||||
condition.put("description_s_like", model.getDescription());
|
condition.put("description_s_like", model.getDescription());
|
||||||
@@ -274,13 +237,11 @@ public class AssetNameAction extends BaseAction<AssetNameModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public AssetNameModel getModel()
|
public AssetNameModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAssetnameService(AssetNameIService assetnameService)
|
public void setAssetnameService(AssetNameIService assetnameService) {
|
||||||
{
|
|
||||||
this.assetnameService = assetnameService;
|
this.assetnameService = assetnameService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
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.BaseAction;
|
||||||
import com.jsh.base.Log;
|
import com.jsh.base.Log;
|
||||||
import com.jsh.model.po.Category;
|
import com.jsh.model.po.Category;
|
||||||
@@ -15,27 +7,36 @@ import com.jsh.model.po.Logdetails;
|
|||||||
import com.jsh.model.vo.basic.CategoryModel;
|
import com.jsh.model.vo.basic.CategoryModel;
|
||||||
import com.jsh.service.basic.CategoryIService;
|
import com.jsh.service.basic.CategoryIService;
|
||||||
import com.jsh.util.PageUtil;
|
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:7-5-2-7-1-8-9-2-0
|
* @author jishenghua qq:7-5-2-7-1-8-9-2-0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class CategoryAction extends BaseAction<CategoryModel>
|
public class CategoryAction extends BaseAction<CategoryModel> {
|
||||||
{
|
|
||||||
private CategoryIService categoryService;
|
private CategoryIService categoryService;
|
||||||
private CategoryModel model = new CategoryModel();
|
private CategoryModel model = new CategoryModel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加资产类型
|
* 增加资产类型
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加资产类型方法create()===================");
|
Log.infoFileSync("==================开始调用增加资产类型方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Category category = new Category();
|
Category category = new Category();
|
||||||
category.setAssetname(model.getCategoryName());
|
category.setAssetname(model.getCategoryName());
|
||||||
category.setIsystem((short)1);
|
category.setIsystem((short) 1);
|
||||||
category.setDescription(model.getDescription());
|
category.setDescription(model.getDescription());
|
||||||
categoryService.create(category);
|
categoryService.create(category);
|
||||||
|
|
||||||
@@ -44,47 +45,37 @@ public class CategoryAction extends BaseAction<CategoryModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加资产类型异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加资产类型异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加资产类型回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加资产类型回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加资产类型", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加资产类型", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加资产类型名称为 "+ model.getCategoryName() + " " + tipMsg + "!", "增加资产类型" + tipMsg));
|
, tipType, "增加资产类型名称为 " + model.getCategoryName() + " " + tipMsg + "!", "增加资产类型" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加资产类型方法create()===================");
|
Log.infoFileSync("==================结束调用增加资产类型方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除资产类型
|
* 删除资产类型
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除资产类型信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除资产类型信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
categoryService.delete(model.getCategoryID());
|
categoryService.delete(model.getCategoryID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getCategoryID() + " 的资产类型异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getCategoryID() + " 的资产类型异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -92,20 +83,19 @@ public class CategoryAction extends BaseAction<CategoryModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除资产类型", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除资产类型", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除资产类型ID为 "+ model.getCategoryID() + " " + tipMsg + "!", "删除资产类型" + tipMsg));
|
, tipType, "删除资产类型ID为 " + model.getCategoryID() + " " + tipMsg + "!", "删除资产类型" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除资产类型信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除资产类型信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新资产类型
|
* 更新资产类型
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Category category = categoryService.get(model.getCategoryID());
|
Category category = categoryService.get(model.getCategoryID());
|
||||||
category.setAssetname(model.getCategoryName());
|
category.setAssetname(model.getCategoryName());
|
||||||
category.setDescription(model.getDescription());
|
category.setDescription(model.getDescription());
|
||||||
@@ -114,46 +104,36 @@ public class CategoryAction extends BaseAction<CategoryModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改资产类型ID为 : " + model.getCategoryID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改资产类型ID为 : " + model.getCategoryID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改资产类型回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改资产类型回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新资产类型", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新资产类型", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新资产类型ID为 "+ model.getCategoryID() + " " + tipMsg + "!", "更新资产类型" + tipMsg));
|
, tipType, "更新资产类型ID为 " + model.getCategoryID() + " " + tipMsg + "!", "更新资产类型" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID资产类型
|
* 批量删除指定ID资产类型
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
categoryService.batchDelete(model.getCategoryIDs());
|
categoryService.batchDelete(model.getCategoryIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除资产类型ID为:" + model.getCategoryIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除资产类型ID为:" + model.getCategoryIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -161,45 +141,35 @@ public class CategoryAction extends BaseAction<CategoryModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除资产类型", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除资产类型", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除资产类型ID为 "+ model.getCategoryIDs() + " " + tipMsg + "!", "批量删除资产类型" + tipMsg));
|
, tipType, "批量删除资产类型ID为 " + model.getCategoryIDs() + " " + tipMsg + "!", "批量删除资产类型" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = categoryService.checkIsNameExist("assetname", model.getCategoryName(), "id", model.getCategoryID());
|
||||||
flag = categoryService.checkIsNameExist("assetname",model.getCategoryName(),"id", model.getCategoryID());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查资产类型名称为:" + model.getCategoryName() + " ID为: " + model.getCategoryID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查资产类型名称为:" + model.getCategoryName() + " ID为: " + model.getCategoryID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查资产类型名称为:" + model.getCategoryName() + " ID为: " + model.getCategoryID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查资产类型名称为:" + model.getCategoryName() + " ID为: " + model.getCategoryID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找供应商信息
|
* 查找供应商信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Category> pageUtil = new PageUtil<Category>();
|
PageUtil<Category> pageUtil = new PageUtil<Category>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -215,15 +185,13 @@ public class CategoryAction extends BaseAction<CategoryModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Category category : dataList) {
|
||||||
for(Category category:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", category.getId());
|
item.put("id", category.getId());
|
||||||
//供应商名称
|
//供应商名称
|
||||||
item.put("categoryname", category.getAssetname());
|
item.put("categoryname", category.getAssetname());
|
||||||
item.put("isystem", category.getIsystem() == (short)0?"是":"否");
|
item.put("isystem", category.getIsystem() == (short) 0 ? "是" : "否");
|
||||||
item.put("description", category.getDescription());
|
item.put("description", category.getDescription());
|
||||||
item.put("op", category.getIsystem());
|
item.put("op", category.getIsystem());
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
@@ -232,27 +200,23 @@ public class CategoryAction extends BaseAction<CategoryModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找资产类型信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找资产类型信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询资产类型信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询资产类型信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("assetname_s_like", model.getCategoryName());
|
condition.put("assetname_s_like", model.getCategoryName());
|
||||||
condition.put("description_s_like", model.getDescription());
|
condition.put("description_s_like", model.getDescription());
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
@@ -261,12 +225,11 @@ public class CategoryAction extends BaseAction<CategoryModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public CategoryModel getModel()
|
public CategoryModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setCategoryService(CategoryIService categoryService)
|
|
||||||
{
|
public void setCategoryService(CategoryIService categoryService) {
|
||||||
this.categoryService = categoryService;
|
this.categoryService = categoryService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,51 +1,47 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
import com.jsh.model.po.Depot;
|
||||||
|
import com.jsh.model.po.Logdetails;
|
||||||
|
import com.jsh.model.vo.basic.DepotModel;
|
||||||
|
import com.jsh.service.basic.DepotIService;
|
||||||
|
import com.jsh.service.basic.UserBusinessIService;
|
||||||
|
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.io.IOException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.util.JshException;
|
|
||||||
import com.jsh.model.po.Depot;
|
|
||||||
import com.jsh.model.po.Logdetails;
|
|
||||||
import com.jsh.model.po.Role;
|
|
||||||
import com.jsh.model.vo.basic.DepotModel;
|
|
||||||
import com.jsh.service.basic.DepotIService;
|
|
||||||
import com.jsh.service.basic.UserBusinessIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
/**
|
/**
|
||||||
* 仓库管理
|
* 仓库管理
|
||||||
|
*
|
||||||
* @author jishenghua qq:7-5-2-7-1-8-9-2-0
|
* @author jishenghua qq:7-5-2-7-1-8-9-2-0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class DepotAction extends BaseAction<DepotModel>
|
public class DepotAction extends BaseAction<DepotModel> {
|
||||||
{
|
|
||||||
private DepotIService depotService;
|
private DepotIService depotService;
|
||||||
private UserBusinessIService userBusinessService;
|
private UserBusinessIService userBusinessService;
|
||||||
private DepotModel model = new DepotModel();
|
private DepotModel model = new DepotModel();
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getBasicData()
|
public String getBasicData() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
|
||||||
condition.put("sort_s_order", "asc");
|
condition.put("sort_s_order", "asc");
|
||||||
depotService.find(pageUtil);
|
depotService.find(pageUtil);
|
||||||
mapData.put("depotList", pageUtil.getPageList());
|
mapData.put("depotList", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exceptoin");
|
model.getShowModel().setMsgTip("exceptoin");
|
||||||
}
|
}
|
||||||
@@ -54,14 +50,13 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加仓库
|
* 增加仓库
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加仓库信息方法create()===================");
|
Log.infoFileSync("==================开始调用增加仓库信息方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Depot depot = new Depot();
|
Depot depot = new Depot();
|
||||||
depot.setName(model.getName());
|
depot.setName(model.getName());
|
||||||
depot.setAddress(model.getAddress());
|
depot.setAddress(model.getAddress());
|
||||||
@@ -77,47 +72,37 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加仓库信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加仓库信息异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加仓库信息回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加仓库信息回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加仓库", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加仓库", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加仓库名称为 "+ model.getName() + " " + tipMsg + "!", "增加仓库" + tipMsg));
|
, tipType, "增加仓库名称为 " + model.getName() + " " + tipMsg + "!", "增加仓库" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加仓库方法create()===================");
|
Log.infoFileSync("==================结束调用增加仓库方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除仓库
|
* 删除仓库
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除仓库信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除仓库信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
depotService.delete(model.getDepotID());
|
depotService.delete(model.getDepotID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getDepotID() + " 的仓库异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getDepotID() + " 的仓库异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -125,20 +110,19 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除仓库", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除仓库", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除仓库ID为 "+ model.getDepotID() + " " + tipMsg + "!", "删除仓库" + tipMsg));
|
, tipType, "删除仓库ID为 " + model.getDepotID() + " " + tipMsg + "!", "删除仓库" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除仓库信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除仓库信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新仓库
|
* 更新仓库
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Depot depot = depotService.get(model.getDepotID());
|
Depot depot = depotService.get(model.getDepotID());
|
||||||
depot.setName(model.getName());
|
depot.setName(model.getName());
|
||||||
depot.setAddress(model.getAddress());
|
depot.setAddress(model.getAddress());
|
||||||
@@ -152,46 +136,36 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改仓库ID为 : " + model.getDepotID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改仓库ID为 : " + model.getDepotID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改仓库回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改仓库回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新仓库", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新仓库", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新仓库ID为 "+ model.getDepotID() + " " + tipMsg + "!", "更新仓库" + tipMsg));
|
, tipType, "更新仓库ID为 " + model.getDepotID() + " " + tipMsg + "!", "更新仓库" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID仓库
|
* 批量删除指定ID仓库
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
depotService.batchDelete(model.getDepotIDs());
|
depotService.batchDelete(model.getDepotIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除仓库ID为:" + model.getDepotIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除仓库ID为:" + model.getDepotIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -199,45 +173,35 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除仓库", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除仓库", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除仓库ID为 "+ model.getDepotIDs() + " " + tipMsg + "!", "批量删除仓库" + tipMsg));
|
, tipType, "批量删除仓库ID为 " + model.getDepotIDs() + " " + tipMsg + "!", "批量删除仓库" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = depotService.checkIsNameExist("name", model.getName(), "id", model.getDepotID());
|
||||||
flag = depotService.checkIsNameExist("name",model.getName(),"id", model.getDepotID());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查仓库名称为:" + model.getName() + " ID为: " + model.getDepotID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查仓库名称为:" + model.getName() + " ID为: " + model.getDepotID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查仓库名称为:" + model.getName() + " ID为: " + model.getDepotID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查仓库名称为:" + model.getName() + " ID为: " + model.getDepotID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找仓库信息
|
* 查找仓库信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Depot> pageUtil = new PageUtil<Depot>();
|
PageUtil<Depot> pageUtil = new PageUtil<Depot>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -249,10 +213,8 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Depot depot : dataList) {
|
||||||
for(Depot depot:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", depot.getId());
|
item.put("id", depot.getId());
|
||||||
//供应商名称
|
//供应商名称
|
||||||
@@ -270,25 +232,20 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓库信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓库信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓库信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓库信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找礼品卡-虚拟仓库
|
* 查找礼品卡-虚拟仓库
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findGiftByType()
|
public void findGiftByType() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Depot> pageUtil = new PageUtil<Depot>();
|
PageUtil<Depot> pageUtil = new PageUtil<Depot>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
@@ -297,10 +254,8 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
List<Depot> dataList = pageUtil.getPageList();
|
List<Depot> dataList = pageUtil.getPageList();
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Depot depot : dataList) {
|
||||||
for(Depot depot:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", depot.getId());
|
item.put("id", depot.getId());
|
||||||
//仓库名称
|
//仓库名称
|
||||||
@@ -310,25 +265,20 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找仓库信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找仓库信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询仓库信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询仓库信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户对应仓库显示
|
* 用户对应仓库显示
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findUserDepot()
|
public void findUserDepot() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Depot> pageUtil = new PageUtil<Depot>();
|
PageUtil<Depot> pageUtil = new PageUtil<Depot>();
|
||||||
pageUtil.setPageSize(100);
|
pageUtil.setPageSize(100);
|
||||||
//pageUtil.setCurPage(model.getPageNo());
|
//pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -344,48 +294,42 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
outer.put("state", "open");
|
outer.put("state", "open");
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Depot depot : dataList) {
|
||||||
for(Depot depot:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", depot.getId());
|
item.put("id", depot.getId());
|
||||||
item.put("text", depot.getName());
|
item.put("text", depot.getName());
|
||||||
//勾选判断1
|
//勾选判断1
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + depot.getId().toString() + "]");
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+depot.getId().toString()+"]");
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的仓库:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的仓库:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){item.put("checked", true);}
|
if (flag == true) {
|
||||||
|
item.put("checked", true);
|
||||||
|
}
|
||||||
//结束
|
//结束
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outer.put("children", dataArray);
|
outer.put("children", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient("["+outer.toString()+"]");
|
toClient("[" + outer.toString() + "]");
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓库异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓库异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓库结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓库结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户查找对应仓库列表-仅显示有权限的
|
* 根据用户查找对应仓库列表-仅显示有权限的
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findDepotByUserId(){
|
public void findDepotByUserId() {
|
||||||
try{
|
try {
|
||||||
PageUtil<Depot> pageUtil = new PageUtil<Depot>();
|
PageUtil<Depot> pageUtil = new PageUtil<Depot>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
@@ -395,22 +339,17 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
|
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Depot depot : dataList) {
|
||||||
for(Depot depot:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
//勾选判断1
|
//勾选判断1
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + depot.getId().toString() + "]");
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+depot.getId().toString()+"]");
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>查询用户对应的仓库:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>查询用户对应的仓库:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){
|
if (flag == true) {
|
||||||
item.put("id", depot.getId());
|
item.put("id", depot.getId());
|
||||||
item.put("depotName", depot.getName());
|
item.put("depotName", depot.getName());
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
@@ -419,27 +358,23 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓库异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓库异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓库结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓库结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
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("name_s_like", model.getName());
|
||||||
condition.put("remark_s_like", model.getRemark());
|
condition.put("remark_s_like", model.getRemark());
|
||||||
condition.put("type_n_eq", model.getType()); //0-仓库,1-礼品卡
|
condition.put("type_n_eq", model.getType()); //0-仓库,1-礼品卡
|
||||||
@@ -449,14 +384,14 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getConditionByType()
|
private Map<String, Object> getConditionByType() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("type_n_eq", model.getType()); //0-仓库,1-礼品卡
|
condition.put("type_n_eq", model.getType()); //0-仓库,1-礼品卡
|
||||||
condition.put("sort_s_order", "asc");
|
condition.put("sort_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
@@ -464,14 +399,14 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-用户对应仓库
|
* 拼接搜索条件-用户对应仓库
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_UserDepot()
|
private Map<String, Object> getCondition_UserDepot() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("type_n_eq", 0);
|
condition.put("type_n_eq", 0);
|
||||||
condition.put("sort_s_order", "asc");
|
condition.put("sort_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
@@ -479,12 +414,11 @@ public class DepotAction extends BaseAction<DepotModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public DepotModel getModel()
|
public DepotModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setDepotService(DepotIService depotService)
|
|
||||||
{
|
public void setDepotService(DepotIService depotService) {
|
||||||
this.depotService = depotService;
|
this.depotService = depotService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +1,42 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
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.BaseAction;
|
||||||
import com.jsh.base.Log;
|
import com.jsh.base.Log;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.App;
|
|
||||||
import com.jsh.model.po.Functions;
|
import com.jsh.model.po.Functions;
|
||||||
import com.jsh.model.po.Logdetails;
|
import com.jsh.model.po.Logdetails;
|
||||||
import com.jsh.model.vo.basic.FunctionsModel;
|
import com.jsh.model.vo.basic.FunctionsModel;
|
||||||
import com.jsh.service.basic.FunctionsIService;
|
import com.jsh.service.basic.FunctionsIService;
|
||||||
import com.jsh.service.basic.UserBusinessIService;
|
import com.jsh.service.basic.UserBusinessIService;
|
||||||
import com.jsh.util.PageUtil;
|
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:7-5-2-7-1-8-9-2-0
|
* @author jishenghua qq:7-5-2-7-1-8-9-2-0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class FunctionsAction extends BaseAction<FunctionsModel>
|
public class FunctionsAction extends BaseAction<FunctionsModel> {
|
||||||
{
|
|
||||||
private FunctionsIService functionsService;
|
private FunctionsIService functionsService;
|
||||||
private UserBusinessIService userBusinessService;
|
private UserBusinessIService userBusinessService;
|
||||||
private FunctionsModel model = new FunctionsModel();
|
private FunctionsModel model = new FunctionsModel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加功能
|
* 增加功能
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加功能信息方法create()===================");
|
Log.infoFileSync("==================开始调用增加功能信息方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Functions functions = new Functions();
|
Functions functions = new Functions();
|
||||||
functions.setNumber(model.getNumber());
|
functions.setNumber(model.getNumber());
|
||||||
functions.setName(model.getName());
|
functions.setName(model.getName());
|
||||||
@@ -55,47 +54,37 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加功能信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加功能信息异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加功能信息回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加功能信息回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加功能", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加功能", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加功能名称为 "+ model.getName() + " " + tipMsg + "!", "增加功能" + tipMsg));
|
, tipType, "增加功能名称为 " + model.getName() + " " + tipMsg + "!", "增加功能" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加功能方法create()===================");
|
Log.infoFileSync("==================结束调用增加功能方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除功能
|
* 删除功能
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除功能信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除功能信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
functionsService.delete(model.getFunctionsID());
|
functionsService.delete(model.getFunctionsID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getFunctionsID() + " 的功能异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getFunctionsID() + " 的功能异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -103,20 +92,19 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除功能", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除功能", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除功能ID为 "+ model.getFunctionsID() + " " + tipMsg + "!", "删除功能" + tipMsg));
|
, tipType, "删除功能ID为 " + model.getFunctionsID() + " " + tipMsg + "!", "删除功能" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除功能信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除功能信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新功能
|
* 更新功能
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Functions functions = functionsService.get(model.getFunctionsID());
|
Functions functions = functionsService.get(model.getFunctionsID());
|
||||||
functions.setNumber(model.getNumber());
|
functions.setNumber(model.getNumber());
|
||||||
functions.setName(model.getName());
|
functions.setName(model.getName());
|
||||||
@@ -132,46 +120,36 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改功能ID为 : " + model.getFunctionsID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改功能ID为 : " + model.getFunctionsID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改功能回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改功能回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新功能", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新功能", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新功能ID为 "+ model.getFunctionsID() + " " + tipMsg + "!", "更新功能" + tipMsg));
|
, tipType, "更新功能ID为 " + model.getFunctionsID() + " " + tipMsg + "!", "更新功能" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID功能
|
* 批量删除指定ID功能
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
functionsService.batchDelete(model.getFunctionsIDs());
|
functionsService.batchDelete(model.getFunctionsIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除功能ID为:" + model.getFunctionsIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除功能ID为:" + model.getFunctionsIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -179,45 +157,35 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除功能", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除功能", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除功能ID为 "+ model.getFunctionsIDs() + " " + tipMsg + "!", "批量删除功能" + tipMsg));
|
, tipType, "批量删除功能ID为 " + model.getFunctionsIDs() + " " + tipMsg + "!", "批量删除功能" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = functionsService.checkIsNameExist("Name", model.getName(), "Id", model.getFunctionsID());
|
||||||
flag = functionsService.checkIsNameExist("Name",model.getName(),"Id", model.getFunctionsID());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查功能名称为:" + model.getName() + " ID为: " + model.getFunctionsID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查功能名称为:" + model.getName() + " ID为: " + model.getFunctionsID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查功能名称为:" + model.getName() + " ID为: " + model.getFunctionsID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查功能名称为:" + model.getName() + " ID为: " + model.getFunctionsID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找功能信息
|
* 查找功能信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Functions> pageUtil = new PageUtil<Functions>();
|
PageUtil<Functions> pageUtil = new PageUtil<Functions>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -233,10 +201,8 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Functions functions : dataList) {
|
||||||
for(Functions functions:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", functions.getId());
|
item.put("Id", functions.getId());
|
||||||
item.put("Number", functions.getNumber());
|
item.put("Number", functions.getNumber());
|
||||||
@@ -255,23 +221,19 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找功能信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找功能信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询功能信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询功能信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id列表查找功能信息
|
* 根据id列表查找功能信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findByIds()
|
public void findByIds() {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
PageUtil<Functions> pageUtil = new PageUtil<Functions>();
|
PageUtil<Functions> pageUtil = new PageUtil<Functions>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
@@ -283,10 +245,8 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Functions functions : dataList) {
|
||||||
for(Functions functions:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", functions.getId());
|
item.put("Id", functions.getId());
|
||||||
item.put("Name", functions.getName());
|
item.put("Name", functions.getName());
|
||||||
@@ -298,13 +258,9 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找功能信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找功能信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询功能信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询功能信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -312,12 +268,11 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色对应功能显示
|
* 角色对应功能显示
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findRoleFunctions()
|
public void findRoleFunctions() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Functions> pageUtil = new PageUtil<Functions>();
|
PageUtil<Functions> pageUtil = new PageUtil<Functions>();
|
||||||
pageUtil.setPageSize(200);
|
pageUtil.setPageSize(200);
|
||||||
pageUtil.setAdvSearch(getCondition_RoleFunctions("0"));
|
pageUtil.setAdvSearch(getCondition_RoleFunctions("0"));
|
||||||
@@ -331,36 +286,31 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
outer.put("state", "open");
|
outer.put("state", "open");
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Functions functions : dataList) {
|
||||||
for(Functions functions:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", functions.getId());
|
item.put("id", functions.getId());
|
||||||
item.put("text", functions.getName());
|
item.put("text", functions.getName());
|
||||||
|
|
||||||
//勾选判断1
|
//勾选判断1
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + functions.getId().toString() + "]");
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions.getId().toString()+"]");
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){item.put("checked", true);}
|
if (flag == true) {
|
||||||
|
item.put("checked", true);
|
||||||
|
}
|
||||||
//结束
|
//结束
|
||||||
|
|
||||||
pageUtil.setAdvSearch(getCondition_RoleFunctions(functions.getNumber()));
|
pageUtil.setAdvSearch(getCondition_RoleFunctions(functions.getNumber()));
|
||||||
functionsService.find(pageUtil);
|
functionsService.find(pageUtil);
|
||||||
List<Functions> dataList1 = pageUtil.getPageList();
|
List<Functions> dataList1 = pageUtil.getPageList();
|
||||||
JSONArray dataArray1 = new JSONArray();
|
JSONArray dataArray1 = new JSONArray();
|
||||||
if(null != dataList1)
|
if (null != dataList1) {
|
||||||
{
|
|
||||||
|
|
||||||
for(Functions functions1:dataList1)
|
for (Functions functions1 : dataList1) {
|
||||||
{
|
|
||||||
item.put("state", "open"); //如果不为空,节点不展开
|
item.put("state", "open"); //如果不为空,节点不展开
|
||||||
JSONObject item1 = new JSONObject();
|
JSONObject item1 = new JSONObject();
|
||||||
item1.put("id", functions1.getId());
|
item1.put("id", functions1.getId());
|
||||||
@@ -368,26 +318,23 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
//勾选判断2
|
//勾选判断2
|
||||||
//Boolean flag = false;
|
//Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + functions1.getId().toString() + "]");
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions1.getId().toString()+"]");
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){item1.put("checked", true);}
|
if (flag == true) {
|
||||||
|
item1.put("checked", true);
|
||||||
|
}
|
||||||
//结束
|
//结束
|
||||||
|
|
||||||
pageUtil.setAdvSearch(getCondition_RoleFunctions(functions1.getNumber()));
|
pageUtil.setAdvSearch(getCondition_RoleFunctions(functions1.getNumber()));
|
||||||
functionsService.find(pageUtil);
|
functionsService.find(pageUtil);
|
||||||
List<Functions> dataList2 = pageUtil.getPageList();
|
List<Functions> dataList2 = pageUtil.getPageList();
|
||||||
JSONArray dataArray2 = new JSONArray();
|
JSONArray dataArray2 = new JSONArray();
|
||||||
if(null != dataList2)
|
if (null != dataList2) {
|
||||||
{
|
|
||||||
|
|
||||||
for(Functions functions2:dataList2)
|
for (Functions functions2 : dataList2) {
|
||||||
{
|
|
||||||
item1.put("state", "closed"); //如果不为空,节点不展开
|
item1.put("state", "closed"); //如果不为空,节点不展开
|
||||||
JSONObject item2 = new JSONObject();
|
JSONObject item2 = new JSONObject();
|
||||||
item2.put("id", functions2.getId());
|
item2.put("id", functions2.getId());
|
||||||
@@ -395,26 +342,23 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
//勾选判断3
|
//勾选判断3
|
||||||
//Boolean flag = false;
|
//Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + functions2.getId().toString() + "]");
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions2.getId().toString()+"]");
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){item2.put("checked", true);}
|
if (flag == true) {
|
||||||
|
item2.put("checked", true);
|
||||||
|
}
|
||||||
//结束
|
//结束
|
||||||
|
|
||||||
pageUtil.setAdvSearch(getCondition_RoleFunctions(functions2.getNumber()));
|
pageUtil.setAdvSearch(getCondition_RoleFunctions(functions2.getNumber()));
|
||||||
functionsService.find(pageUtil);
|
functionsService.find(pageUtil);
|
||||||
List<Functions> dataList3 = pageUtil.getPageList();
|
List<Functions> dataList3 = pageUtil.getPageList();
|
||||||
JSONArray dataArray3 = new JSONArray();
|
JSONArray dataArray3 = new JSONArray();
|
||||||
if(null != dataList3)
|
if (null != dataList3) {
|
||||||
{
|
|
||||||
|
|
||||||
for(Functions functions3:dataList3)
|
for (Functions functions3 : dataList3) {
|
||||||
{
|
|
||||||
item2.put("state", "closed"); //如果不为空,节点不展开
|
item2.put("state", "closed"); //如果不为空,节点不展开
|
||||||
JSONObject item3 = new JSONObject();
|
JSONObject item3 = new JSONObject();
|
||||||
item3.put("id", functions3.getId());
|
item3.put("id", functions3.getId());
|
||||||
@@ -422,15 +366,14 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
//勾选判断4
|
//勾选判断4
|
||||||
//Boolean flag = false;
|
//Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + functions3.getId().toString() + "]");
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions3.getId().toString()+"]");
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){item3.put("checked", true);}
|
if (flag == true) {
|
||||||
|
item3.put("checked", true);
|
||||||
|
}
|
||||||
//结束
|
//结束
|
||||||
|
|
||||||
dataArray3.add(item3);
|
dataArray3.add(item3);
|
||||||
@@ -454,14 +397,10 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
outer.put("children", dataArray);
|
outer.put("children", dataArray);
|
||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient("["+outer.toString()+"]");
|
toClient("[" + outer.toString() + "]");
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -469,6 +408,7 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面显示菜单
|
* 页面显示菜单
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findMenu() {
|
public void findMenu() {
|
||||||
@@ -566,14 +506,14 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
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("Name_s_like", model.getName());
|
||||||
condition.put("Type_s_eq", model.getType());
|
condition.put("Type_s_eq", model.getType());
|
||||||
condition.put("Sort_s_order", "asc");
|
condition.put("Sort_s_order", "asc");
|
||||||
@@ -582,14 +522,14 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-角色对应功能
|
* 拼接搜索条件-角色对应功能
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_RoleFunctions(String num)
|
private Map<String, Object> getCondition_RoleFunctions(String num) {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("Enabled_n_eq", 1);
|
condition.put("Enabled_n_eq", 1);
|
||||||
condition.put("PNumber_s_eq", num);
|
condition.put("PNumber_s_eq", num);
|
||||||
condition.put("Sort_s_order", "asc");
|
condition.put("Sort_s_order", "asc");
|
||||||
@@ -598,10 +538,11 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-角色对应功能
|
* 拼接搜索条件-角色对应功能
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getConditionByIds() {
|
private Map<String, Object> getConditionByIds() {
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("Enabled_n_eq", 1);
|
condition.put("Enabled_n_eq", 1);
|
||||||
condition.put("Id_s_in", model.getFunctionsIDs());
|
condition.put("Id_s_in", model.getFunctionsIDs());
|
||||||
condition.put("Sort_s_order", "asc");
|
condition.put("Sort_s_order", "asc");
|
||||||
@@ -610,12 +551,11 @@ public class FunctionsAction extends BaseAction<FunctionsModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public FunctionsModel getModel()
|
public FunctionsModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setFunctionsService(FunctionsIService functionsService)
|
|
||||||
{
|
public void setFunctionsService(FunctionsIService functionsService) {
|
||||||
this.functionsService = functionsService;
|
this.functionsService = functionsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,40 +1,41 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
import com.jsh.model.po.InOutItem;
|
||||||
|
import com.jsh.model.po.Logdetails;
|
||||||
|
import com.jsh.model.vo.basic.InOutItemModel;
|
||||||
|
import com.jsh.service.basic.InOutItemIService;
|
||||||
|
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.io.IOException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.Logdetails;
|
|
||||||
import com.jsh.model.po.InOutItem;
|
|
||||||
import com.jsh.model.vo.basic.InOutItemModel;
|
|
||||||
import com.jsh.service.basic.InOutItemIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
/**
|
/**
|
||||||
* 收支项目
|
* 收支项目
|
||||||
|
*
|
||||||
* @author ji*sheng*hua qq 7.5.2.7.1.8.9.2.0
|
* @author ji*sheng*hua qq 7.5.2.7.1.8.9.2.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class InOutItemAction extends BaseAction<InOutItemModel>
|
public class InOutItemAction extends BaseAction<InOutItemModel> {
|
||||||
{
|
|
||||||
private InOutItemIService inOutItemService;
|
private InOutItemIService inOutItemService;
|
||||||
private InOutItemModel model = new InOutItemModel();
|
private InOutItemModel model = new InOutItemModel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加收支项目
|
* 增加收支项目
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加收支项目方法===================");
|
Log.infoFileSync("==================开始调用增加收支项目方法===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
InOutItem inOutItem = new InOutItem();
|
InOutItem inOutItem = new InOutItem();
|
||||||
inOutItem.setName(model.getName());
|
inOutItem.setName(model.getName());
|
||||||
inOutItem.setType(model.getType());
|
inOutItem.setType(model.getType());
|
||||||
@@ -46,47 +47,37 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加收支项目异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加收支项目异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加收支项目回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加收支项目回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加收支项目", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加收支项目", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加收支项目名称为 "+ model.getName() + " " + tipMsg + "!", "增加收支项目" + tipMsg));
|
, tipType, "增加收支项目名称为 " + model.getName() + " " + tipMsg + "!", "增加收支项目" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加收支项目方法===================");
|
Log.infoFileSync("==================结束调用增加收支项目方法===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除收支项目
|
* 删除收支项目
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除收支项目信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除收支项目信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
inOutItemService.delete(model.getInOutItemID());
|
inOutItemService.delete(model.getInOutItemID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getInOutItemID() + " 的收支项目异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getInOutItemID() + " 的收支项目异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -94,20 +85,19 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除收支项目", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除收支项目", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除收支项目ID为 "+ model.getInOutItemID() + ",名称为 " + model.getName() + tipMsg + "!", "删除收支项目" + tipMsg));
|
, tipType, "删除收支项目ID为 " + model.getInOutItemID() + ",名称为 " + model.getName() + tipMsg + "!", "删除收支项目" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除收支项目信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除收支项目信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新收支项目
|
* 更新收支项目
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
InOutItem inOutItem = inOutItemService.get(model.getInOutItemID());
|
InOutItem inOutItem = inOutItemService.get(model.getInOutItemID());
|
||||||
inOutItem.setName(model.getName());
|
inOutItem.setName(model.getName());
|
||||||
inOutItem.setType(model.getType());
|
inOutItem.setType(model.getType());
|
||||||
@@ -117,46 +107,36 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改收支项目ID为 : " + model.getInOutItemID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改收支项目ID为 : " + model.getInOutItemID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改收支项目回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改收支项目回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新收支项目", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新收支项目", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新收支项目ID为 "+ model.getInOutItemID() + " " + tipMsg + "!", "更新收支项目" + tipMsg));
|
, tipType, "更新收支项目ID为 " + model.getInOutItemID() + " " + tipMsg + "!", "更新收支项目" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID收支项目
|
* 批量删除指定ID收支项目
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
inOutItemService.batchDelete(model.getInOutItemIDs());
|
inOutItemService.batchDelete(model.getInOutItemIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除收支项目ID为:" + model.getInOutItemIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除收支项目ID为:" + model.getInOutItemIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -164,45 +144,35 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除收支项目", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除收支项目", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除收支项目ID为 "+ model.getInOutItemIDs() + " " + tipMsg + "!", "批量删除收支项目" + tipMsg));
|
, tipType, "批量删除收支项目ID为 " + model.getInOutItemIDs() + " " + tipMsg + "!", "批量删除收支项目" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = inOutItemService.checkIsNameExist("name", model.getName(), "id", model.getInOutItemID());
|
||||||
flag = inOutItemService.checkIsNameExist("name",model.getName(),"id", model.getInOutItemID());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查收支项目名称为:" + model.getName() + " ID为: " + model.getInOutItemID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查收支项目名称为:" + model.getName() + " ID为: " + model.getInOutItemID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查收支项目名称为:" + model.getName() + " ID为: " + model.getInOutItemID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查收支项目名称为:" + model.getName() + " ID为: " + model.getInOutItemID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找收支项目信息
|
* 查找收支项目信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<InOutItem> pageUtil = new PageUtil<InOutItem>();
|
PageUtil<InOutItem> pageUtil = new PageUtil<InOutItem>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -214,10 +184,8 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (InOutItem inOutItem : dataList) {
|
||||||
for(InOutItem inOutItem:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", inOutItem.getId());
|
item.put("id", inOutItem.getId());
|
||||||
//收支项目名称
|
//收支项目名称
|
||||||
@@ -231,25 +199,20 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找收支项目信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找收支项目信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询收支项目信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询收支项目信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找收支项目信息-下拉框
|
* 查找收支项目信息-下拉框
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBySelect()
|
public void findBySelect() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<InOutItem> pageUtil = new PageUtil<InOutItem>();
|
PageUtil<InOutItem> pageUtil = new PageUtil<InOutItem>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
@@ -258,10 +221,8 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
List<InOutItem> dataList = pageUtil.getPageList();
|
List<InOutItem> dataList = pageUtil.getPageList();
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (InOutItem inOutItem : dataList) {
|
||||||
for(InOutItem inOutItem:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", inOutItem.getId());
|
item.put("Id", inOutItem.getId());
|
||||||
//收支项目名称
|
//收支项目名称
|
||||||
@@ -271,27 +232,23 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找收支项目信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找收支项目信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询收支项目信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询收支项目信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
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("name_s_like", model.getName());
|
||||||
condition.put("remark_s_like", model.getRemark());
|
condition.put("remark_s_like", model.getRemark());
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
@@ -300,18 +257,17 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-下拉框-收支项目
|
* 拼接搜索条件-下拉框-收支项目
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_select()
|
private Map<String, Object> getCondition_select() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
if(model.getType().equals("in")) {
|
if (model.getType().equals("in")) {
|
||||||
condition.put("type_s_eq", "收入");
|
condition.put("type_s_eq", "收入");
|
||||||
}
|
} else if (model.getType().equals("out")) {
|
||||||
else if(model.getType().equals("out")) {
|
|
||||||
condition.put("type_s_eq", "支出");
|
condition.put("type_s_eq", "支出");
|
||||||
}
|
}
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
@@ -320,12 +276,11 @@ public class InOutItemAction extends BaseAction<InOutItemModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public InOutItemModel getModel()
|
public InOutItemModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setInOutItemService(InOutItemIService inOutItemService)
|
|
||||||
{
|
public void setInOutItemService(InOutItemIService inOutItemService) {
|
||||||
this.inOutItemService = inOutItemService;
|
this.inOutItemService = inOutItemService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
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.BaseAction;
|
||||||
import com.jsh.base.Log;
|
import com.jsh.base.Log;
|
||||||
import com.jsh.model.po.Logdetails;
|
import com.jsh.model.po.Logdetails;
|
||||||
@@ -15,34 +7,38 @@ import com.jsh.model.vo.basic.LogModel;
|
|||||||
import com.jsh.service.basic.UserIService;
|
import com.jsh.service.basic.UserIService;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
import com.jsh.util.Tools;
|
import com.jsh.util.Tools;
|
||||||
|
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:7-5-2-7-1-8-9-2-0
|
* @author jishenghua qq:7-5-2-7-1-8-9-2-0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class LogAction extends BaseAction<LogModel>
|
public class LogAction extends BaseAction<LogModel> {
|
||||||
{
|
|
||||||
private LogModel model = new LogModel();
|
private LogModel model = new LogModel();
|
||||||
private UserIService userService;
|
private UserIService userService;
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getBasicData()
|
public String getBasicData() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
|
||||||
condition.clear();
|
condition.clear();
|
||||||
condition.put("ismanager_n_eq", 0);
|
condition.put("ismanager_n_eq", 0);
|
||||||
userService.find(pageUtil);
|
userService.find(pageUtil);
|
||||||
mapData.put("userList", pageUtil.getPageList());
|
mapData.put("userList", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exceptoin");
|
model.getShowModel().setMsgTip("exceptoin");
|
||||||
}
|
}
|
||||||
@@ -51,19 +47,16 @@ public class LogAction extends BaseAction<LogModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除日志
|
* 删除日志
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除日志信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除日志信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
logService.delete(model.getLogID());
|
logService.delete(model.getLogID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getLogID() + " 的日志异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getLogID() + " 的日志异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -71,27 +64,24 @@ public class LogAction extends BaseAction<LogModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除日志", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除日志", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除日志ID为 "+ model.getLogID() + " " + tipMsg + "!", "删除日志" + tipMsg));
|
, tipType, "删除日志ID为 " + model.getLogID() + " " + tipMsg + "!", "删除日志" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除日志信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除日志信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID日志
|
* 批量删除指定ID日志
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
logService.batchDelete(model.getLogIDs());
|
logService.batchDelete(model.getLogIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除日志ID为:" + model.getLogIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除日志ID为:" + model.getLogIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -99,18 +89,17 @@ public class LogAction extends BaseAction<LogModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除日志", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除日志", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除日志ID为 "+ model.getLogIDs() + " " + tipMsg + "!", "批量删除日志" + tipMsg));
|
, tipType, "批量删除日志ID为 " + model.getLogIDs() + " " + tipMsg + "!", "批量删除日志" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找日志信息
|
* 查找日志信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Logdetails> pageUtil = new PageUtil<Logdetails>();
|
PageUtil<Logdetails> pageUtil = new PageUtil<Logdetails>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -126,10 +115,8 @@ public class LogAction extends BaseAction<LogModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Logdetails log : dataList) {
|
||||||
for(Logdetails log:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", log.getId());
|
item.put("id", log.getId());
|
||||||
item.put("clientIP", log.getClientIp());
|
item.put("clientIP", log.getClientIp());
|
||||||
@@ -137,36 +124,32 @@ public class LogAction extends BaseAction<LogModel>
|
|||||||
item.put("createTime", Tools.getCenternTime(log.getCreatetime()));
|
item.put("createTime", Tools.getCenternTime(log.getCreatetime()));
|
||||||
item.put("operation", log.getOperation());
|
item.put("operation", log.getOperation());
|
||||||
item.put("remark", log.getRemark());
|
item.put("remark", log.getRemark());
|
||||||
item.put("status", log.getStatus() == 0 ?"成功":"失败");
|
item.put("status", log.getStatus() == 0 ? "成功" : "失败");
|
||||||
item.put("statusShort", log.getStatus());
|
item.put("statusShort", log.getStatus());
|
||||||
item.put("username", log.getUser()==null?"":log.getUser().getUsername());
|
item.put("username", log.getUser() == null ? "" : log.getUser().getUsername());
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找日志信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找日志信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询日志信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询日志信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("user.id_n_eq", model.getUsernameID());
|
condition.put("user.id_n_eq", model.getUsernameID());
|
||||||
condition.put("createtime_s_gteq", model.getBeginTime());
|
condition.put("createtime_s_gteq", model.getBeginTime());
|
||||||
condition.put("createtime_s_lteq", model.getEndTime());
|
condition.put("createtime_s_lteq", model.getEndTime());
|
||||||
@@ -180,14 +163,12 @@ public class LogAction extends BaseAction<LogModel>
|
|||||||
}
|
}
|
||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
public void setUserService(UserIService userService)
|
public void setUserService(UserIService userService) {
|
||||||
{
|
|
||||||
this.userService = userService;
|
this.userService = userService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LogModel getModel()
|
public LogModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,43 +1,42 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
import com.jsh.model.po.Logdetails;
|
||||||
|
import com.jsh.model.po.Role;
|
||||||
|
import com.jsh.model.vo.basic.RoleModel;
|
||||||
|
import com.jsh.service.basic.RoleIService;
|
||||||
|
import com.jsh.service.basic.UserBusinessIService;
|
||||||
|
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.io.IOException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.util.JshException;
|
|
||||||
import com.jsh.model.po.App;
|
|
||||||
import com.jsh.model.po.Role;
|
|
||||||
import com.jsh.model.po.Logdetails;
|
|
||||||
import com.jsh.model.vo.basic.RoleModel;
|
|
||||||
import com.jsh.service.basic.RoleIService;
|
|
||||||
import com.jsh.service.basic.UserBusinessIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
/*
|
/*
|
||||||
* 角色管理
|
* 角色管理
|
||||||
* @author jishenghua qq:7-5-2-7-1-8-9-2-0
|
* @author jishenghua qq:7-5-2-7-1-8-9-2-0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class RoleAction extends BaseAction<RoleModel>
|
public class RoleAction extends BaseAction<RoleModel> {
|
||||||
{
|
|
||||||
private RoleIService roleService;
|
private RoleIService roleService;
|
||||||
private UserBusinessIService userBusinessService;
|
private UserBusinessIService userBusinessService;
|
||||||
private RoleModel model = new RoleModel();
|
private RoleModel model = new RoleModel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加角色
|
* 增加角色
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加角色信息方法create()===================");
|
Log.infoFileSync("==================开始调用增加角色信息方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Role role = new Role();
|
Role role = new Role();
|
||||||
role.setName(model.getName());
|
role.setName(model.getName());
|
||||||
roleService.create(role);
|
roleService.create(role);
|
||||||
@@ -47,47 +46,37 @@ public class RoleAction extends BaseAction<RoleModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加角色信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加角色信息异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加角色信息回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加角色信息回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加角色", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加角色", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加角色名称为 "+ model.getName() + " " + tipMsg + "!", "增加角色" + tipMsg));
|
, tipType, "增加角色名称为 " + model.getName() + " " + tipMsg + "!", "增加角色" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加角色方法create()===================");
|
Log.infoFileSync("==================结束调用增加角色方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除角色
|
* 删除角色
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除角色信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除角色信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
roleService.delete(model.getRoleID());
|
roleService.delete(model.getRoleID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getRoleID() + " 的角色异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getRoleID() + " 的角色异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -95,20 +84,19 @@ public class RoleAction extends BaseAction<RoleModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除角色", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除角色", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除角色ID为 "+ model.getRoleID() + " " + tipMsg + "!", "删除角色" + tipMsg));
|
, tipType, "删除角色ID为 " + model.getRoleID() + " " + tipMsg + "!", "删除角色" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除角色信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除角色信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新角色
|
* 更新角色
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Role role = roleService.get(model.getRoleID());
|
Role role = roleService.get(model.getRoleID());
|
||||||
role.setName(model.getName());
|
role.setName(model.getName());
|
||||||
roleService.update(role);
|
roleService.update(role);
|
||||||
@@ -116,46 +104,36 @@ public class RoleAction extends BaseAction<RoleModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改角色ID为 : " + model.getRoleID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改角色ID为 : " + model.getRoleID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改角色回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改角色回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新角色", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新角色", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新角色ID为 "+ model.getRoleID() + " " + tipMsg + "!", "更新角色" + tipMsg));
|
, tipType, "更新角色ID为 " + model.getRoleID() + " " + tipMsg + "!", "更新角色" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID角色
|
* 批量删除指定ID角色
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
roleService.batchDelete(model.getRoleIDs());
|
roleService.batchDelete(model.getRoleIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除角色ID为:" + model.getRoleIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除角色ID为:" + model.getRoleIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -163,45 +141,35 @@ public class RoleAction extends BaseAction<RoleModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除角色", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除角色", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除角色ID为 "+ model.getRoleIDs() + " " + tipMsg + "!", "批量删除角色" + tipMsg));
|
, tipType, "批量删除角色ID为 " + model.getRoleIDs() + " " + tipMsg + "!", "批量删除角色" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = roleService.checkIsNameExist("name", model.getName(), "Id", model.getRoleID());
|
||||||
flag = roleService.checkIsNameExist("name",model.getName(),"Id", model.getRoleID());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查角色名称为:" + model.getName() + " ID为: " + model.getRoleID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查角色名称为:" + model.getName() + " ID为: " + model.getRoleID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查角色名称为:" + model.getName() + " ID为: " + model.getRoleID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查角色名称为:" + model.getName() + " ID为: " + model.getRoleID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找角色信息
|
* 查找角色信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Role> pageUtil = new PageUtil<Role>();
|
PageUtil<Role> pageUtil = new PageUtil<Role>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -217,10 +185,8 @@ public class RoleAction extends BaseAction<RoleModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Role role : dataList) {
|
||||||
for(Role role:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", role.getId());
|
item.put("Id", role.getId());
|
||||||
//供应商名称
|
//供应商名称
|
||||||
@@ -232,25 +198,20 @@ public class RoleAction extends BaseAction<RoleModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找角色信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找角色信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询角色信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询角色信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户对应角色显示
|
* 用户对应角色显示
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findUserRole()
|
public void findUserRole() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Role> pageUtil = new PageUtil<Role>();
|
PageUtil<Role> pageUtil = new PageUtil<Role>();
|
||||||
pageUtil.setPageSize(100);
|
pageUtil.setPageSize(100);
|
||||||
//pageUtil.setCurPage(model.getPageNo());
|
//pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -266,52 +227,45 @@ public class RoleAction extends BaseAction<RoleModel>
|
|||||||
outer.put("state", "open");
|
outer.put("state", "open");
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Role role : dataList) {
|
||||||
for(Role role:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", role.getId());
|
item.put("id", role.getId());
|
||||||
item.put("text", role.getName());
|
item.put("text", role.getName());
|
||||||
//勾选判断1
|
//勾选判断1
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + role.getId().toString() + "]");
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+role.getId().toString()+"]");
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的角色:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的角色:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){item.put("checked", true);}
|
if (flag == true) {
|
||||||
|
item.put("checked", true);
|
||||||
|
}
|
||||||
//结束
|
//结束
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outer.put("children", dataArray);
|
outer.put("children", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient("["+outer.toString()+"]");
|
toClient("[" + outer.toString() + "]");
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找角色异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找角色异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询角色结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询角色结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
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("Name_s_like", model.getName());
|
||||||
condition.put("Id_s_order", "asc");
|
condition.put("Id_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
@@ -319,28 +273,28 @@ public class RoleAction extends BaseAction<RoleModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-用户对应角色
|
* 拼接搜索条件-用户对应角色
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_UserRole()
|
private Map<String, Object> getCondition_UserRole() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("Id_s_order", "asc");
|
condition.put("Id_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public RoleModel getModel()
|
public RoleModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setRoleService(RoleIService roleService)
|
|
||||||
{
|
public void setRoleService(RoleIService roleService) {
|
||||||
this.roleService = roleService;
|
this.roleService = roleService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserBusinessService(UserBusinessIService userBusinessService) {
|
public void setUserBusinessService(UserBusinessIService userBusinessService) {
|
||||||
this.userBusinessService = userBusinessService;
|
this.userBusinessService = userBusinessService;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,25 +26,24 @@ import java.util.Map;
|
|||||||
/*
|
/*
|
||||||
* 单位管理
|
* 单位管理
|
||||||
* @author ji-sheng-hua qq:7 5 2 7 1 8 9 2 0
|
* @author ji-sheng-hua qq:7 5 2 7 1 8 9 2 0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class SupplierAction extends BaseAction<SupplierModel>
|
public class SupplierAction extends BaseAction<SupplierModel> {
|
||||||
{
|
public static final String EXCEL = "excel"; //action返回excel结果
|
||||||
|
private final static Integer ISYSTEM = 1;
|
||||||
private SupplierIService supplierService;
|
private SupplierIService supplierService;
|
||||||
private UserBusinessIService userBusinessService;
|
private UserBusinessIService userBusinessService;
|
||||||
private SupplierModel model = new SupplierModel();
|
private SupplierModel model = new SupplierModel();
|
||||||
private final static Integer ISYSTEM = 1;
|
|
||||||
public static final String EXCEL = "excel"; //action返回excel结果
|
|
||||||
/**
|
/**
|
||||||
* 增加供应商
|
* 增加供应商
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加供应商方法===================");
|
Log.infoFileSync("==================开始调用增加供应商方法===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Supplier supplier = new Supplier();
|
Supplier supplier = new Supplier();
|
||||||
supplier.setContacts(model.getContacts());
|
supplier.setContacts(model.getContacts());
|
||||||
supplier.setType(model.getType());
|
supplier.setType(model.getType());
|
||||||
@@ -53,7 +52,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
supplier.setAdvanceIn(0.0);
|
supplier.setAdvanceIn(0.0);
|
||||||
supplier.setBeginNeedGet(model.getBeginNeedGet());
|
supplier.setBeginNeedGet(model.getBeginNeedGet());
|
||||||
supplier.setBeginNeedPay(model.getBeginNeedPay());
|
supplier.setBeginNeedPay(model.getBeginNeedPay());
|
||||||
supplier.setIsystem((short)1);
|
supplier.setIsystem((short) 1);
|
||||||
supplier.setEnabled(true);
|
supplier.setEnabled(true);
|
||||||
supplier.setPhonenum(model.getPhonenum());
|
supplier.setPhonenum(model.getPhonenum());
|
||||||
supplier.setSupplier(model.getSupplier());
|
supplier.setSupplier(model.getSupplier());
|
||||||
@@ -73,47 +72,37 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加供应商异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加供应商异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加供应商回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加供应商回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加供应商", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加供应商", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加供应商名称为 "+ model.getSupplier() + " " + tipMsg + "!", "增加供应商" + tipMsg));
|
, tipType, "增加供应商名称为 " + model.getSupplier() + " " + tipMsg + "!", "增加供应商" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加供应商方法===================");
|
Log.infoFileSync("==================结束调用增加供应商方法===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除供应商
|
* 删除供应商
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除供应商信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除供应商信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
supplierService.delete(model.getSupplierID());
|
supplierService.delete(model.getSupplierID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getSupplierID() + " 的供应商异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getSupplierID() + " 的供应商异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -121,20 +110,19 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除供应商", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除供应商", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除供应商ID为 "+ model.getSupplierID() + ",名称为 " + model.getSupplier() + tipMsg + "!", "删除供应商" + tipMsg));
|
, tipType, "删除供应商ID为 " + model.getSupplierID() + ",名称为 " + model.getSupplier() + tipMsg + "!", "删除供应商" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除供应商信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除供应商信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新供应商
|
* 更新供应商
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Supplier supplier = supplierService.get(model.getSupplierID());
|
Supplier supplier = supplierService.get(model.getSupplierID());
|
||||||
supplier.setContacts(model.getContacts());
|
supplier.setContacts(model.getContacts());
|
||||||
supplier.setType(model.getType());
|
supplier.setType(model.getType());
|
||||||
@@ -143,7 +131,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
supplier.setAdvanceIn(supplier.getAdvanceIn());
|
supplier.setAdvanceIn(supplier.getAdvanceIn());
|
||||||
supplier.setBeginNeedGet(model.getBeginNeedGet());
|
supplier.setBeginNeedGet(model.getBeginNeedGet());
|
||||||
supplier.setBeginNeedPay(model.getBeginNeedPay());
|
supplier.setBeginNeedPay(model.getBeginNeedPay());
|
||||||
supplier.setIsystem((short)1);
|
supplier.setIsystem((short) 1);
|
||||||
supplier.setPhonenum(model.getPhonenum());
|
supplier.setPhonenum(model.getPhonenum());
|
||||||
supplier.setSupplier(model.getSupplier());
|
supplier.setSupplier(model.getSupplier());
|
||||||
|
|
||||||
@@ -161,39 +149,31 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改供应商ID为 : " + model.getSupplierID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改供应商ID为 : " + model.getSupplierID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改供应商回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改供应商回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新供应商", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新供应商", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新供应商ID为 "+ model.getSupplierID() + " " + tipMsg + "!", "更新供应商" + tipMsg));
|
, tipType, "更新供应商ID为 " + model.getSupplierID() + " " + tipMsg + "!", "更新供应商" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新供应商-只更新预付款,其余用原来的值
|
* 更新供应商-只更新预付款,其余用原来的值
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void updateAdvanceIn()
|
public void updateAdvanceIn() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Supplier supplier = supplierService.get(model.getSupplierID());
|
Supplier supplier = supplierService.get(model.getSupplierID());
|
||||||
supplier.setContacts(supplier.getContacts());
|
supplier.setContacts(supplier.getContacts());
|
||||||
supplier.setType(supplier.getType());
|
supplier.setType(supplier.getType());
|
||||||
@@ -202,7 +182,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
supplier.setAdvanceIn(supplier.getAdvanceIn() + model.getAdvanceIn()); //增加预收款的金额,可能增加的是负值
|
supplier.setAdvanceIn(supplier.getAdvanceIn() + model.getAdvanceIn()); //增加预收款的金额,可能增加的是负值
|
||||||
supplier.setBeginNeedGet(supplier.getBeginNeedGet());
|
supplier.setBeginNeedGet(supplier.getBeginNeedGet());
|
||||||
supplier.setBeginNeedPay(supplier.getBeginNeedPay());
|
supplier.setBeginNeedPay(supplier.getBeginNeedPay());
|
||||||
supplier.setIsystem((short)1);
|
supplier.setIsystem((short) 1);
|
||||||
supplier.setPhonenum(supplier.getPhonenum());
|
supplier.setPhonenum(supplier.getPhonenum());
|
||||||
supplier.setSupplier(supplier.getSupplier());
|
supplier.setSupplier(supplier.getSupplier());
|
||||||
|
|
||||||
@@ -220,46 +200,36 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改供应商ID为 : " + model.getSupplierID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改供应商ID为 : " + model.getSupplierID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改供应商回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改供应商回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新供应商预付款", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新供应商预付款", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新供应商ID为 "+ model.getSupplierID() + " " + tipMsg + "!", "更新供应商" + tipMsg));
|
, tipType, "更新供应商ID为 " + model.getSupplierID() + " " + tipMsg + "!", "更新供应商" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID供应商
|
* 批量删除指定ID供应商
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
supplierService.batchDelete(model.getSupplierIDs());
|
supplierService.batchDelete(model.getSupplierIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除供应商ID为:" + model.getSupplierIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除供应商ID为:" + model.getSupplierIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -267,26 +237,23 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除供应商", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除供应商", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除供应商ID为 "+ model.getSupplierIDs() + " " + tipMsg + "!", "批量删除供应商" + tipMsg));
|
, tipType, "批量删除供应商ID为 " + model.getSupplierIDs() + " " + tipMsg + "!", "批量删除供应商" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量设置状态-启用或者禁用
|
* 批量设置状态-启用或者禁用
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchSetEnable()
|
public String batchSetEnable() {
|
||||||
{
|
try {
|
||||||
try
|
supplierService.batchSetEnable(model.getEnabled(), model.getSupplierIDs());
|
||||||
{
|
|
||||||
supplierService.batchSetEnable(model.getEnabled(),model.getSupplierIDs());
|
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量修改状态,单位ID为:" + model.getSupplierIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量修改状态,单位ID为:" + model.getSupplierIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -294,58 +261,46 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量修改单位状态", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量修改单位状态", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量修改状态,单位ID为 "+ model.getSupplierIDs() + " " + tipMsg + "!", "批量修改单位状态" + tipMsg));
|
, tipType, "批量修改状态,单位ID为 " + model.getSupplierIDs() + " " + tipMsg + "!", "批量修改单位状态" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = supplierService.checkIsNameExist("supplier", model.getSupplier(), "id", model.getSupplierID());
|
||||||
flag = supplierService.checkIsNameExist("supplier",model.getSupplier(),"id", model.getSupplierID());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查供应商名称为:" + model.getSupplier() + " ID为: " + model.getSupplierID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查供应商名称为:" + model.getSupplier() + " ID为: " + model.getSupplierID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查供应商名称为:" + model.getSupplier() + " ID为: " + model.getSupplierID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查供应商名称为:" + model.getSupplier() + " ID为: " + model.getSupplierID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找供应商信息
|
* 查找供应商信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
pageUtil.setAdvSearch(getCondition());
|
pageUtil.setAdvSearch(getCondition());
|
||||||
supplierService.find(pageUtil);
|
supplierService.find(pageUtil);
|
||||||
String sName = "";
|
String sName = "";
|
||||||
if((model.getType()).equals("供应商")){
|
if ((model.getType()).equals("供应商")) {
|
||||||
sName = "pageUtilVendor";
|
sName = "pageUtilVendor";
|
||||||
}
|
} else if ((model.getType()).equals("客户")) {
|
||||||
else if((model.getType()).equals("客户")){
|
|
||||||
sName = "pageUtilCustomer";
|
sName = "pageUtilCustomer";
|
||||||
}
|
} else if ((model.getType()).equals("会员")) {
|
||||||
else if((model.getType()).equals("会员")){
|
|
||||||
sName = "pageUtilMember";
|
sName = "pageUtilMember";
|
||||||
}
|
}
|
||||||
getSession().put(sName, pageUtil);
|
getSession().put(sName, pageUtil);
|
||||||
@@ -355,22 +310,20 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Supplier supplier : dataList) {
|
||||||
for(Supplier supplier:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", supplier.getId());
|
item.put("id", supplier.getId());
|
||||||
//供应商名称
|
//供应商名称
|
||||||
item.put("supplier", supplier.getSupplier());
|
item.put("supplier", supplier.getSupplier());
|
||||||
item.put("type", supplier.getType());
|
item.put("type", supplier.getType());
|
||||||
item.put("contacts",supplier.getContacts());
|
item.put("contacts", supplier.getContacts());
|
||||||
item.put("phonenum", supplier.getPhonenum());
|
item.put("phonenum", supplier.getPhonenum());
|
||||||
item.put("email", supplier.getEmail());
|
item.put("email", supplier.getEmail());
|
||||||
item.put("AdvanceIn",supplier.getAdvanceIn());
|
item.put("AdvanceIn", supplier.getAdvanceIn());
|
||||||
item.put("BeginNeedGet",supplier.getBeginNeedGet());
|
item.put("BeginNeedGet", supplier.getBeginNeedGet());
|
||||||
item.put("BeginNeedPay",supplier.getBeginNeedPay());
|
item.put("BeginNeedPay", supplier.getBeginNeedPay());
|
||||||
item.put("isystem", supplier.getIsystem() == (short)0?"是":"否");
|
item.put("isystem", supplier.getIsystem() == (short) 0 ? "是" : "否");
|
||||||
item.put("description", supplier.getDescription());
|
item.put("description", supplier.getDescription());
|
||||||
|
|
||||||
item.put("fax", supplier.getFax());
|
item.put("fax", supplier.getFax());
|
||||||
@@ -389,19 +342,16 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找供应商信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找供应商信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查找信息
|
* 根据id查找信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findById() {
|
public void findById() {
|
||||||
@@ -416,22 +366,20 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Supplier supplier : dataList) {
|
||||||
for(Supplier supplier:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", supplier.getId());
|
item.put("id", supplier.getId());
|
||||||
//名称
|
//名称
|
||||||
item.put("supplier", supplier.getSupplier());
|
item.put("supplier", supplier.getSupplier());
|
||||||
item.put("type", supplier.getType());
|
item.put("type", supplier.getType());
|
||||||
item.put("contacts",supplier.getContacts());
|
item.put("contacts", supplier.getContacts());
|
||||||
item.put("phonenum", supplier.getPhonenum());
|
item.put("phonenum", supplier.getPhonenum());
|
||||||
item.put("email", supplier.getEmail());
|
item.put("email", supplier.getEmail());
|
||||||
item.put("AdvanceIn",supplier.getAdvanceIn());
|
item.put("AdvanceIn", supplier.getAdvanceIn());
|
||||||
item.put("BeginNeedGet",supplier.getBeginNeedGet());
|
item.put("BeginNeedGet", supplier.getBeginNeedGet());
|
||||||
item.put("BeginNeedPay",supplier.getBeginNeedPay());
|
item.put("BeginNeedPay", supplier.getBeginNeedPay());
|
||||||
item.put("isystem", supplier.getIsystem() == (short)0?"是":"否");
|
item.put("isystem", supplier.getIsystem() == (short) 0 ? "是" : "否");
|
||||||
item.put("description", supplier.getDescription());
|
item.put("description", supplier.getDescription());
|
||||||
|
|
||||||
item.put("fax", supplier.getFax());
|
item.put("fax", supplier.getFax());
|
||||||
@@ -450,23 +398,20 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找供应商信息-下拉框
|
* 查找供应商信息-下拉框
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBySelect_sup()
|
public void findBySelect_sup() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
@@ -475,10 +420,8 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
List<Supplier> dataList = pageUtil.getPageList();
|
List<Supplier> dataList = pageUtil.getPageList();
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Supplier supplier : dataList) {
|
||||||
for(Supplier supplier:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", supplier.getId());
|
item.put("id", supplier.getId());
|
||||||
//供应商名称
|
//供应商名称
|
||||||
@@ -488,18 +431,16 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找供应商信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找供应商信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找客户信息-下拉框
|
* 查找客户信息-下拉框
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBySelect_cus() {
|
public void findBySelect_cus() {
|
||||||
@@ -512,18 +453,17 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
List<Supplier> dataList = pageUtil.getPageList();
|
List<Supplier> dataList = pageUtil.getPageList();
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList) {
|
if (null != dataList) {
|
||||||
for(Supplier supplier:dataList) {
|
for (Supplier supplier : dataList) {
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
//勾选判断1
|
//勾选判断1
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try{
|
try {
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+supplier.getId().toString()+"]");
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + supplier.getId().toString() + "]");
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e){
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>查询用户对应的客户:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>查询用户对应的客户:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){
|
if (flag == true) {
|
||||||
item.put("id", supplier.getId());
|
item.put("id", supplier.getId());
|
||||||
item.put("supplier", supplier.getSupplier()); //客户名称
|
item.put("supplier", supplier.getSupplier()); //客户名称
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
@@ -532,23 +472,20 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找客户信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找客户信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询客户信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询客户信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找会员信息-下拉框
|
* 查找会员信息-下拉框
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBySelect_retail()
|
public void findBySelect_retail() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
@@ -557,10 +494,8 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
List<Supplier> dataList = pageUtil.getPageList();
|
List<Supplier> dataList = pageUtil.getPageList();
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Supplier supplier : dataList) {
|
||||||
for(Supplier supplier:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", supplier.getId());
|
item.put("id", supplier.getId());
|
||||||
//客户名称
|
//客户名称
|
||||||
@@ -571,13 +506,9 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找客户信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找客户信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询客户信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询客户信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -585,10 +516,8 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
/**
|
/**
|
||||||
* 查找非会员的id
|
* 查找非会员的id
|
||||||
*/
|
*/
|
||||||
public void findBySelectRetailNoPeople()
|
public void findBySelectRetailNoPeople() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
@@ -597,10 +526,8 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
List<Supplier> dataList = pageUtil.getPageList();
|
List<Supplier> dataList = pageUtil.getPageList();
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Supplier supplier : dataList) {
|
||||||
for(Supplier supplier:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", supplier.getId());
|
item.put("id", supplier.getId());
|
||||||
//客户名称
|
//客户名称
|
||||||
@@ -611,19 +538,16 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找客户信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找客户信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询客户信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询客户信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户对应客户显示
|
* 用户对应客户显示
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findUserCustomer() {
|
public void findUserCustomer() {
|
||||||
@@ -631,7 +555,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
PageUtil<Supplier> pageUtil = new PageUtil<Supplier>();
|
||||||
pageUtil.setPageSize(500);
|
pageUtil.setPageSize(500);
|
||||||
|
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("type_s_eq", "客户");
|
condition.put("type_s_eq", "客户");
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
|
|
||||||
@@ -646,50 +570,47 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
outer.put("state", "open");
|
outer.put("state", "open");
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList){
|
if (null != dataList) {
|
||||||
for(Supplier supplier:dataList){
|
for (Supplier supplier : dataList) {
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", supplier.getId());
|
item.put("id", supplier.getId());
|
||||||
item.put("text", supplier.getSupplier());
|
item.put("text", supplier.getSupplier());
|
||||||
//勾选判断1
|
//勾选判断1
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try{
|
try {
|
||||||
flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+supplier.getId().toString()+"]");
|
flag = userBusinessService.checkIsUserBusinessExist("Type", model.getUBType(), "KeyId", model.getUBKeyId(), "Value", "[" + supplier.getId().toString() + "]");
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e){
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的客户:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的客户:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
|
||||||
}
|
}
|
||||||
if (flag==true){item.put("checked", true);}
|
if (flag == true) {
|
||||||
|
item.put("checked", true);
|
||||||
|
}
|
||||||
//结束
|
//结束
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outer.put("children", dataArray);
|
outer.put("children", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient("["+outer.toString()+"]");
|
toClient("[" + outer.toString() + "]");
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e){
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找客户异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找客户异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e){
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询客户结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询客户结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String importFun(){
|
public String importFun() {
|
||||||
//excel表格file
|
//excel表格file
|
||||||
Boolean result = false;
|
Boolean result = false;
|
||||||
String returnStr = "";
|
String returnStr = "";
|
||||||
try {
|
try {
|
||||||
InputStream in = supplierService.importExcel(model.getSupplierFile());
|
InputStream in = supplierService.importExcel(model.getSupplierFile());
|
||||||
|
|
||||||
if(null != in)
|
if (null != in) {
|
||||||
{
|
|
||||||
model.setFileName(Tools.getRandomChar() + Tools.getNow2(Calendar.getInstance().getTime()) + "_wrong.xls");
|
model.setFileName(Tools.getRandomChar() + Tools.getNow2(Calendar.getInstance().getTime()) + "_wrong.xls");
|
||||||
model.setExcelStream(in);
|
model.setExcelStream(in);
|
||||||
returnStr = SupplierConstants.BusinessForExcel.EXCEL;
|
returnStr = SupplierConstants.BusinessForExcel.EXCEL;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
result = true;
|
result = true;
|
||||||
try {
|
try {
|
||||||
toClient(result.toString());
|
toClient(result.toString());
|
||||||
@@ -700,9 +621,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
returnStr = SUCCESS;
|
returnStr = SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} catch (JshException e) {
|
||||||
catch (JshException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e);
|
||||||
}
|
}
|
||||||
return returnStr;
|
return returnStr;
|
||||||
@@ -710,6 +629,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入excel表格-供应商
|
* 导入excel表格-供应商
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -719,6 +639,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入excel表格-客户
|
* 导入excel表格-客户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -728,6 +649,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入excel表格-会员
|
* 导入excel表格-会员
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -738,6 +660,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel表格
|
* 导出excel表格
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -745,16 +668,15 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
Log.infoFileSync("===================调用导出信息action方法exportExcel开始=======================");
|
Log.infoFileSync("===================调用导出信息action方法exportExcel开始=======================");
|
||||||
try {
|
try {
|
||||||
String sName = "pageUtil" + model.getType();
|
String sName = "pageUtil" + model.getType();
|
||||||
PageUtil<Supplier> pageUtil = (PageUtil<Supplier>)getSession().get(sName);
|
PageUtil<Supplier> pageUtil = (PageUtil<Supplier>) getSession().get(sName);
|
||||||
|
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
String isCurrentPage = "allPage";
|
String isCurrentPage = "allPage";
|
||||||
model.setFileName(Tools.changeUnicode("report" + System.currentTimeMillis() + ".xls",model.getBrowserType()));
|
model.setFileName(Tools.changeUnicode("report" + System.currentTimeMillis() + ".xls", model.getBrowserType()));
|
||||||
model.setExcelStream(supplierService.exmportExcel(isCurrentPage,pageUtil));
|
model.setExcelStream(supplierService.exmportExcel(isCurrentPage, pageUtil));
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出信息action方法exportExcel异常", e);
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出信息action方法exportExcel异常",e);
|
|
||||||
model.getShowModel().setMsgTip("export excel exception");
|
model.getShowModel().setMsgTip("export excel exception");
|
||||||
}
|
}
|
||||||
Log.infoFileSync("===================调用导出信息action方法exportExcel结束==================");
|
Log.infoFileSync("===================调用导出信息action方法exportExcel结束==================");
|
||||||
@@ -763,16 +685,17 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition() {
|
private Map<String, Object> getCondition() {
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("supplier_s_like", model.getSupplier());
|
condition.put("supplier_s_like", model.getSupplier());
|
||||||
condition.put("type_s_like", model.getType());
|
condition.put("type_s_like", model.getType());
|
||||||
condition.put("phonenum_s_like",model.getPhonenum());
|
condition.put("phonenum_s_like", model.getPhonenum());
|
||||||
condition.put("telephone_s_like", model.getTelephone());
|
condition.put("telephone_s_like", model.getTelephone());
|
||||||
condition.put("description_s_like", model.getDescription());
|
condition.put("description_s_like", model.getDescription());
|
||||||
condition.put("isystem_n_eq", ISYSTEM);
|
condition.put("isystem_n_eq", ISYSTEM);
|
||||||
@@ -781,75 +704,75 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*搜索条件
|
* 搜索条件
|
||||||
*/
|
*/
|
||||||
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.getSupplierID());
|
condition.put("Id_n_eq", model.getSupplierID());
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-下拉框-供应商
|
* 拼接搜索条件-下拉框-供应商
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_Select_sup()
|
private Map<String, Object> getCondition_Select_sup() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("type_s_like", "供应商");
|
condition.put("type_s_like", "供应商");
|
||||||
condition.put("enabled_s_eq",1);
|
condition.put("enabled_s_eq", 1);
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-下拉框-客户
|
* 拼接搜索条件-下拉框-客户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_Select_cus()
|
private Map<String, Object> getCondition_Select_cus() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("type_s_like", "客户");
|
condition.put("type_s_like", "客户");
|
||||||
condition.put("enabled_s_eq",1);
|
condition.put("enabled_s_eq", 1);
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-下拉框-会员
|
* 拼接搜索条件-下拉框-会员
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_Select_retail()
|
private Map<String, Object> getCondition_Select_retail() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("type_s_like", "会员");
|
condition.put("type_s_like", "会员");
|
||||||
condition.put("enabled_s_eq",1);
|
condition.put("enabled_s_eq", 1);
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-非会员
|
* 拼接搜索条件-非会员
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_Select_retail_no_people()
|
private Map<String, Object> getCondition_Select_retail_no_people() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("type_s_like", "会员");
|
condition.put("type_s_like", "会员");
|
||||||
condition.put("isystem_n_eq", 0);
|
condition.put("isystem_n_eq", 0);
|
||||||
condition.put("id_s_order", "desc");
|
condition.put("id_s_order", "desc");
|
||||||
@@ -858,12 +781,11 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public SupplierModel getModel()
|
public SupplierModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setSupplierService(SupplierIService supplierService)
|
|
||||||
{
|
public void setSupplierService(SupplierIService supplierService) {
|
||||||
this.supplierService = supplierService;
|
this.supplierService = supplierService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,22 +20,20 @@ import java.util.Map;
|
|||||||
/*
|
/*
|
||||||
* 系统配置
|
* 系统配置
|
||||||
* @author jishenghua qq:7-5-2-7 1-8-9-2-0
|
* @author jishenghua qq:7-5-2-7 1-8-9-2-0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class SystemConfigAction extends BaseAction<SystemConfigModel>
|
public class SystemConfigAction extends BaseAction<SystemConfigModel> {
|
||||||
{
|
|
||||||
private SystemConfigIService systemConfigService;
|
private SystemConfigIService systemConfigService;
|
||||||
private SystemConfigModel model = new SystemConfigModel();
|
private SystemConfigModel model = new SystemConfigModel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新系统配置
|
* 更新系统配置
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
SystemConfig sysConfig = systemConfigService.get(model.getId());
|
SystemConfig sysConfig = systemConfigService.get(model.getId());
|
||||||
sysConfig.setType(sysConfig.getType());
|
sysConfig.setType(sysConfig.getType());
|
||||||
sysConfig.setName(sysConfig.getName());
|
sysConfig.setName(sysConfig.getName());
|
||||||
@@ -46,38 +44,30 @@ public class SystemConfigAction extends BaseAction<SystemConfigModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改系统配置ID为 : " + model.getId() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改系统配置ID为 : " + model.getId() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改系统配置回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改系统配置回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新系统配置", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新系统配置", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新系统配置ID为 "+ model.getId() + " " + tipMsg + "!", "更新系统配置" + tipMsg));
|
, tipType, "更新系统配置ID为 " + model.getId() + " " + tipMsg + "!", "更新系统配置" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找系统配置信息
|
* 查找系统配置信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<SystemConfig> pageUtil = new PageUtil<SystemConfig>();
|
PageUtil<SystemConfig> pageUtil = new PageUtil<SystemConfig>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
@@ -87,10 +77,8 @@ public class SystemConfigAction extends BaseAction<SystemConfigModel>
|
|||||||
JSONObject outer = new JSONObject();
|
JSONObject outer = new JSONObject();
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (SystemConfig sysConfig : dataList) {
|
||||||
for(SystemConfig sysConfig:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", sysConfig.getId());
|
item.put("id", sysConfig.getId());
|
||||||
item.put("type", sysConfig.getType());
|
item.put("type", sysConfig.getType());
|
||||||
@@ -104,27 +92,23 @@ public class SystemConfigAction extends BaseAction<SystemConfigModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找系统配置信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找系统配置信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询系统配置信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询系统配置信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("id_s_order", "asc");
|
condition.put("id_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
@@ -132,12 +116,11 @@ public class SystemConfigAction extends BaseAction<SystemConfigModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public SystemConfigModel getModel()
|
public SystemConfigModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setSystemConfigService(SystemConfigIService systemConfigService)
|
|
||||||
{
|
public void setSystemConfigService(SystemConfigIService systemConfigService) {
|
||||||
this.systemConfigService = systemConfigService;
|
this.systemConfigService = systemConfigService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.jsh.action.basic;
|
|||||||
|
|
||||||
import com.jsh.base.BaseAction;
|
import com.jsh.base.BaseAction;
|
||||||
import com.jsh.base.Log;
|
import com.jsh.base.Log;
|
||||||
import com.jsh.model.po.Unit;
|
|
||||||
import com.jsh.model.po.Logdetails;
|
import com.jsh.model.po.Logdetails;
|
||||||
|
import com.jsh.model.po.Unit;
|
||||||
import com.jsh.model.vo.basic.UnitModel;
|
import com.jsh.model.vo.basic.UnitModel;
|
||||||
import com.jsh.service.basic.UnitIService;
|
import com.jsh.service.basic.UnitIService;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
@@ -19,25 +19,24 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 计量单位
|
* 计量单位
|
||||||
|
*
|
||||||
* @author ji shenghua qq:752 718 920
|
* @author ji shenghua qq:752 718 920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class UnitAction extends BaseAction<UnitModel>
|
public class UnitAction extends BaseAction<UnitModel> {
|
||||||
{
|
|
||||||
private UnitIService unitService;
|
private UnitIService unitService;
|
||||||
private UnitModel model = new UnitModel();
|
private UnitModel model = new UnitModel();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加计量单位
|
* 增加计量单位
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加计量单位方法create()===================");
|
Log.infoFileSync("==================开始调用增加计量单位方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Unit unit = new Unit();
|
Unit unit = new Unit();
|
||||||
unit.setUName(model.getUName());
|
unit.setUName(model.getUName());
|
||||||
unitService.create(unit);
|
unitService.create(unit);
|
||||||
@@ -47,34 +46,28 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加计量单位异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加计量单位异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加计量单位回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加计量单位回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加计量单位", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加计量单位", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加计量单位名称为 "+ model.getUName() + " " + tipMsg + "!", "增加计量单位" + tipMsg));
|
, tipType, "增加计量单位名称为 " + model.getUName() + " " + tipMsg + "!", "增加计量单位" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加计量单位方法create()===================");
|
Log.infoFileSync("==================结束调用增加计量单位方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除计量单位
|
* 删除计量单位
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete() {
|
public String delete() {
|
||||||
@@ -83,8 +76,7 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
unitService.delete(model.getUnitID());
|
unitService.delete(model.getUnitID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getUnitID() + " 的计量单位异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getUnitID() + " 的计量单位异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -92,13 +84,14 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除计量单位", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除计量单位", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除计量单位ID为 "+ model.getUnitID() + " " + tipMsg + "!", "删除计量单位" + tipMsg));
|
, tipType, "删除计量单位ID为 " + model.getUnitID() + " " + tipMsg + "!", "删除计量单位" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除计量单位方法delete()================");
|
Log.infoFileSync("====================结束调用删除计量单位方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新计量单位
|
* 更新计量单位
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update() {
|
public void update() {
|
||||||
@@ -111,42 +104,36 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改计量单位ID为 : " + model.getUnitID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改计量单位ID为 : " + model.getUnitID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
try {
|
try {
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改计量单位回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改计量单位回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新计量单位", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新计量单位", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新计量单位ID为 "+ model.getUnitID() + " " + tipMsg + "!", "更新计量单位" + tipMsg));
|
, tipType, "更新计量单位ID为 " + model.getUnitID() + " " + tipMsg + "!", "更新计量单位" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID计量单位
|
* 批量删除指定ID计量单位
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
unitService.batchDelete(model.getUnitIDs());
|
unitService.batchDelete(model.getUnitIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除计量单位ID为:" + model.getUnitIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除计量单位ID为:" + model.getUnitIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -154,45 +141,35 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除计量单位", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除计量单位", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除计量单位ID为 "+ model.getUnitIDs() + " " + tipMsg + "!", "批量删除计量单位" + tipMsg));
|
, tipType, "批量删除计量单位ID为 " + model.getUnitIDs() + " " + tipMsg + "!", "批量删除计量单位" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = unitService.checkIsNameExist("UName", model.getUName(), "id", model.getUnitID());
|
||||||
flag = unitService.checkIsNameExist("UName",model.getUName(),"id", model.getUnitID());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查计量单位名称为:" + model.getUName() + " ID为: " + model.getUnitID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查计量单位名称为:" + model.getUName() + " ID为: " + model.getUnitID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查计量单位名称为:" + model.getUName() + " ID为: " + model.getUnitID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查计量单位名称为:" + model.getUName() + " ID为: " + model.getUnitID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找计量单位信息
|
* 查找计量单位信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Unit> pageUtil = new PageUtil<Unit>();
|
PageUtil<Unit> pageUtil = new PageUtil<Unit>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -204,10 +181,8 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Unit unit : dataList) {
|
||||||
for(Unit unit:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", unit.getId());
|
item.put("id", unit.getId());
|
||||||
//名称
|
//名称
|
||||||
@@ -219,19 +194,16 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找计量单位异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找计量单位异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询计量单位结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询计量单位结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找计量单位信息-下拉框
|
* 查找计量单位信息-下拉框
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findUnitDownList() {
|
public void findUnitDownList() {
|
||||||
@@ -245,8 +217,8 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
|
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList) {
|
if (null != dataList) {
|
||||||
for(Unit unit:dataList) {
|
for (Unit unit : dataList) {
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", unit.getId());
|
item.put("id", unit.getId());
|
||||||
//名称
|
//名称
|
||||||
@@ -256,27 +228,23 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找计量单位异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找计量单位异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询计量单位结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询计量单位结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("UName_s_like", model.getUName());
|
condition.put("UName_s_like", model.getUName());
|
||||||
condition.put("id_s_order", "asc");
|
condition.put("id_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
@@ -284,8 +252,7 @@ public class UnitAction extends BaseAction<UnitModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public UnitModel getModel()
|
public UnitModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,77 +1,70 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
import com.jsh.model.po.Basicuser;
|
||||||
|
import com.jsh.model.po.Logdetails;
|
||||||
|
import com.jsh.model.vo.basic.UserModel;
|
||||||
|
import com.jsh.service.basic.UserIService;
|
||||||
|
import com.jsh.util.ExceptionCodeConstants;
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
import com.jsh.util.Tools;
|
||||||
|
import net.sf.json.JSONArray;
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.util.ExceptionCodeConstants;
|
|
||||||
import com.jsh.model.po.Basicuser;
|
|
||||||
import com.jsh.model.po.Logdetails;
|
|
||||||
import com.jsh.model.vo.basic.UserModel;
|
|
||||||
import com.jsh.service.basic.UserIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
import com.jsh.util.Tools;
|
|
||||||
/*
|
/*
|
||||||
* 用户管理
|
* 用户管理
|
||||||
* @author jishenghua qq:752718920
|
* @author jishenghua qq:752718920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class UserAction extends BaseAction<UserModel>
|
public class UserAction extends BaseAction<UserModel> {
|
||||||
{
|
|
||||||
private UserModel model = new UserModel();
|
private UserModel model = new UserModel();
|
||||||
private UserIService userService;
|
private UserIService userService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 需要判断用户状态,用户名密码错误不能登录 ,黑名单用户不能登录,如果已经登录过,不再进行处理,直接进入管理页面
|
* 需要判断用户状态,用户名密码错误不能登录 ,黑名单用户不能登录,如果已经登录过,不再进行处理,直接进入管理页面
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String login()
|
public String login() {
|
||||||
{
|
|
||||||
Log.infoFileSync("============用户登录 login 方法调用开始==============");
|
Log.infoFileSync("============用户登录 login 方法调用开始==============");
|
||||||
String username = model.getLoginame().trim();
|
String username = model.getLoginame().trim();
|
||||||
String password = model.getPassword().trim();
|
String password = model.getPassword().trim();
|
||||||
//因密码用MD5加密,需要对密码进行转化
|
//因密码用MD5加密,需要对密码进行转化
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
password = Tools.md5Encryp(password);
|
password = Tools.md5Encryp(password);
|
||||||
System.out.println(password);
|
System.out.println(password);
|
||||||
}
|
} catch (NoSuchAlgorithmException e) {
|
||||||
catch (NoSuchAlgorithmException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>转化MD5字符串错误 :" + e.getMessage(), e);
|
Log.errorFileSync(">>>>>>>>>>>>>>转化MD5字符串错误 :" + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断用户是否已经登录过,登录过不再处理
|
//判断用户是否已经登录过,登录过不再处理
|
||||||
Basicuser sessionUser = (Basicuser)getSession().get("user");
|
Basicuser sessionUser = (Basicuser) getSession().get("user");
|
||||||
if(null != sessionUser && username.equalsIgnoreCase(sessionUser.getLoginame())
|
if (null != sessionUser && username.equalsIgnoreCase(sessionUser.getLoginame())
|
||||||
&& sessionUser.getPassword().equals(password))
|
&& sessionUser.getPassword().equals(password)) {
|
||||||
{
|
Log.infoFileSync("====用户 " + username + "已经登录过, login 方法调用结束====");
|
||||||
Log.infoFileSync("====用户 "+ username + "已经登录过, login 方法调用结束====");
|
|
||||||
model.getShowModel().setMsgTip("user already login");
|
model.getShowModel().setMsgTip("user already login");
|
||||||
/*return "login";*/
|
/*return "login";*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取用户状态
|
//获取用户状态
|
||||||
int userStatus = -1;
|
int userStatus = -1;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
userStatus = userService.validateUser(username, password);
|
userStatus = userService.validateUser(username, password);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
Log.errorFileSync(">>>>>>>>>>>>>用户 " + username + " 登录 login 方法 访问服务层异常====", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>用户 " + username + " 登录 login 方法 访问服务层异常====",e);
|
|
||||||
model.getShowModel().setMsgTip("access service exception");
|
model.getShowModel().setMsgTip("access service exception");
|
||||||
}
|
}
|
||||||
switch (userStatus)
|
switch (userStatus) {
|
||||||
{
|
|
||||||
case ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST:
|
case ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST:
|
||||||
model.getShowModel().setMsgTip("user is not exist");
|
model.getShowModel().setMsgTip("user is not exist");
|
||||||
break;
|
break;
|
||||||
@@ -85,17 +78,14 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
model.getShowModel().setMsgTip("access service error");
|
model.getShowModel().setMsgTip("access service error");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
//验证通过 ,可以登录,放入session,记录登录日志
|
//验证通过 ,可以登录,放入session,记录登录日志
|
||||||
Basicuser user = userService.getUser(username);
|
Basicuser user = userService.getUser(username);
|
||||||
logService.create(new Logdetails(user, "登录系统", model.getClientIp(),
|
logService.create(new Logdetails(user, "登录系统", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis()), (short)0,"管理用户:" + username + " 登录系统",username + " 登录系统"));
|
new Timestamp(System.currentTimeMillis()), (short) 0, "管理用户:" + username + " 登录系统", username + " 登录系统"));
|
||||||
model.getShowModel().setMsgTip("user can login");
|
model.getShowModel().setMsgTip("user can login");
|
||||||
getSession().put("user", user);
|
getSession().put("user", user);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>查询用户名为:" + username + " ,用户信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>查询用户名为:" + username + " ,用户信息异常", e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -108,43 +98,39 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户退出登录
|
* 用户退出登录
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String logout()
|
public String logout() {
|
||||||
{
|
|
||||||
logService.create(new Logdetails(getUser(), "退出系统", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "退出系统", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis()), (short)0,
|
new Timestamp(System.currentTimeMillis()), (short) 0,
|
||||||
"管理用户:" + getUser().getLoginame() + " 退出系统",getUser().getLoginame() + " 退出系统"));
|
"管理用户:" + getUser().getLoginame() + " 退出系统", getUser().getLoginame() + " 退出系统"));
|
||||||
getSession().remove("user");
|
getSession().remove("user");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加用户
|
* 增加用户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加用户方法===================");
|
Log.infoFileSync("==================开始调用增加用户方法===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Basicuser user = new Basicuser();
|
Basicuser user = new Basicuser();
|
||||||
user.setDepartment(model.getDepartment());
|
user.setDepartment(model.getDepartment());
|
||||||
user.setDescription(model.getDescription());
|
user.setDescription(model.getDescription());
|
||||||
user.setEmail(model.getEmail());
|
user.setEmail(model.getEmail());
|
||||||
// user.setIsmanager(model.getIsmanager());
|
// user.setIsmanager(model.getIsmanager());
|
||||||
user.setIsystem((short)1);
|
user.setIsystem((short) 1);
|
||||||
user.setIsmanager((short)1);
|
user.setIsmanager((short) 1);
|
||||||
user.setLoginame(model.getLoginame());
|
user.setLoginame(model.getLoginame());
|
||||||
String password ="123456";
|
String password = "123456";
|
||||||
//因密码用MD5加密,需要对密码进行转化
|
//因密码用MD5加密,需要对密码进行转化
|
||||||
try
|
try {
|
||||||
{
|
password = Tools.md5Encryp(password);
|
||||||
password=Tools.md5Encryp(password);
|
} catch (NoSuchAlgorithmException e) {
|
||||||
}
|
|
||||||
catch (NoSuchAlgorithmException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>转化MD5字符串错误 :" + e.getMessage(), e);
|
Log.errorFileSync(">>>>>>>>>>>>>>转化MD5字符串错误 :" + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
@@ -160,47 +146,37 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加用户异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加用户异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加用户回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加用户回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加用户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加用户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加用户名称为 "+ model.getUsername() + " " + tipMsg + "!", "增加用户" + tipMsg));
|
, tipType, "增加用户名称为 " + model.getUsername() + " " + tipMsg + "!", "增加用户" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加用户方法===================");
|
Log.infoFileSync("==================结束调用增加用户方法===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除用户
|
* 删除用户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除用户信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除用户信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
userService.delete(model.getUserID());
|
userService.delete(model.getUserID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getUserID() + " 的用户异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getUserID() + " 的用户异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -208,20 +184,19 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除用户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除用户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除用户ID为 "+ model.getUserID() + " " + tipMsg + "!", "删除用户" + tipMsg));
|
, tipType, "删除用户ID为 " + model.getUserID() + " " + tipMsg + "!", "删除用户" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除用户信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除用户信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新用户
|
* 更新用户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Basicuser user = userService.get(model.getUserID());
|
Basicuser user = userService.get(model.getUserID());
|
||||||
user.setDepartment(model.getDepartment());
|
user.setDepartment(model.getDepartment());
|
||||||
user.setDescription(model.getDescription());
|
user.setDescription(model.getDescription());
|
||||||
@@ -235,52 +210,41 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
userService.update(user);
|
userService.update(user);
|
||||||
|
|
||||||
//看是否需要更新seesion中user
|
//看是否需要更新seesion中user
|
||||||
if(getUser().getId() == model.getUserID())
|
if (getUser().getId() == model.getUserID()) {
|
||||||
{
|
|
||||||
getSession().put("user", user);
|
getSession().put("user", user);
|
||||||
}
|
}
|
||||||
|
|
||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改用户ID为 : " + model.getUserID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改用户ID为 : " + model.getUserID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改用户回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改用户回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新用户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新用户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新用户ID为 "+ model.getUserID() + " " + tipMsg + "!", "更新用户" + tipMsg));
|
, tipType, "更新用户ID为 " + model.getUserID() + " " + tipMsg + "!", "更新用户" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改密码
|
* 修改密码
|
||||||
*/
|
*/
|
||||||
public void updatePwd()
|
public void updatePwd() {
|
||||||
{
|
|
||||||
Integer flag = 0;
|
Integer flag = 0;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Basicuser user = getUser();
|
Basicuser user = getUser();
|
||||||
String orgPassword = Tools.md5Encryp(model.getOrgpwd());
|
String orgPassword = Tools.md5Encryp(model.getOrgpwd());
|
||||||
String md5Pwd = Tools.md5Encryp(model.getPassword());
|
String md5Pwd = Tools.md5Encryp(model.getPassword());
|
||||||
//必须和原始密码一致才可以更新密码
|
//必须和原始密码一致才可以更新密码
|
||||||
if(orgPassword.equalsIgnoreCase(user.getPassword()))
|
if (orgPassword.equalsIgnoreCase(user.getPassword())) {
|
||||||
{
|
|
||||||
|
|
||||||
user.setPassword(md5Pwd);
|
user.setPassword(md5Pwd);
|
||||||
userService.update(user);
|
userService.update(user);
|
||||||
@@ -294,36 +258,27 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
flag = 1;
|
flag = 1;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
flag = 2;
|
flag = 2;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改用户ID为 : " + model.getUserID() + "密码信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改用户ID为 : " + model.getUserID() + "密码信息失败", e);
|
||||||
flag = 3;
|
flag = 3;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改用户密码回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改用户密码回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新用户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新用户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新用户ID为 "+ model.getUserID() + "密码信息 " + tipMsg + "!", "更新用户" + tipMsg));
|
, tipType, "更新用户ID为 " + model.getUserID() + "密码信息 " + tipMsg + "!", "更新用户" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -340,41 +295,35 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
flag = 1;
|
flag = 1;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改用户ID为 : " + model.getUserID() + "密码信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改用户ID为 : " + model.getUserID() + "密码信息失败", e);
|
||||||
flag = 0;
|
flag = 0;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
try {
|
try {
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改用户密码回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改用户密码回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "重置用户密码", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "重置用户密码", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis()), tipType, "重置用户ID为 "+ model.getUserID() + "密码信息 " + tipMsg + "!", "重置用户密码" + tipMsg));
|
new Timestamp(System.currentTimeMillis()), tipType, "重置用户ID为 " + model.getUserID() + "密码信息 " + tipMsg + "!", "重置用户密码" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID用户
|
* 批量删除指定ID用户
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
userService.batchDelete(model.getUserIDs());
|
userService.batchDelete(model.getUserIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除用户ID为:" + model.getUserIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除用户ID为:" + model.getUserIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -382,57 +331,44 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除用户", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除用户", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除用户ID为 "+ model.getUserIDs() + " " + tipMsg + "!", "批量删除用户" + tipMsg));
|
, tipType, "批量删除用户ID为 " + model.getUserIDs() + " " + tipMsg + "!", "批量删除用户" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查输入名称是否存在
|
* 检查输入名称是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsNameExist()
|
public void checkIsNameExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
String fieldName = "";
|
String fieldName = "";
|
||||||
String fieldValue = "";
|
String fieldValue = "";
|
||||||
try
|
try {
|
||||||
{
|
if (0 == model.getCheckFlag()) {
|
||||||
if(0 == model.getCheckFlag())
|
|
||||||
{
|
|
||||||
fieldName = "username";
|
fieldName = "username";
|
||||||
fieldValue = model.getUsername();
|
fieldValue = model.getUsername();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
fieldName = "loginame";
|
fieldName = "loginame";
|
||||||
fieldValue = model.getLoginame();
|
fieldValue = model.getLoginame();
|
||||||
}
|
}
|
||||||
flag = userService.checkIsNameExist(fieldName,fieldValue, model.getUserID());
|
flag = userService.checkIsNameExist(fieldName, fieldValue, model.getUserID());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查用户名称为:" + fieldValue + " ID为: " + model.getUserID() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查用户名称为:" + fieldValue + " ID为: " + model.getUserID() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查用户名称为:" + fieldValue + " ID为: " + model.getUserID() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查用户名称为:" + fieldValue + " ID为: " + model.getUserID() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找用户信息
|
* 查找用户信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Basicuser> pageUtil = new PageUtil<Basicuser>();
|
PageUtil<Basicuser> pageUtil = new PageUtil<Basicuser>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -448,10 +384,8 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Basicuser user : dataList) {
|
||||||
for(Basicuser user:dataList)
|
|
||||||
{
|
|
||||||
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", user.getId());
|
item.put("id", user.getId());
|
||||||
@@ -462,11 +396,11 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
item.put("department", Tools.dealNullStr(user.getDepartment()));
|
item.put("department", Tools.dealNullStr(user.getDepartment()));
|
||||||
item.put("email", Tools.dealNullStr(user.getEmail()));
|
item.put("email", Tools.dealNullStr(user.getEmail()));
|
||||||
item.put("phonenum", Tools.dealNullStr(user.getPhonenum()));
|
item.put("phonenum", Tools.dealNullStr(user.getPhonenum()));
|
||||||
item.put("ismanager", user.getIsmanager()== (short)0?"是":"否");
|
item.put("ismanager", user.getIsmanager() == (short) 0 ? "是" : "否");
|
||||||
item.put("isystem",user.getIsystem() == (short)0?"是":"否");
|
item.put("isystem", user.getIsystem() == (short) 0 ? "是" : "否");
|
||||||
item.put("status", user.getStatus());
|
item.put("status", user.getStatus());
|
||||||
item.put("description", Tools.dealNullStr(user.getDescription()));
|
item.put("description", Tools.dealNullStr(user.getDescription()));
|
||||||
item.put("remark",user.getRemark());
|
item.put("remark", user.getRemark());
|
||||||
item.put("op", user.getIsystem());
|
item.put("op", user.getIsystem());
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
@@ -474,27 +408,23 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找用户信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找用户信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询用户信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询用户信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return 拼接后的条件
|
* @return 拼接后的条件
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("username_s_like", model.getUsername());
|
condition.put("username_s_like", model.getUsername());
|
||||||
condition.put("loginame_s_like", model.getLoginame());
|
condition.put("loginame_s_like", model.getLoginame());
|
||||||
condition.put("id_s_order", "asc");
|
condition.put("id_s_order", "asc");
|
||||||
@@ -503,12 +433,11 @@ public class UserAction extends BaseAction<UserModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public UserModel getModel()
|
public UserModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setUserService(UserIService userService)
|
|
||||||
{
|
public void setUserService(UserIService userService) {
|
||||||
this.userService = userService;
|
this.userService = userService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +1,42 @@
|
|||||||
package com.jsh.action.basic;
|
package com.jsh.action.basic;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
import com.jsh.model.po.Logdetails;
|
||||||
|
import com.jsh.model.po.UserBusiness;
|
||||||
|
import com.jsh.model.vo.basic.UserBusinessModel;
|
||||||
|
import com.jsh.service.basic.UserBusinessIService;
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.jsh.model.po.Functions;
|
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
import com.jsh.base.BaseAction;
|
|
||||||
import com.jsh.base.Log;
|
|
||||||
import com.jsh.model.po.UserBusiness;
|
|
||||||
import com.jsh.model.po.Logdetails;
|
|
||||||
import com.jsh.model.vo.basic.UserBusinessModel;
|
|
||||||
import com.jsh.service.basic.UserBusinessIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
/*
|
/*
|
||||||
* 权限关系管理
|
* 权限关系管理
|
||||||
* @author jishenghua qq:752718920
|
* @author jishenghua qq:752718920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class UserBusinessAction extends BaseAction<UserBusinessModel>
|
public class UserBusinessAction extends BaseAction<UserBusinessModel> {
|
||||||
{
|
|
||||||
private UserBusinessIService userBusinessService;
|
private UserBusinessIService userBusinessService;
|
||||||
private UserBusinessModel model = new UserBusinessModel();
|
private UserBusinessModel model = new UserBusinessModel();
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getBasicData()
|
public String getBasicData() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
|
||||||
condition.put("KeyId_s_eq", model.getKeyId());
|
condition.put("KeyId_s_eq", model.getKeyId());
|
||||||
condition.put("Type_s_eq", model.getType());
|
condition.put("Type_s_eq", model.getType());
|
||||||
userBusinessService.find(pageUtil);
|
userBusinessService.find(pageUtil);
|
||||||
mapData.put("userBusinessList", pageUtil.getPageList());
|
mapData.put("userBusinessList", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找UserBusiness信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找UserBusiness信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exceptoin");
|
model.getShowModel().setMsgTip("exceptoin");
|
||||||
}
|
}
|
||||||
@@ -51,22 +46,18 @@ public class UserBusinessAction extends BaseAction<UserBusinessModel>
|
|||||||
/*
|
/*
|
||||||
* 测试hql语句的写法
|
* 测试hql语句的写法
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getceshi()
|
public String getceshi() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
|
||||||
condition.put("Type_s_eq", model.getType());
|
condition.put("Type_s_eq", model.getType());
|
||||||
userBusinessService.find(pageUtil,"ceshi");
|
userBusinessService.find(pageUtil, "ceshi");
|
||||||
mapData.put("userBusinessList", pageUtil.getPageList());
|
mapData.put("userBusinessList", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找UserBusiness信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找UserBusiness信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exceptoin");
|
model.getShowModel().setMsgTip("exceptoin");
|
||||||
}
|
}
|
||||||
@@ -75,14 +66,13 @@ public class UserBusinessAction extends BaseAction<UserBusinessModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加UserBusiness
|
* 增加UserBusiness
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加UserBusiness信息方法create()===================");
|
Log.infoFileSync("==================开始调用增加UserBusiness信息方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
UserBusiness userBusiness = new UserBusiness();
|
UserBusiness userBusiness = new UserBusiness();
|
||||||
userBusiness.setType(model.getType());
|
userBusiness.setType(model.getType());
|
||||||
userBusiness.setKeyId(model.getKeyId());
|
userBusiness.setKeyId(model.getKeyId());
|
||||||
@@ -94,53 +84,43 @@ public class UserBusinessAction extends BaseAction<UserBusinessModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加UserBusiness信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加UserBusiness信息异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加UserBusiness信息回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加UserBusiness信息回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加UserBusiness", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加UserBusiness", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加UserBusiness为 "+ model.getType() + " " + tipMsg + "!", "增加UserBusiness" + tipMsg));
|
, tipType, "增加UserBusiness为 " + model.getType() + " " + tipMsg + "!", "增加UserBusiness" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加UserBusiness方法create()===================");
|
Log.infoFileSync("==================结束调用增加UserBusiness方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新UserBusiness
|
* 更新UserBusiness
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
Long id=0l;
|
Long id = 0l;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
PageUtil<UserBusiness> pageUtil = new PageUtil<UserBusiness>();
|
PageUtil<UserBusiness> pageUtil = new PageUtil<UserBusiness>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
pageUtil.setAdvSearch(getCondition_RoleAPP());
|
pageUtil.setAdvSearch(getCondition_RoleAPP());
|
||||||
userBusinessService.find(pageUtil);
|
userBusinessService.find(pageUtil);
|
||||||
List<UserBusiness> dataList = pageUtil.getPageList();
|
List<UserBusiness> dataList = pageUtil.getPageList();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (UserBusiness userBusiness : dataList) {
|
||||||
for(UserBusiness userBusiness:dataList)
|
id = userBusiness.getId();
|
||||||
{
|
|
||||||
id=userBusiness.getId();
|
|
||||||
}
|
}
|
||||||
UserBusiness userBusiness = userBusinessService.get(id);
|
UserBusiness userBusiness = userBusinessService.get(id);
|
||||||
userBusiness.setType(model.getType());
|
userBusiness.setType(model.getType());
|
||||||
@@ -152,32 +132,26 @@ public class UserBusinessAction extends BaseAction<UserBusinessModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改UserBusiness的ID为 : " + id + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改UserBusiness的ID为 : " + id + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改UserBusiness回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改UserBusiness回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新UserBusiness", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新UserBusiness", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新UserBusiness的ID为 "+ id + " " + tipMsg + "!", "更新UserBusiness" + tipMsg));
|
, tipType, "更新UserBusiness的ID为 " + id + " " + tipMsg + "!", "更新UserBusiness" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新角色的按钮权限
|
* 更新角色的按钮权限
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void updateBtnStr() {
|
public void updateBtnStr() {
|
||||||
@@ -192,36 +166,33 @@ public class UserBusinessAction extends BaseAction<UserBusinessModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改角色按钮权限的ID为 : " + model.getUserBusinessID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改角色按钮权限的ID为 : " + model.getUserBusinessID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
try {
|
try {
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改功能回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改功能回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新角色按钮权限", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新角色按钮权限", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis()), tipType,
|
new Timestamp(System.currentTimeMillis()), tipType,
|
||||||
"角色按钮权限的ID为 "+ model.getUserBusinessID() + " " + tipMsg + "!", "更新角色按钮权限" + tipMsg));
|
"角色按钮权限的ID为 " + model.getUserBusinessID() + " " + tipMsg + "!", "更新角色按钮权限" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-RoleAPP
|
* 拼接搜索条件-RoleAPP
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_RoleAPP()
|
private Map<String, Object> getCondition_RoleAPP() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("Type_s_eq", model.getType());
|
condition.put("Type_s_eq", model.getType());
|
||||||
condition.put("KeyId_s_eq", model.getKeyId());
|
condition.put("KeyId_s_eq", model.getKeyId());
|
||||||
return condition;
|
return condition;
|
||||||
@@ -230,38 +201,28 @@ public class UserBusinessAction extends BaseAction<UserBusinessModel>
|
|||||||
/**
|
/**
|
||||||
* 检查角色对应应用/功能是否存在
|
* 检查角色对应应用/功能是否存在
|
||||||
*/
|
*/
|
||||||
public void checkIsValueExist()
|
public void checkIsValueExist() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
flag = userBusinessService.checkIsValueExist("Type", model.getType(), "KeyId", model.getKeyId());
|
||||||
flag = userBusinessService.checkIsValueExist("Type",model.getType(),"KeyId", model.getKeyId());
|
} catch (DataAccessException e) {
|
||||||
}
|
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查角色对应应用/功能的类型为:" + model.getType() + " KeyId为: " + model.getKeyId() + " 是否存在异常!");
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>检查角色对应应用/功能的类型为:" + model.getType() + " KeyId为: " + model.getKeyId() + " 是否存在异常!");
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
Log.errorFileSync(">>>>>>>>>>>>回写检查角色对应应用/功能的类型为:" + model.getType() + " KeyId为: " + model.getKeyId() + " 是否存在异常!", e);
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>回写检查角色对应应用/功能的类型为:" + model.getType() + " KeyId为: " + model.getKeyId() + " 是否存在异常!",e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public UserBusinessModel getModel()
|
public UserBusinessModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setUserBusinessService(UserBusinessIService userBusinessService)
|
|
||||||
{
|
public void setUserBusinessService(UserBusinessIService userBusinessService) {
|
||||||
this.userBusinessService = userBusinessService;
|
this.userBusinessService = userBusinessService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,58 +1,46 @@
|
|||||||
package com.jsh.action.materials;
|
package com.jsh.action.materials;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
import com.jsh.model.po.*;
|
||||||
|
import com.jsh.model.vo.materials.AccountHeadModel;
|
||||||
|
import com.jsh.service.materials.AccountHeadIService;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
import com.jsh.util.Tools;
|
||||||
|
import net.sf.json.JSONArray;
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.Account;
|
|
||||||
import com.jsh.model.po.AccountHead;
|
|
||||||
import com.jsh.model.po.Logdetails;
|
|
||||||
import com.jsh.model.po.Person;
|
|
||||||
import com.jsh.model.po.Supplier;
|
|
||||||
import com.jsh.model.vo.materials.AccountHeadModel;
|
|
||||||
import com.jsh.service.materials.AccountHeadIService;
|
|
||||||
import com.jsh.service.materials.DepotHeadIService;
|
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
import com.jsh.util.Tools;
|
|
||||||
/*
|
/*
|
||||||
* 财务表头管理
|
* 财务表头管理
|
||||||
* @author jishenghua qq:752718920
|
* @author jishenghua qq:752718920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
public class AccountHeadAction extends BaseAction<AccountHeadModel> {
|
||||||
{
|
|
||||||
private AccountHeadIService accountHeadService;
|
private AccountHeadIService accountHeadService;
|
||||||
private AccountHeadModel model = new AccountHeadModel();
|
private AccountHeadModel model = new AccountHeadModel();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 获取MaxId
|
* 获取MaxId
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getMaxId()
|
public String getMaxId() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
accountHeadService.find(pageUtil, "maxId");
|
||||||
accountHeadService.find(pageUtil,"maxId");
|
|
||||||
mapData.put("accountHeadMax", pageUtil.getPageList());
|
mapData.put("accountHeadMax", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找最大的Id信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找最大的Id信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exceptoin");
|
model.getShowModel().setMsgTip("exceptoin");
|
||||||
}
|
}
|
||||||
@@ -61,28 +49,30 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加财务
|
* 增加财务
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加财务信息方法create()===================");
|
Log.infoFileSync("==================开始调用增加财务信息方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
AccountHead accountHead = new AccountHead();
|
AccountHead accountHead = new AccountHead();
|
||||||
accountHead.setType(model.getType());
|
accountHead.setType(model.getType());
|
||||||
if(model.getOrganId()!=null){accountHead.setOrganId(new Supplier(model.getOrganId()));}
|
if (model.getOrganId() != null) {
|
||||||
if(model.getHandsPersonId()!=null){accountHead.setHandsPersonId(new Person(model.getHandsPersonId()));}
|
accountHead.setOrganId(new Supplier(model.getOrganId()));
|
||||||
accountHead.setChangeAmount(model.getChangeAmount()==null ? 0:model.getChangeAmount());
|
|
||||||
accountHead.setTotalPrice(model.getTotalPrice());
|
|
||||||
if(model.getAccountId()!=null){accountHead.setAccountId(new Account(model.getAccountId()));}
|
|
||||||
accountHead.setBillNo(model.getBillNo());
|
|
||||||
try
|
|
||||||
{
|
|
||||||
accountHead.setBillTime(new Timestamp(Tools.parse(model.getBillTime(), "yyyy-MM-dd HH:mm:ss").getTime()));
|
|
||||||
}
|
}
|
||||||
catch (ParseException e)
|
if (model.getHandsPersonId() != null) {
|
||||||
{
|
accountHead.setHandsPersonId(new Person(model.getHandsPersonId()));
|
||||||
|
}
|
||||||
|
accountHead.setChangeAmount(model.getChangeAmount() == null ? 0 : model.getChangeAmount());
|
||||||
|
accountHead.setTotalPrice(model.getTotalPrice());
|
||||||
|
if (model.getAccountId() != null) {
|
||||||
|
accountHead.setAccountId(new Account(model.getAccountId()));
|
||||||
|
}
|
||||||
|
accountHead.setBillNo(model.getBillNo());
|
||||||
|
try {
|
||||||
|
accountHead.setBillTime(new Timestamp(Tools.parse(model.getBillTime(), "yyyy-MM-dd HH:mm:ss").getTime()));
|
||||||
|
} catch (ParseException e) {
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
|
||||||
}
|
}
|
||||||
accountHead.setRemark(model.getRemark());
|
accountHead.setRemark(model.getRemark());
|
||||||
@@ -93,47 +83,37 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加财务信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加财务信息异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加财务信息回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加财务信息回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加财务", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加财务", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加财务编号为 "+ model.getBillNo() + " " + tipMsg + "!", "增加财务" + tipMsg));
|
, tipType, "增加财务编号为 " + model.getBillNo() + " " + tipMsg + "!", "增加财务" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加财务方法create()===================");
|
Log.infoFileSync("==================结束调用增加财务方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除财务
|
* 删除财务
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除财务信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除财务信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
accountHeadService.delete(model.getAccountHeadID());
|
accountHeadService.delete(model.getAccountHeadID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAccountHeadID() + " 的财务异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAccountHeadID() + " 的财务异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -141,34 +121,36 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除财务", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除财务", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除财务ID为 "+ model.getAccountHeadID() + " " + tipMsg + "!", "删除财务" + tipMsg));
|
, tipType, "删除财务ID为 " + model.getAccountHeadID() + " " + tipMsg + "!", "删除财务" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除财务信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除财务信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新财务
|
* 更新财务
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
AccountHead accountHead = accountHeadService.get(model.getAccountHeadID());
|
AccountHead accountHead = accountHeadService.get(model.getAccountHeadID());
|
||||||
accountHead.setType(model.getType());
|
accountHead.setType(model.getType());
|
||||||
if(model.getOrganId()!=null){accountHead.setOrganId(new Supplier(model.getOrganId()));}
|
if (model.getOrganId() != null) {
|
||||||
if(model.getHandsPersonId()!=null){accountHead.setHandsPersonId(new Person(model.getHandsPersonId()));}
|
accountHead.setOrganId(new Supplier(model.getOrganId()));
|
||||||
accountHead.setChangeAmount(model.getChangeAmount()==null ? 0:model.getChangeAmount());
|
|
||||||
accountHead.setTotalPrice(model.getTotalPrice());
|
|
||||||
if(model.getAccountId()!=null){accountHead.setAccountId(new Account(model.getAccountId()));}
|
|
||||||
accountHead.setBillNo(model.getBillNo());
|
|
||||||
try
|
|
||||||
{
|
|
||||||
accountHead.setBillTime(new Timestamp(Tools.parse(model.getBillTime(), "yyyy-MM-dd HH:mm:ss").getTime()));
|
|
||||||
}
|
}
|
||||||
catch (ParseException e)
|
if (model.getHandsPersonId() != null) {
|
||||||
{
|
accountHead.setHandsPersonId(new Person(model.getHandsPersonId()));
|
||||||
|
}
|
||||||
|
accountHead.setChangeAmount(model.getChangeAmount() == null ? 0 : model.getChangeAmount());
|
||||||
|
accountHead.setTotalPrice(model.getTotalPrice());
|
||||||
|
if (model.getAccountId() != null) {
|
||||||
|
accountHead.setAccountId(new Account(model.getAccountId()));
|
||||||
|
}
|
||||||
|
accountHead.setBillNo(model.getBillNo());
|
||||||
|
try {
|
||||||
|
accountHead.setBillTime(new Timestamp(Tools.parse(model.getBillTime(), "yyyy-MM-dd HH:mm:ss").getTime()));
|
||||||
|
} catch (ParseException e) {
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
|
||||||
}
|
}
|
||||||
accountHead.setRemark(model.getRemark());
|
accountHead.setRemark(model.getRemark());
|
||||||
@@ -177,46 +159,36 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改财务ID为 : " + model.getAccountHeadID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改财务ID为 : " + model.getAccountHeadID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改财务回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改财务回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新财务", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新财务", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新财务ID为 "+ model.getAccountHeadID() + " " + tipMsg + "!", "更新财务" + tipMsg));
|
, tipType, "更新财务ID为 " + model.getAccountHeadID() + " " + tipMsg + "!", "更新财务" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID财务
|
* 批量删除指定ID财务
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
accountHeadService.batchDelete(model.getAccountHeadIDs());
|
accountHeadService.batchDelete(model.getAccountHeadIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除财务ID为:" + model.getAccountHeadIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除财务ID为:" + model.getAccountHeadIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -224,18 +196,17 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除财务", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除财务", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除财务ID为 "+ model.getAccountHeadIDs() + " " + tipMsg + "!", "批量删除财务" + tipMsg));
|
, tipType, "批量删除财务ID为 " + model.getAccountHeadIDs() + " " + tipMsg + "!", "批量删除财务" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找财务信息
|
* 查找财务信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<AccountHead> pageUtil = new PageUtil<AccountHead>();
|
PageUtil<AccountHead> pageUtil = new PageUtil<AccountHead>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -247,22 +218,20 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (AccountHead accountHead : dataList) {
|
||||||
for(AccountHead accountHead:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", accountHead.getId());
|
item.put("Id", accountHead.getId());
|
||||||
item.put("OrganId", accountHead.getOrganId()==null?"":accountHead.getOrganId().getId());
|
item.put("OrganId", accountHead.getOrganId() == null ? "" : accountHead.getOrganId().getId());
|
||||||
item.put("OrganName", accountHead.getOrganId()==null?"":accountHead.getOrganId().getSupplier());
|
item.put("OrganName", accountHead.getOrganId() == null ? "" : accountHead.getOrganId().getSupplier());
|
||||||
item.put("HandsPersonId", accountHead.getHandsPersonId()==null?"":accountHead.getHandsPersonId().getId());
|
item.put("HandsPersonId", accountHead.getHandsPersonId() == null ? "" : accountHead.getHandsPersonId().getId());
|
||||||
item.put("HandsPersonName", accountHead.getHandsPersonId()==null?"":accountHead.getHandsPersonId().getName());
|
item.put("HandsPersonName", accountHead.getHandsPersonId() == null ? "" : accountHead.getHandsPersonId().getName());
|
||||||
item.put("AccountId", accountHead.getAccountId()==null?"":accountHead.getAccountId().getId());
|
item.put("AccountId", accountHead.getAccountId() == null ? "" : accountHead.getAccountId().getId());
|
||||||
item.put("AccountName", accountHead.getAccountId()==null?"":accountHead.getAccountId().getName());
|
item.put("AccountName", accountHead.getAccountId() == null ? "" : accountHead.getAccountId().getName());
|
||||||
item.put("BillNo", accountHead.getBillNo());
|
item.put("BillNo", accountHead.getBillNo());
|
||||||
item.put("BillTime", Tools.getCenternTime(accountHead.getBillTime()));
|
item.put("BillTime", Tools.getCenternTime(accountHead.getBillTime()));
|
||||||
item.put("ChangeAmount", accountHead.getChangeAmount()==null?"":Math.abs(accountHead.getChangeAmount()));
|
item.put("ChangeAmount", accountHead.getChangeAmount() == null ? "" : Math.abs(accountHead.getChangeAmount()));
|
||||||
item.put("TotalPrice", accountHead.getTotalPrice()==null?"":Math.abs(accountHead.getTotalPrice()));
|
item.put("TotalPrice", accountHead.getTotalPrice() == null ? "" : Math.abs(accountHead.getTotalPrice()));
|
||||||
item.put("Remark", accountHead.getRemark());
|
item.put("Remark", accountHead.getRemark());
|
||||||
item.put("op", 1);
|
item.put("op", 1);
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
@@ -271,13 +240,9 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找财务信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找财务信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询财务信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询财务信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -285,7 +250,7 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
/**
|
/**
|
||||||
* 根据编号查询单据信息
|
* 根据编号查询单据信息
|
||||||
*/
|
*/
|
||||||
public void getDetailByNumber(){
|
public void getDetailByNumber() {
|
||||||
try {
|
try {
|
||||||
PageUtil<AccountHead> pageUtil = new PageUtil<AccountHead>();
|
PageUtil<AccountHead> pageUtil = new PageUtil<AccountHead>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
@@ -294,75 +259,69 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
accountHeadService.find(pageUtil);
|
accountHeadService.find(pageUtil);
|
||||||
List<AccountHead> dataList = pageUtil.getPageList();
|
List<AccountHead> dataList = pageUtil.getPageList();
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
if(dataList!=null && dataList.get(0)!=null) {
|
if (dataList != null && dataList.get(0) != null) {
|
||||||
AccountHead accountHead = dataList.get(0);
|
AccountHead accountHead = dataList.get(0);
|
||||||
item.put("Id", accountHead.getId());
|
item.put("Id", accountHead.getId());
|
||||||
item.put("OrganId", accountHead.getOrganId()==null?"":accountHead.getOrganId().getId());
|
item.put("OrganId", accountHead.getOrganId() == null ? "" : accountHead.getOrganId().getId());
|
||||||
item.put("OrganName", accountHead.getOrganId()==null?"":accountHead.getOrganId().getSupplier());
|
item.put("OrganName", accountHead.getOrganId() == null ? "" : accountHead.getOrganId().getSupplier());
|
||||||
item.put("HandsPersonId", accountHead.getHandsPersonId()==null?"":accountHead.getHandsPersonId().getId());
|
item.put("HandsPersonId", accountHead.getHandsPersonId() == null ? "" : accountHead.getHandsPersonId().getId());
|
||||||
item.put("HandsPersonName", accountHead.getHandsPersonId()==null?"":accountHead.getHandsPersonId().getName());
|
item.put("HandsPersonName", accountHead.getHandsPersonId() == null ? "" : accountHead.getHandsPersonId().getName());
|
||||||
item.put("AccountId", accountHead.getAccountId()==null?"":accountHead.getAccountId().getId());
|
item.put("AccountId", accountHead.getAccountId() == null ? "" : accountHead.getAccountId().getId());
|
||||||
item.put("AccountName", accountHead.getAccountId()==null?"":accountHead.getAccountId().getName());
|
item.put("AccountName", accountHead.getAccountId() == null ? "" : accountHead.getAccountId().getName());
|
||||||
item.put("BillNo", accountHead.getBillNo());
|
item.put("BillNo", accountHead.getBillNo());
|
||||||
item.put("BillTime", Tools.getCenternTime(accountHead.getBillTime()));
|
item.put("BillTime", Tools.getCenternTime(accountHead.getBillTime()));
|
||||||
item.put("ChangeAmount", accountHead.getChangeAmount()==null?"":Math.abs(accountHead.getChangeAmount()));
|
item.put("ChangeAmount", accountHead.getChangeAmount() == null ? "" : Math.abs(accountHead.getChangeAmount()));
|
||||||
item.put("TotalPrice", accountHead.getTotalPrice()==null?"":Math.abs(accountHead.getTotalPrice()));
|
item.put("TotalPrice", accountHead.getTotalPrice() == null ? "" : Math.abs(accountHead.getTotalPrice()));
|
||||||
item.put("Remark", accountHead.getRemark());
|
item.put("Remark", accountHead.getRemark());
|
||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(item.toString());
|
toClient(item.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找单据信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找单据信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询单据信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询单据信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询单位的累计应收和累计应付,收预付款不计入此处
|
* 查询单位的累计应收和累计应付,收预付款不计入此处
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findTotalPay() {
|
public void findTotalPay() {
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
JSONObject outer = new JSONObject();
|
JSONObject outer = new JSONObject();
|
||||||
Double sum = 0.0;
|
Double sum = 0.0;
|
||||||
String getS = model.getSupplierId();
|
String getS = model.getSupplierId();
|
||||||
String supType = model.getSupType(); //单位类型:客户、供应商
|
String supType = model.getSupType(); //单位类型:客户、供应商
|
||||||
int i = 1;
|
int i = 1;
|
||||||
if(supType.equals("customer")){ //客户
|
if (supType.equals("customer")) { //客户
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
} else if (supType.equals("vendor")) { //供应商
|
||||||
else if(supType.equals("vendor")){ //供应商
|
|
||||||
i = -1;
|
i = -1;
|
||||||
}
|
}
|
||||||
//收付款部分
|
//收付款部分
|
||||||
sum = sum + (allMoney(getS, "付款", "合计") + allMoney(getS, "付款", "实际"))*i;
|
sum = sum + (allMoney(getS, "付款", "合计") + allMoney(getS, "付款", "实际")) * i;
|
||||||
sum = sum - (allMoney(getS, "收款", "合计") + allMoney(getS, "收款", "实际"))*i;
|
sum = sum - (allMoney(getS, "收款", "合计") + allMoney(getS, "收款", "实际")) * i;
|
||||||
sum = sum + (allMoney(getS, "收入", "合计") - allMoney(getS, "收入", "实际"))*i;
|
sum = sum + (allMoney(getS, "收入", "合计") - allMoney(getS, "收入", "实际")) * i;
|
||||||
sum = sum - (allMoney(getS, "支出", "合计") - allMoney(getS, "支出", "实际"))*i;
|
sum = sum - (allMoney(getS, "支出", "合计") - allMoney(getS, "支出", "实际")) * i;
|
||||||
outer.put("getAllMoney", sum);
|
outer.put("getAllMoney", sum);
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计总金额
|
* 统计总金额
|
||||||
|
*
|
||||||
* @param type
|
* @param type
|
||||||
* @param mode 合计或者金额
|
* @param mode 合计或者金额
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public Double allMoney(String getS, String type, String mode) {
|
public Double allMoney(String getS, String type, String mode) {
|
||||||
Log.infoFileSync("getS:" + getS);
|
Log.infoFileSync("getS:" + getS);
|
||||||
Double allMoney = 0.0;
|
Double allMoney = 0.0;
|
||||||
@@ -375,8 +334,8 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
Integer supplierId = Integer.valueOf(getS);
|
Integer supplierId = Integer.valueOf(getS);
|
||||||
accountHeadService.findAllMoney(pageUtil, supplierId, type, mode);
|
accountHeadService.findAllMoney(pageUtil, supplierId, type, mode);
|
||||||
allReturn = pageUtil.getPageList().toString();
|
allReturn = pageUtil.getPageList().toString();
|
||||||
allReturn = allReturn.substring(1,allReturn.length()-1);
|
allReturn = allReturn.substring(1, allReturn.length() - 1);
|
||||||
if(allReturn.equals("null")){
|
if (allReturn.equals("null")) {
|
||||||
allReturn = "0";
|
allReturn = "0";
|
||||||
}
|
}
|
||||||
} catch (JshException e) {
|
} catch (JshException e) {
|
||||||
@@ -385,50 +344,50 @@ public class AccountHeadAction extends BaseAction<AccountHeadModel>
|
|||||||
}
|
}
|
||||||
allMoney = Double.parseDouble(allReturn);
|
allMoney = Double.parseDouble(allReturn);
|
||||||
//返回正数,如果负数也转为正数
|
//返回正数,如果负数也转为正数
|
||||||
if(allMoney<0){
|
if (allMoney < 0) {
|
||||||
allMoney = -allMoney;
|
allMoney = -allMoney;
|
||||||
}
|
}
|
||||||
return allMoney;
|
return allMoney;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String,Object> getConditionByNumber() {
|
private Map<String, Object> getConditionByNumber() {
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("BillNo_s_eq",model.getBillNo());
|
condition.put("BillNo_s_eq", model.getBillNo());
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
{condition.put("BillNo_s_like", model.getBillNo());}
|
{
|
||||||
condition.put("Type_s_eq",model.getType());
|
condition.put("BillNo_s_like", model.getBillNo());
|
||||||
condition.put("BillTime_s_gteq",model.getBeginTime());
|
}
|
||||||
condition.put("BillTime_s_lteq",model.getEndTime());
|
condition.put("Type_s_eq", model.getType());
|
||||||
condition.put("Id_s_order","desc");
|
condition.put("BillTime_s_gteq", model.getBeginTime());
|
||||||
|
condition.put("BillTime_s_lteq", model.getEndTime());
|
||||||
|
condition.put("Id_s_order", "desc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String,Object> getConditionHead_byEndTime()
|
private Map<String, Object> getConditionHead_byEndTime() {
|
||||||
{
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
|
||||||
condition.put("BillTime_s_lteq", model.getEndTime());
|
condition.put("BillTime_s_lteq", model.getEndTime());
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
public AccountHeadModel getModel()
|
public AccountHeadModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setAccountHeadService(AccountHeadIService accountHeadService)
|
|
||||||
{
|
public void setAccountHeadService(AccountHeadIService accountHeadService) {
|
||||||
this.accountHeadService = accountHeadService;
|
this.accountHeadService = accountHeadService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,100 +1,96 @@
|
|||||||
package com.jsh.action.materials;
|
package com.jsh.action.materials;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
import com.jsh.model.po.*;
|
||||||
|
import com.jsh.model.vo.materials.AccountItemModel;
|
||||||
|
import com.jsh.service.materials.AccountItemIService;
|
||||||
|
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.io.IOException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.AccountHead;
|
|
||||||
import com.jsh.model.po.AccountItem;
|
|
||||||
import com.jsh.model.po.Logdetails;
|
|
||||||
import com.jsh.model.po.Account;
|
|
||||||
import com.jsh.model.po.InOutItem;
|
|
||||||
import com.jsh.model.vo.materials.AccountItemModel;
|
|
||||||
import com.jsh.service.materials.AccountItemIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
/*
|
/*
|
||||||
* 财务明细管理(收支|收付款|转账)
|
* 财务明细管理(收支|收付款|转账)
|
||||||
* @author jishenghua qq:752718920
|
* @author jishenghua qq:752718920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class AccountItemAction extends BaseAction<AccountItemModel>
|
public class AccountItemAction extends BaseAction<AccountItemModel> {
|
||||||
{
|
|
||||||
private AccountItemIService accountItemService;
|
private AccountItemIService accountItemService;
|
||||||
private AccountItemModel model = new AccountItemModel();
|
private AccountItemModel model = new AccountItemModel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存明细
|
* 保存明细
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void saveDetials()
|
public void saveDetials() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用保存财务明细信息方法saveDetials()===================");
|
Log.infoFileSync("==================开始调用保存财务明细信息方法saveDetials()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
Long headerId = model.getHeaderId();
|
||||||
Long headerId=model.getHeaderId();
|
|
||||||
String listType = model.getListType(); //单据类型
|
String listType = model.getListType(); //单据类型
|
||||||
String inserted=model.getInserted();
|
String inserted = model.getInserted();
|
||||||
String deleted=model.getDeleted();
|
String deleted = model.getDeleted();
|
||||||
String updated=model.getUpdated();
|
String updated = model.getUpdated();
|
||||||
//转为json
|
//转为json
|
||||||
JSONArray insertedJson = JSONArray.fromObject(inserted);
|
JSONArray insertedJson = JSONArray.fromObject(inserted);
|
||||||
JSONArray deletedJson = JSONArray.fromObject(deleted);
|
JSONArray deletedJson = JSONArray.fromObject(deleted);
|
||||||
JSONArray updatedJson = JSONArray.fromObject(updated);
|
JSONArray updatedJson = JSONArray.fromObject(updated);
|
||||||
if(null != insertedJson)
|
if (null != insertedJson) {
|
||||||
{
|
for (int i = 0; i < insertedJson.size(); i++) {
|
||||||
for(int i = 0;i < insertedJson.size(); i++)
|
|
||||||
{
|
|
||||||
AccountItem accountItem = new AccountItem();
|
AccountItem accountItem = new AccountItem();
|
||||||
JSONObject tempInsertedJson = JSONObject.fromObject(insertedJson.get(i));
|
JSONObject tempInsertedJson = JSONObject.fromObject(insertedJson.get(i));
|
||||||
accountItem.setHeaderId(new AccountHead(headerId));
|
accountItem.setHeaderId(new AccountHead(headerId));
|
||||||
if(tempInsertedJson.get("AccountId")!=null&&!tempInsertedJson.get("AccountId").equals("")){accountItem.setAccountId(new Account(tempInsertedJson.getLong("AccountId")));}
|
if (tempInsertedJson.get("AccountId") != null && !tempInsertedJson.get("AccountId").equals("")) {
|
||||||
if(tempInsertedJson.get("InOutItemId")!=null&&!tempInsertedJson.get("InOutItemId").equals("")){accountItem.setInOutItemId(new InOutItem(tempInsertedJson.getLong("InOutItemId")));}
|
accountItem.setAccountId(new Account(tempInsertedJson.getLong("AccountId")));
|
||||||
if(tempInsertedJson.get("EachAmount")!=null&&!tempInsertedJson.get("EachAmount").equals("")){
|
}
|
||||||
|
if (tempInsertedJson.get("InOutItemId") != null && !tempInsertedJson.get("InOutItemId").equals("")) {
|
||||||
|
accountItem.setInOutItemId(new InOutItem(tempInsertedJson.getLong("InOutItemId")));
|
||||||
|
}
|
||||||
|
if (tempInsertedJson.get("EachAmount") != null && !tempInsertedJson.get("EachAmount").equals("")) {
|
||||||
Double eachAmount = tempInsertedJson.getDouble("EachAmount");
|
Double eachAmount = tempInsertedJson.getDouble("EachAmount");
|
||||||
if(listType.equals("付款")) {
|
if (listType.equals("付款")) {
|
||||||
eachAmount = 0 - eachAmount;
|
eachAmount = 0 - eachAmount;
|
||||||
}
|
}
|
||||||
accountItem.setEachAmount(eachAmount);
|
accountItem.setEachAmount(eachAmount);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
accountItem.setEachAmount(0.0);
|
accountItem.setEachAmount(0.0);
|
||||||
}
|
}
|
||||||
accountItem.setRemark(tempInsertedJson.getString("Remark"));
|
accountItem.setRemark(tempInsertedJson.getString("Remark"));
|
||||||
accountItemService.create(accountItem);
|
accountItemService.create(accountItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(null != deletedJson)
|
if (null != deletedJson) {
|
||||||
{
|
for (int i = 0; i < deletedJson.size(); i++) {
|
||||||
for(int i = 0;i < deletedJson.size(); i++)
|
|
||||||
{
|
|
||||||
JSONObject tempDeletedJson = JSONObject.fromObject(deletedJson.get(i));
|
JSONObject tempDeletedJson = JSONObject.fromObject(deletedJson.get(i));
|
||||||
accountItemService.delete(tempDeletedJson.getLong("Id"));
|
accountItemService.delete(tempDeletedJson.getLong("Id"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(null != updatedJson)
|
if (null != updatedJson) {
|
||||||
{
|
for (int i = 0; i < updatedJson.size(); i++) {
|
||||||
for(int i = 0;i < updatedJson.size(); i++)
|
|
||||||
{
|
|
||||||
JSONObject tempUpdatedJson = JSONObject.fromObject(updatedJson.get(i));
|
JSONObject tempUpdatedJson = JSONObject.fromObject(updatedJson.get(i));
|
||||||
AccountItem accountItem = accountItemService.get(tempUpdatedJson.getLong("Id"));
|
AccountItem accountItem = accountItemService.get(tempUpdatedJson.getLong("Id"));
|
||||||
accountItem.setHeaderId(new AccountHead(headerId));
|
accountItem.setHeaderId(new AccountHead(headerId));
|
||||||
if(tempUpdatedJson.get("AccountId")!=null&&!tempUpdatedJson.get("AccountId").equals("")){accountItem.setAccountId(new Account(tempUpdatedJson.getLong("AccountId")));}
|
if (tempUpdatedJson.get("AccountId") != null && !tempUpdatedJson.get("AccountId").equals("")) {
|
||||||
if(tempUpdatedJson.get("InOutItemId")!=null&&!tempUpdatedJson.get("InOutItemId").equals("")){accountItem.setInOutItemId(new InOutItem(tempUpdatedJson.getLong("InOutItemId")));}
|
accountItem.setAccountId(new Account(tempUpdatedJson.getLong("AccountId")));
|
||||||
if(tempUpdatedJson.get("EachAmount")!=null&&!tempUpdatedJson.get("EachAmount").equals("")){
|
}
|
||||||
|
if (tempUpdatedJson.get("InOutItemId") != null && !tempUpdatedJson.get("InOutItemId").equals("")) {
|
||||||
|
accountItem.setInOutItemId(new InOutItem(tempUpdatedJson.getLong("InOutItemId")));
|
||||||
|
}
|
||||||
|
if (tempUpdatedJson.get("EachAmount") != null && !tempUpdatedJson.get("EachAmount").equals("")) {
|
||||||
Double eachAmount = tempUpdatedJson.getDouble("EachAmount");
|
Double eachAmount = tempUpdatedJson.getDouble("EachAmount");
|
||||||
if(listType.equals("付款")) {
|
if (listType.equals("付款")) {
|
||||||
eachAmount = 0 - eachAmount;
|
eachAmount = 0 - eachAmount;
|
||||||
}
|
}
|
||||||
accountItem.setEachAmount(eachAmount);
|
accountItem.setEachAmount(eachAmount);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
accountItem.setEachAmount(0.0);
|
accountItem.setEachAmount(0.0);
|
||||||
}
|
}
|
||||||
accountItem.setRemark(tempUpdatedJson.getString("Remark"));
|
accountItem.setRemark(tempUpdatedJson.getString("Remark"));
|
||||||
@@ -107,41 +103,33 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>保存财务明细信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>保存财务明细信息异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>保存财务明细信息回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>保存财务明细信息回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "保存财务明细", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "保存财务明细", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "保存财务明细对应主表编号为 "+ model.getHeaderId() + " " + tipMsg + "!", "保存财务明细" + tipMsg));
|
, tipType, "保存财务明细对应主表编号为 " + model.getHeaderId() + " " + tipMsg + "!", "保存财务明细" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用保存财务明细方法saveDetials()===================");
|
Log.infoFileSync("==================结束调用保存财务明细方法saveDetials()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找财务信息
|
* 查找财务信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<AccountItem> pageUtil = new PageUtil<AccountItem>();
|
PageUtil<AccountItem> pageUtil = new PageUtil<AccountItem>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -153,18 +141,16 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (AccountItem accountItem : dataList) {
|
||||||
for(AccountItem accountItem:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", accountItem.getId());
|
item.put("Id", accountItem.getId());
|
||||||
item.put("AccountId", accountItem.getAccountId()==null?"":accountItem.getAccountId().getId());
|
item.put("AccountId", accountItem.getAccountId() == null ? "" : accountItem.getAccountId().getId());
|
||||||
item.put("AccountName", accountItem.getAccountId()==null?"":accountItem.getAccountId().getName());
|
item.put("AccountName", accountItem.getAccountId() == null ? "" : accountItem.getAccountId().getName());
|
||||||
item.put("InOutItemId", accountItem.getInOutItemId()==null?"":accountItem.getInOutItemId().getId());
|
item.put("InOutItemId", accountItem.getInOutItemId() == null ? "" : accountItem.getInOutItemId().getId());
|
||||||
item.put("InOutItemName", accountItem.getInOutItemId()==null?"":accountItem.getInOutItemId().getName());
|
item.put("InOutItemName", accountItem.getInOutItemId() == null ? "" : accountItem.getInOutItemId().getName());
|
||||||
Double eachAmount = accountItem.getEachAmount();
|
Double eachAmount = accountItem.getEachAmount();
|
||||||
item.put("EachAmount", eachAmount < 0 ? 0-eachAmount : eachAmount);
|
item.put("EachAmount", eachAmount < 0 ? 0 - eachAmount : eachAmount);
|
||||||
item.put("Remark", accountItem.getRemark());
|
item.put("Remark", accountItem.getRemark());
|
||||||
item.put("op", 1);
|
item.put("op", 1);
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
@@ -173,40 +159,35 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找财务信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找财务信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询财务信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询财务信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
private Map<String, Object> getCondition() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("HeaderId_n_eq", model.getHeaderId());
|
condition.put("HeaderId_n_eq", model.getHeaderId());
|
||||||
condition.put("Id_s_order","asc");
|
condition.put("Id_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public AccountItemModel getModel()
|
public AccountItemModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setAccountItemService(AccountItemIService accountItemService)
|
|
||||||
{
|
public void setAccountItemService(AccountItemIService accountItemService) {
|
||||||
this.accountItemService = accountItemService;
|
this.accountItemService = accountItemService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,21 @@
|
|||||||
package com.jsh.action.materials;
|
package com.jsh.action.materials;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
import com.jsh.model.po.Logdetails;
|
||||||
|
import com.jsh.model.po.Material;
|
||||||
|
import com.jsh.model.po.MaterialCategory;
|
||||||
|
import com.jsh.model.po.Unit;
|
||||||
|
import com.jsh.model.vo.materials.MaterialModel;
|
||||||
|
import com.jsh.service.materials.MaterialIService;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
|
import com.jsh.util.MaterialConstants;
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
import com.jsh.util.Tools;
|
||||||
|
import net.sf.json.JSONArray;
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
@@ -8,39 +24,25 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.jsh.model.po.*;
|
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.util.MaterialConstants;
|
|
||||||
import com.jsh.util.Tools;
|
|
||||||
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.vo.materials.MaterialModel;
|
|
||||||
import com.jsh.service.materials.MaterialIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
/*
|
/*
|
||||||
* 商品管理
|
* 商品管理
|
||||||
* @author jishenghua qq:752718920
|
* @author jishenghua qq:752718920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class MaterialAction extends BaseAction<MaterialModel>
|
public class MaterialAction extends BaseAction<MaterialModel> {
|
||||||
{
|
public static final String EXCEL = "excel"; //action返回excel结果
|
||||||
private MaterialIService materialService;
|
private MaterialIService materialService;
|
||||||
private MaterialModel model = new MaterialModel();
|
private MaterialModel model = new MaterialModel();
|
||||||
public static final String EXCEL = "excel"; //action返回excel结果
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加商品
|
* 增加商品
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加商品信息方法create()===================");
|
Log.infoFileSync("==================开始调用增加商品信息方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Material material = new Material();
|
Material material = new Material();
|
||||||
material.setMaterialCategory(new MaterialCategory(model.getCategoryId()));
|
material.setMaterialCategory(new MaterialCategory(model.getCategoryId()));
|
||||||
|
|
||||||
@@ -56,10 +58,9 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
material.setLowPrice(model.getLowPrice());
|
material.setLowPrice(model.getLowPrice());
|
||||||
material.setPresetPriceOne(model.getPresetPriceOne());
|
material.setPresetPriceOne(model.getPresetPriceOne());
|
||||||
material.setPresetPriceTwo(model.getPresetPriceTwo());
|
material.setPresetPriceTwo(model.getPresetPriceTwo());
|
||||||
if(model.getUnitId()!=null){
|
if (model.getUnitId() != null) {
|
||||||
material.setUnitId(new Unit(model.getUnitId()));
|
material.setUnitId(new Unit(model.getUnitId()));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
material.setUnitId(null);
|
material.setUnitId(null);
|
||||||
}
|
}
|
||||||
material.setFirstOutUnit(model.getFirstOutUnit());
|
material.setFirstOutUnit(model.getFirstOutUnit());
|
||||||
@@ -77,47 +78,37 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加商品信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加商品信息异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加商品信息回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加商品信息回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加商品", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加商品", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加商品名称为 "+ model.getName() + " " + tipMsg + "!", "增加商品" + tipMsg));
|
, tipType, "增加商品名称为 " + model.getName() + " " + tipMsg + "!", "增加商品" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加商品方法create()===================");
|
Log.infoFileSync("==================结束调用增加商品方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品
|
* 删除商品
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除商品信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除商品信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
materialService.delete(model.getMaterialID());
|
materialService.delete(model.getMaterialID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getMaterialID() + " 的商品异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getMaterialID() + " 的商品异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -125,20 +116,19 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除商品", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除商品", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除商品ID为 "+ model.getMaterialID() + " " + tipMsg + "!", "删除商品" + tipMsg));
|
, tipType, "删除商品ID为 " + model.getMaterialID() + " " + tipMsg + "!", "删除商品" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除商品信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除商品信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商品
|
* 更新商品
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Material material = materialService.get(model.getMaterialID());
|
Material material = materialService.get(model.getMaterialID());
|
||||||
material.setMaterialCategory(new MaterialCategory(model.getCategoryId()));
|
material.setMaterialCategory(new MaterialCategory(model.getCategoryId()));
|
||||||
|
|
||||||
@@ -154,10 +144,9 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
material.setLowPrice(model.getLowPrice());
|
material.setLowPrice(model.getLowPrice());
|
||||||
material.setPresetPriceOne(model.getPresetPriceOne());
|
material.setPresetPriceOne(model.getPresetPriceOne());
|
||||||
material.setPresetPriceTwo(model.getPresetPriceTwo());
|
material.setPresetPriceTwo(model.getPresetPriceTwo());
|
||||||
if(model.getUnitId()!=null){
|
if (model.getUnitId() != null) {
|
||||||
material.setUnitId(new Unit(model.getUnitId()));
|
material.setUnitId(new Unit(model.getUnitId()));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
material.setUnitId(null);
|
material.setUnitId(null);
|
||||||
}
|
}
|
||||||
material.setFirstOutUnit(model.getFirstOutUnit());
|
material.setFirstOutUnit(model.getFirstOutUnit());
|
||||||
@@ -172,46 +161,36 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改商品ID为 : " + model.getMaterialID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改商品ID为 : " + model.getMaterialID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改商品回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改商品回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新商品", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新商品", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新商品ID为 "+ model.getMaterialID() + " " + tipMsg + "!", "更新商品" + tipMsg));
|
, tipType, "更新商品ID为 " + model.getMaterialID() + " " + tipMsg + "!", "更新商品" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID商品
|
* 批量删除指定ID商品
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
materialService.batchDelete(model.getMaterialIDs());
|
materialService.batchDelete(model.getMaterialIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除商品ID为:" + model.getMaterialIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除商品ID为:" + model.getMaterialIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -219,26 +198,23 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除商品", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除商品", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除商品ID为 "+ model.getMaterialIDs() + " " + tipMsg + "!", "批量删除商品" + tipMsg));
|
, tipType, "批量删除商品ID为 " + model.getMaterialIDs() + " " + tipMsg + "!", "批量删除商品" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量设置状态-启用或者禁用
|
* 批量设置状态-启用或者禁用
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchSetEnable()
|
public String batchSetEnable() {
|
||||||
{
|
try {
|
||||||
try
|
materialService.batchSetEnable(model.getEnabled(), model.getMaterialIDs());
|
||||||
{
|
|
||||||
materialService.batchSetEnable(model.getEnabled(),model.getMaterialIDs());
|
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量修改状态,商品ID为:" + model.getMaterialIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量修改状态,商品ID为:" + model.getMaterialIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -246,12 +222,13 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量修改商品状态", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量修改商品状态", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量修改状态,商品ID为 "+ model.getMaterialIDs() + " " + tipMsg + "!", "批量修改商品状态" + tipMsg));
|
, tipType, "批量修改状态,商品ID为 " + model.getMaterialIDs() + " " + tipMsg + "!", "批量修改商品状态" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找该商品是否存在
|
* 查找该商品是否存在
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void checkIsExist() {
|
public void checkIsExist() {
|
||||||
@@ -263,41 +240,35 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
pageUtil.setAdvSearch(getConditionCheckIsExist());
|
pageUtil.setAdvSearch(getConditionCheckIsExist());
|
||||||
materialService.find(pageUtil);
|
materialService.find(pageUtil);
|
||||||
List<Material> dataList = pageUtil.getPageList();
|
List<Material> dataList = pageUtil.getPageList();
|
||||||
if(null != dataList && dataList.size() > 0){
|
if (null != dataList && dataList.size() > 0) {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找商品信息
|
* 查找商品信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Material> pageUtil = new PageUtil<Material>();
|
PageUtil<Material> pageUtil = new PageUtil<Material>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
Long lei=model.getCategoryId();
|
Long lei = model.getCategoryId();
|
||||||
if(1==lei) //判断值还真不能用String类型的判断
|
if (1 == lei) //判断值还真不能用String类型的判断
|
||||||
{
|
{
|
||||||
pageUtil.setAdvSearch(getCondition_all());
|
pageUtil.setAdvSearch(getCondition_all());
|
||||||
}
|
} else if (1 != lei) {
|
||||||
else if(1!=lei)
|
|
||||||
{
|
|
||||||
pageUtil.setAdvSearch(getCondition());
|
pageUtil.setAdvSearch(getCondition());
|
||||||
}
|
}
|
||||||
materialService.find(pageUtil);
|
materialService.find(pageUtil);
|
||||||
@@ -309,59 +280,57 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Material material : dataList) {
|
||||||
for(Material material:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", material.getId());
|
item.put("Id", material.getId());
|
||||||
item.put("Name", material.getName());
|
item.put("Name", material.getName());
|
||||||
item.put("CategoryId", material.getMaterialCategory().getId()); //类型Id
|
item.put("CategoryId", material.getMaterialCategory().getId()); //类型Id
|
||||||
item.put("CategoryName", material.getMaterialCategory().getName()); //类型名称
|
item.put("CategoryName", material.getMaterialCategory().getName()); //类型名称
|
||||||
item.put("Packing", material.getPacking()==null?"" : material.getPacking());
|
item.put("Packing", material.getPacking() == null ? "" : material.getPacking());
|
||||||
item.put("SafetyStock", material.getSafetyStock()==null?"" : material.getSafetyStock());
|
item.put("SafetyStock", material.getSafetyStock() == null ? "" : material.getSafetyStock());
|
||||||
item.put("Model", material.getModel()==null?"" : material.getModel());
|
item.put("Model", material.getModel() == null ? "" : material.getModel());
|
||||||
//扩展信息
|
//扩展信息
|
||||||
String materialOther = "";
|
String materialOther = "";
|
||||||
for(int i=0; i< mpArr.length; i++) {
|
for (int i = 0; i < mpArr.length; i++) {
|
||||||
if(mpArr[i].equals("颜色")) {
|
if (mpArr[i].equals("颜色")) {
|
||||||
materialOther = materialOther + ((material.getColor() == null || material.getColor().equals(""))?"":"("+material.getColor() + ")");
|
materialOther = materialOther + ((material.getColor() == null || material.getColor().equals("")) ? "" : "(" + material.getColor() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("规格")) {
|
if (mpArr[i].equals("规格")) {
|
||||||
materialOther = materialOther + ((material.getStandard() == null || material.getStandard().equals(""))?"":"("+material.getStandard() + ")");
|
materialOther = materialOther + ((material.getStandard() == null || material.getStandard().equals("")) ? "" : "(" + material.getStandard() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("制造商")) {
|
if (mpArr[i].equals("制造商")) {
|
||||||
materialOther = materialOther + ((material.getMfrs() == null || material.getMfrs().equals(""))?"":"("+material.getMfrs() + ")");
|
materialOther = materialOther + ((material.getMfrs() == null || material.getMfrs().equals("")) ? "" : "(" + material.getMfrs() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("自定义1")) {
|
if (mpArr[i].equals("自定义1")) {
|
||||||
materialOther = materialOther + ((material.getOtherField1() == null || material.getOtherField1().equals(""))?"":"("+material.getOtherField1() + ")");
|
materialOther = materialOther + ((material.getOtherField1() == null || material.getOtherField1().equals("")) ? "" : "(" + material.getOtherField1() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("自定义2")) {
|
if (mpArr[i].equals("自定义2")) {
|
||||||
materialOther = materialOther + ((material.getOtherField2() == null || material.getOtherField2().equals(""))?"":"("+material.getOtherField2() + ")");
|
materialOther = materialOther + ((material.getOtherField2() == null || material.getOtherField2().equals("")) ? "" : "(" + material.getOtherField2() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("自定义3")) {
|
if (mpArr[i].equals("自定义3")) {
|
||||||
materialOther = materialOther + ((material.getOtherField3() == null || material.getOtherField3().equals(""))?"":"("+material.getOtherField3() + ")");
|
materialOther = materialOther + ((material.getOtherField3() == null || material.getOtherField3().equals("")) ? "" : "(" + material.getOtherField3() + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item.put("MaterialOther", materialOther);
|
item.put("MaterialOther", materialOther);
|
||||||
item.put("Unit", material.getUnit()==null?"": material.getUnit());
|
item.put("Unit", material.getUnit() == null ? "" : material.getUnit());
|
||||||
item.put("RetailPrice", material.getRetailPrice());
|
item.put("RetailPrice", material.getRetailPrice());
|
||||||
item.put("LowPrice", material.getLowPrice());
|
item.put("LowPrice", material.getLowPrice());
|
||||||
item.put("PresetPriceOne", material.getPresetPriceOne()==null? "":material.getPresetPriceOne());
|
item.put("PresetPriceOne", material.getPresetPriceOne() == null ? "" : material.getPresetPriceOne());
|
||||||
item.put("PresetPriceTwo", material.getPresetPriceTwo()==null? "":material.getPresetPriceTwo());
|
item.put("PresetPriceTwo", material.getPresetPriceTwo() == null ? "" : material.getPresetPriceTwo());
|
||||||
item.put("UnitId",material.getUnitId()==null? "": material.getUnitId().getId()); //计量单位Id
|
item.put("UnitId", material.getUnitId() == null ? "" : material.getUnitId().getId()); //计量单位Id
|
||||||
item.put("UnitName", material.getUnitId()==null? "": material.getUnitId().getUName()); //计量单位名称
|
item.put("UnitName", material.getUnitId() == null ? "" : material.getUnitId().getUName()); //计量单位名称
|
||||||
item.put("FirstOutUnit", material.getFirstOutUnit());
|
item.put("FirstOutUnit", material.getFirstOutUnit());
|
||||||
item.put("FirstInUnit", material.getFirstInUnit());
|
item.put("FirstInUnit", material.getFirstInUnit());
|
||||||
item.put("PriceStrategy", material.getPriceStrategy());
|
item.put("PriceStrategy", material.getPriceStrategy());
|
||||||
item.put("Enabled", material.getEnabled());
|
item.put("Enabled", material.getEnabled());
|
||||||
item.put("Remark", material.getRemark());
|
item.put("Remark", material.getRemark());
|
||||||
item.put("Color", material.getColor()==null?"" : material.getColor());
|
item.put("Color", material.getColor() == null ? "" : material.getColor());
|
||||||
item.put("Standard", material.getStandard()==null?"" : material.getStandard());
|
item.put("Standard", material.getStandard() == null ? "" : material.getStandard());
|
||||||
item.put("Mfrs", material.getMfrs()==null?"" : material.getMfrs());
|
item.put("Mfrs", material.getMfrs() == null ? "" : material.getMfrs());
|
||||||
item.put("OtherField1", material.getOtherField1()==null?"" : material.getOtherField1());
|
item.put("OtherField1", material.getOtherField1() == null ? "" : material.getOtherField1());
|
||||||
item.put("OtherField2", material.getOtherField2()==null?"" : material.getOtherField2());
|
item.put("OtherField2", material.getOtherField2() == null ? "" : material.getOtherField2());
|
||||||
item.put("OtherField3", material.getOtherField3()==null?"" : material.getOtherField3());
|
item.put("OtherField3", material.getOtherField3() == null ? "" : material.getOtherField3());
|
||||||
item.put("op", 1);
|
item.put("op", 1);
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
@@ -369,24 +338,20 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id来查询商品名称
|
* 根据id来查询商品名称
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findById() {
|
public void findById() {
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
PageUtil<Material> pageUtil = new PageUtil<Material>();
|
PageUtil<Material> pageUtil = new PageUtil<Material>();
|
||||||
pageUtil.setAdvSearch(getConditionById());
|
pageUtil.setAdvSearch(getConditionById());
|
||||||
materialService.find(pageUtil);
|
materialService.find(pageUtil);
|
||||||
@@ -395,26 +360,24 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Material material : dataList) {
|
||||||
for(Material material:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", material.getId());
|
item.put("Id", material.getId());
|
||||||
item.put("Name", material.getName());
|
item.put("Name", material.getName());
|
||||||
item.put("Mfrs", material.getMfrs()==null?"" : material.getMfrs());
|
item.put("Mfrs", material.getMfrs() == null ? "" : material.getMfrs());
|
||||||
item.put("Packing", material.getPacking()==null?"" : material.getPacking());
|
item.put("Packing", material.getPacking() == null ? "" : material.getPacking());
|
||||||
item.put("SafetyStock", material.getSafetyStock()==null?"" : material.getSafetyStock());
|
item.put("SafetyStock", material.getSafetyStock() == null ? "" : material.getSafetyStock());
|
||||||
item.put("Model", material.getModel());
|
item.put("Model", material.getModel());
|
||||||
item.put("Standard", material.getStandard());
|
item.put("Standard", material.getStandard());
|
||||||
item.put("Color", material.getColor()==null?"": material.getColor());
|
item.put("Color", material.getColor() == null ? "" : material.getColor());
|
||||||
item.put("Unit", material.getUnit());
|
item.put("Unit", material.getUnit());
|
||||||
item.put("RetailPrice", material.getRetailPrice());
|
item.put("RetailPrice", material.getRetailPrice());
|
||||||
item.put("LowPrice", material.getLowPrice());
|
item.put("LowPrice", material.getLowPrice());
|
||||||
item.put("PresetPriceOne", material.getPresetPriceOne());
|
item.put("PresetPriceOne", material.getPresetPriceOne());
|
||||||
item.put("PresetPriceTwo", material.getPresetPriceTwo());
|
item.put("PresetPriceTwo", material.getPresetPriceTwo());
|
||||||
item.put("UnitId",material.getUnitId()==null? "": material.getUnitId().getId()); //计量单位Id
|
item.put("UnitId", material.getUnitId() == null ? "" : material.getUnitId().getId()); //计量单位Id
|
||||||
item.put("UnitName", material.getUnitId()==null? "": material.getUnitId().getUName()); //计量单位名称
|
item.put("UnitName", material.getUnitId() == null ? "" : material.getUnitId().getUName()); //计量单位名称
|
||||||
item.put("FirstOutUnit", material.getFirstOutUnit());
|
item.put("FirstOutUnit", material.getFirstOutUnit());
|
||||||
item.put("FirstInUnit", material.getFirstInUnit());
|
item.put("FirstInUnit", material.getFirstInUnit());
|
||||||
item.put("PriceStrategy", material.getPriceStrategy());
|
item.put("PriceStrategy", material.getPriceStrategy());
|
||||||
@@ -426,19 +389,16 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找商品信息-下拉框
|
* 查找商品信息-下拉框
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBySelect() {
|
public void findBySelect() {
|
||||||
@@ -453,52 +413,49 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
String[] mpArr = mpList.split(",");
|
String[] mpArr = mpList.split(",");
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList) {
|
if (null != dataList) {
|
||||||
for(Material material:dataList) {
|
for (Material material : dataList) {
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", material.getId());
|
item.put("Id", material.getId());
|
||||||
String ratio; //比例
|
String ratio; //比例
|
||||||
if(material.getUnitId() == null || material.getUnitId().equals("")){
|
if (material.getUnitId() == null || material.getUnitId().equals("")) {
|
||||||
ratio = "";
|
ratio = "";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ratio = material.getUnitId().getUName();
|
ratio = material.getUnitId().getUName();
|
||||||
ratio = ratio.substring(ratio.indexOf("("));
|
ratio = ratio.substring(ratio.indexOf("("));
|
||||||
}
|
}
|
||||||
//品名/型号/扩展信息/包装
|
//品名/型号/扩展信息/包装
|
||||||
String MaterialName = material.getName() + ((material.getModel() == null || material.getModel().equals(""))?"":"("+material.getModel() + ")");
|
String MaterialName = material.getName() + ((material.getModel() == null || material.getModel().equals("")) ? "" : "(" + material.getModel() + ")");
|
||||||
for(int i=0; i< mpArr.length; i++) {
|
for (int i = 0; i < mpArr.length; i++) {
|
||||||
if(mpArr[i].equals("颜色")) {
|
if (mpArr[i].equals("颜色")) {
|
||||||
MaterialName = MaterialName + ((material.getColor() == null || material.getColor().equals(""))?"":"("+material.getColor() + ")");
|
MaterialName = MaterialName + ((material.getColor() == null || material.getColor().equals("")) ? "" : "(" + material.getColor() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("规格")) {
|
if (mpArr[i].equals("规格")) {
|
||||||
MaterialName = MaterialName + ((material.getStandard() == null || material.getStandard().equals(""))?"":"("+material.getStandard() + ")");
|
MaterialName = MaterialName + ((material.getStandard() == null || material.getStandard().equals("")) ? "" : "(" + material.getStandard() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("制造商")) {
|
if (mpArr[i].equals("制造商")) {
|
||||||
MaterialName = MaterialName + ((material.getMfrs() == null || material.getMfrs().equals(""))?"":"("+material.getMfrs() + ")");
|
MaterialName = MaterialName + ((material.getMfrs() == null || material.getMfrs().equals("")) ? "" : "(" + material.getMfrs() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("自定义1")) {
|
if (mpArr[i].equals("自定义1")) {
|
||||||
MaterialName = MaterialName + ((material.getOtherField1() == null || material.getOtherField1().equals(""))?"":"("+material.getOtherField1() + ")");
|
MaterialName = MaterialName + ((material.getOtherField1() == null || material.getOtherField1().equals("")) ? "" : "(" + material.getOtherField1() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("自定义2")) {
|
if (mpArr[i].equals("自定义2")) {
|
||||||
MaterialName = MaterialName + ((material.getOtherField2() == null || material.getOtherField2().equals(""))?"":"("+material.getOtherField2() + ")");
|
MaterialName = MaterialName + ((material.getOtherField2() == null || material.getOtherField2().equals("")) ? "" : "(" + material.getOtherField2() + ")");
|
||||||
}
|
}
|
||||||
if(mpArr[i].equals("自定义3")) {
|
if (mpArr[i].equals("自定义3")) {
|
||||||
MaterialName = MaterialName + ((material.getOtherField3() == null || material.getOtherField3().equals(""))?"":"("+material.getOtherField3() + ")");
|
MaterialName = MaterialName + ((material.getOtherField3() == null || material.getOtherField3().equals("")) ? "" : "(" + material.getOtherField3() + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MaterialName = MaterialName + ((material.getUnit() == null || material.getUnit().equals(""))?"":"("+material.getUnit() + ")") + ratio;
|
MaterialName = MaterialName + ((material.getUnit() == null || material.getUnit().equals("")) ? "" : "(" + material.getUnit() + ")") + ratio;
|
||||||
item.put("MaterialName", MaterialName);
|
item.put("MaterialName", MaterialName);
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找供应商信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找供应商信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -507,12 +464,11 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找商品信息-统计排序
|
* 查找商品信息-统计排序
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findByOrder()
|
public void findByOrder() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Material> pageUtil = new PageUtil<Material>();
|
PageUtil<Material> pageUtil = new PageUtil<Material>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
@@ -522,32 +478,27 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONObject outer = new JSONObject();
|
JSONObject outer = new JSONObject();
|
||||||
String mId = "";
|
String mId = "";
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Material material : dataList) {
|
||||||
for(Material material:dataList)
|
|
||||||
{
|
|
||||||
mId = mId + material.getId() + ",";
|
mId = mId + material.getId() + ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(mId!="") {
|
if (mId != "") {
|
||||||
mId = mId.substring(0, mId.lastIndexOf(","));
|
mId = mId.substring(0, mId.lastIndexOf(","));
|
||||||
}
|
}
|
||||||
outer.put("mIds", mId);
|
outer.put("mIds", mId);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找供应商信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找供应商信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入excel表格-供应商
|
* 导入excel表格-供应商
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -558,13 +509,11 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
try {
|
try {
|
||||||
InputStream in = materialService.importExcel(model.getMaterialFile());
|
InputStream in = materialService.importExcel(model.getMaterialFile());
|
||||||
|
|
||||||
if(null != in)
|
if (null != in) {
|
||||||
{
|
|
||||||
model.setFileName(Tools.getRandomChar() + Tools.getNow2(Calendar.getInstance().getTime()) + "_wrong.xls");
|
model.setFileName(Tools.getRandomChar() + Tools.getNow2(Calendar.getInstance().getTime()) + "_wrong.xls");
|
||||||
model.setExcelStream(in);
|
model.setExcelStream(in);
|
||||||
returnStr = MaterialConstants.BusinessForExcel.EXCEL;
|
returnStr = MaterialConstants.BusinessForExcel.EXCEL;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
result = true;
|
result = true;
|
||||||
try {
|
try {
|
||||||
toClient(result.toString());
|
toClient(result.toString());
|
||||||
@@ -575,9 +524,7 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
returnStr = SUCCESS;
|
returnStr = SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} catch (JshException e) {
|
||||||
catch (JshException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e);
|
||||||
}
|
}
|
||||||
return returnStr;
|
return returnStr;
|
||||||
@@ -585,6 +532,7 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel表格
|
* 导出excel表格
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -592,15 +540,14 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
Log.infoFileSync("===================调用导出信息action方法exportExcel开始=======================");
|
Log.infoFileSync("===================调用导出信息action方法exportExcel开始=======================");
|
||||||
try {
|
try {
|
||||||
String sName = "pageUtilMaterial";
|
String sName = "pageUtilMaterial";
|
||||||
PageUtil<Material> pageUtil = (PageUtil<Material>)getSession().get(sName);
|
PageUtil<Material> pageUtil = (PageUtil<Material>) getSession().get(sName);
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
String isCurrentPage = "allPage";
|
String isCurrentPage = "allPage";
|
||||||
model.setFileName(Tools.changeUnicode("goods" + System.currentTimeMillis() + ".xls", model.getBrowserType()));
|
model.setFileName(Tools.changeUnicode("goods" + System.currentTimeMillis() + ".xls", model.getBrowserType()));
|
||||||
model.setExcelStream(materialService.exmportExcel(isCurrentPage,pageUtil));
|
model.setExcelStream(materialService.exmportExcel(isCurrentPage, pageUtil));
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出信息action方法exportExcel异常", e);
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出信息action方法exportExcel异常",e);
|
|
||||||
model.getShowModel().setMsgTip("export excel exception");
|
model.getShowModel().setMsgTip("export excel exception");
|
||||||
}
|
}
|
||||||
Log.infoFileSync("===================调用导出信息action方法exportExcel结束==================");
|
Log.infoFileSync("===================调用导出信息action方法exportExcel结束==================");
|
||||||
@@ -609,14 +556,14 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件(查全部)
|
* 拼接搜索条件(查全部)
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_all()
|
private Map<String, Object> getCondition_all() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
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("Name_s_like", model.getName());
|
||||||
condition.put("Model_s_like", model.getModel());
|
condition.put("Model_s_like", model.getModel());
|
||||||
condition.put("Color_s_like", model.getColor());
|
condition.put("Color_s_like", model.getColor());
|
||||||
@@ -626,13 +573,14 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition() {
|
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("Name_s_like", model.getName());
|
||||||
condition.put("Model_s_like", model.getModel());
|
condition.put("Model_s_like", model.getModel());
|
||||||
condition.put("Color_s_like", model.getColor());
|
condition.put("Color_s_like", model.getColor());
|
||||||
@@ -641,9 +589,9 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String,Object> getConditionCheckIsExist() {
|
private Map<String, Object> getConditionCheckIsExist() {
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
if(model.getMaterialID()>0){
|
if (model.getMaterialID() > 0) {
|
||||||
condition.put("ID_n_neq", model.getMaterialID());
|
condition.put("ID_n_neq", model.getMaterialID());
|
||||||
}
|
}
|
||||||
condition.put("Name_s_eq", model.getName());
|
condition.put("Name_s_eq", model.getName());
|
||||||
@@ -654,10 +602,10 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
condition.put("OtherField1_s_eq", model.getOtherField1());
|
condition.put("OtherField1_s_eq", model.getOtherField1());
|
||||||
condition.put("OtherField2_s_eq", model.getOtherField2());
|
condition.put("OtherField2_s_eq", model.getOtherField2());
|
||||||
condition.put("OtherField3_s_eq", model.getOtherField3());
|
condition.put("OtherField3_s_eq", model.getOtherField3());
|
||||||
if(model.getUnit()!=null){
|
if (model.getUnit() != null) {
|
||||||
condition.put("Unit_s_eq", model.getUnit());
|
condition.put("Unit_s_eq", model.getUnit());
|
||||||
}
|
}
|
||||||
if(model.getUnitId()!=null){
|
if (model.getUnitId() != null) {
|
||||||
condition.put("UnitId_n_eq", model.getUnitId());
|
condition.put("UnitId_n_eq", model.getUnitId());
|
||||||
}
|
}
|
||||||
return condition;
|
return condition;
|
||||||
@@ -665,55 +613,54 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @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.getMaterialID());
|
condition.put("Id_n_eq", model.getMaterialID());
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-下拉框
|
* 拼接搜索条件-下拉框
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_Select()
|
private Map<String, Object> getCondition_Select() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("enabled_s_eq",1);
|
condition.put("enabled_s_eq", 1);
|
||||||
condition.put("Id_s_order", "asc");
|
condition.put("Id_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件-下拉框
|
* 拼接搜索条件-下拉框
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition_Order()
|
private Map<String, Object> getCondition_Order() {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
*/
|
*/
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put("Name,Model_s_order", "asc");
|
condition.put("Name,Model_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public MaterialModel getModel()
|
public MaterialModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setMaterialService(MaterialIService materialService)
|
|
||||||
{
|
public void setMaterialService(MaterialIService materialService) {
|
||||||
this.materialService = materialService;
|
this.materialService = materialService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +1,46 @@
|
|||||||
package com.jsh.action.materials;
|
package com.jsh.action.materials;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
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.io.IOException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.vo.materials.MaterialCategoryModel;
|
|
||||||
import com.jsh.service.materials.MaterialCategoryIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
/*
|
/*
|
||||||
* 商品类型管理
|
* 商品类型管理
|
||||||
* @author jishenghua qq:752718920
|
* @author jishenghua qq:752718920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel> {
|
||||||
{
|
|
||||||
private MaterialCategoryIService materialCategoryService;
|
private MaterialCategoryIService materialCategoryService;
|
||||||
private MaterialCategoryModel model = new MaterialCategoryModel();
|
private MaterialCategoryModel model = new MaterialCategoryModel();
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getBasicData()
|
public String getBasicData() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
|
||||||
condition.put("ParentId_n_eq", model.getParentId());
|
condition.put("ParentId_n_eq", model.getParentId());
|
||||||
condition.put("Id_n_neq", 1);
|
condition.put("Id_n_neq", 1);
|
||||||
condition.put("Id_s_order", "asc");
|
condition.put("Id_s_order", "asc");
|
||||||
materialCategoryService.find(pageUtil);
|
materialCategoryService.find(pageUtil);
|
||||||
mapData.put("materialCategoryList", pageUtil.getPageList());
|
mapData.put("materialCategoryList", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找商品类别信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找商品类别信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exceptoin");
|
model.getShowModel().setMsgTip("exceptoin");
|
||||||
}
|
}
|
||||||
@@ -52,14 +49,13 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加商品类别
|
* 增加商品类别
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加商品类别信息方法create()===================");
|
Log.infoFileSync("==================开始调用增加商品类别信息方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
MaterialCategory materialCategory = new MaterialCategory();
|
MaterialCategory materialCategory = new MaterialCategory();
|
||||||
materialCategory.setMaterialCategory(new MaterialCategory(model.getParentId()));
|
materialCategory.setMaterialCategory(new MaterialCategory(model.getParentId()));
|
||||||
|
|
||||||
@@ -72,47 +68,37 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加商品类别信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加商品类别信息异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加商品类别信息回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加商品类别信息回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加商品类别", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加商品类别", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加商品类别名称为 "+ model.getName() + " " + tipMsg + "!", "增加商品类别" + tipMsg));
|
, tipType, "增加商品类别名称为 " + model.getName() + " " + tipMsg + "!", "增加商品类别" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加商品类别方法create()===================");
|
Log.infoFileSync("==================结束调用增加商品类别方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品类别
|
* 删除商品类别
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除商品类别信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除商品类别信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
materialCategoryService.delete(model.getMaterialCategoryID());
|
materialCategoryService.delete(model.getMaterialCategoryID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getMaterialCategoryID() + " 的商品类别异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getMaterialCategoryID() + " 的商品类别异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -120,20 +106,19 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除商品类别", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除商品类别", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除商品类别ID为 "+ model.getMaterialCategoryID() + " " + tipMsg + "!", "删除商品类别" + tipMsg));
|
, tipType, "删除商品类别ID为 " + model.getMaterialCategoryID() + " " + tipMsg + "!", "删除商品类别" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除商品类别信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除商品类别信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商品类别
|
* 更新商品类别
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
MaterialCategory materialCategory = materialCategoryService.get(model.getMaterialCategoryID());
|
MaterialCategory materialCategory = materialCategoryService.get(model.getMaterialCategoryID());
|
||||||
materialCategory.setMaterialCategory(new MaterialCategory(model.getParentId()));
|
materialCategory.setMaterialCategory(new MaterialCategory(model.getParentId()));
|
||||||
|
|
||||||
@@ -144,46 +129,36 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改商品类别ID为 : " + model.getMaterialCategoryID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改商品类别ID为 : " + model.getMaterialCategoryID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改商品类别回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改商品类别回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新商品类别", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新商品类别", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新商品类别ID为 "+ model.getMaterialCategoryID() + " " + tipMsg + "!", "更新商品类别" + tipMsg));
|
, tipType, "更新商品类别ID为 " + model.getMaterialCategoryID() + " " + tipMsg + "!", "更新商品类别" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID商品类别
|
* 批量删除指定ID商品类别
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
materialCategoryService.batchDelete(model.getMaterialCategoryIDs());
|
materialCategoryService.batchDelete(model.getMaterialCategoryIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除商品类别ID为:" + model.getMaterialCategoryIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除商品类别ID为:" + model.getMaterialCategoryIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -191,18 +166,17 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除商品类别", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除商品类别", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除商品类别ID为 "+ model.getMaterialCategoryIDs() + " " + tipMsg + "!", "批量删除商品类别" + tipMsg));
|
, tipType, "批量删除商品类别ID为 " + model.getMaterialCategoryIDs() + " " + tipMsg + "!", "批量删除商品类别" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找商品类别信息
|
* 查找商品类别信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<MaterialCategory> pageUtil = new PageUtil<MaterialCategory>();
|
PageUtil<MaterialCategory> pageUtil = new PageUtil<MaterialCategory>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -218,10 +192,8 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (MaterialCategory materialCategory : dataList) {
|
||||||
for(MaterialCategory materialCategory:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", materialCategory.getId());
|
item.put("Id", materialCategory.getId());
|
||||||
item.put("ParentId", materialCategory.getMaterialCategory().getId());
|
item.put("ParentId", materialCategory.getMaterialCategory().getId());
|
||||||
@@ -235,19 +207,16 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品类别信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品类别信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品类别信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品类别信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id来查询商品名称
|
* 根据id来查询商品名称
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findById() {
|
public void findById() {
|
||||||
@@ -257,35 +226,31 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
|||||||
materialCategoryService.find(pageUtil);
|
materialCategoryService.find(pageUtil);
|
||||||
List<MaterialCategory> dataList = pageUtil.getPageList();
|
List<MaterialCategory> dataList = pageUtil.getPageList();
|
||||||
JSONObject outer = new JSONObject();
|
JSONObject outer = new JSONObject();
|
||||||
if(null != dataList) {
|
if (null != dataList) {
|
||||||
for(MaterialCategory materialCategory : dataList) {
|
for (MaterialCategory materialCategory : dataList) {
|
||||||
outer.put("name", materialCategory.getName());
|
outer.put("name", materialCategory.getName());
|
||||||
outer.put("parentId", materialCategory.getMaterialCategory().getId());
|
outer.put("parentId", materialCategory.getMaterialCategory().getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品类别信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品类别信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品类别信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品类别信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
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("Name_s_like", model.getName());
|
||||||
condition.put("ParentId_n_eq", model.getParentId());
|
condition.put("ParentId_n_eq", model.getParentId());
|
||||||
condition.put("Id_n_neq", 1);
|
condition.put("Id_n_neq", 1);
|
||||||
@@ -295,25 +260,25 @@ public class MaterialCategoryAction extends BaseAction<MaterialCategoryModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @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());
|
condition.put("Id_n_eq", model.getMaterialCategoryID());
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public MaterialCategoryModel getModel()
|
public MaterialCategoryModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setMaterialCategoryService(MaterialCategoryIService materialCategoryService)
|
|
||||||
{
|
public void setMaterialCategoryService(MaterialCategoryIService materialCategoryService) {
|
||||||
this.materialCategoryService = materialCategoryService;
|
this.materialCategoryService = materialCategoryService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,15 +20,15 @@ import java.util.Map;
|
|||||||
/*
|
/*
|
||||||
* 商品属性
|
* 商品属性
|
||||||
* @author ji s h e n g hua qq:75 27 18 920
|
* @author ji s h e n g hua qq:75 27 18 920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
|
public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel> {
|
||||||
{
|
|
||||||
private MaterialPropertyIService materialPropertyService;
|
private MaterialPropertyIService materialPropertyService;
|
||||||
private MaterialPropertyModel model = new MaterialPropertyModel();
|
private MaterialPropertyModel model = new MaterialPropertyModel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商品属性
|
* 更新商品属性
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update() {
|
public void update() {
|
||||||
@@ -44,28 +44,26 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改商品属性ID为 : " + model.getId() + "失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改商品属性ID为 : " + model.getId() + "失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
try {
|
try {
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改商品属性回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改商品属性回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新商品属性", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新商品属性", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新商品属性ID为 "+ model.getId() + " " + tipMsg + "!", "更新商品属性" + tipMsg));
|
, tipType, "更新商品属性ID为 " + model.getId() + " " + tipMsg + "!", "更新商品属性" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找商品属性
|
* 查找商品属性
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy() {
|
public void findBy() {
|
||||||
@@ -81,8 +79,8 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList) {
|
if (null != dataList) {
|
||||||
for(MaterialProperty materialProperty:dataList) {
|
for (MaterialProperty materialProperty : dataList) {
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", materialProperty.getId());
|
item.put("id", materialProperty.getId());
|
||||||
item.put("nativeName", materialProperty.getNativeName());
|
item.put("nativeName", materialProperty.getNativeName());
|
||||||
@@ -95,27 +93,23 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品属性异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品属性异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品属性结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品属性结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
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("nativeName_s_like", model.getNativeName());
|
||||||
condition.put("sort_s_order", "asc");
|
condition.put("sort_s_order", "asc");
|
||||||
return condition;
|
return condition;
|
||||||
@@ -126,6 +120,7 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
|
|||||||
public MaterialPropertyModel getModel() {
|
public MaterialPropertyModel getModel() {
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMaterialPropertyService(MaterialPropertyIService materialPropertyService) {
|
public void setMaterialPropertyService(MaterialPropertyIService materialPropertyService) {
|
||||||
this.materialPropertyService = materialPropertyService;
|
this.materialPropertyService = materialPropertyService;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,70 +1,62 @@
|
|||||||
package com.jsh.action.materials;
|
package com.jsh.action.materials;
|
||||||
|
|
||||||
|
import com.jsh.base.BaseAction;
|
||||||
|
import com.jsh.base.Log;
|
||||||
|
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.io.IOException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.vo.materials.PersonModel;
|
|
||||||
import com.jsh.service.materials.PersonIService;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
/*
|
/*
|
||||||
* 经手人管理
|
* 经手人管理
|
||||||
* @author jishenghua qq:752718920
|
* @author jishenghua qq:752718920
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class PersonAction extends BaseAction<PersonModel>
|
public class PersonAction extends BaseAction<PersonModel> {
|
||||||
{
|
|
||||||
private PersonIService personService;
|
private PersonIService personService;
|
||||||
private PersonModel model = new PersonModel();
|
private PersonModel model = new PersonModel();
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getBasicData()
|
public String getBasicData() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
|
||||||
condition.put("Id_s_order", "asc");
|
condition.put("Id_s_order", "asc");
|
||||||
personService.find(pageUtil);
|
personService.find(pageUtil);
|
||||||
mapData.put("personList", pageUtil.getPageList());
|
mapData.put("personList", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exceptoin");
|
model.getShowModel().setMsgTip("exceptoin");
|
||||||
}
|
}
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public String getPersonByType()
|
public String getPersonByType() {
|
||||||
{
|
Map<String, List> mapData = model.getShowModel().getMap();
|
||||||
Map<String,List> mapData = model.getShowModel().getMap();
|
|
||||||
PageUtil pageUtil = new PageUtil();
|
PageUtil pageUtil = new PageUtil();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
try
|
try {
|
||||||
{
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
|
||||||
condition.put("Type_s_eq", model.getType());
|
condition.put("Type_s_eq", model.getType());
|
||||||
condition.put("Id_s_order", "asc");
|
condition.put("Id_s_order", "asc");
|
||||||
personService.find(pageUtil);
|
personService.find(pageUtil);
|
||||||
mapData.put("personList", pageUtil.getPageList());
|
mapData.put("personList", pageUtil.getPageList());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
|
||||||
model.getShowModel().setMsgTip("exceptoin");
|
model.getShowModel().setMsgTip("exceptoin");
|
||||||
}
|
}
|
||||||
@@ -73,6 +65,7 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据类型获取经手人信息 1-业务员,2-仓管员,3-财务员
|
* 根据类型获取经手人信息 1-业务员,2-仓管员,3-财务员
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void getPersonByNumType() {
|
public void getPersonByNumType() {
|
||||||
@@ -80,24 +73,22 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
PageUtil<Person> pageUtil = new PageUtil<Person>();
|
PageUtil<Person> pageUtil = new PageUtil<Person>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(0);
|
pageUtil.setCurPage(0);
|
||||||
Map<String,Object> condition = pageUtil.getAdvSearch();
|
Map<String, Object> condition = pageUtil.getAdvSearch();
|
||||||
String type = "";
|
String type = "";
|
||||||
if(model.getType().equals("1")){
|
if (model.getType().equals("1")) {
|
||||||
type = "业务员";
|
type = "业务员";
|
||||||
}
|
} else if (model.getType().equals("2")) {
|
||||||
else if(model.getType().equals("2")){
|
|
||||||
type = "仓管员";
|
type = "仓管员";
|
||||||
}
|
} else if (model.getType().equals("3")) {
|
||||||
else if(model.getType().equals("3")){
|
|
||||||
type = "财务员";
|
type = "财务员";
|
||||||
}
|
}
|
||||||
condition.put("Type_s_eq",type);
|
condition.put("Type_s_eq", type);
|
||||||
condition.put("Id_s_order", "asc");
|
condition.put("Id_s_order", "asc");
|
||||||
personService.find(pageUtil);
|
personService.find(pageUtil);
|
||||||
List<Person> dataList = pageUtil.getPageList();
|
List<Person> dataList = pageUtil.getPageList();
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList) {
|
if (null != dataList) {
|
||||||
for(Person person:dataList){
|
for (Person person : dataList) {
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("id", person.getId());
|
item.put("id", person.getId());
|
||||||
item.put("name", person.getName());
|
item.put("name", person.getName());
|
||||||
@@ -106,17 +97,16 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(dataArray.toString());
|
toClient(dataArray.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据Id获取经手人信息
|
* 根据Id获取经手人信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void getPersonByIds() {
|
public void getPersonByIds() {
|
||||||
@@ -124,38 +114,35 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
PageUtil<Person> pageUtil = new PageUtil<Person>();
|
PageUtil<Person> pageUtil = new PageUtil<Person>();
|
||||||
pageUtil.setPageSize(0);
|
pageUtil.setPageSize(0);
|
||||||
pageUtil.setCurPage(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_in", model.getPersonIDs());
|
||||||
condition.put("Id_s_order", "asc");
|
condition.put("Id_s_order", "asc");
|
||||||
personService.find(pageUtil);
|
personService.find(pageUtil);
|
||||||
List<Person> dataList = pageUtil.getPageList();
|
List<Person> dataList = pageUtil.getPageList();
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
if(null != dataList) {
|
if (null != dataList) {
|
||||||
for(Person person:dataList){
|
for (Person person : dataList) {
|
||||||
sb.append(person.getName() + " ");
|
sb.append(person.getName() + " ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(sb.toString());
|
toClient(sb.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
|
Log.errorFileSync(">>>>>>>>>查找信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
Log.errorFileSync(">>>>>>>>>回写查询信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>回写查询信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加经手人
|
* 增加经手人
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void create()
|
public void create() {
|
||||||
{
|
|
||||||
Log.infoFileSync("==================开始调用增加经手人信息方法create()===================");
|
Log.infoFileSync("==================开始调用增加经手人信息方法create()===================");
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Person person = new Person();
|
Person person = new Person();
|
||||||
|
|
||||||
person.setType(model.getType());
|
person.setType(model.getType());
|
||||||
@@ -167,47 +154,37 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加经手人信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加经手人信息异常", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>增加经手人信息回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>增加经手人信息回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "增加经手人", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "增加经手人", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "增加经手人名称为 "+ model.getName() + " " + tipMsg + "!", "增加经手人" + tipMsg));
|
, tipType, "增加经手人名称为 " + model.getName() + " " + tipMsg + "!", "增加经手人" + tipMsg));
|
||||||
Log.infoFileSync("==================结束调用增加经手人方法create()===================");
|
Log.infoFileSync("==================结束调用增加经手人方法create()===================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除经手人
|
* 删除经手人
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String delete()
|
public String delete() {
|
||||||
{
|
|
||||||
Log.infoFileSync("====================开始调用删除经手人信息方法delete()================");
|
Log.infoFileSync("====================开始调用删除经手人信息方法delete()================");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
personService.delete(model.getPersonID());
|
personService.delete(model.getPersonID());
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getPersonID() + " 的经手人异常", e);
|
Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getPersonID() + " 的经手人异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -215,20 +192,19 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
model.getShowModel().setMsgTip(tipMsg);
|
model.getShowModel().setMsgTip(tipMsg);
|
||||||
logService.create(new Logdetails(getUser(), "删除经手人", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "删除经手人", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "删除经手人ID为 "+ model.getPersonID() + " " + tipMsg + "!", "删除经手人" + tipMsg));
|
, tipType, "删除经手人ID为 " + model.getPersonID() + " " + tipMsg + "!", "删除经手人" + tipMsg));
|
||||||
Log.infoFileSync("====================结束调用删除经手人信息方法delete()================");
|
Log.infoFileSync("====================结束调用删除经手人信息方法delete()================");
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新经手人
|
* 更新经手人
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Person person = personService.get(model.getPersonID());
|
Person person = personService.get(model.getPersonID());
|
||||||
|
|
||||||
person.setType(model.getType());
|
person.setType(model.getType());
|
||||||
@@ -238,46 +214,36 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
flag = true;
|
flag = true;
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>修改经手人ID为 : " + model.getPersonID() + "信息失败", e);
|
Log.errorFileSync(">>>>>>>>>>>>>修改经手人ID为 : " + model.getPersonID() + "信息失败", e);
|
||||||
flag = false;
|
flag = false;
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
}
|
} finally {
|
||||||
finally
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
toClient(flag.toString());
|
toClient(flag.toString());
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>修改经手人回写客户端结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>修改经手人回写客户端结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.create(new Logdetails(getUser(), "更新经手人", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "更新经手人", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "更新经手人ID为 "+ model.getPersonID() + " " + tipMsg + "!", "更新经手人" + tipMsg));
|
, tipType, "更新经手人ID为 " + model.getPersonID() + " " + tipMsg + "!", "更新经手人" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID经手人
|
* 批量删除指定ID经手人
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String batchDelete()
|
public String batchDelete() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
personService.batchDelete(model.getPersonIDs());
|
personService.batchDelete(model.getPersonIDs());
|
||||||
model.getShowModel().setMsgTip("成功");
|
model.getShowModel().setMsgTip("成功");
|
||||||
//记录操作日志使用
|
//记录操作日志使用
|
||||||
tipMsg = "成功";
|
tipMsg = "成功";
|
||||||
tipType = 0;
|
tipType = 0;
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>批量删除经手人ID为:" + model.getPersonIDs() + "信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>批量删除经手人ID为:" + model.getPersonIDs() + "信息异常", e);
|
||||||
tipMsg = "失败";
|
tipMsg = "失败";
|
||||||
tipType = 1;
|
tipType = 1;
|
||||||
@@ -285,18 +251,17 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
|
|
||||||
logService.create(new Logdetails(getUser(), "批量删除经手人", model.getClientIp(),
|
logService.create(new Logdetails(getUser(), "批量删除经手人", model.getClientIp(),
|
||||||
new Timestamp(System.currentTimeMillis())
|
new Timestamp(System.currentTimeMillis())
|
||||||
, tipType, "批量删除经手人ID为 "+ model.getPersonIDs() + " " + tipMsg + "!", "批量删除经手人" + tipMsg));
|
, tipType, "批量删除经手人ID为 " + model.getPersonIDs() + " " + tipMsg + "!", "批量删除经手人" + tipMsg));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找经手人信息
|
* 查找经手人信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void findBy()
|
public void findBy() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
PageUtil<Person> pageUtil = new PageUtil<Person>();
|
PageUtil<Person> pageUtil = new PageUtil<Person>();
|
||||||
pageUtil.setPageSize(model.getPageSize());
|
pageUtil.setPageSize(model.getPageSize());
|
||||||
pageUtil.setCurPage(model.getPageNo());
|
pageUtil.setCurPage(model.getPageNo());
|
||||||
@@ -308,10 +273,8 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
outer.put("total", pageUtil.getTotalCount());
|
outer.put("total", pageUtil.getTotalCount());
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if(null != dataList)
|
if (null != dataList) {
|
||||||
{
|
for (Person person : dataList) {
|
||||||
for(Person person:dataList)
|
|
||||||
{
|
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("Id", person.getId());
|
item.put("Id", person.getId());
|
||||||
item.put("Type", person.getType());
|
item.put("Type", person.getType());
|
||||||
@@ -323,27 +286,23 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
outer.put("rows", dataArray);
|
outer.put("rows", dataArray);
|
||||||
//回写查询结果
|
//回写查询结果
|
||||||
toClient(outer.toString());
|
toClient(outer.toString());
|
||||||
}
|
} catch (DataAccessException e) {
|
||||||
catch (DataAccessException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找经手人信息异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找经手人信息异常", e);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询经手人信息结果异常", e);
|
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询经手人信息结果异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接搜索条件
|
* 拼接搜索条件
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String,Object> getCondition()
|
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("Name_s_like", model.getName());
|
||||||
condition.put("Type_s_eq", model.getType());
|
condition.put("Type_s_eq", model.getType());
|
||||||
return condition;
|
return condition;
|
||||||
@@ -351,12 +310,11 @@ public class PersonAction extends BaseAction<PersonModel>
|
|||||||
|
|
||||||
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
|
||||||
@Override
|
@Override
|
||||||
public PersonModel getModel()
|
public PersonModel getModel() {
|
||||||
{
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
public void setPersonService(PersonIService personService)
|
|
||||||
{
|
public void setPersonService(PersonIService personService) {
|
||||||
this.personService = personService;
|
this.personService = personService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,25 @@
|
|||||||
package com.jsh.base;
|
package com.jsh.base;
|
||||||
|
|
||||||
import java.io.IOException;
|
import com.jsh.model.po.Basicuser;
|
||||||
import java.util.Map;
|
import com.jsh.service.basic.LogIService;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.struts2.ServletActionContext;
|
|
||||||
|
|
||||||
import com.opensymphony.xwork2.ActionContext;
|
import com.opensymphony.xwork2.ActionContext;
|
||||||
import com.opensymphony.xwork2.ActionSupport;
|
import com.opensymphony.xwork2.ActionSupport;
|
||||||
import com.opensymphony.xwork2.ModelDriven;
|
import com.opensymphony.xwork2.ModelDriven;
|
||||||
import com.jsh.model.po.Basicuser;
|
import org.apache.struts2.ServletActionContext;
|
||||||
import com.jsh.service.basic.LogIService;
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struts2工具类
|
* struts2工具类
|
||||||
|
*
|
||||||
* @author jishenghua qq752718920
|
* @author jishenghua qq752718920
|
||||||
* struts2 base action 一些常用方法获取
|
* struts2 base action 一些常用方法获取
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public abstract class BaseAction<T> extends ActionSupport implements ModelDriven<T>
|
public abstract class BaseAction<T> extends ActionSupport implements ModelDriven<T> {
|
||||||
{
|
|
||||||
public LogIService logService;
|
public LogIService logService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,82 +32,82 @@ public abstract class BaseAction<T> extends ActionSupport implements ModelDriven
|
|||||||
*/
|
*/
|
||||||
public short tipType = 0;
|
public short tipType = 0;
|
||||||
|
|
||||||
public void setLogService(LogIService logService)
|
|
||||||
{
|
|
||||||
this.logService = logService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取session
|
* 获取session
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static Map<String,Object> getSession()
|
public static Map<String, Object> getSession() {
|
||||||
{
|
|
||||||
return ActionContext.getContext().getSession();
|
return ActionContext.getContext().getSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取request
|
* 获取request
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static HttpServletRequest getRequest()
|
public static HttpServletRequest getRequest() {
|
||||||
{
|
|
||||||
return ServletActionContext.getRequest();
|
return ServletActionContext.getRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取response
|
* 获取response
|
||||||
|
*
|
||||||
* @return response
|
* @return response
|
||||||
*/
|
*/
|
||||||
public static HttpServletResponse getResponse()
|
public static HttpServletResponse getResponse() {
|
||||||
{
|
|
||||||
return ServletActionContext.getResponse();
|
return ServletActionContext.getResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLogService(LogIService logService) {
|
||||||
|
this.logService = logService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加错误信息
|
* 添加错误信息
|
||||||
|
*
|
||||||
* @param anErrorMessage
|
* @param anErrorMessage
|
||||||
*/
|
*/
|
||||||
public void addActionError(String anErrorMessage)
|
public void addActionError(String anErrorMessage) {
|
||||||
{
|
|
||||||
super.addActionError(anErrorMessage);
|
super.addActionError(anErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加消息
|
* 添加消息
|
||||||
|
*
|
||||||
* @param aMessage
|
* @param aMessage
|
||||||
*/
|
*/
|
||||||
public void addActionMessage(String aMessage)
|
public void addActionMessage(String aMessage) {
|
||||||
{
|
|
||||||
clearErrorsAndMessages();
|
clearErrorsAndMessages();
|
||||||
super.addActionMessage(aMessage);
|
super.addActionMessage(aMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加字段错误
|
* 添加字段错误
|
||||||
|
*
|
||||||
* @param fieldName
|
* @param fieldName
|
||||||
* @param errorMessage
|
* @param errorMessage
|
||||||
*/
|
*/
|
||||||
public void addFieldError(String fieldName, String errorMessage)
|
public void addFieldError(String fieldName, String errorMessage) {
|
||||||
{
|
|
||||||
clearErrorsAndMessages();
|
clearErrorsAndMessages();
|
||||||
super.addFieldError(fieldName, errorMessage);
|
super.addFieldError(fieldName, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录用户信息
|
* 登录用户信息
|
||||||
|
*
|
||||||
* @return 登录用户对象
|
* @return 登录用户对象
|
||||||
*/
|
*/
|
||||||
public Basicuser getUser()
|
public Basicuser getUser() {
|
||||||
{
|
return (Basicuser) getSession().get("user");
|
||||||
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();
|
HttpServletResponse response = ServletActionContext.getResponse();
|
||||||
response.setContentType("text/html;charset=utf-8");
|
response.setContentType("text/html;charset=utf-8");
|
||||||
response.getWriter().print(jsonData);
|
response.getWriter().print(jsonData);
|
||||||
|
|||||||
@@ -1,77 +1,68 @@
|
|||||||
package com.jsh.base;
|
package com.jsh.base;
|
||||||
|
|
||||||
|
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 java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
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;
|
|
||||||
/**
|
/**
|
||||||
* 基础dao
|
* 基础dao
|
||||||
|
*
|
||||||
* @author ji_sheng_hua qq:752718920
|
* @author ji_sheng_hua qq:752718920
|
||||||
*/
|
*/
|
||||||
public class BaseDAO<T> extends HibernateDaoSupport implements BaseIDAO<T>
|
public class BaseDAO<T> extends HibernateDaoSupport implements BaseIDAO<T> {
|
||||||
{
|
|
||||||
protected Class<T> entityClass;
|
protected Class<T> entityClass;
|
||||||
|
|
||||||
public void setPoJoClass(Class<T> c)
|
public void setPoJoClass(Class<T> c) {
|
||||||
{
|
|
||||||
this.entityClass = c;
|
this.entityClass = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Class<T> getEntityClass()
|
protected Class<T> getEntityClass() {
|
||||||
{
|
|
||||||
return this.entityClass;
|
return this.entityClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Serializable create(T t) throws DataAccessException
|
public Serializable create(T t) throws DataAccessException {
|
||||||
{
|
|
||||||
return this.getHibernateTemplate().save(t);
|
return this.getHibernateTemplate().save(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(T t) throws DataAccessException
|
public void delete(T t) throws DataAccessException {
|
||||||
{
|
|
||||||
this.getHibernateTemplate().delete(t);
|
this.getHibernateTemplate().delete(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T get(Long objID) throws DataAccessException
|
public T get(Long objID) throws DataAccessException {
|
||||||
{
|
|
||||||
return (T) this.getHibernateTemplate().get(getEntityClass(), objID);
|
return (T) this.getHibernateTemplate().get(getEntityClass(), objID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(T t) throws DataAccessException
|
public void update(T t) throws DataAccessException {
|
||||||
{
|
|
||||||
this.getHibernateTemplate().update(t);
|
this.getHibernateTemplate().update(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void batchDelete(String objIDs) throws DataAccessException
|
public void batchDelete(String objIDs) throws DataAccessException {
|
||||||
{
|
this.getHibernateTemplate().bulkUpdate("delete from " + getEntityClass().getName() + " where id in (" + objIDs + ")");
|
||||||
this.getHibernateTemplate().bulkUpdate("delete from " + getEntityClass().getName() + " where id in ("+ objIDs + ")");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void find(PageUtil<T> pageUtil) throws DataAccessException
|
public void find(PageUtil<T> pageUtil) throws DataAccessException {
|
||||||
{
|
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
||||||
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+
|
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " +
|
||||||
SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
|
|
||||||
// 分页查询
|
// 分页查询
|
||||||
int pageNo = pageUtil.getCurPage();
|
int pageNo = pageUtil.getCurPage();
|
||||||
int pageSize = pageUtil.getPageSize();
|
int pageSize = pageUtil.getPageSize();
|
||||||
if (0 != pageNo && 0 != pageSize)
|
if (0 != pageNo && 0 != pageSize) {
|
||||||
{
|
|
||||||
query.setFirstResult((pageNo - 1) * pageSize);
|
query.setFirstResult((pageNo - 1) * pageSize);
|
||||||
query.setMaxResults(pageSize);
|
query.setMaxResults(pageSize);
|
||||||
}
|
}
|
||||||
@@ -94,10 +85,9 @@ public class BaseDAO<T> extends HibernateDaoSupport implements BaseIDAO<T>
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public List<T> find(Map<String, Object> conditon, int pageSize, int pageNo)throws DataAccessException
|
public List<T> find(Map<String, Object> conditon, int pageSize, int pageNo) throws DataAccessException {
|
||||||
{
|
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
||||||
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+ SearchConditionUtil.getCondition(conditon));
|
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " + SearchConditionUtil.getCondition(conditon));
|
||||||
query.setFirstResult((pageNo - 1) * pageSize);
|
query.setFirstResult((pageNo - 1) * pageSize);
|
||||||
query.setMaxResults(pageSize);
|
query.setMaxResults(pageSize);
|
||||||
return query.list();
|
return query.list();
|
||||||
@@ -105,10 +95,9 @@ public class BaseDAO<T> extends HibernateDaoSupport implements BaseIDAO<T>
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public List<T> find(String hql, int pageSize, int pageNo)throws DataAccessException
|
public List<T> find(String hql, int pageSize, int pageNo) throws DataAccessException {
|
||||||
{
|
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
||||||
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+ hql);
|
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " + hql);
|
||||||
query.setFirstResult((pageNo - 1) * pageSize);
|
query.setFirstResult((pageNo - 1) * pageSize);
|
||||||
query.setMaxResults(pageSize);
|
query.setMaxResults(pageSize);
|
||||||
return query.list();
|
return query.list();
|
||||||
@@ -116,25 +105,22 @@ public class BaseDAO<T> extends HibernateDaoSupport implements BaseIDAO<T>
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Integer countSum(Map<String, Object> conditon)throws DataAccessException
|
public Integer countSum(Map<String, Object> conditon) throws DataAccessException {
|
||||||
{
|
|
||||||
List<T> dataList = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
List<T> dataList = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
||||||
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+ SearchConditionUtil.getCondition(conditon)).list();
|
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " + SearchConditionUtil.getCondition(conditon)).list();
|
||||||
return dataList ==null?0:dataList.size();
|
return dataList == null ? 0 : dataList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Integer countSum(String hql) throws DataAccessException
|
public Integer countSum(String hql) throws DataAccessException {
|
||||||
{
|
|
||||||
List<T> dataList = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
List<T> dataList = this.getHibernateTemplate().getSessionFactory().getCurrentSession()
|
||||||
.createQuery(" from " + getEntityClass().getName() + " where 1=1 "+ hql).list();
|
.createQuery(" from " + getEntityClass().getName() + " where 1=1 " + hql).list();
|
||||||
return dataList ==null?0:dataList.size();
|
return dataList == null ? 0 : dataList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save(T t) throws DataAccessException
|
public void save(T t) throws DataAccessException {
|
||||||
{
|
|
||||||
this.getHibernateTemplate().save(t);
|
this.getHibernateTemplate().save(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,76 +1,83 @@
|
|||||||
package com.jsh.base;
|
package com.jsh.base;
|
||||||
|
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常用增删改查操作
|
* 常用增删改查操作
|
||||||
* @author ji-sheng-hua qq752718920
|
*
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @author ji-sheng-hua qq752718920
|
||||||
*/
|
*/
|
||||||
public interface BaseIDAO<T>
|
public interface BaseIDAO<T> {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置操作类对象
|
* 设置操作类对象
|
||||||
|
*
|
||||||
* @param paramClass
|
* @param paramClass
|
||||||
*/
|
*/
|
||||||
void setPoJoClass(Class<T> paramClass);
|
void setPoJoClass(Class<T> paramClass);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加
|
* 增加
|
||||||
|
*
|
||||||
* @param t 对象
|
* @param t 对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
Serializable create(T t)throws DataAccessException;
|
Serializable create(T t) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加
|
* 增加
|
||||||
|
*
|
||||||
* @param t 对象
|
* @param t 对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void save(T t)throws DataAccessException;
|
void save(T t) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
|
*
|
||||||
* @param t 对象
|
* @param t 对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void delete(T t)throws DataAccessException;
|
void delete(T t) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取
|
* 获取
|
||||||
|
*
|
||||||
* @param objID ID
|
* @param objID ID
|
||||||
* @return 对象
|
* @return 对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
T get(Long objID)throws DataAccessException;
|
T get(Long objID) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改信息
|
* 修改信息
|
||||||
|
*
|
||||||
* @param t 要修改的对象
|
* @param t 要修改的对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void update(T t)throws DataAccessException;
|
void update(T t) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除信息
|
* 批量删除信息
|
||||||
|
*
|
||||||
* @param 以逗号分割的ID
|
* @param 以逗号分割的ID
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void batchDelete(String objIDs)throws DataAccessException;
|
void batchDelete(String objIDs) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找列表
|
* 查找列表
|
||||||
|
*
|
||||||
* @param pageUtil 分页工具类
|
* @param pageUtil 分页工具类
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void find(PageUtil<T> pageUtil)throws DataAccessException;
|
void find(PageUtil<T> pageUtil) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件查询列表--没有分页信息
|
* 根据条件查询列表--没有分页信息
|
||||||
@@ -88,37 +95,41 @@ public interface BaseIDAO<T>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据搜索条件查询--分页
|
* 根据搜索条件查询--分页
|
||||||
|
*
|
||||||
* @param conditon 查询条件
|
* @param conditon 查询条件
|
||||||
* @param pageSize 每页个数
|
* @param pageSize 每页个数
|
||||||
* @param pageNo 页码
|
* @param pageNo 页码
|
||||||
* @return 查询列表数据
|
* @return 查询列表数据
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
List<T> find(Map<String,Object> conditon,int pageSize,int pageNo)throws DataAccessException;
|
List<T> find(Map<String, Object> conditon, int pageSize, int pageNo) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据hql查询--分页
|
* 根据hql查询--分页
|
||||||
|
*
|
||||||
* @param hql hibernate查询语句
|
* @param hql hibernate查询语句
|
||||||
* @param pageSize 每页个数
|
* @param pageSize 每页个数
|
||||||
* @param pageNo 页码
|
* @param pageNo 页码
|
||||||
* @return 查询列表数据
|
* @return 查询列表数据
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
List<T> find(String hql,int pageSize,int pageNo)throws DataAccessException;
|
List<T> find(String hql, int pageSize, int pageNo) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找符合条件的总数
|
* 查找符合条件的总数
|
||||||
|
*
|
||||||
* @param conditon
|
* @param conditon
|
||||||
* @return
|
* @return
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
Integer countSum(Map<String,Object> conditon)throws DataAccessException;
|
Integer countSum(Map<String, Object> conditon) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找符合条件的总数
|
* 查找符合条件的总数
|
||||||
|
*
|
||||||
* @param hql
|
* @param hql
|
||||||
* @return
|
* @return
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
Integer countSum(String hql)throws DataAccessException;
|
Integer countSum(String hql) throws DataAccessException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,69 +1,77 @@
|
|||||||
package com.jsh.base;
|
package com.jsh.base;
|
||||||
|
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
/**
|
/**
|
||||||
* 服务层底层接口
|
* 服务层底层接口
|
||||||
* @author ji-sheng-hua qq752718920
|
*
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @author ji-sheng-hua qq752718920
|
||||||
*/
|
*/
|
||||||
public interface BaseIService<T>
|
public interface BaseIService<T> {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 增加
|
* 增加
|
||||||
|
*
|
||||||
* @param t 对象
|
* @param t 对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
Serializable create(T t)throws DataAccessException;
|
Serializable create(T t) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加
|
* 增加
|
||||||
|
*
|
||||||
* @param t 对象
|
* @param t 对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void save(T t)throws DataAccessException;
|
void save(T t) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
|
*
|
||||||
* @param t 对象
|
* @param t 对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void delete(T t)throws DataAccessException;
|
void delete(T t) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
|
*
|
||||||
* @param id 对象ID
|
* @param id 对象ID
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void delete(Long id)throws DataAccessException;
|
void delete(Long id) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取
|
* 获取
|
||||||
|
*
|
||||||
* @param objID ID
|
* @param objID ID
|
||||||
* @return 对象
|
* @return 对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
T get(Long objID)throws DataAccessException;
|
T get(Long objID) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改信息
|
* 修改信息
|
||||||
|
*
|
||||||
* @param t 要修改的对象
|
* @param t 要修改的对象
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void update(T t)throws DataAccessException;
|
void update(T t) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除信息
|
* 批量删除信息
|
||||||
|
*
|
||||||
* @param 以逗号分割的ID
|
* @param 以逗号分割的ID
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
void batchDelete(String objIDs)throws DataAccessException;
|
void batchDelete(String objIDs) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找列表
|
* 查找列表
|
||||||
|
*
|
||||||
* @param pageUtil 分页工具类
|
* @param pageUtil 分页工具类
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
@@ -71,6 +79,7 @@ public interface BaseIService<T>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查名称是否存在,页面唯一性效验使用
|
* 检查名称是否存在,页面唯一性效验使用
|
||||||
|
*
|
||||||
* @param filedName 效验的字段名称
|
* @param filedName 效验的字段名称
|
||||||
* @param filedVale 校验值
|
* @param filedVale 校验值
|
||||||
* @param idFiled ID字段名称
|
* @param idFiled ID字段名称
|
||||||
@@ -78,10 +87,11 @@ public interface BaseIService<T>
|
|||||||
* @return true==存在 false==不存在
|
* @return true==存在 false==不存在
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
Boolean checkIsNameExist(String filedName,String filedVale,String idFiled,Long objectID) throws DataAccessException;
|
Boolean checkIsNameExist(String filedName, String filedVale, String idFiled, Long objectID) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查UserBusiness是否存在,页面唯一性效验使用
|
* 检查UserBusiness是否存在,页面唯一性效验使用
|
||||||
|
*
|
||||||
* @param TypeName 类型名称
|
* @param TypeName 类型名称
|
||||||
* @param TypeVale 类型值
|
* @param TypeVale 类型值
|
||||||
* @param KeyIdName 关键id
|
* @param KeyIdName 关键id
|
||||||
@@ -91,10 +101,11 @@ public interface BaseIService<T>
|
|||||||
* @return true==存在 false==不存在
|
* @return true==存在 false==不存在
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
Boolean checkIsUserBusinessExist(String TypeName,String TypeVale,String KeyIdName,String KeyIdValue,String UBName,String UBValue) throws DataAccessException;
|
Boolean checkIsUserBusinessExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue, String UBName, String UBValue) throws DataAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查UserBusiness是否存在,页面唯一性效验使用
|
* 检查UserBusiness是否存在,页面唯一性效验使用
|
||||||
|
*
|
||||||
* @param TypeName 类型名称
|
* @param TypeName 类型名称
|
||||||
* @param TypeVale 类型值
|
* @param TypeVale 类型值
|
||||||
* @param KeyIdName 关键id
|
* @param KeyIdName 关键id
|
||||||
@@ -105,5 +116,4 @@ public interface BaseIService<T>
|
|||||||
Boolean checkIsValueExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue) throws DataAccessException;
|
Boolean checkIsValueExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue) throws DataAccessException;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,116 +1,100 @@
|
|||||||
package com.jsh.base;
|
package com.jsh.base;
|
||||||
|
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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>
|
* @param <T>
|
||||||
|
* @author ji-sheng-hua qq752718920
|
||||||
*/
|
*/
|
||||||
public abstract class BaseService<T> implements BaseIService<T>
|
public abstract class BaseService<T> implements BaseIService<T> {
|
||||||
{
|
protected Class<T> entityClass;
|
||||||
/**
|
/**
|
||||||
* Dao对象
|
* Dao对象
|
||||||
*/
|
*/
|
||||||
private BaseIDAO<T> baseDao;
|
private BaseIDAO<T> baseDao;
|
||||||
|
|
||||||
protected Class<T> entityClass;
|
protected BaseIDAO<T> getBaseDao() {
|
||||||
|
return this.baseDao;
|
||||||
|
}
|
||||||
|
|
||||||
public void setBaseDao(BaseIDAO<T> baseDao)
|
public void setBaseDao(BaseIDAO<T> baseDao) {
|
||||||
{
|
|
||||||
this.baseDao = baseDao;
|
this.baseDao = baseDao;
|
||||||
setPoJoClass(getEntityClass());
|
setPoJoClass(getEntityClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BaseIDAO<T> getBaseDao()
|
private void setPoJoClass(Class<T> c) {
|
||||||
{
|
|
||||||
return this.baseDao;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setPoJoClass(Class<T> c)
|
|
||||||
{
|
|
||||||
this.baseDao.setPoJoClass(c);
|
this.baseDao.setPoJoClass(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract Class<T> getEntityClass();
|
protected abstract Class<T> getEntityClass();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Serializable create(T t) throws DataAccessException
|
public Serializable create(T t) throws DataAccessException {
|
||||||
{
|
|
||||||
return baseDao.create(t);
|
return baseDao.create(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save(T t) throws DataAccessException
|
public void save(T t) throws DataAccessException {
|
||||||
{
|
|
||||||
baseDao.save(t);
|
baseDao.save(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(T t) throws DataAccessException
|
public void delete(T t) throws DataAccessException {
|
||||||
{
|
|
||||||
baseDao.delete(t);
|
baseDao.delete(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(Long id) throws DataAccessException
|
public void delete(Long id) throws DataAccessException {
|
||||||
{
|
|
||||||
baseDao.batchDelete(id.toString());
|
baseDao.batchDelete(id.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T get(Long objID) throws DataAccessException
|
public T get(Long objID) throws DataAccessException {
|
||||||
{
|
|
||||||
return baseDao.get(objID);
|
return baseDao.get(objID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(T t) throws DataAccessException
|
public void update(T t) throws DataAccessException {
|
||||||
{
|
|
||||||
baseDao.update(t);
|
baseDao.update(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void batchDelete(String objIDs) throws DataAccessException
|
public void batchDelete(String objIDs) throws DataAccessException {
|
||||||
{
|
|
||||||
baseDao.batchDelete(objIDs);
|
baseDao.batchDelete(objIDs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void find(PageUtil<T> pageUtil) throws DataAccessException
|
public void find(PageUtil<T> pageUtil) throws DataAccessException {
|
||||||
{
|
|
||||||
baseDao.find(pageUtil);
|
baseDao.find(pageUtil);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean checkIsNameExist(String filedName, String filedVale,String idFiled,Long objectID) throws DataAccessException
|
public Boolean checkIsNameExist(String filedName, String filedVale, String idFiled, Long objectID) throws DataAccessException {
|
||||||
{
|
|
||||||
PageUtil<T> pageUtil = new PageUtil<T>();
|
PageUtil<T> pageUtil = new PageUtil<T>();
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put(filedName + "_s_eq", filedVale);
|
condition.put(filedName + "_s_eq", filedVale);
|
||||||
condition.put(idFiled + "_n_neq", objectID);
|
condition.put(idFiled + "_n_neq", objectID);
|
||||||
pageUtil.setAdvSearch(condition);
|
pageUtil.setAdvSearch(condition);
|
||||||
baseDao.find(pageUtil);
|
baseDao.find(pageUtil);
|
||||||
|
|
||||||
List<T> dataList = pageUtil.getPageList();
|
List<T> dataList = pageUtil.getPageList();
|
||||||
if(null != dataList && dataList.size() > 0)
|
if (null != dataList && dataList.size() > 0)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean checkIsUserBusinessExist(String TypeName,String TypeVale,String KeyIdName,String KeyIdValue,String UBName,String UBValue) throws DataAccessException
|
public Boolean checkIsUserBusinessExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue, String UBName, String UBValue) throws DataAccessException {
|
||||||
{
|
|
||||||
PageUtil<T> pageUtil = new PageUtil<T>();
|
PageUtil<T> pageUtil = new PageUtil<T>();
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put(TypeName + "_s_eq", TypeVale);
|
condition.put(TypeName + "_s_eq", TypeVale);
|
||||||
condition.put(KeyIdName + "_s_eq", KeyIdValue);
|
condition.put(KeyIdName + "_s_eq", KeyIdValue);
|
||||||
condition.put(UBName + "_s_like", UBValue);
|
condition.put(UBName + "_s_like", UBValue);
|
||||||
@@ -118,23 +102,22 @@ public abstract class BaseService<T> implements BaseIService<T>
|
|||||||
baseDao.find(pageUtil);
|
baseDao.find(pageUtil);
|
||||||
|
|
||||||
List<T> dataList = pageUtil.getPageList();
|
List<T> dataList = pageUtil.getPageList();
|
||||||
if(null != dataList && dataList.size() > 0)
|
if (null != dataList && dataList.size() > 0)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean checkIsValueExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue) throws DataAccessException
|
public Boolean checkIsValueExist(String TypeName, String TypeVale, String KeyIdName, String KeyIdValue) throws DataAccessException {
|
||||||
{
|
|
||||||
PageUtil<T> pageUtil = new PageUtil<T>();
|
PageUtil<T> pageUtil = new PageUtil<T>();
|
||||||
Map<String,Object> condition = new HashMap<String,Object>();
|
Map<String, Object> condition = new HashMap<String, Object>();
|
||||||
condition.put(TypeName + "_s_eq", TypeVale);
|
condition.put(TypeName + "_s_eq", TypeVale);
|
||||||
condition.put(KeyIdName + "_s_eq", KeyIdValue);
|
condition.put(KeyIdName + "_s_eq", KeyIdValue);
|
||||||
pageUtil.setAdvSearch(condition);
|
pageUtil.setAdvSearch(condition);
|
||||||
baseDao.find(pageUtil);
|
baseDao.find(pageUtil);
|
||||||
|
|
||||||
List<T> dataList = pageUtil.getPageList();
|
List<T> dataList = pageUtil.getPageList();
|
||||||
if(null != dataList && dataList.size() > 0)
|
if (null != dataList && dataList.size() > 0)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,159 +4,150 @@ import org.apache.log4j.Logger;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 封装log4j日志信息,打印日志信息类
|
* 封装log4j日志信息,打印日志信息类
|
||||||
|
*
|
||||||
* @author ji/sheng/hua qq_7527.18920
|
* @author ji/sheng/hua qq_7527.18920
|
||||||
* @since 2014-01-22
|
* @since 2014-01-22
|
||||||
*/
|
*/
|
||||||
public class Log
|
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();
|
private static final Exception ex = new Exception();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取Log4j实例
|
* 获取Log4j实例
|
||||||
*/
|
*/
|
||||||
private static final Logger log = Logger.getLogger("jsh");
|
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日期信息
|
* 打印deug日期信息
|
||||||
|
*
|
||||||
* @param msg 日志信息
|
* @param msg 日志信息
|
||||||
*/
|
*/
|
||||||
public static void debugFileSync(Object msg)
|
public static void debugFileSync(Object msg) {
|
||||||
{
|
|
||||||
log.debug(getLogDetail(msg));
|
log.debug(getLogDetail(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印debug异常信息
|
* 打印debug异常信息
|
||||||
|
*
|
||||||
* @param msg 日志信息
|
* @param msg 日志信息
|
||||||
* @param e 异常堆栈
|
* @param e 异常堆栈
|
||||||
*/
|
*/
|
||||||
public static void debugFileSync(Object msg, Throwable e)
|
public static void debugFileSync(Object msg, Throwable e) {
|
||||||
{
|
|
||||||
log.debug(getLogDetail(msg), e);
|
log.debug(getLogDetail(msg), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印info日志信息
|
* 打印info日志信息
|
||||||
|
*
|
||||||
* @param msg 日志信息
|
* @param msg 日志信息
|
||||||
*/
|
*/
|
||||||
public static void infoFileSync(Object msg)
|
public static void infoFileSync(Object msg) {
|
||||||
{
|
|
||||||
log.info(getLogDetail(msg));
|
log.info(getLogDetail(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印 info日志带异常信息
|
* 打印 info日志带异常信息
|
||||||
|
*
|
||||||
* @param msg 日志信息
|
* @param msg 日志信息
|
||||||
* @param e 异常堆栈
|
* @param e 异常堆栈
|
||||||
*/
|
*/
|
||||||
public static void infoFileSync(Object msg, Throwable e)
|
public static void infoFileSync(Object msg, Throwable e) {
|
||||||
{
|
|
||||||
log.info(getLogDetail(msg), e);
|
log.info(getLogDetail(msg), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印warn日期信息
|
* 打印warn日期信息
|
||||||
|
*
|
||||||
* @param msg 日志信息
|
* @param msg 日志信息
|
||||||
*/
|
*/
|
||||||
public static void warnFileSync(Object msg)
|
public static void warnFileSync(Object msg) {
|
||||||
{
|
|
||||||
log.warn(getLogDetail(msg));
|
log.warn(getLogDetail(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印warn日志信息带异常
|
* 打印warn日志信息带异常
|
||||||
|
*
|
||||||
* @param msg日志信息
|
* @param msg日志信息
|
||||||
* @param e 异常堆栈
|
* @param e 异常堆栈
|
||||||
*/
|
*/
|
||||||
public static void warnFileSync(Object msg, Throwable e)
|
public static void warnFileSync(Object msg, Throwable e) {
|
||||||
{
|
|
||||||
log.warn(getLogDetail(msg), e);
|
log.warn(getLogDetail(msg), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印error日志信息
|
* 打印error日志信息
|
||||||
|
*
|
||||||
* @param msg 日志信息
|
* @param msg 日志信息
|
||||||
*/
|
*/
|
||||||
public static void errorFileSync(Object msg)
|
public static void errorFileSync(Object msg) {
|
||||||
{
|
|
||||||
log.error(getLogDetail(msg));
|
log.error(getLogDetail(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印error日志信息带异常
|
* 打印error日志信息带异常
|
||||||
|
*
|
||||||
* @param msg 日志信息
|
* @param msg 日志信息
|
||||||
* @param e 异常堆栈
|
* @param e 异常堆栈
|
||||||
*/
|
*/
|
||||||
public static void errorFileSync(Object msg, Throwable e)
|
public static void errorFileSync(Object msg, Throwable e) {
|
||||||
{
|
|
||||||
log.error(getLogDetail(msg), e);
|
log.error(getLogDetail(msg), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印fatal日志信息
|
* 打印fatal日志信息
|
||||||
|
*
|
||||||
* @param msg 日志信息
|
* @param msg 日志信息
|
||||||
*/
|
*/
|
||||||
public static void fatalFileSync(Object msg)
|
public static void fatalFileSync(Object msg) {
|
||||||
{
|
|
||||||
log.fatal(getLogDetail(msg));
|
log.fatal(getLogDetail(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印fatal日志信息带异常
|
* 打印fatal日志信息带异常
|
||||||
|
*
|
||||||
* @param msg 日志信息
|
* @param msg 日志信息
|
||||||
* @param e 异常堆栈
|
* @param e 异常堆栈
|
||||||
*/
|
*/
|
||||||
public static void fatalFileSync(Object msg, Throwable e)
|
public static void fatalFileSync(Object msg, Throwable e) {
|
||||||
{
|
|
||||||
log.fatal(getLogDetail(msg), e);
|
log.fatal(getLogDetail(msg), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼装日志详细信息
|
* 拼装日志详细信息
|
||||||
|
*
|
||||||
* @param message 要打印的日志信息
|
* @param message 要打印的日志信息
|
||||||
* @return 封装后的日志详细信息
|
* @return 封装后的日志详细信息
|
||||||
*/
|
*/
|
||||||
private static synchronized String getLogDetail(Object message)
|
private static synchronized String getLogDetail(Object message) {
|
||||||
{
|
|
||||||
String msg = "";
|
String msg = "";
|
||||||
if (null != message)
|
if (null != message)
|
||||||
msg = message.toString();
|
msg = message.toString();
|
||||||
StringBuffer bf = new StringBuffer();
|
StringBuffer bf = new StringBuffer();
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
ex.fillInStackTrace();
|
ex.fillInStackTrace();
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
} catch (Exception ex) {
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
StackTraceElement[] trace = ex.getStackTrace();
|
StackTraceElement[] trace = ex.getStackTrace();
|
||||||
//获取异常堆栈中的调用类信息
|
//获取异常堆栈中的调用类信息
|
||||||
final int pos = 2;
|
final int pos = 2;
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.asset;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Asset;
|
import com.jsh.model.po.Asset;
|
||||||
|
|
||||||
public class AssetDAO extends BaseDAO<Asset> implements AssetIDAO
|
public class AssetDAO extends BaseDAO<Asset> implements AssetIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Asset> getEntityClass()
|
public Class<Asset> getEntityClass() {
|
||||||
{
|
|
||||||
return Asset.class;
|
return Asset.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.asset;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Asset;
|
import com.jsh.model.po.Asset;
|
||||||
|
|
||||||
public interface AssetIDAO extends BaseIDAO<Asset>
|
public interface AssetIDAO extends BaseIDAO<Asset> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
package com.jsh.dao.asset;
|
package com.jsh.dao.asset;
|
||||||
|
|
||||||
|
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.hibernate.Query;
|
||||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||||
|
|
||||||
import com.jsh.util.JshException;
|
public class ReportDAO extends HibernateDaoSupport implements ReportIDAO {
|
||||||
import com.jsh.model.po.Asset;
|
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
import com.jsh.util.SearchConditionUtil;
|
|
||||||
|
|
||||||
public class ReportDAO extends HibernateDaoSupport implements ReportIDAO
|
|
||||||
{
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void find(PageUtil<Asset> pageUtil,String reportType,String reportName) throws JshException
|
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()));
|
||||||
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.setTotalCount(query.list().size());
|
||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package com.jsh.dao.asset;
|
package com.jsh.dao.asset;
|
||||||
|
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.Asset;
|
import com.jsh.model.po.Asset;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
|
|
||||||
public interface ReportIDAO
|
public interface ReportIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查找资产列表
|
* 查找资产列表
|
||||||
|
*
|
||||||
* @param pageUtil 分页工具类
|
* @param pageUtil 分页工具类
|
||||||
* @param reportType 报表统计字段
|
* @param reportType 报表统计字段
|
||||||
* @throws JshException
|
* @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 com.jsh.util.SearchConditionUtil;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
|
|
||||||
public class AccountDAO extends BaseDAO<Account> implements AccountIDAO
|
public class AccountDAO extends BaseDAO<Account> implements AccountIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Account> getEntityClass()
|
public Class<Account> getEntityClass() {
|
||||||
{
|
|
||||||
return Account.class;
|
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 " +
|
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 ");
|
" from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id where 1=1 ");
|
||||||
if(accountId!=null && !accountId.equals("")) {
|
if (accountId != null && !accountId.equals("")) {
|
||||||
queryString.append(" and dh.AccountId='"+ accountId +"' ");
|
queryString.append(" and dh.AccountId='" + accountId + "' ");
|
||||||
}
|
}
|
||||||
//主表收入和支出涉及的账户
|
//主表收入和支出涉及的账户
|
||||||
queryString.append("UNION ALL " +
|
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 " +
|
"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 ");
|
" from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id where 1=1 ");
|
||||||
if(accountId!=null && !accountId.equals("")) {
|
if (accountId != null && !accountId.equals("")) {
|
||||||
queryString.append(" and ah.AccountId='"+ accountId +"' ");
|
queryString.append(" and ah.AccountId='" + accountId + "' ");
|
||||||
}
|
}
|
||||||
//明细中涉及的账户(收款,付款,收预付款)
|
//明细中涉及的账户(收款,付款,收预付款)
|
||||||
queryString.append("UNION ALL " +
|
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 " +
|
" from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id " +
|
||||||
" inner join jsh_accountitem ai on ai.HeaderId=ah.Id " +
|
" inner join jsh_accountitem ai on ai.HeaderId=ah.Id " +
|
||||||
" where ah.Type in ('收款','付款','收预付款') ");
|
" where ah.Type in ('收款','付款','收预付款') ");
|
||||||
if(accountId!=null && !accountId.equals("")) {
|
if (accountId != null && !accountId.equals("")) {
|
||||||
queryString.append(" and ai.AccountId='"+ accountId +"' ");
|
queryString.append(" and ai.AccountId='" + accountId + "' ");
|
||||||
}
|
}
|
||||||
//主表中转出的账户
|
//主表中转出的账户
|
||||||
queryString.append("UNION ALL " +
|
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 " +
|
"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 " +
|
" from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id " +
|
||||||
" where ah.Type='转账' ");
|
" where ah.Type='转账' ");
|
||||||
if(accountId!=null && !accountId.equals("")) {
|
if (accountId != null && !accountId.equals("")) {
|
||||||
queryString.append(" and ah.AccountId='"+ accountId +"' ");
|
queryString.append(" and ah.AccountId='" + accountId + "' ");
|
||||||
}
|
}
|
||||||
//明细中被转入的账户
|
//明细中被转入的账户
|
||||||
queryString.append("UNION ALL " +
|
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 " +
|
"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 " +
|
" from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id " +
|
||||||
" where ah.Type='转账' ");
|
" where ah.Type='转账' ");
|
||||||
if(accountId!=null && !accountId.equals("")) {
|
if (accountId != null && !accountId.equals("")) {
|
||||||
queryString.append(" and ai.AccountId='"+ accountId +"' ");
|
queryString.append(" and ai.AccountId='" + accountId + "' ");
|
||||||
}
|
}
|
||||||
//多账户的情况
|
//多账户的情况
|
||||||
queryString.append("UNION ALL " +
|
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" +
|
"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 ");
|
" from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id where 1=1 ");
|
||||||
if(accountId!=null && !accountId.equals("")) {
|
if (accountId != null && !accountId.equals("")) {
|
||||||
queryString.append(" and dh.AccountIdList like '%\""+ accountId +"\"%' ");
|
queryString.append(" and dh.AccountIdList like '%\"" + accountId + "\"%' ");
|
||||||
}
|
}
|
||||||
queryString.append(" ORDER BY oTime desc");
|
queryString.append(" ORDER BY oTime desc");
|
||||||
Query query;
|
Query query;
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.App;
|
import com.jsh.model.po.App;
|
||||||
|
|
||||||
public class AppDAO extends BaseDAO<App> implements AppIDAO
|
public class AppDAO extends BaseDAO<App> implements AppIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<App> getEntityClass()
|
public Class<App> getEntityClass() {
|
||||||
{
|
|
||||||
return App.class;
|
return App.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.App;
|
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.base.BaseDAO;
|
||||||
import com.jsh.model.po.Assetname;
|
import com.jsh.model.po.Assetname;
|
||||||
|
|
||||||
public class AssetNameDAO extends BaseDAO<Assetname> implements AssetNameIDAO
|
public class AssetNameDAO extends BaseDAO<Assetname> implements AssetNameIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Assetname> getEntityClass()
|
public Class<Assetname> getEntityClass() {
|
||||||
{
|
|
||||||
return Assetname.class;
|
return Assetname.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Assetname;
|
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.base.BaseDAO;
|
||||||
import com.jsh.model.po.Category;
|
import com.jsh.model.po.Category;
|
||||||
|
|
||||||
public class CategoryDAO extends BaseDAO<Category> implements CategoryIDAO
|
public class CategoryDAO extends BaseDAO<Category> implements CategoryIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Category> getEntityClass()
|
public Class<Category> getEntityClass() {
|
||||||
{
|
|
||||||
return Category.class;
|
return Category.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Category;
|
import com.jsh.model.po.Category;
|
||||||
|
|
||||||
public interface CategoryIDAO extends BaseIDAO<Category>
|
public interface CategoryIDAO extends BaseIDAO<Category> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Depot;
|
import com.jsh.model.po.Depot;
|
||||||
|
|
||||||
public class DepotDAO extends BaseDAO<Depot> implements DepotIDAO
|
public class DepotDAO extends BaseDAO<Depot> implements DepotIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Depot> getEntityClass()
|
public Class<Depot> getEntityClass() {
|
||||||
{
|
|
||||||
return Depot.class;
|
return Depot.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Depot;
|
import com.jsh.model.po.Depot;
|
||||||
|
|
||||||
public interface DepotIDAO extends BaseIDAO<Depot>
|
public interface DepotIDAO extends BaseIDAO<Depot> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Functions;
|
import com.jsh.model.po.Functions;
|
||||||
|
|
||||||
public class FunctionsDAO extends BaseDAO<Functions> implements FunctionsIDAO
|
public class FunctionsDAO extends BaseDAO<Functions> implements FunctionsIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Functions> getEntityClass()
|
public Class<Functions> getEntityClass() {
|
||||||
{
|
|
||||||
return Functions.class;
|
return Functions.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Functions;
|
import com.jsh.model.po.Functions;
|
||||||
|
|
||||||
public interface FunctionsIDAO extends BaseIDAO<Functions>
|
public interface FunctionsIDAO extends BaseIDAO<Functions> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.InOutItem;
|
import com.jsh.model.po.InOutItem;
|
||||||
|
|
||||||
public class InOutItemDAO extends BaseDAO<InOutItem> implements InOutItemIDAO
|
public class InOutItemDAO extends BaseDAO<InOutItem> implements InOutItemIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<InOutItem> getEntityClass()
|
public Class<InOutItem> getEntityClass() {
|
||||||
{
|
|
||||||
return InOutItem.class;
|
return InOutItem.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.InOutItem;
|
import com.jsh.model.po.InOutItem;
|
||||||
|
|
||||||
public interface InOutItemIDAO extends BaseIDAO<InOutItem>
|
public interface InOutItemIDAO extends BaseIDAO<InOutItem> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Logdetails;
|
import com.jsh.model.po.Logdetails;
|
||||||
|
|
||||||
public class LogDAO extends BaseDAO<Logdetails> implements LogIDAO
|
public class LogDAO extends BaseDAO<Logdetails> implements LogIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Logdetails> getEntityClass()
|
public Class<Logdetails> getEntityClass() {
|
||||||
{
|
|
||||||
return Logdetails.class;
|
return Logdetails.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import com.jsh.model.po.Logdetails;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 日志相关处理接口
|
* 日志相关处理接口
|
||||||
|
*
|
||||||
* @author angel
|
* @author angel
|
||||||
*/
|
*/
|
||||||
public interface LogIDAO extends BaseIDAO<Logdetails>
|
public interface LogIDAO extends BaseIDAO<Logdetails> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Role;
|
import com.jsh.model.po.Role;
|
||||||
|
|
||||||
public class RoleDAO extends BaseDAO<Role> implements RoleIDAO
|
public class RoleDAO extends BaseDAO<Role> implements RoleIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Role> getEntityClass()
|
public Class<Role> getEntityClass() {
|
||||||
{
|
|
||||||
return Role.class;
|
return Role.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Role;
|
import com.jsh.model.po.Role;
|
||||||
|
|
||||||
public interface RoleIDAO extends BaseIDAO<Role>
|
public interface RoleIDAO extends BaseIDAO<Role> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,26 +2,23 @@ package com.jsh.dao.basic;
|
|||||||
|
|
||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Supplier;
|
import com.jsh.model.po.Supplier;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.util.SearchConditionUtil;
|
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
|
|
||||||
public class SupplierDAO extends BaseDAO<Supplier> implements SupplierIDAO
|
public class SupplierDAO extends BaseDAO<Supplier> implements SupplierIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Supplier> getEntityClass()
|
public Class<Supplier> getEntityClass() {
|
||||||
{
|
|
||||||
return Supplier.class;
|
return Supplier.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void batchSetEnable(Boolean enable,String supplierIDs) {
|
public void batchSetEnable(Boolean enable, String supplierIDs) {
|
||||||
String sql="update jsh_supplier s set s.enabled=" + enable + " where s.id in (" + supplierIDs + ")";
|
String sql = "update jsh_supplier s set s.enabled=" + enable + " where s.id in (" + supplierIDs + ")";
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(sql);
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(sql);
|
||||||
query.executeUpdate();
|
query.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Supplier;
|
import com.jsh.model.po.Supplier;
|
||||||
|
|
||||||
public interface SupplierIDAO extends BaseIDAO<Supplier>
|
public interface SupplierIDAO extends BaseIDAO<Supplier> {
|
||||||
{
|
public void batchSetEnable(Boolean enable, String supplierIDs);
|
||||||
public void batchSetEnable(Boolean enable,String supplierIDs);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.SystemConfig;
|
import com.jsh.model.po.SystemConfig;
|
||||||
|
|
||||||
public class SystemConfigDAO extends BaseDAO<SystemConfig> implements SystemConfigIDAO
|
public class SystemConfigDAO extends BaseDAO<SystemConfig> implements SystemConfigIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<SystemConfig> getEntityClass()
|
public Class<SystemConfig> getEntityClass() {
|
||||||
{
|
|
||||||
return SystemConfig.class;
|
return SystemConfig.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.SystemConfig;
|
import com.jsh.model.po.SystemConfig;
|
||||||
|
|
||||||
public interface SystemConfigIDAO extends BaseIDAO<SystemConfig>
|
public interface SystemConfigIDAO extends BaseIDAO<SystemConfig> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Unit;
|
import com.jsh.model.po.Unit;
|
||||||
|
|
||||||
public class UnitDAO extends BaseDAO<Unit> implements UnitIDAO
|
public class UnitDAO extends BaseDAO<Unit> implements UnitIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Unit> getEntityClass()
|
public Class<Unit> getEntityClass() {
|
||||||
{
|
|
||||||
return Unit.class;
|
return Unit.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Unit;
|
import com.jsh.model.po.Unit;
|
||||||
|
|
||||||
public interface UnitIDAO extends BaseIDAO<Unit>
|
public interface UnitIDAO extends BaseIDAO<Unit> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,26 @@
|
|||||||
package com.jsh.dao.basic;
|
package com.jsh.dao.basic;
|
||||||
|
|
||||||
import org.hibernate.Query;
|
|
||||||
|
|
||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.Asset;
|
|
||||||
import com.jsh.model.po.UserBusiness;
|
import com.jsh.model.po.UserBusiness;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
import com.jsh.util.SearchConditionUtil;
|
import com.jsh.util.SearchConditionUtil;
|
||||||
|
import org.hibernate.Query;
|
||||||
|
|
||||||
public class UserBusinessDAO extends BaseDAO<UserBusiness> implements UserBusinessIDAO
|
public class UserBusinessDAO extends BaseDAO<UserBusiness> implements UserBusinessIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<UserBusiness> getEntityClass()
|
public Class<UserBusiness> getEntityClass() {
|
||||||
{
|
|
||||||
return UserBusiness.class;
|
return UserBusiness.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void find(PageUtil<UserBusiness> pageUtil,String ceshi) throws JshException
|
public void find(PageUtil<UserBusiness> pageUtil, String ceshi) throws JshException {
|
||||||
{
|
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select count(id),sum(id) from UserBusiness userBusiness where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select count(id),sum(id) from UserBusiness userBusiness where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
package com.jsh.dao.basic;
|
package com.jsh.dao.basic;
|
||||||
|
|
||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.UserBusiness;
|
import com.jsh.model.po.UserBusiness;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
|
|
||||||
public interface UserBusinessIDAO extends BaseIDAO<UserBusiness>
|
public interface UserBusinessIDAO extends BaseIDAO<UserBusiness> {
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
* 测试hql语句
|
* 测试hql语句
|
||||||
*/
|
*/
|
||||||
void find(PageUtil<UserBusiness> pageUtil,String ceshi) throws JshException;
|
void find(PageUtil<UserBusiness> pageUtil, String ceshi) throws JshException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Basicuser;
|
import com.jsh.model.po.Basicuser;
|
||||||
|
|
||||||
public class UserDAO extends BaseDAO<Basicuser> implements UserIDAO
|
public class UserDAO extends BaseDAO<Basicuser> implements UserIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Basicuser> getEntityClass()
|
public Class<Basicuser> getEntityClass() {
|
||||||
{
|
|
||||||
return Basicuser.class;
|
return Basicuser.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.basic;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Basicuser;
|
import com.jsh.model.po.Basicuser;
|
||||||
|
|
||||||
public interface UserIDAO extends BaseIDAO<Basicuser>
|
public interface UserIDAO extends BaseIDAO<Basicuser> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +1,45 @@
|
|||||||
package com.jsh.dao.materials;
|
package com.jsh.dao.materials;
|
||||||
|
|
||||||
import org.hibernate.Query;
|
|
||||||
|
|
||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.AccountHead;
|
import com.jsh.model.po.AccountHead;
|
||||||
import com.jsh.model.po.DepotHead;
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.model.po.UserBusiness;
|
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
import com.jsh.util.SearchConditionUtil;
|
import com.jsh.util.SearchConditionUtil;
|
||||||
|
import org.hibernate.Query;
|
||||||
|
|
||||||
public class AccountHeadDAO extends BaseDAO<AccountHead> implements AccountHeadIDAO
|
/**
|
||||||
{
|
* @author alan
|
||||||
|
*/
|
||||||
|
public class AccountHeadDAO extends BaseDAO<AccountHead> implements AccountHeadIDAO {
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<AccountHead> getEntityClass()
|
public Class<AccountHead> getEntityClass() {
|
||||||
{
|
|
||||||
return AccountHead.class;
|
return AccountHead.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void find(PageUtil<AccountHead> pageUtil,String maxid) throws JshException
|
@Override
|
||||||
{
|
public void find(PageUtil<AccountHead> pageUtil, String maxid) throws JshException {
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from AccountHead accountHead where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from AccountHead accountHead where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void findAllMoney(PageUtil<AccountHead> pageUtil, Integer supplierId, String type, String mode) throws JshException
|
@Override
|
||||||
{
|
public void findAllMoney(PageUtil<AccountHead> pageUtil, Integer supplierId, String type, String mode) throws JshException {
|
||||||
Query query;
|
Query query;
|
||||||
String modeName = "";
|
String modeName = "";
|
||||||
if(mode.equals("实际")){
|
if (mode.equals("实际")) {
|
||||||
modeName = "ChangeAmount";
|
modeName = "ChangeAmount";
|
||||||
}
|
} else if (mode.equals("合计")) {
|
||||||
else if(mode.equals("合计")){
|
|
||||||
modeName = "TotalPrice";
|
modeName = "TotalPrice";
|
||||||
}
|
}
|
||||||
query= this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select sum(" + modeName + ") as allMoney from AccountHead accountHead where Type='" + type + "' and OrganId =" + supplierId + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select sum(" + modeName + ") as allMoney from AccountHead accountHead where Type='" + type + "' and OrganId =" + supplierId + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
package com.jsh.dao.materials;
|
package com.jsh.dao.materials;
|
||||||
|
|
||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.AccountHead;
|
import com.jsh.model.po.AccountHead;
|
||||||
import com.jsh.model.po.DepotHead;
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.model.po.UserBusiness;
|
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
|
|
||||||
public interface AccountHeadIDAO extends BaseIDAO<AccountHead>
|
public interface AccountHeadIDAO extends BaseIDAO<AccountHead> {
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
* 获取MaxId
|
* 获取MaxId
|
||||||
*/
|
*/
|
||||||
void find(PageUtil<AccountHead> pageUtil,String maxid) throws JshException;
|
void find(PageUtil<AccountHead> pageUtil, String maxid) throws JshException;
|
||||||
|
|
||||||
void findAllMoney(PageUtil<AccountHead> pageUtil, Integer supplierId, String type, String mode) throws JshException;
|
void findAllMoney(PageUtil<AccountHead> pageUtil, Integer supplierId, String type, String mode) throws JshException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,16 @@
|
|||||||
package com.jsh.dao.materials;
|
package com.jsh.dao.materials;
|
||||||
|
|
||||||
import org.hibernate.Query;
|
|
||||||
|
|
||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.AccountItem;
|
import com.jsh.model.po.AccountItem;
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
import com.jsh.util.SearchConditionUtil;
|
|
||||||
|
|
||||||
public class AccountItemDAO extends BaseDAO<AccountItem> implements AccountItemIDAO
|
public class AccountItemDAO extends BaseDAO<AccountItem> implements AccountItemIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<AccountItem> getEntityClass()
|
public Class<AccountItem> getEntityClass() {
|
||||||
{
|
|
||||||
return AccountItem.class;
|
return AccountItem.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
package com.jsh.dao.materials;
|
package com.jsh.dao.materials;
|
||||||
|
|
||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.AccountItem;
|
import com.jsh.model.po.AccountItem;
|
||||||
import com.jsh.util.PageUtil;
|
|
||||||
|
|
||||||
public interface AccountItemIDAO extends BaseIDAO<AccountItem>
|
public interface AccountItemIDAO extends BaseIDAO<AccountItem> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +1,57 @@
|
|||||||
package com.jsh.dao.materials;
|
package com.jsh.dao.materials;
|
||||||
|
|
||||||
import org.hibernate.Query;
|
|
||||||
|
|
||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.DepotHead;
|
import com.jsh.model.po.DepotHead;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
import com.jsh.util.SearchConditionUtil;
|
import com.jsh.util.SearchConditionUtil;
|
||||||
|
import org.hibernate.Query;
|
||||||
|
|
||||||
public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
|
public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<DepotHead> getEntityClass()
|
public Class<DepotHead> getEntityClass() {
|
||||||
{
|
|
||||||
return DepotHead.class;
|
return DepotHead.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void find(PageUtil<DepotHead> pageUtil,String maxid) throws JshException
|
@Override
|
||||||
{
|
public void find(PageUtil<DepotHead> pageUtil, String maxid) throws JshException {
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from DepotHead depotHead where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from DepotHead depotHead where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException
|
@Override
|
||||||
{
|
public void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException {
|
||||||
Query query;
|
Query query;
|
||||||
String modeName = "";
|
String modeName = "";
|
||||||
if(mode.equals("实际")){
|
if (mode.equals("实际")) {
|
||||||
modeName = "ChangeAmount";
|
modeName = "ChangeAmount";
|
||||||
}
|
} else if (mode.equals("合计")) {
|
||||||
else if(mode.equals("合计")){
|
|
||||||
modeName = "DiscountLastMoney";
|
modeName = "DiscountLastMoney";
|
||||||
}
|
}
|
||||||
query= this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select sum(" + modeName + ") as allMoney from DepotHead depotHead where Type='" + type + "' and SubType = '" + subType + "' and OrganId =" + supplierId + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select sum(" + modeName + ") as allMoney from DepotHead depotHead where Type='" + type + "' and SubType = '" + subType + "' and OrganId =" + supplierId + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void batchSetStatus(Boolean status,String depotHeadIDs) {
|
public void batchSetStatus(Boolean status, String depotHeadIDs) {
|
||||||
String sql="update jsh_depothead d set d.Status=" + status + " where d.id in (" + depotHeadIDs + ")";
|
String sql = "update jsh_depothead d set d.Status=" + status + " where d.id in (" + depotHeadIDs + ")";
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(sql);
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(sql);
|
||||||
query.executeUpdate();
|
query.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException {
|
public void findInDetail(PageUtil pageUtil, String beginTime, String endTime, String type, Long pid, String dids, Long oId) throws JshException {
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuffer queryString = new StringBuffer();
|
||||||
queryString.append("select dh.Number,m.`name`,m.Model,di.UnitPrice,di.OperNumber,di.AllPrice,s.supplier,d.dName," +
|
queryString.append("select dh.Number,m.`name`,m.Model,di.UnitPrice,di.OperNumber,di.AllPrice,s.supplier,d.dName," +
|
||||||
"date_format(dh.OperTime, '%Y-%m-%d'), concat(dh.SubType,dh.Type) as newType " +
|
"date_format(dh.OperTime, '%Y-%m-%d'), concat(dh.SubType,dh.Type) as newType " +
|
||||||
@@ -60,18 +59,17 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
|
|||||||
"inner join jsh_material m on m.id=di.MaterialId " +
|
"inner join jsh_material m on m.id=di.MaterialId " +
|
||||||
"inner join jsh_supplier s on s.id=dh.OrganId " +
|
"inner join jsh_supplier s on s.id=dh.OrganId " +
|
||||||
"inner join (select id,name as dName from jsh_depot) d on d.id=di.DepotId " +
|
"inner join (select id,name as dName from jsh_depot) d on d.id=di.DepotId " +
|
||||||
"where dh.OperTime >='"+ beginTime +"' and dh.OperTime <='"+ endTime +"' ");
|
"where dh.OperTime >='" + beginTime + "' and dh.OperTime <='" + endTime + "' ");
|
||||||
if(oId!=null){
|
if (oId != null) {
|
||||||
queryString.append(" and dh.OrganId = "+ oId );
|
queryString.append(" and dh.OrganId = " + oId);
|
||||||
}
|
}
|
||||||
if(pid!=null){
|
if (pid != null) {
|
||||||
queryString.append(" and di.DepotId=" + pid );
|
queryString.append(" and di.DepotId=" + pid);
|
||||||
|
} else {
|
||||||
|
queryString.append(" and di.DepotId in (" + dids + ")");
|
||||||
}
|
}
|
||||||
else {
|
if (type != null && !type.equals("")) {
|
||||||
queryString.append(" and di.DepotId in (" + dids + ")" );
|
queryString.append(" and dh.Type='" + type + "'");
|
||||||
}
|
|
||||||
if(type!=null && !type.equals("")) {
|
|
||||||
queryString.append(" and dh.Type='"+ type +"'");
|
|
||||||
}
|
}
|
||||||
queryString.append(" ORDER BY OperTime DESC,Number desc");
|
queryString.append(" ORDER BY OperTime DESC,Number desc");
|
||||||
Query query;
|
Query query;
|
||||||
@@ -87,50 +85,48 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
|
|||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException {
|
public void findInOutMaterialCount(PageUtil pageUtil, String beginTime, String endTime, String type, Long pid, String dids, Long oId) throws JshException {
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuffer queryString = new StringBuffer();
|
||||||
queryString.append("select di.MaterialId, m.mName,m.Model,m.categoryName, ");
|
queryString.append("select di.MaterialId, m.mName,m.Model,m.categoryName, ");
|
||||||
//数量汇总
|
//数量汇总
|
||||||
queryString.append(" (select sum(jdi.BasicNumber) numSum from jsh_depothead jdh INNER JOIN jsh_depotitem jdi " +
|
queryString.append(" (select sum(jdi.BasicNumber) numSum from jsh_depothead jdh INNER JOIN jsh_depotitem jdi " +
|
||||||
"on jdh.id=jdi.HeaderId where jdi.MaterialId=di.MaterialId " +
|
"on jdh.id=jdi.HeaderId where jdi.MaterialId=di.MaterialId " +
|
||||||
" and jdh.type='"+ type +"' and jdh.OperTime >='"+ beginTime +"' and jdh.OperTime <='"+ endTime +"'");
|
" and jdh.type='" + type + "' and jdh.OperTime >='" + beginTime + "' and jdh.OperTime <='" + endTime + "'");
|
||||||
if(oId!=null){
|
if (oId != null) {
|
||||||
queryString.append(" and jdh.OrganId = "+ oId );
|
queryString.append(" and jdh.OrganId = " + oId);
|
||||||
}
|
}
|
||||||
if(pid!=null){
|
if (pid != null) {
|
||||||
queryString.append(" and jdi.DepotId=" + pid );
|
queryString.append(" and jdi.DepotId=" + pid);
|
||||||
}
|
} else {
|
||||||
else {
|
queryString.append(" and jdi.DepotId in (" + dids + ")");
|
||||||
queryString.append(" and jdi.DepotId in (" + dids + ")" );
|
|
||||||
}
|
}
|
||||||
queryString.append(" ) numSum, ");
|
queryString.append(" ) numSum, ");
|
||||||
//金额汇总
|
//金额汇总
|
||||||
queryString.append(" (select sum(jdi.AllPrice) priceSum from jsh_depothead jdh INNER JOIN jsh_depotitem jdi " +
|
queryString.append(" (select sum(jdi.AllPrice) priceSum from jsh_depothead jdh INNER JOIN jsh_depotitem jdi " +
|
||||||
"on jdh.id=jdi.HeaderId where jdi.MaterialId=di.MaterialId " +
|
"on jdh.id=jdi.HeaderId where jdi.MaterialId=di.MaterialId " +
|
||||||
" and jdh.type='"+ type +"' and jdh.OperTime >='"+ beginTime +"' and jdh.OperTime <='"+ endTime +"'");
|
" and jdh.type='" + type + "' and jdh.OperTime >='" + beginTime + "' and jdh.OperTime <='" + endTime + "'");
|
||||||
if(oId!=null){
|
if (oId != null) {
|
||||||
queryString.append(" and jdh.OrganId = "+ oId );
|
queryString.append(" and jdh.OrganId = " + oId);
|
||||||
}
|
}
|
||||||
if(pid!=null){
|
if (pid != null) {
|
||||||
queryString.append(" and jdi.DepotId=" + pid );
|
queryString.append(" and jdi.DepotId=" + pid);
|
||||||
}
|
} else {
|
||||||
else {
|
queryString.append(" and jdi.DepotId in (" + dids + ")");
|
||||||
queryString.append(" and jdi.DepotId in (" + dids + ")" );
|
|
||||||
}
|
}
|
||||||
queryString.append(" ) priceSum ");
|
queryString.append(" ) priceSum ");
|
||||||
|
|
||||||
queryString.append(" from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId " +
|
queryString.append(" from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId " +
|
||||||
" INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName from jsh_material INNER JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id) m " +
|
" INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName from jsh_material INNER JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id) m " +
|
||||||
" on m.Id=di.MaterialId where dh.type='"+ type +"' and dh.OperTime >='"+ beginTime +"' and dh.OperTime <='"+ endTime +"' ");
|
" on m.Id=di.MaterialId where dh.type='" + type + "' and dh.OperTime >='" + beginTime + "' and dh.OperTime <='" + endTime + "' ");
|
||||||
if(oId!=null){
|
if (oId != null) {
|
||||||
queryString.append(" and dh.OrganId = "+ oId );
|
queryString.append(" and dh.OrganId = " + oId);
|
||||||
}
|
}
|
||||||
if(pid!=null){
|
if (pid != null) {
|
||||||
queryString.append(" and di.DepotId=" + pid );
|
queryString.append(" and di.DepotId=" + pid);
|
||||||
}
|
} else {
|
||||||
else {
|
queryString.append(" and di.DepotId in (" + dids + ")");
|
||||||
queryString.append(" and di.DepotId in (" + dids + ")" );
|
|
||||||
}
|
}
|
||||||
queryString.append(" GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName ");
|
queryString.append(" GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName ");
|
||||||
Query query;
|
Query query;
|
||||||
@@ -147,29 +143,29 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException {
|
public void findMaterialsListByHeaderId(PageUtil pageUtil, Long headerId) throws JshException {
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuffer queryString = new StringBuffer();
|
||||||
queryString.append("select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName from jsh_depotitem inner join jsh_material " +
|
queryString.append("select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName from jsh_depotitem inner join jsh_material " +
|
||||||
" on jsh_depotitem.MaterialId = jsh_material.Id where jsh_depotitem.HeaderId ="+ headerId);
|
" on jsh_depotitem.MaterialId = jsh_material.Id where jsh_depotitem.HeaderId =" + headerId);
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime,Long organId,String supType) throws JshException {
|
public void findStatementAccount(PageUtil pageUtil, String beginTime, String endTime, Long organId, String supType) throws JshException {
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuffer queryString = new StringBuffer();
|
||||||
queryString.append("select dh.Number,concat(dh.SubType,dh.Type) as newType,dh.DiscountLastMoney,dh.ChangeAmount,s.supplier,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh " +
|
queryString.append("select dh.Number,concat(dh.SubType,dh.Type) as newType,dh.DiscountLastMoney,dh.ChangeAmount,s.supplier,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh " +
|
||||||
"inner join jsh_supplier s on s.id=dh.OrganId where s.type='" + supType + "' and dh.SubType!='其它' " +
|
"inner join jsh_supplier s on s.id=dh.OrganId where s.type='" + supType + "' and dh.SubType!='其它' " +
|
||||||
"and dh.OperTime >='"+ beginTime +"' and dh.OperTime<='"+ endTime +"' ");
|
"and dh.OperTime >='" + beginTime + "' and dh.OperTime<='" + endTime + "' ");
|
||||||
if(organId!=null && !organId.equals("")) {
|
if (organId != null && !organId.equals("")) {
|
||||||
queryString.append(" and dh.OrganId='"+ organId +"' ");
|
queryString.append(" and dh.OrganId='" + organId + "' ");
|
||||||
}
|
}
|
||||||
queryString.append("UNION ALL " +
|
queryString.append("UNION ALL " +
|
||||||
"select ah.BillNo,ah.Type as newType,ah.TotalPrice,ah.ChangeAmount,s.supplier,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah " +
|
"select ah.BillNo,ah.Type as newType,ah.TotalPrice,ah.ChangeAmount,s.supplier,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah " +
|
||||||
"inner join jsh_supplier s on s.id=ah.OrganId where s.type='" + supType + "' " +
|
"inner join jsh_supplier s on s.id=ah.OrganId where s.type='" + supType + "' " +
|
||||||
"and ah.BillTime >='"+ beginTime +"' and ah.BillTime<='"+ endTime +"' ");
|
"and ah.BillTime >='" + beginTime + "' and ah.BillTime<='" + endTime + "' ");
|
||||||
if(organId!=null && !organId.equals("")) {
|
if (organId != null && !organId.equals("")) {
|
||||||
queryString.append(" and ah.OrganId='"+ organId +"' ");
|
queryString.append(" and ah.OrganId='" + organId + "' ");
|
||||||
}
|
}
|
||||||
queryString.append(" ORDER BY oTime");
|
queryString.append(" ORDER BY oTime");
|
||||||
Query query;
|
Query query;
|
||||||
@@ -185,12 +181,13 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
|
|||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam,String depotIds) throws JshException {
|
public void getHeaderIdByMaterial(PageUtil pageUtil, String materialParam, String depotIds) throws JshException {
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuffer queryString = new StringBuffer();
|
||||||
queryString.append("select dt.HeaderId from jsh_depotitem dt INNER JOIN jsh_material m on dt.MaterialId = m.Id where ( m.`Name` "+
|
queryString.append("select dt.HeaderId from jsh_depotitem dt INNER JOIN jsh_material m on dt.MaterialId = m.Id where ( m.`Name` " +
|
||||||
" like '%" + materialParam + "%' or m.Model like '%" + materialParam + "%') ");
|
" like '%" + materialParam + "%' or m.Model like '%" + materialParam + "%') ");
|
||||||
if(!depotIds.equals("")){
|
if (!depotIds.equals("")) {
|
||||||
queryString.append(" and dt.DepotId in (" + depotIds + ") ");
|
queryString.append(" and dt.DepotId in (" + depotIds + ") ");
|
||||||
}
|
}
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
|
|||||||
@@ -1,30 +1,28 @@
|
|||||||
package com.jsh.dao.materials;
|
package com.jsh.dao.materials;
|
||||||
|
|
||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.DepotHead;
|
import com.jsh.model.po.DepotHead;
|
||||||
import com.jsh.model.po.UserBusiness;
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
|
|
||||||
public interface DepotHeadIDAO extends BaseIDAO<DepotHead>
|
public interface DepotHeadIDAO extends BaseIDAO<DepotHead> {
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
* 获取MaxId
|
* 获取MaxId
|
||||||
*/
|
*/
|
||||||
void find(PageUtil<DepotHead> pageUtil,String maxid) throws JshException;
|
void find(PageUtil<DepotHead> pageUtil, String maxid) throws JshException;
|
||||||
|
|
||||||
void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException;
|
void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException;
|
||||||
|
|
||||||
public void batchSetStatus(Boolean status,String depotHeadIDs);
|
void batchSetStatus(Boolean status, String depotHeadIDs);
|
||||||
|
|
||||||
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException;
|
void findInDetail(PageUtil pageUtil, String beginTime, String endTime, String type, Long pid, String dids, Long oId) throws JshException;
|
||||||
|
|
||||||
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids, Long oId) throws JshException;
|
void findInOutMaterialCount(PageUtil pageUtil, String beginTime, String endTime, String type, Long pid, String dids, Long oId) throws JshException;
|
||||||
|
|
||||||
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException;
|
void findMaterialsListByHeaderId(PageUtil pageUtil, Long headerId) throws JshException;
|
||||||
|
|
||||||
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime,Long organId, String supType) throws JshException;
|
void findStatementAccount(PageUtil pageUtil, String beginTime, String endTime, Long organId, String supType) throws JshException;
|
||||||
|
|
||||||
public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam,String depotIds) throws JshException;
|
void getHeaderIdByMaterial(PageUtil pageUtil, String materialParam, String depotIds) throws JshException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,59 +1,56 @@
|
|||||||
package com.jsh.dao.materials;
|
package com.jsh.dao.materials;
|
||||||
|
|
||||||
import org.hibernate.Query;
|
|
||||||
|
|
||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.DepotHead;
|
|
||||||
import com.jsh.model.po.DepotItem;
|
import com.jsh.model.po.DepotItem;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
import com.jsh.util.SearchConditionUtil;
|
import com.jsh.util.SearchConditionUtil;
|
||||||
|
import org.hibernate.Query;
|
||||||
|
|
||||||
|
public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO {
|
||||||
|
private final static String TYPE = "入库";
|
||||||
|
private final static String SUM_TYPE = "Number";
|
||||||
|
private final static String IN = "in";
|
||||||
|
private final static String OUT = "out";
|
||||||
|
|
||||||
public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<DepotItem> getEntityClass()
|
public Class<DepotItem> getEntityClass() {
|
||||||
{
|
|
||||||
return DepotItem.class;
|
return DepotItem.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void findByType(PageUtil<DepotItem> pageUtil,String type,Integer dId,Long MId,String MonthTime,Boolean isPrev) throws JshException {
|
public void findByType(PageUtil<DepotItem> pageUtil, String type, Integer dId, Long MId, String MonthTime, Boolean isPrev) throws JshException {
|
||||||
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
||||||
Query query;
|
Query query;
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuilder queryString = new StringBuilder();
|
||||||
if(type.equals("入库")) {
|
if (TYPE.equals(type)) {
|
||||||
if (isPrev) {
|
if (isPrev) {
|
||||||
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh where di.HeaderId = dh.id ");
|
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh where di.HeaderId = dh.id ");
|
||||||
queryString.append(" and ((type='入库' and DepotId='" + dId + "') " +
|
queryString.append(" and ((type='入库' and DepotId='").append(dId).append("') ").append(" or (SubType='调拨' and AnotherDepotId='").append(dId).append("') ").append(" or (SubType='礼品充值' and AnotherDepotId='").append(dId).append("')) ");
|
||||||
" or (SubType='调拨' and AnotherDepotId='" + dId + "') " +
|
queryString.append(" and MaterialId =").append(MId).append(" and dh.OperTime <'").append(MonthTime).append("-01 00:00:00' ");
|
||||||
" or (SubType='礼品充值' and AnotherDepotId='" + dId + "')) ");
|
|
||||||
queryString.append(" and MaterialId =" + MId + " and dh.OperTime <'" + MonthTime + "-01 00:00:00' ");
|
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
} else {
|
} else {
|
||||||
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh where di.HeaderId = dh.id ");
|
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh where di.HeaderId = dh.id ");
|
||||||
queryString.append(" and ((type='入库' and DepotId='" + dId + "') " +
|
queryString.append(" and ((type='入库' and DepotId='").append(dId).append("') ").append(" or (SubType='调拨' and AnotherDepotId='").append(dId).append("') ").append(" or (SubType='礼品充值' and AnotherDepotId='").append(dId).append("')) ");
|
||||||
" or (SubType='调拨' and AnotherDepotId='" + dId + "') " +
|
queryString.append(" and MaterialId =").append(MId).append(" and dh.OperTime >='").append(MonthTime).append("-01 00:00:00' and dh.OperTime <='").append(MonthTime).append("-31 59:59:59' ");
|
||||||
" or (SubType='礼品充值' and AnotherDepotId='" + dId + "')) ");
|
|
||||||
queryString.append(" and MaterialId =" + MId + " and dh.OperTime >='" + MonthTime + "-01 00:00:00' and dh.OperTime <='" + MonthTime + "-31 59:59:59' ");
|
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (isPrev) {
|
if (isPrev) {
|
||||||
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库'");
|
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库'");
|
||||||
queryString.append(" and DepotId='" + dId + "'");
|
queryString.append(" and DepotId='").append(dId).append("'");
|
||||||
queryString.append(" and MaterialId =" + MId + " and jsh_depothead.OperTime <'" + MonthTime + "-01 00:00:00' ");
|
queryString.append(" and MaterialId =").append(MId).append(" and jsh_depothead.OperTime <'").append(MonthTime).append("-01 00:00:00' ");
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
} else {
|
} else {
|
||||||
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库'");
|
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库'");
|
||||||
queryString.append(" and DepotId='" + dId + "'");
|
queryString.append(" and DepotId='").append(dId).append("'");
|
||||||
queryString.append(" and MaterialId =" + MId + " and jsh_depothead.OperTime >='" + MonthTime + "-01 00:00:00' and jsh_depothead.OperTime <='" + MonthTime + "-31 59:59:59' ");
|
queryString.append(" and MaterialId =").append(MId).append(" and jsh_depothead.OperTime >='").append(MonthTime).append("-01 00:00:00' and jsh_depothead.OperTime <='").append(MonthTime).append("-31 59:59:59' ");
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,38 +60,32 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void findPriceByType(PageUtil<DepotItem> pageUtil,String type,Integer dId,Long MId,String MonthTime,Boolean isPrev) throws JshException
|
public void findPriceByType(PageUtil<DepotItem> pageUtil, String type, Integer dId, Long MId, String MonthTime, Boolean isPrev) throws JshException {
|
||||||
{
|
|
||||||
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
||||||
Query query;
|
Query query;
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuilder queryString = new StringBuilder();
|
||||||
if(type.equals("入库")) {
|
if (TYPE.equals(type)) {
|
||||||
if (isPrev) {
|
if (isPrev) {
|
||||||
queryString.append("select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh where di.HeaderId = dh.id ");
|
queryString.append("select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh where di.HeaderId = dh.id ");
|
||||||
queryString.append(" and ((type='入库' and DepotId='" + dId + "') " +
|
queryString.append(" and ((type='入库' and DepotId='").append(dId).append("') ").append(" or (SubType='调拨' and AnotherDepotId='").append(dId).append("') ").append(" or (SubType='礼品充值' and AnotherDepotId='").append(dId).append("')) ");
|
||||||
" or (SubType='调拨' and AnotherDepotId='" + dId + "') " +
|
queryString.append(" and MaterialId =").append(MId).append(" and dh.OperTime <'").append(MonthTime).append("-01 00:00:00' ");
|
||||||
" or (SubType='礼品充值' and AnotherDepotId='" + dId + "')) ");
|
|
||||||
queryString.append(" and MaterialId =" + MId + " and dh.OperTime <'" + MonthTime + "-01 00:00:00' ");
|
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
} else {
|
} else {
|
||||||
queryString.append("select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh where di.HeaderId = dh.id ");
|
queryString.append("select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh where di.HeaderId = dh.id ");
|
||||||
queryString.append(" and ((type='入库' and DepotId='" + dId + "') " +
|
queryString.append(" and ((type='入库' and DepotId='").append(dId).append("') ").append(" or (SubType='调拨' and AnotherDepotId='").append(dId).append("') ").append(" or (SubType='礼品充值' and AnotherDepotId='").append(dId).append("')) ");
|
||||||
" or (SubType='调拨' and AnotherDepotId='" + dId + "') " +
|
queryString.append(" and MaterialId =").append(MId).append(" and dh.OperTime >='").append(MonthTime).append("-01 00:00:00' and dh.OperTime <='").append(MonthTime).append("-31 59:59:59' ");
|
||||||
" or (SubType='礼品充值' and AnotherDepotId='" + dId + "')) ");
|
|
||||||
queryString.append(" and MaterialId =" + MId + " and dh.OperTime >='" + MonthTime + "-01 00:00:00' and dh.OperTime <='" + MonthTime + "-31 59:59:59' ");
|
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (isPrev) {
|
if (isPrev) {
|
||||||
queryString.append("select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库'");
|
queryString.append("select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库'");
|
||||||
queryString.append(" and DepotId='" + dId + "'");
|
queryString.append(" and DepotId='").append(dId).append("'");
|
||||||
queryString.append(" and MaterialId =" + MId + " and jsh_depothead.OperTime <'" + MonthTime + "-01 00:00:00' ");
|
queryString.append(" and MaterialId =").append(MId).append(" and jsh_depothead.OperTime <'").append(MonthTime).append("-01 00:00:00' ");
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
} else {
|
} else {
|
||||||
queryString.append("select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库'");
|
queryString.append("select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='出库'");
|
||||||
queryString.append(" and DepotId='" + dId + "'");
|
queryString.append(" and DepotId='").append(dId).append("'");
|
||||||
queryString.append(" and MaterialId =" + MId + " and jsh_depothead.OperTime >='" + MonthTime + "-01 00:00:00' and jsh_depothead.OperTime <='" + MonthTime + "-31 59:59:59' ");
|
queryString.append(" and MaterialId =").append(MId).append(" and jsh_depothead.OperTime >='").append(MonthTime).append("-01 00:00:00' and jsh_depothead.OperTime <='").append(MonthTime).append("-31 59:59:59' ");
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,18 +95,17 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void findByTypeAndMaterialId(PageUtil<DepotItem> pageUtil,String type,Long MId) throws JshException {
|
public void findByTypeAndMaterialId(PageUtil<DepotItem> pageUtil, String type, Long MId) throws JshException {
|
||||||
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
||||||
Query query;
|
Query query;
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuilder queryString = new StringBuilder();
|
||||||
if(type.equals("入库")) {
|
if (TYPE.equals(type)) {
|
||||||
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type='入库'");
|
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type='入库'");
|
||||||
queryString.append(" and MaterialId ="+ MId);
|
queryString.append(" and MaterialId =").append(MId);
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type='出库'");
|
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type='出库'");
|
||||||
queryString.append(" and SubType!='调拨' and SubType!='礼品充值' and MaterialId ="+ MId);
|
queryString.append(" and SubType!='调拨' and SubType!='礼品充值' and MaterialId =").append(MId);
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
}
|
}
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
@@ -124,16 +114,16 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void findDetailByTypeAndMaterialId(PageUtil<DepotItem> pageUtil,Long MId) throws JshException {
|
public void findDetailByTypeAndMaterialId(PageUtil<DepotItem> pageUtil, Long MId) throws JshException {
|
||||||
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
||||||
Query query;
|
Query query;
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuilder queryString = new StringBuilder();
|
||||||
queryString.append("select dh.Number,concat(dh.SubType,dh.Type) as newType, " +
|
queryString.append("select dh.Number,concat(dh.SubType,dh.Type) as newType, " +
|
||||||
"case when type='入库' then di.BasicNumber when type='出库' then 0-di.BasicNumber else 0 end as b_num, " +
|
"case when type='入库' then di.BasicNumber when type='出库' then 0-di.BasicNumber else 0 end as b_num, " +
|
||||||
"date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime " +
|
"date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime " +
|
||||||
"from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type!='其它' " +
|
"from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type!='其它' " +
|
||||||
"and SubType!='调拨' and SubType!='礼品充值' ");
|
"and SubType!='调拨' and SubType!='礼品充值' ");
|
||||||
queryString.append(" and MaterialId ="+ MId +" ORDER BY oTime desc ");
|
queryString.append(" and MaterialId =").append(MId).append(" ORDER BY oTime desc ");
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
// 分页查询
|
// 分页查询
|
||||||
@@ -148,15 +138,13 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void buyOrSale(PageUtil<DepotItem> pageUtil,String type, String subType,Long MId,String MonthTime, String sumType) throws JshException
|
public void buyOrSale(PageUtil<DepotItem> pageUtil, String type, String subType, Long MId, String MonthTime, String sumType) throws JshException {
|
||||||
{
|
|
||||||
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
||||||
Query query;
|
Query query;
|
||||||
if(sumType.equals("Number")) {
|
if (SUM_TYPE.equals(sumType)) {
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='" + type +"' and subType='" + subType +"' and MaterialId ="+ MId + " and jsh_depothead.OperTime >='"+ MonthTime +"-01 00:00:00' and jsh_depothead.OperTime <='"+ MonthTime +"-31 59:59:59' " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='" + type + "' and subType='" + subType + "' and MaterialId =" + MId + " and jsh_depothead.OperTime >='" + MonthTime + "-01 00:00:00' and jsh_depothead.OperTime <='" + MonthTime + "-31 59:59:59' " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
}
|
} else {
|
||||||
else {
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='" + type + "' and subType='" + subType + "' and MaterialId =" + MId + " and jsh_depothead.OperTime >='" + MonthTime + "-01 00:00:00' and jsh_depothead.OperTime <='" + MonthTime + "-31 59:59:59' " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='" + type +"' and subType='" + subType +"' and MaterialId ="+ MId + " and jsh_depothead.OperTime >='"+ MonthTime +"-01 00:00:00' and jsh_depothead.OperTime <='"+ MonthTime +"-31 59:59:59' " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
|
||||||
}
|
}
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
@@ -164,21 +152,19 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void findGiftByType(PageUtil<DepotItem> pageUtil,String subType,Integer ProjectId,Long MId,String type) throws JshException
|
public void findGiftByType(PageUtil<DepotItem> pageUtil, String subType, Integer ProjectId, Long MId, String type) throws JshException {
|
||||||
{
|
|
||||||
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
|
||||||
Query query;
|
Query query;
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuilder queryString = new StringBuilder();
|
||||||
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and jsh_depothead.SubType='" + subType +"'");
|
queryString.append("select sum(BasicNumber) as BasicNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and jsh_depothead.SubType='").append(subType).append("'");
|
||||||
if(ProjectId!=null) {
|
if (ProjectId != null) {
|
||||||
if(type.equals("in")){
|
if (IN.equals(type)) {
|
||||||
queryString.append(" and jsh_depotitem.AnotherDepotId='" + ProjectId +"'"); //礼品充值时
|
queryString.append(" and jsh_depotitem.AnotherDepotId='").append(ProjectId).append("'"); //礼品充值时
|
||||||
}
|
} else if (OUT.equals(type)) {
|
||||||
else if(type.equals("out")){
|
queryString.append(" and jsh_depotitem.DepotId='").append(ProjectId).append("'");
|
||||||
queryString.append(" and jsh_depotitem.DepotId='" + ProjectId +"'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
queryString.append(" and jsh_depotitem.MaterialId ="+ MId);
|
queryString.append(" and jsh_depotitem.MaterialId =").append(MId);
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
pageUtil.setPageList(query.list());
|
pageUtil.setPageList(query.list());
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
package com.jsh.dao.materials;
|
package com.jsh.dao.materials;
|
||||||
|
|
||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.util.JshException;
|
|
||||||
import com.jsh.model.po.DepotHead;
|
|
||||||
import com.jsh.model.po.DepotItem;
|
import com.jsh.model.po.DepotItem;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
|
|
||||||
public interface DepotItemIDAO extends BaseIDAO<DepotItem>
|
public interface DepotItemIDAO extends BaseIDAO<DepotItem> {
|
||||||
{
|
public void findByType(PageUtil<DepotItem> pageUtil, String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) throws JshException;
|
||||||
public void findByType(PageUtil<DepotItem> pageUtil,String type,Integer ProjectId,Long MId, String MonthTime,Boolean isPrev) throws JshException;
|
|
||||||
|
|
||||||
public void findByTypeAndMaterialId(PageUtil<DepotItem> pageUtil,String type,Long MId) throws JshException;
|
public void findByTypeAndMaterialId(PageUtil<DepotItem> pageUtil, String type, Long MId) throws JshException;
|
||||||
|
|
||||||
public void findDetailByTypeAndMaterialId(PageUtil<DepotItem> pageUtil,Long MId) throws JshException;
|
public void findDetailByTypeAndMaterialId(PageUtil<DepotItem> pageUtil, Long MId) throws JshException;
|
||||||
|
|
||||||
public void findPriceByType(PageUtil<DepotItem> pageUtil,String type,Integer ProjectId,Long MId, String MonthTime,Boolean isPrev) throws JshException;
|
public void findPriceByType(PageUtil<DepotItem> pageUtil, String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) throws JshException;
|
||||||
|
|
||||||
public void buyOrSale(PageUtil<DepotItem> pageUtil,String type, String subType,Long MId, String MonthTime, String sumType) throws JshException;
|
public void buyOrSale(PageUtil<DepotItem> pageUtil, String type, String subType, Long MId, String MonthTime, String sumType) throws JshException;
|
||||||
|
|
||||||
public void findGiftByType(PageUtil<DepotItem> pageUtil,String subType,Integer ProjectId,Long MId, String type) throws JshException;
|
public void findGiftByType(PageUtil<DepotItem> pageUtil, String subType, Integer ProjectId, Long MId, String type) throws JshException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.materials;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.MaterialCategory;
|
import com.jsh.model.po.MaterialCategory;
|
||||||
|
|
||||||
public class MaterialCategoryDAO extends BaseDAO<MaterialCategory> implements MaterialCategoryIDAO
|
public class MaterialCategoryDAO extends BaseDAO<MaterialCategory> implements MaterialCategoryIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<MaterialCategory> getEntityClass()
|
public Class<MaterialCategory> getEntityClass() {
|
||||||
{
|
|
||||||
return MaterialCategory.class;
|
return MaterialCategory.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.materials;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.MaterialCategory;
|
import com.jsh.model.po.MaterialCategory;
|
||||||
|
|
||||||
public interface MaterialCategoryIDAO extends BaseIDAO<MaterialCategory>
|
public interface MaterialCategoryIDAO extends BaseIDAO<MaterialCategory> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,32 +7,31 @@ import com.jsh.util.PageUtil;
|
|||||||
import com.jsh.util.SearchConditionUtil;
|
import com.jsh.util.SearchConditionUtil;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
|
|
||||||
public class MaterialDAO extends BaseDAO<Material> implements MaterialIDAO
|
public class MaterialDAO extends BaseDAO<Material> implements MaterialIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Material> getEntityClass()
|
public Class<Material> getEntityClass() {
|
||||||
{
|
|
||||||
return Material.class;
|
return Material.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void batchSetEnable(Boolean enable,String supplierIDs) {
|
public void batchSetEnable(Boolean enable, String supplierIDs) {
|
||||||
String sql="update jsh_material m set m.enabled=" + enable + " where m.id in (" + supplierIDs + ")";
|
String sql = "update jsh_material m set m.enabled=" + enable + " where m.id in (" + supplierIDs + ")";
|
||||||
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(sql);
|
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(sql);
|
||||||
query.executeUpdate();
|
query.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void findUnitName(PageUtil<Material> pageUtil,Long mId) throws JshException {
|
public void findUnitName(PageUtil<Material> pageUtil, Long mId) throws JshException {
|
||||||
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便,
|
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便,
|
||||||
StringBuffer queryString = new StringBuffer();
|
StringBuffer queryString = new StringBuffer();
|
||||||
queryString.append("select jsh_unit.UName from jsh_unit inner join jsh_material on UnitId=jsh_unit.id where jsh_material.id="+mId);
|
queryString.append("select jsh_unit.UName from jsh_unit inner join jsh_material on UnitId=jsh_unit.id where jsh_material.id=" + mId);
|
||||||
Query query;
|
Query query;
|
||||||
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
|
||||||
pageUtil.setTotalCount(query.list().size());
|
pageUtil.setTotalCount(query.list().size());
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ import com.jsh.model.po.Material;
|
|||||||
import com.jsh.util.JshException;
|
import com.jsh.util.JshException;
|
||||||
import com.jsh.util.PageUtil;
|
import com.jsh.util.PageUtil;
|
||||||
|
|
||||||
public interface MaterialIDAO extends BaseIDAO<Material>
|
public interface MaterialIDAO extends BaseIDAO<Material> {
|
||||||
{
|
public void batchSetEnable(Boolean enable, String supplierIDs);
|
||||||
public void batchSetEnable(Boolean enable,String supplierIDs);
|
|
||||||
|
|
||||||
public void findUnitName(PageUtil<Material> pageUtil,Long mId) throws JshException;
|
public void findUnitName(PageUtil<Material> pageUtil, Long mId) throws JshException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.materials;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.MaterialProperty;
|
import com.jsh.model.po.MaterialProperty;
|
||||||
|
|
||||||
public class MaterialPropertyDAO extends BaseDAO<MaterialProperty> implements MaterialPropertyIDAO
|
public class MaterialPropertyDAO extends BaseDAO<MaterialProperty> implements MaterialPropertyIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<MaterialProperty> getEntityClass()
|
public Class<MaterialProperty> getEntityClass() {
|
||||||
{
|
|
||||||
return MaterialProperty.class;
|
return MaterialProperty.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.materials;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.MaterialProperty;
|
import com.jsh.model.po.MaterialProperty;
|
||||||
|
|
||||||
public interface MaterialPropertyIDAO extends BaseIDAO<MaterialProperty>
|
public interface MaterialPropertyIDAO extends BaseIDAO<MaterialProperty> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ package com.jsh.dao.materials;
|
|||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Person;
|
import com.jsh.model.po.Person;
|
||||||
|
|
||||||
public class PersonDAO extends BaseDAO<Person> implements PersonIDAO
|
public class PersonDAO extends BaseDAO<Person> implements PersonIDAO {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 设置dao映射基类
|
* 设置dao映射基类
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Class<Person> getEntityClass()
|
public Class<Person> getEntityClass() {
|
||||||
{
|
|
||||||
return Person.class;
|
return Person.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.jsh.dao.materials;
|
|||||||
import com.jsh.base.BaseIDAO;
|
import com.jsh.base.BaseIDAO;
|
||||||
import com.jsh.model.po.Person;
|
import com.jsh.model.po.Person;
|
||||||
|
|
||||||
public interface PersonIDAO extends BaseIDAO<Person>
|
public interface PersonIDAO extends BaseIDAO<Person> {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Account implements java.io.Serializable
|
public class Account implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private String Name;
|
private String Name;
|
||||||
private String SerialNo;
|
private String SerialNo;
|
||||||
@@ -11,13 +10,11 @@ public class Account implements java.io.Serializable
|
|||||||
private Boolean IsDefault;
|
private Boolean IsDefault;
|
||||||
private String Remark;
|
private String Remark;
|
||||||
|
|
||||||
public Account()
|
public Account() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Account(Long Id)
|
public Account(Long Id) {
|
||||||
{
|
|
||||||
this.Id = Id;
|
this.Id = Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,56 +27,46 @@ public class Account implements java.io.Serializable
|
|||||||
Remark = remark;
|
Remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public Long getId() {
|
||||||
{
|
|
||||||
Id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return Id;
|
return Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name)
|
public void setId(Long id) {
|
||||||
{
|
Id = id;
|
||||||
Name = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName() {
|
||||||
{
|
|
||||||
return Name;
|
return Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSerialNo(String serialNo)
|
public void setName(String name) {
|
||||||
{
|
Name = name;
|
||||||
SerialNo = serialNo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSerialNo()
|
public String getSerialNo() {
|
||||||
{
|
|
||||||
return SerialNo;
|
return SerialNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInitialAmount(Double initialAmount)
|
public void setSerialNo(String serialNo) {
|
||||||
{
|
SerialNo = serialNo;
|
||||||
InitialAmount = initialAmount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getInitialAmount()
|
public Double getInitialAmount() {
|
||||||
{
|
|
||||||
return InitialAmount;
|
return InitialAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCurrentAmount(Double currentAmount)
|
public void setInitialAmount(Double initialAmount) {
|
||||||
{
|
InitialAmount = initialAmount;
|
||||||
CurrentAmount = currentAmount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getCurrentAmount()
|
public Double getCurrentAmount() {
|
||||||
{
|
|
||||||
return CurrentAmount;
|
return CurrentAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCurrentAmount(Double currentAmount) {
|
||||||
|
CurrentAmount = currentAmount;
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean getIsDefault() {
|
public Boolean getIsDefault() {
|
||||||
return IsDefault;
|
return IsDefault;
|
||||||
}
|
}
|
||||||
@@ -88,13 +75,11 @@ public class Account implements java.io.Serializable
|
|||||||
IsDefault = isDefault;
|
IsDefault = isDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
public String getRemark() {
|
||||||
{
|
|
||||||
Remark = remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemark()
|
|
||||||
{
|
|
||||||
return Remark;
|
return Remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
Remark = remark;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ package com.jsh.model.po;
|
|||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class AccountHead implements java.io.Serializable
|
public class AccountHead implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private String Type;
|
private String Type;
|
||||||
private Supplier OrganId;
|
private Supplier OrganId;
|
||||||
@@ -16,20 +15,17 @@ public class AccountHead implements java.io.Serializable
|
|||||||
private Timestamp BillTime;
|
private Timestamp BillTime;
|
||||||
private String Remark;
|
private String Remark;
|
||||||
|
|
||||||
public AccountHead()
|
public AccountHead() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccountHead(Long Id)
|
public AccountHead(Long Id) {
|
||||||
{
|
this.Id = Id;
|
||||||
this.Id = Id ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccountHead(String type, Supplier organId,
|
public AccountHead(String type, Supplier organId,
|
||||||
Person handsPersonId, Double changeAmount, Double totalPrice,
|
Person handsPersonId, Double changeAmount, Double totalPrice,
|
||||||
Account accountId, String billNo, Timestamp billTime, String remark)
|
Account accountId, String billNo, Timestamp billTime, String remark) {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
Type = type;
|
Type = type;
|
||||||
OrganId = organId;
|
OrganId = organId;
|
||||||
@@ -42,102 +38,84 @@ public class AccountHead implements java.io.Serializable
|
|||||||
Remark = remark;
|
Remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public Long getId() {
|
||||||
{
|
|
||||||
Id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return Id;
|
return Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setType(String type)
|
public void setId(Long id) {
|
||||||
{
|
Id = id;
|
||||||
Type = type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getType()
|
public String getType() {
|
||||||
{
|
|
||||||
return Type;
|
return Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrganId(Supplier organId)
|
public void setType(String type) {
|
||||||
{
|
Type = type;
|
||||||
OrganId = organId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Supplier getOrganId()
|
public Supplier getOrganId() {
|
||||||
{
|
|
||||||
return OrganId;
|
return OrganId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHandsPersonId(Person handsPersonId)
|
public void setOrganId(Supplier organId) {
|
||||||
{
|
OrganId = organId;
|
||||||
HandsPersonId = handsPersonId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person getHandsPersonId()
|
public Person getHandsPersonId() {
|
||||||
{
|
|
||||||
return HandsPersonId;
|
return HandsPersonId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChangeAmount(Double changeAmount)
|
public void setHandsPersonId(Person handsPersonId) {
|
||||||
{
|
HandsPersonId = handsPersonId;
|
||||||
ChangeAmount = changeAmount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getChangeAmount()
|
public Double getChangeAmount() {
|
||||||
{
|
|
||||||
return ChangeAmount;
|
return ChangeAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotalPrice(Double totalPrice) {
|
public void setChangeAmount(Double changeAmount) {
|
||||||
TotalPrice = totalPrice;
|
ChangeAmount = changeAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getTotalPrice() {
|
public Double getTotalPrice() {
|
||||||
return TotalPrice;
|
return TotalPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAccountId(Account accountId)
|
public void setTotalPrice(Double totalPrice) {
|
||||||
{
|
TotalPrice = totalPrice;
|
||||||
AccountId = accountId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Account getAccountId()
|
public Account getAccountId() {
|
||||||
{
|
|
||||||
return AccountId;
|
return AccountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBillNo(String billNo)
|
public void setAccountId(Account accountId) {
|
||||||
{
|
AccountId = accountId;
|
||||||
BillNo = billNo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBillNo()
|
public String getBillNo() {
|
||||||
{
|
|
||||||
return BillNo;
|
return BillNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBillTime(Timestamp billTime)
|
public void setBillNo(String billNo) {
|
||||||
{
|
BillNo = billNo;
|
||||||
BillTime = billTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Timestamp getBillTime()
|
public Timestamp getBillTime() {
|
||||||
{
|
|
||||||
return BillTime;
|
return BillTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
public void setBillTime(Timestamp billTime) {
|
||||||
{
|
BillTime = billTime;
|
||||||
Remark = remark;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemark()
|
public String getRemark() {
|
||||||
{
|
|
||||||
return Remark;
|
return Remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
Remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class AccountItem implements java.io.Serializable
|
public class AccountItem implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private AccountHead HeaderId;
|
private AccountHead HeaderId;
|
||||||
private Account AccountId;
|
private Account AccountId;
|
||||||
@@ -10,19 +9,16 @@ public class AccountItem implements java.io.Serializable
|
|||||||
private Double EachAmount;
|
private Double EachAmount;
|
||||||
private String Remark;
|
private String Remark;
|
||||||
|
|
||||||
public AccountItem()
|
public AccountItem() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccountItem(Long Id)
|
public AccountItem(Long Id) {
|
||||||
{
|
this.Id = Id;
|
||||||
this.Id = Id ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccountItem(AccountHead headerId, Account accountId,
|
public AccountItem(AccountHead headerId, Account accountId,
|
||||||
InOutItem inOutItemId, Double eachAmount, String remark)
|
InOutItem inOutItemId, Double eachAmount, String remark) {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
HeaderId = headerId;
|
HeaderId = headerId;
|
||||||
AccountId = accountId;
|
AccountId = accountId;
|
||||||
@@ -31,64 +27,52 @@ public class AccountItem implements java.io.Serializable
|
|||||||
Remark = remark;
|
Remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public Long getId() {
|
||||||
{
|
|
||||||
Id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return Id;
|
return Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHeaderId(AccountHead headerId)
|
public void setId(Long id) {
|
||||||
{
|
Id = id;
|
||||||
HeaderId = headerId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccountHead getHeaderId()
|
public AccountHead getHeaderId() {
|
||||||
{
|
|
||||||
return HeaderId;
|
return HeaderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAccountId(Account accountId)
|
public void setHeaderId(AccountHead headerId) {
|
||||||
{
|
HeaderId = headerId;
|
||||||
AccountId = accountId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Account getAccountId()
|
public Account getAccountId() {
|
||||||
{
|
|
||||||
return AccountId;
|
return AccountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInOutItemId(InOutItem inOutItemId)
|
public void setAccountId(Account accountId) {
|
||||||
{
|
AccountId = accountId;
|
||||||
InOutItemId = inOutItemId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public InOutItem getInOutItemId()
|
public InOutItem getInOutItemId() {
|
||||||
{
|
|
||||||
return InOutItemId;
|
return InOutItemId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEachAmount(Double eachAmount)
|
public void setInOutItemId(InOutItem inOutItemId) {
|
||||||
{
|
InOutItemId = inOutItemId;
|
||||||
EachAmount = eachAmount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getEachAmount()
|
public Double getEachAmount() {
|
||||||
{
|
|
||||||
return EachAmount;
|
return EachAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
public void setEachAmount(Double eachAmount) {
|
||||||
{
|
EachAmount = eachAmount;
|
||||||
Remark = remark;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemark()
|
public String getRemark() {
|
||||||
{
|
|
||||||
return Remark;
|
return Remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
Remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class App implements java.io.Serializable
|
public class App implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private String Number;
|
private String Number;
|
||||||
private String Name;
|
private String Name;
|
||||||
@@ -20,20 +19,17 @@ public class App implements java.io.Serializable
|
|||||||
private Boolean Enabled;
|
private Boolean Enabled;
|
||||||
|
|
||||||
|
|
||||||
public App()
|
public App() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public App(Long Id)
|
public App(Long Id) {
|
||||||
{
|
this.Id = Id;
|
||||||
this.Id = Id ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public App(String Number, String Name, String Type, String Icon, String URL, String Width,
|
public App(String Number, String Name, String Type, String Icon, String URL, String Width,
|
||||||
String Height, Boolean ReSize, Boolean OpenMax, Boolean Flash, String ZL, String Sort,
|
String Height, Boolean ReSize, Boolean OpenMax, Boolean Flash, String ZL, String Sort,
|
||||||
String Remark, Boolean Enabled)
|
String Remark, Boolean Enabled) {
|
||||||
{
|
|
||||||
this.Number = Number;
|
this.Number = Number;
|
||||||
this.Name = Name;
|
this.Name = Name;
|
||||||
this.Type = Type;
|
this.Type = Type;
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import java.sql.Timestamp;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Asset implements java.io.Serializable
|
public class Asset implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private Assetname assetname;
|
private Assetname assetname;
|
||||||
private String location;
|
private String location;
|
||||||
@@ -30,7 +29,7 @@ public class Asset implements java.io.Serializable
|
|||||||
/**
|
/**
|
||||||
* 类型 right--正确 warn--警告 wrong--错误
|
* 类型 right--正确 warn--警告 wrong--错误
|
||||||
*/
|
*/
|
||||||
private Map<Integer,String> cellInfo;
|
private Map<Integer, String> cellInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行号
|
* 行号
|
||||||
@@ -67,13 +66,11 @@ public class Asset implements java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
private String warrantydateStr;
|
private String warrantydateStr;
|
||||||
|
|
||||||
public Asset()
|
public Asset() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Asset(Long id)
|
public Asset(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,8 +79,7 @@ public class Asset implements java.io.Serializable
|
|||||||
Timestamp periodofvalidity, Timestamp warrantydate,
|
Timestamp periodofvalidity, Timestamp warrantydate,
|
||||||
String assetnum, String serialnum, Supplier supplier,
|
String assetnum, String serialnum, Supplier supplier,
|
||||||
String description, Timestamp createtime, Basicuser creator,
|
String description, Timestamp createtime, Basicuser creator,
|
||||||
Timestamp updatetime,String labels, Basicuser updator,String addMonth)
|
Timestamp updatetime, String labels, Basicuser updator, String addMonth) {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
this.assetname = assetname;
|
this.assetname = assetname;
|
||||||
this.location = location;
|
this.location = location;
|
||||||
@@ -106,274 +102,219 @@ public class Asset implements java.io.Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Assetname getAssetname()
|
public Assetname getAssetname() {
|
||||||
{
|
|
||||||
return assetname;
|
return assetname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAssetname(Assetname assetname)
|
public void setAssetname(Assetname assetname) {
|
||||||
{
|
|
||||||
this.assetname = assetname;
|
this.assetname = assetname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLocation()
|
public String getLocation() {
|
||||||
{
|
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLocation(String location)
|
public void setLocation(String location) {
|
||||||
{
|
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getStatus()
|
public Short getStatus() {
|
||||||
{
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(Short status)
|
public void setStatus(Short status) {
|
||||||
{
|
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Basicuser getUser()
|
public Basicuser getUser() {
|
||||||
{
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUser(Basicuser user)
|
public void setUser(Basicuser user) {
|
||||||
{
|
|
||||||
this.user = user;
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getPrice()
|
public Double getPrice() {
|
||||||
{
|
|
||||||
return price;
|
return price;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPrice(Double price)
|
public void setPrice(Double price) {
|
||||||
{
|
|
||||||
this.price = price;
|
this.price = price;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Timestamp getPurchasedate()
|
public Timestamp getPurchasedate() {
|
||||||
{
|
|
||||||
return purchasedate;
|
return purchasedate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPurchasedate(Timestamp purchasedate)
|
public void setPurchasedate(Timestamp purchasedate) {
|
||||||
{
|
|
||||||
this.purchasedate = purchasedate;
|
this.purchasedate = purchasedate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Timestamp getPeriodofvalidity()
|
public Timestamp getPeriodofvalidity() {
|
||||||
{
|
|
||||||
return periodofvalidity;
|
return periodofvalidity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPeriodofvalidity(Timestamp periodofvalidity)
|
public void setPeriodofvalidity(Timestamp periodofvalidity) {
|
||||||
{
|
|
||||||
this.periodofvalidity = periodofvalidity;
|
this.periodofvalidity = periodofvalidity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Timestamp getWarrantydate()
|
public Timestamp getWarrantydate() {
|
||||||
{
|
|
||||||
return warrantydate;
|
return warrantydate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWarrantydate(Timestamp warrantydate)
|
public void setWarrantydate(Timestamp warrantydate) {
|
||||||
{
|
|
||||||
this.warrantydate = warrantydate;
|
this.warrantydate = warrantydate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAssetnum()
|
public String getAssetnum() {
|
||||||
{
|
|
||||||
return assetnum;
|
return assetnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAssetnum(String assetnum)
|
public void setAssetnum(String assetnum) {
|
||||||
{
|
|
||||||
this.assetnum = assetnum;
|
this.assetnum = assetnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSerialnum()
|
public String getSerialnum() {
|
||||||
{
|
|
||||||
return serialnum;
|
return serialnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSerialnum(String serialnum)
|
public void setSerialnum(String serialnum) {
|
||||||
{
|
|
||||||
this.serialnum = serialnum;
|
this.serialnum = serialnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Supplier getSupplier()
|
public Supplier getSupplier() {
|
||||||
{
|
|
||||||
return supplier;
|
return supplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSupplier(Supplier supplier)
|
public void setSupplier(Supplier supplier) {
|
||||||
{
|
|
||||||
this.supplier = supplier;
|
this.supplier = supplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription()
|
public String getDescription() {
|
||||||
{
|
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description)
|
public void setDescription(String description) {
|
||||||
{
|
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Timestamp getCreatetime()
|
public Timestamp getCreatetime() {
|
||||||
{
|
|
||||||
return createtime;
|
return createtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreatetime(Timestamp createtime)
|
public void setCreatetime(Timestamp createtime) {
|
||||||
{
|
|
||||||
this.createtime = createtime;
|
this.createtime = createtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Basicuser getCreator()
|
public Basicuser getCreator() {
|
||||||
{
|
|
||||||
return creator;
|
return creator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreator(Basicuser creator)
|
public void setCreator(Basicuser creator) {
|
||||||
{
|
|
||||||
this.creator = creator;
|
this.creator = creator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Timestamp getUpdatetime()
|
public Timestamp getUpdatetime() {
|
||||||
{
|
|
||||||
return updatetime;
|
return updatetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpdatetime(Timestamp updatetime)
|
public void setUpdatetime(Timestamp updatetime) {
|
||||||
{
|
|
||||||
this.updatetime = updatetime;
|
this.updatetime = updatetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Basicuser getUpdator()
|
public Basicuser getUpdator() {
|
||||||
{
|
|
||||||
return updator;
|
return updator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpdator(Basicuser updator)
|
public void setUpdator(Basicuser updator) {
|
||||||
{
|
|
||||||
this.updator = updator;
|
this.updator = updator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLabels()
|
public String getLabels() {
|
||||||
{
|
|
||||||
return labels;
|
return labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLabels(String labels)
|
public void setLabels(String labels) {
|
||||||
{
|
|
||||||
this.labels = labels;
|
this.labels = labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddMonth()
|
public String getAddMonth() {
|
||||||
{
|
|
||||||
return addMonth;
|
return addMonth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAddMonth(String addMonth)
|
public void setAddMonth(String addMonth) {
|
||||||
{
|
|
||||||
this.addMonth = addMonth;
|
this.addMonth = addMonth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getRowLineNum()
|
public Integer getRowLineNum() {
|
||||||
{
|
|
||||||
return rowLineNum;
|
return rowLineNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRowLineNum(Integer rowLineNum)
|
public void setRowLineNum(Integer rowLineNum) {
|
||||||
{
|
|
||||||
this.rowLineNum = rowLineNum;
|
this.rowLineNum = rowLineNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Integer, String> getCellInfo()
|
public Map<Integer, String> getCellInfo() {
|
||||||
{
|
|
||||||
return cellInfo;
|
return cellInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCellInfo(Map<Integer, String> cellInfo)
|
public void setCellInfo(Map<Integer, String> cellInfo) {
|
||||||
{
|
|
||||||
this.cellInfo = cellInfo;
|
this.cellInfo = cellInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPriceStr()
|
public String getPriceStr() {
|
||||||
{
|
|
||||||
return priceStr;
|
return priceStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPriceStr(String priceStr)
|
public void setPriceStr(String priceStr) {
|
||||||
{
|
|
||||||
this.priceStr = priceStr;
|
this.priceStr = priceStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAssetnameStr()
|
public String getAssetnameStr() {
|
||||||
{
|
|
||||||
return assetnameStr;
|
return assetnameStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAssetnameStr(String assetnameStr)
|
public void setAssetnameStr(String assetnameStr) {
|
||||||
{
|
|
||||||
this.assetnameStr = assetnameStr;
|
this.assetnameStr = assetnameStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCategory()
|
public String getCategory() {
|
||||||
{
|
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCategory(String category)
|
public void setCategory(String category) {
|
||||||
{
|
|
||||||
this.category = category;
|
this.category = category;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPurchasedateStr()
|
public String getPurchasedateStr() {
|
||||||
{
|
|
||||||
return purchasedateStr;
|
return purchasedateStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPurchasedateStr(String purchasedateStr)
|
public void setPurchasedateStr(String purchasedateStr) {
|
||||||
{
|
|
||||||
this.purchasedateStr = purchasedateStr;
|
this.purchasedateStr = purchasedateStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPeriodofvalidityStr()
|
public String getPeriodofvalidityStr() {
|
||||||
{
|
|
||||||
return periodofvalidityStr;
|
return periodofvalidityStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPeriodofvalidityStr(String periodofvalidityStr)
|
public void setPeriodofvalidityStr(String periodofvalidityStr) {
|
||||||
{
|
|
||||||
this.periodofvalidityStr = periodofvalidityStr;
|
this.periodofvalidityStr = periodofvalidityStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getWarrantydateStr()
|
public String getWarrantydateStr() {
|
||||||
{
|
|
||||||
return warrantydateStr;
|
return warrantydateStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWarrantydateStr(String warrantydateStr)
|
public void setWarrantydateStr(String warrantydateStr) {
|
||||||
{
|
|
||||||
this.warrantydateStr = warrantydateStr;
|
this.warrantydateStr = warrantydateStr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Assetname implements java.io.Serializable
|
public class Assetname implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String assetname;
|
private String assetname;
|
||||||
private Short isystem;
|
private Short isystem;
|
||||||
@@ -10,19 +9,16 @@ public class Assetname implements java.io.Serializable
|
|||||||
private String description;
|
private String description;
|
||||||
private Short isconsumables;
|
private Short isconsumables;
|
||||||
|
|
||||||
public Assetname()
|
public Assetname() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Assetname(Long id)
|
public Assetname(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Assetname(String assetname, Short isystem, String description,
|
public Assetname(String assetname, Short isystem, String description,
|
||||||
Short isconsumables,Category category)
|
Short isconsumables, Category category) {
|
||||||
{
|
|
||||||
this.assetname = assetname;
|
this.assetname = assetname;
|
||||||
this.isystem = isystem;
|
this.isystem = isystem;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
@@ -30,63 +26,51 @@ public class Assetname implements java.io.Serializable
|
|||||||
this.category = category;
|
this.category = category;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId()
|
public Long getId() {
|
||||||
{
|
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAssetname()
|
public String getAssetname() {
|
||||||
{
|
|
||||||
return this.assetname;
|
return this.assetname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAssetname(String assetname)
|
public void setAssetname(String assetname) {
|
||||||
{
|
|
||||||
this.assetname = assetname;
|
this.assetname = assetname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getIsystem()
|
public Short getIsystem() {
|
||||||
{
|
|
||||||
return this.isystem;
|
return this.isystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsystem(Short isystem)
|
public void setIsystem(Short isystem) {
|
||||||
{
|
|
||||||
this.isystem = isystem;
|
this.isystem = isystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription()
|
public String getDescription() {
|
||||||
{
|
|
||||||
return this.description;
|
return this.description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description)
|
public void setDescription(String description) {
|
||||||
{
|
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getIsconsumables()
|
public Short getIsconsumables() {
|
||||||
{
|
|
||||||
return this.isconsumables;
|
return this.isconsumables;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsconsumables(Short isconsumables)
|
public void setIsconsumables(Short isconsumables) {
|
||||||
{
|
|
||||||
this.isconsumables = isconsumables;
|
this.isconsumables = isconsumables;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Category getCategory()
|
public Category getCategory() {
|
||||||
{
|
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCategory(Category category)
|
public void setCategory(Category category) {
|
||||||
{
|
|
||||||
this.category = category;
|
this.category = category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Basicuser implements java.io.Serializable
|
public class Basicuser implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String username;
|
private String username;
|
||||||
private String loginame;
|
private String loginame;
|
||||||
@@ -17,20 +16,17 @@ public class Basicuser implements java.io.Serializable
|
|||||||
private String description;
|
private String description;
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
public Basicuser()
|
public Basicuser() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Basicuser(Long id)
|
public Basicuser(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Basicuser(String username, String loginame, String password,
|
public Basicuser(String username, String loginame, String password,
|
||||||
String position, String department, String email, String phonenum,
|
String position, String department, String email, String phonenum,
|
||||||
Short ismanager, Short isystem, Short status, String description,
|
Short ismanager, Short isystem, Short status, String description,
|
||||||
String remark)
|
String remark) {
|
||||||
{
|
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.loginame = loginame;
|
this.loginame = loginame;
|
||||||
this.password = password;
|
this.password = password;
|
||||||
@@ -45,133 +41,107 @@ public class Basicuser implements java.io.Serializable
|
|||||||
this.remark = remark;
|
this.remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId()
|
public Long getId() {
|
||||||
{
|
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUsername()
|
public String getUsername() {
|
||||||
{
|
|
||||||
return this.username;
|
return this.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsername(String username)
|
public void setUsername(String username) {
|
||||||
{
|
|
||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLoginame()
|
public String getLoginame() {
|
||||||
{
|
|
||||||
return this.loginame;
|
return this.loginame;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLoginame(String loginame)
|
public void setLoginame(String loginame) {
|
||||||
{
|
|
||||||
this.loginame = loginame;
|
this.loginame = loginame;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPassword()
|
public String getPassword() {
|
||||||
{
|
|
||||||
return this.password;
|
return this.password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPassword(String password)
|
public void setPassword(String password) {
|
||||||
{
|
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPosition()
|
public String getPosition() {
|
||||||
{
|
|
||||||
return this.position;
|
return this.position;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPosition(String position)
|
public void setPosition(String position) {
|
||||||
{
|
|
||||||
this.position = position;
|
this.position = position;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDepartment()
|
public String getDepartment() {
|
||||||
{
|
|
||||||
return this.department;
|
return this.department;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDepartment(String department)
|
public void setDepartment(String department) {
|
||||||
{
|
|
||||||
this.department = department;
|
this.department = department;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getEmail()
|
public String getEmail() {
|
||||||
{
|
|
||||||
return this.email;
|
return this.email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmail(String email)
|
public void setEmail(String email) {
|
||||||
{
|
|
||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPhonenum()
|
public String getPhonenum() {
|
||||||
{
|
|
||||||
return this.phonenum;
|
return this.phonenum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPhonenum(String phonenum)
|
public void setPhonenum(String phonenum) {
|
||||||
{
|
|
||||||
this.phonenum = phonenum;
|
this.phonenum = phonenum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getIsmanager()
|
public Short getIsmanager() {
|
||||||
{
|
|
||||||
return this.ismanager;
|
return this.ismanager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsmanager(Short ismanager)
|
public void setIsmanager(Short ismanager) {
|
||||||
{
|
|
||||||
this.ismanager = ismanager;
|
this.ismanager = ismanager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getIsystem()
|
public Short getIsystem() {
|
||||||
{
|
|
||||||
return this.isystem;
|
return this.isystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsystem(Short isystem)
|
public void setIsystem(Short isystem) {
|
||||||
{
|
|
||||||
this.isystem = isystem;
|
this.isystem = isystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getStatus()
|
public Short getStatus() {
|
||||||
{
|
|
||||||
return this.status;
|
return this.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(Short status)
|
public void setStatus(Short status) {
|
||||||
{
|
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription()
|
public String getDescription() {
|
||||||
{
|
|
||||||
return this.description;
|
return this.description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description)
|
public void setDescription(String description) {
|
||||||
{
|
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemark()
|
public String getRemark() {
|
||||||
{
|
|
||||||
return this.remark;
|
return this.remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
public void setRemark(String remark) {
|
||||||
{
|
|
||||||
this.remark = remark;
|
this.remark = remark;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,67 +1,55 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Category implements java.io.Serializable
|
public class Category implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String assetname;
|
private String assetname;
|
||||||
private Short isystem;
|
private Short isystem;
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
public Category()
|
public Category() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Category(Long id)
|
public Category(Long id) {
|
||||||
{
|
|
||||||
this.id = id ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Category(String assetname, Short isystem, String description)
|
|
||||||
{
|
|
||||||
this.assetname = assetname;
|
|
||||||
this.isystem = isystem;
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAssetname()
|
public Category(String assetname, Short isystem, String description) {
|
||||||
{
|
this.assetname = assetname;
|
||||||
|
this.isystem = isystem;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAssetname() {
|
||||||
return this.assetname;
|
return this.assetname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAssetname(String assetname)
|
public void setAssetname(String assetname) {
|
||||||
{
|
|
||||||
this.assetname = assetname;
|
this.assetname = assetname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getIsystem()
|
public Short getIsystem() {
|
||||||
{
|
|
||||||
return this.isystem;
|
return this.isystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsystem(Short isystem)
|
public void setIsystem(Short isystem) {
|
||||||
{
|
|
||||||
this.isystem = isystem;
|
this.isystem = isystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription()
|
public String getDescription() {
|
||||||
{
|
|
||||||
return this.description;
|
return this.description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description)
|
public void setDescription(String description) {
|
||||||
{
|
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Depot implements java.io.Serializable
|
public class Depot implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String name;
|
private String name;
|
||||||
private String address;
|
private String address;
|
||||||
@@ -12,18 +11,15 @@ public class Depot implements java.io.Serializable
|
|||||||
private String sort;
|
private String sort;
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
public Depot()
|
public Depot() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Depot(Long id)
|
public Depot(Long id) {
|
||||||
{
|
this.id = id;
|
||||||
this.id = id ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Depot(String name, String address, Double warehousing, Double truckage, Integer type, String sort, String remark)
|
public Depot(String name, String address, Double warehousing, Double truckage, Integer type, String sort, String remark) {
|
||||||
{
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.address = address;
|
this.address = address;
|
||||||
this.warehousing = warehousing;
|
this.warehousing = warehousing;
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ package com.jsh.model.po;
|
|||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class DepotHead implements java.io.Serializable
|
public class DepotHead implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private String Type;
|
private String Type;
|
||||||
private String SubType;
|
private String SubType;
|
||||||
@@ -34,20 +33,18 @@ public class DepotHead implements java.io.Serializable
|
|||||||
private Boolean Status = false; //单据状态
|
private Boolean Status = false; //单据状态
|
||||||
private String Remark;
|
private String Remark;
|
||||||
|
|
||||||
public DepotHead()
|
public DepotHead() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DepotHead(Long Id)
|
public DepotHead(Long Id) {
|
||||||
{
|
this.Id = Id;
|
||||||
this.Id = Id ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DepotHead(String type, String subType, Depot projectId, String defaultNumber, String number, String operPersonName, Timestamp createTime,
|
public DepotHead(String type, String subType, Depot projectId, String defaultNumber, String number, String operPersonName, Timestamp createTime,
|
||||||
Timestamp operTime, Supplier organId, Person handsPersonId, String salesman, String accountIdList,String accountMoneyList,
|
Timestamp operTime, Supplier organId, Person handsPersonId, String salesman, String accountIdList, String accountMoneyList,
|
||||||
Double discount, Double discountMoney,Double discountLastMoney, Double otherMoney, String otherMoneyItem,Integer accountDay,
|
Double discount, Double discountMoney, Double discountLastMoney, Double otherMoney, String otherMoneyItem, Integer accountDay,
|
||||||
Account accountId, Double changeAmount, Depot allocationProjectId, Double totalPrice,String payType, Boolean status, String remark) {
|
Account accountId, Double changeAmount, Depot allocationProjectId, Double totalPrice, String payType, Boolean status, String remark) {
|
||||||
super();
|
super();
|
||||||
Type = type;
|
Type = type;
|
||||||
SubType = subType;
|
SubType = subType;
|
||||||
@@ -59,10 +56,10 @@ public class DepotHead implements java.io.Serializable
|
|||||||
OperTime = operTime;
|
OperTime = operTime;
|
||||||
OrganId = organId;
|
OrganId = organId;
|
||||||
HandsPersonId = handsPersonId;
|
HandsPersonId = handsPersonId;
|
||||||
Salesman= salesman;
|
Salesman = salesman;
|
||||||
AccountIdList= accountIdList;
|
AccountIdList = accountIdList;
|
||||||
AccountMoneyList= accountMoneyList;
|
AccountMoneyList = accountMoneyList;
|
||||||
Discount= discount;
|
Discount = discount;
|
||||||
DiscountMoney = discountMoney;
|
DiscountMoney = discountMoney;
|
||||||
DiscountLastMoney = discountLastMoney;
|
DiscountLastMoney = discountLastMoney;
|
||||||
OtherMoney = otherMoney;
|
OtherMoney = otherMoney;
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class DepotItem implements java.io.Serializable
|
public class DepotItem implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private DepotHead HeaderId;
|
private DepotHead HeaderId;
|
||||||
private Material MaterialId;
|
private Material MaterialId;
|
||||||
@@ -27,14 +26,12 @@ public class DepotItem implements java.io.Serializable
|
|||||||
private String MType; //商品类型
|
private String MType; //商品类型
|
||||||
|
|
||||||
|
|
||||||
public DepotItem()
|
public DepotItem() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DepotItem(Long Id)
|
public DepotItem(Long Id) {
|
||||||
{
|
this.Id = Id;
|
||||||
this.Id = Id ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DepotItem(DepotHead headerId, Material materialId, String mUnit,
|
public DepotItem(DepotHead headerId, Material materialId, String mUnit,
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Functions implements java.io.Serializable
|
public class Functions implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private String Number;
|
private String Number;
|
||||||
private String Name;
|
private String Name;
|
||||||
@@ -14,8 +13,7 @@ public class Functions implements java.io.Serializable
|
|||||||
private String Type;
|
private String Type;
|
||||||
private String PushBtn;
|
private String PushBtn;
|
||||||
|
|
||||||
public Functions()
|
public Functions() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class InOutItem implements java.io.Serializable
|
public class InOutItem implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private String Name;
|
private String Name;
|
||||||
private String Type;
|
private String Type;
|
||||||
private String Remark;
|
private String Remark;
|
||||||
|
|
||||||
public InOutItem()
|
public InOutItem() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public InOutItem(Long Id)
|
public InOutItem(Long Id) {
|
||||||
{
|
|
||||||
this.Id = Id;
|
this.Id = Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,43 +21,35 @@ public class InOutItem implements java.io.Serializable
|
|||||||
Remark = remark;
|
Remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public Long getId() {
|
||||||
{
|
|
||||||
Id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return Id;
|
return Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name)
|
public void setId(Long id) {
|
||||||
{
|
Id = id;
|
||||||
Name = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName() {
|
||||||
{
|
|
||||||
return Name;
|
return Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setType(String type)
|
public void setName(String name) {
|
||||||
{
|
Name = name;
|
||||||
Type = type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getType()
|
public String getType() {
|
||||||
{
|
|
||||||
return Type;
|
return Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
public void setType(String type) {
|
||||||
{
|
Type = type;
|
||||||
Remark = remark;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemark()
|
public String getRemark() {
|
||||||
{
|
|
||||||
return Remark;
|
return Remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
Remark = remark;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ package com.jsh.model.po;
|
|||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Logdetails implements java.io.Serializable
|
public class Logdetails implements java.io.Serializable {
|
||||||
{
|
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private Basicuser user;
|
private Basicuser user;
|
||||||
@@ -15,20 +14,17 @@ public class Logdetails implements java.io.Serializable
|
|||||||
private String contentdetails;
|
private String contentdetails;
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
public Logdetails()
|
public Logdetails() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Logdetails(Long id)
|
public Logdetails(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Logdetails(Basicuser user, String operation, String clientIp,
|
public Logdetails(Basicuser user, String operation, String clientIp,
|
||||||
Timestamp createtime, Short status, String contentdetails,
|
Timestamp createtime, Short status, String contentdetails,
|
||||||
String remark)
|
String remark) {
|
||||||
{
|
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.operation = operation;
|
this.operation = operation;
|
||||||
this.clientIp = clientIp;
|
this.clientIp = clientIp;
|
||||||
@@ -38,13 +34,11 @@ public class Logdetails implements java.io.Serializable
|
|||||||
this.remark = remark;
|
this.remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId()
|
public Long getId() {
|
||||||
{
|
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,63 +50,51 @@ public class Logdetails implements java.io.Serializable
|
|||||||
this.user = user;
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOperation()
|
public String getOperation() {
|
||||||
{
|
|
||||||
return this.operation;
|
return this.operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOperation(String operation)
|
public void setOperation(String operation) {
|
||||||
{
|
|
||||||
this.operation = operation;
|
this.operation = operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getClientIp()
|
public String getClientIp() {
|
||||||
{
|
|
||||||
return this.clientIp;
|
return this.clientIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setClientIp(String clientIp)
|
public void setClientIp(String clientIp) {
|
||||||
{
|
|
||||||
this.clientIp = clientIp;
|
this.clientIp = clientIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Timestamp getCreatetime()
|
public Timestamp getCreatetime() {
|
||||||
{
|
|
||||||
return this.createtime;
|
return this.createtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreatetime(Timestamp createtime)
|
public void setCreatetime(Timestamp createtime) {
|
||||||
{
|
|
||||||
this.createtime = createtime;
|
this.createtime = createtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short getStatus()
|
public Short getStatus() {
|
||||||
{
|
|
||||||
return this.status;
|
return this.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(Short status)
|
public void setStatus(Short status) {
|
||||||
{
|
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentdetails()
|
public String getContentdetails() {
|
||||||
{
|
|
||||||
return this.contentdetails;
|
return this.contentdetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContentdetails(String contentdetails)
|
public void setContentdetails(String contentdetails) {
|
||||||
{
|
|
||||||
this.contentdetails = contentdetails;
|
this.contentdetails = contentdetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemark()
|
public String getRemark() {
|
||||||
{
|
|
||||||
return this.remark;
|
return this.remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
public void setRemark(String remark) {
|
||||||
{
|
|
||||||
this.remark = remark;
|
this.remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ package com.jsh.model.po;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Material implements java.io.Serializable
|
public class Material implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private MaterialCategory materialCategory;
|
private MaterialCategory materialCategory;
|
||||||
private String Name;
|
private String Name;
|
||||||
@@ -33,7 +32,7 @@ public class Material implements java.io.Serializable
|
|||||||
/**
|
/**
|
||||||
* 类型 right--正确 warn--警告 wrong--错误
|
* 类型 right--正确 warn--警告 wrong--错误
|
||||||
*/
|
*/
|
||||||
private Map<Integer,String> cellInfo;
|
private Map<Integer, String> cellInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行号
|
* 行号
|
||||||
@@ -42,13 +41,11 @@ public class Material implements java.io.Serializable
|
|||||||
|
|
||||||
private String safetyStockStr;
|
private String safetyStockStr;
|
||||||
|
|
||||||
public Material()
|
public Material() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Material(Long Id)
|
public Material(Long Id) {
|
||||||
{
|
|
||||||
this.Id = Id;
|
this.Id = Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,43 +79,35 @@ public class Material implements java.io.Serializable
|
|||||||
OtherField3 = otherField3;
|
OtherField3 = otherField3;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId()
|
public Long getId() {
|
||||||
{
|
|
||||||
return Id;
|
return Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id) {
|
||||||
{
|
|
||||||
Id = id;
|
Id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaterialCategory getMaterialCategory()
|
public MaterialCategory getMaterialCategory() {
|
||||||
{
|
|
||||||
return materialCategory;
|
return materialCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMaterialCategory(MaterialCategory materialCategory)
|
public void setMaterialCategory(MaterialCategory materialCategory) {
|
||||||
{
|
|
||||||
this.materialCategory = materialCategory;
|
this.materialCategory = materialCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName() {
|
||||||
{
|
|
||||||
return Name;
|
return Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name)
|
public void setName(String name) {
|
||||||
{
|
|
||||||
Name = name;
|
Name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getModel()
|
public String getModel() {
|
||||||
{
|
|
||||||
return Model;
|
return Model;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModel(String model)
|
public void setModel(String model) {
|
||||||
{
|
|
||||||
Model = model;
|
Model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,13 +119,11 @@ public class Material implements java.io.Serializable
|
|||||||
Standard = standard;
|
Standard = standard;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getColor()
|
public String getColor() {
|
||||||
{
|
|
||||||
return Color;
|
return Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setColor(String color)
|
public void setColor(String color) {
|
||||||
{
|
|
||||||
Color = color;
|
Color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,53 +135,43 @@ public class Material implements java.io.Serializable
|
|||||||
Unit = unit;
|
Unit = unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRetailPrice(Double retailPrice)
|
public Double getRetailPrice() {
|
||||||
{
|
|
||||||
RetailPrice = retailPrice;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getRetailPrice()
|
|
||||||
{
|
|
||||||
return RetailPrice;
|
return RetailPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLowPrice(Double lowPrice)
|
public void setRetailPrice(Double retailPrice) {
|
||||||
{
|
RetailPrice = retailPrice;
|
||||||
LowPrice = lowPrice;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getLowPrice()
|
public Double getLowPrice() {
|
||||||
{
|
|
||||||
return LowPrice;
|
return LowPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPresetPriceOne(Double presetPriceOne)
|
public void setLowPrice(Double lowPrice) {
|
||||||
{
|
LowPrice = lowPrice;
|
||||||
PresetPriceOne = presetPriceOne;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getPresetPriceOne()
|
public Double getPresetPriceOne() {
|
||||||
{
|
|
||||||
return PresetPriceOne;
|
return PresetPriceOne;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPresetPriceTwo(Double presetPriceTwo)
|
public void setPresetPriceOne(Double presetPriceOne) {
|
||||||
{
|
PresetPriceOne = presetPriceOne;
|
||||||
PresetPriceTwo = presetPriceTwo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getPresetPriceTwo()
|
public Double getPresetPriceTwo() {
|
||||||
{
|
|
||||||
return PresetPriceTwo;
|
return PresetPriceTwo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemark()
|
public void setPresetPriceTwo(Double presetPriceTwo) {
|
||||||
{
|
PresetPriceTwo = presetPriceTwo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
return Remark;
|
return Remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
public void setRemark(String remark) {
|
||||||
{
|
|
||||||
Remark = remark;
|
Remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,18 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class MaterialCategory implements java.io.Serializable
|
public class MaterialCategory implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private String Name;
|
private String Name;
|
||||||
private Short CategoryLevel;
|
private Short CategoryLevel;
|
||||||
private MaterialCategory materialCategory;
|
private MaterialCategory materialCategory;
|
||||||
|
|
||||||
|
|
||||||
public MaterialCategory()
|
public MaterialCategory() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaterialCategory(Long Id)
|
public MaterialCategory(Long Id) {
|
||||||
{
|
|
||||||
this.Id = Id;
|
this.Id = Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,12 +12,11 @@ public class MaterialProperty implements java.io.Serializable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaterialProperty(Long id)
|
public MaterialProperty(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaterialProperty(String nativeName, Boolean enabled,String sort, String anotherName) {
|
public MaterialProperty(String nativeName, Boolean enabled, String sort, String anotherName) {
|
||||||
nativeName = nativeName;
|
nativeName = nativeName;
|
||||||
enabled = enabled;
|
enabled = enabled;
|
||||||
sort = sort;
|
sort = sort;
|
||||||
|
|||||||
@@ -1,19 +1,16 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Person implements java.io.Serializable
|
public class Person implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private String Type;
|
private String Type;
|
||||||
private String Name;
|
private String Name;
|
||||||
|
|
||||||
public Person()
|
public Person() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person(Long Id)
|
public Person(Long Id) {
|
||||||
{
|
|
||||||
this.Id = Id;
|
this.Id = Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Role implements java.io.Serializable
|
public class Role implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long Id;
|
private Long Id;
|
||||||
private String Name;
|
private String Name;
|
||||||
|
|
||||||
public Role()
|
public Role() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ package com.jsh.model.po;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Supplier implements java.io.Serializable
|
public class Supplier implements java.io.Serializable {
|
||||||
{
|
private Long id = 0l;
|
||||||
private Long id =0l;
|
|
||||||
private String supplier = "";
|
private String supplier = "";
|
||||||
private String type = "";
|
private String type = "";
|
||||||
private String contacts = "";
|
private String contacts = "";
|
||||||
@@ -31,7 +30,7 @@ public class Supplier implements java.io.Serializable
|
|||||||
/**
|
/**
|
||||||
* 类型 right--正确 warn--警告 wrong--错误
|
* 类型 right--正确 warn--警告 wrong--错误
|
||||||
*/
|
*/
|
||||||
private Map<Integer,String> cellInfo;
|
private Map<Integer, String> cellInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行号
|
* 行号
|
||||||
@@ -49,20 +48,18 @@ public class Supplier implements java.io.Serializable
|
|||||||
private String enabledStr;
|
private String enabledStr;
|
||||||
|
|
||||||
|
|
||||||
public Supplier()
|
public Supplier() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Supplier(Long id)
|
public Supplier(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Supplier(String supplier, String type, String contacts, String phonenum,
|
public Supplier(String supplier, String type, String contacts, String phonenum,
|
||||||
String fax,String telephone, String email, String address, Short isystem, String description,
|
String fax, String telephone, String email, String address, Short isystem, String description,
|
||||||
Boolean enabled, Double advanceIn, String taxNum,String bankName,String accountNumber, Double taxRate,
|
Boolean enabled, Double advanceIn, String taxNum, String bankName, String accountNumber, Double taxRate,
|
||||||
Double beginNeedGet,Double beginNeedPay,Double allNeedGet,Double allNeedPay) {
|
Double beginNeedGet, Double beginNeedPay, Double allNeedGet, Double allNeedPay) {
|
||||||
super();
|
super();
|
||||||
this.supplier = supplier;
|
this.supplier = supplier;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
@@ -86,18 +83,15 @@ public class Supplier implements java.io.Serializable
|
|||||||
this.taxRate = taxRate;
|
this.taxRate = taxRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId()
|
public Long getId() {
|
||||||
{
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSupplier()
|
public String getSupplier() {
|
||||||
{
|
|
||||||
return supplier;
|
return supplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,46 +131,38 @@ public class Supplier implements java.io.Serializable
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBeginNeedGet(Double beginNeedGet)
|
public Double getBeginNeedGet() {
|
||||||
{
|
|
||||||
BeginNeedGet = beginNeedGet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getBeginNeedGet()
|
|
||||||
{
|
|
||||||
return BeginNeedGet;
|
return BeginNeedGet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBeginNeedPay(Double beginNeedPay)
|
public void setBeginNeedGet(Double beginNeedGet) {
|
||||||
{
|
BeginNeedGet = beginNeedGet;
|
||||||
BeginNeedPay = beginNeedPay;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getBeginNeedPay()
|
public Double getBeginNeedPay() {
|
||||||
{
|
|
||||||
return BeginNeedPay;
|
return BeginNeedPay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllNeedGet(Double allNeedGet)
|
public void setBeginNeedPay(Double beginNeedPay) {
|
||||||
{
|
BeginNeedPay = beginNeedPay;
|
||||||
AllNeedGet = allNeedGet;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getAllNeedGet()
|
public Double getAllNeedGet() {
|
||||||
{
|
|
||||||
return AllNeedGet;
|
return AllNeedGet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllNeedPay(Double allNeedPay)
|
public void setAllNeedGet(Double allNeedGet) {
|
||||||
{
|
AllNeedGet = allNeedGet;
|
||||||
AllNeedPay = allNeedPay;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getAllNeedPay()
|
public Double getAllNeedPay() {
|
||||||
{
|
|
||||||
return AllNeedPay;
|
return AllNeedPay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAllNeedPay(Double allNeedPay) {
|
||||||
|
AllNeedPay = allNeedPay;
|
||||||
|
}
|
||||||
|
|
||||||
public Short getIsystem() {
|
public Short getIsystem() {
|
||||||
return isystem;
|
return isystem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class SystemConfig implements java.io.Serializable
|
public class SystemConfig implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String type;
|
private String type;
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package com.jsh.model.po;
|
package com.jsh.model.po;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class Unit implements java.io.Serializable
|
public class Unit implements java.io.Serializable {
|
||||||
{
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String UName;
|
private String UName;
|
||||||
|
|
||||||
public Unit()
|
public Unit() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,8 +13,7 @@ public class Unit implements java.io.Serializable
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Unit(String UName)
|
public Unit(String UName) {
|
||||||
{
|
|
||||||
this.UName = UName;
|
this.UName = UName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user