package com.chinasofti.mango.fswsystem.action;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.chinasofti.mango.fswsystem.domain.Client;
import com.chinasofti.mango.fswsystem.domain.DayplanDetail;
import com.chinasofti.mango.fswsystem.domain.MinSto;
import com.chinasofti.mango.fswsystem.domain.MinStoDetail;
import com.chinasofti.mango.fswsystem.domain.Spotcheck;
import com.chinasofti.mango.fswsystem.domain.SpotcheckDetail;
import com.chinasofti.mango.fswsystem.domain.Storage;
import com.chinasofti.mango.fswsystem.domain.User;
import com.chinasofti.mango.fswsystem.service.ClientService;
import com.chinasofti.mango.fswsystem.service.DeliveryUnitService;
import com.chinasofti.mango.fswsystem.service.MinStoDetailService;
import com.chinasofti.mango.fswsystem.service.MinStoService;
import com.chinasofti.mango.fswsystem.service.SpotcheckService;
import com.chinasofti.mango.fswsystem.service.StorageService;
import com.chinasofti.mango.fswsystem.service.TobaccoGradeService;
import com.chinasofti.mango.fswsystem.service.TobaccoKindService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class MinStoAction extends ActionSupport {
private MinSto minSto;
private User user;
private Date nowtime;
private MinStoService minStoService;
private MinStoDetailService minStoDetailService;
private List allMinStos;
private List allMinStoDetails;
private MinStoDetail minStoDetail;
private List allClients;
private List allStorages;
private StorageService storageService;
private Storage storage;
private ClientService clientService;
private Spotcheck spotcheck;
private SpotcheckDetail spotcheckDetail;
private SpotcheckService spotcheckService;
private Client client;
private TobaccoKindService tobaccoKindService;
private List allTobaccoKinds;
private TobaccoGradeService tobaccoGradeService;
private List allTobaccoGrades;
private DeliveryUnitService deliveryUnitService;
@SuppressWarnings("unchecked")
private List allDeliveryUnits;
//添加主从表表格
@SuppressWarnings("unchecked")
public String add(){
try{
Map session = ActionContext.getContext().getSession();
User u=new User();
u=(User) session.get("user");
minSto.setStoragekeeper(u.getName());
minSto.setAuditflag("0");
if(minStoService.findById(minSto.getMinid())==null)
{
minStoService.addMinSto(minSto);
}
//添加明细表
minStoDetail.setMinSto(minSto);
minStoDetail.setminid(minSto.getMinid());
minStoDetailService.addMinStoDetail(minStoDetail);
searchAllDetailsByMinid();
addActionError("添加成功!");
}
catch(Exception e){
e.printStackTrace();
}
return "success";
}
//通过主表ID查看明细
public String searchAllDetailsByMinid()
{
try
{
if(minSto.getMinid()!=null){
allMinStoDetails =minStoDetailService.findAllById(minSto.getMinid());
if(allMinStoDetails.size()>0){
addActionError("查询成功!");
return SUCCESS;
}
else{
addActionError("没有找到结果!");
return "input";
}
}
else{
addActionError("搜索条件为空!");
return "input";
}
}
catch(Exception e)
{
addActionError("查询失败");
return "input";
}
}
//填写新建表格的数据
@SuppressWarnings("unchecked")
public String newTable(){
String s=" *";
try{
allTobaccoGrades = tobaccoGradeService.findAll();
allTobaccoKinds = tobaccoKindService.findAll();
allClients=clientService.findAll();
allStorages = storageService.findAll();
allDeliveryUnits=deliveryUnitService.findAll();
Map session = ActionContext.getContext().getSession();
if(allDeliveryUnits.size()>0){
session.put("allDeliveryUnits",allDeliveryUnits);
}
else{
s=s+"没查到发货单位 ";
}
if(allStorages.size()>0){
session.put("allStorages",allStorages);
}
else{
s=s+"没查到仓库 ";
}
if(allClients.size()>0){
session.put("allClients",allClients);
}
else{
s=s+"没查到委托方 ";
}
if(allTobaccoKinds.size()>0){
session.put("allTobaccoKinds", allTobaccoKinds);
}
else{
s=s+"没查到烟叶品种 ";
}
if(allTobaccoGrades.size()>0){
session.put("allTobaccoGrades", allTobaccoGrades);
}
else{
s=s+"没查到烟叶等级 ";
}
s=s+"共找到"+Integer.toString(allTobaccoGrades.size())+"条数据";
s=s+"共找到"+Integer.toString(allTobaccoKinds.size())+"条数据";
addActionError(s);
return "success";
}
catch(Exception e){
e.printStackTrace();
return "input";
}
}
public String lookDetail()
{
try
{
if(minSto.getMinid() != null)
{
allMinStoDetails = minStoDetailService.findAllById(minSto.getMinid());
addActionError("查询成功!");
return "success";
}
else
{
addActionError("沒有找到結果!");
return "input";
}
}
catch(Exception e)
{
addActionError("查询失败!" + minSto.getMinid());
e.printStackTrace();
return "input";
}
}
public String searchByPeople()
{
if(minSto.getStoragekeeper()==null)
{
addActionError("输入为空!");
}
else
{
try{
allMinStos = minStoService.findAllByStoragekeeper(minSto.getStoragekeeper());
addActionError("查詢成功!");
}
catch(Exception e)
{
e.printStackTrace();
addActionError("查询失败!");
}
}
return "success";
}
public String searchByTime()
{
try{
if(minSto.getIntime()==null)
{
addActionError("输入为空!");
}
else
{
allMinStos = minStoService.findAllByIntime(minSto.getIntime());
addActionError("查詢成功!");
}
return "success";
}
catch(Exception e)
{
addActionError("查詢失敗!");
e.printStackTrace();
return "input";
}
}
public String listAll()
{
try
{
allMinStos = minStoService.findAll();
addActionError("查询成功!");
return "success";
}
catch(Exception e)
{
addActionError("查询失败!");
e.printStackTrace();
return "input";
}
}
//查看待审核列表
public String listAuditMinSto(){
try{
allMinStos = minStoService.findByAuditflag();
addActionError("查看待审核表成功");
return SUCCESS;
}
catch(Exception e){
addActionError("查看失败");
return "input";
}
}
//审核
public String audit() throws Exception {
minSto = minStoService.getMinSto(minSto.getMinid());
if(minSto!=null){
List ms = new ArrayList();
ms.add(minSto);
allMinStos=ms;
//显示明细
searchAllDetailsByMinid();
return "success";
}
else{
return "failed";
}
}
public String auditMingxi() throws Exception{
Map session = ActionContext.getContext().getSession();
User u=new User();
u=(User) session.get("user");
minSto.setAuditor(u.getName());//得到审核人。
Date nowtime = new Date();
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
minSto.setAudittime(df.format(nowtime));
if(minSto.getAuditflag()==null){
minSto.setAuditflag("1"); //1表示 未通过
}
else
{
minSto.setAuditflag("2"); //2表示 通过
}
minStoService.updateMinSto(minSto);
return SUCCESS;
}
//编辑
public String editMinsto() throws Exception {
minSto = minStoService.getMinSto(minSto.getMinid());
if(minSto!=null){
List ms = new ArrayList();
ms.add(minSto);
allMinStos=ms;
//显示明细
searchAllDetailsByMinid();
return "success";
}
else{
return "failed";
}
}
public String editMinStoDetail() throws Exception {
minStoDetail = minStoDetailService.getMinSt
没有合适的资源?快使用搜索试试~ 我知道了~
复烤生产物流系统myeclipse
共1634个文件
svn-base:732个
java:179个
class:179个
4星 · 超过85%的资源 需积分: 9 40 下载量 71 浏览量
2011-03-25
20:46:08
上传
评论
收藏 6.41MB RAR 举报
温馨提示
复烤生产物流系统复烤生产物流系统复烤生产物流系统复烤生产物流系统复烤生产物流系统
资源推荐
资源详情
资源评论
收起资源包目录
复烤生产物流系统myeclipse (1634个子文件)
all-wcprops 29KB
all-wcprops 12KB
all-wcprops 10KB
all-wcprops 10KB
all-wcprops 10KB
all-wcprops 10KB
all-wcprops 6KB
all-wcprops 6KB
all-wcprops 4KB
all-wcprops 4KB
all-wcprops 3KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 962B
all-wcprops 952B
all-wcprops 902B
all-wcprops 900B
all-wcprops 416B
all-wcprops 410B
all-wcprops 388B
all-wcprops 211B
all-wcprops 201B
all-wcprops 195B
all-wcprops 187B
all-wcprops 184B
MinStoAction.class 14KB
DayplanAction.class 11KB
YuanliaoChoujianAction.class 9KB
TobaccoAction.class 8KB
WeekplanAction.class 7KB
UserAction.class 7KB
ShengchanTouliaoAction.class 7KB
SpotcheckDAO.class 6KB
BranchPopedomDAO.class 6KB
MinStoDAO.class 6KB
ChengpinChanchuAction.class 6KB
SpotcheckDetailDAO.class 6KB
BeiliaoTongzhiAction.class 6KB
MinStoDetailDAO.class 6KB
FahuoTongzhiAction.class 6KB
FahuoChukuAction.class 6KB
PCarryOverDAO.class 6KB
ChengpinRukuAction.class 6KB
WeekplanDetailDAO.class 6KB
StuffOutDetailDAO.class 6KB
DayplanDetailDAO.class 6KB
ClienteDAO.class 6KB
PopedomDAO.class 5KB
PrepareStuffDetailDAO.class 5KB
MessageDAO.class 5KB
ClientDAO.class 5KB
DayplanDAO.class 5KB
TobaccoClassifyDAO.class 5KB
DeliveryDetailDAO.class 5KB
TobaccoCompanyDAO.class 5KB
PDelOutDetailDAO.class 5KB
ProductDetailDAO.class 5KB
DeliveryUniteDAO.class 5KB
PinStoDetailDAO.class 5KB
PrepareStuffDAO.class 5KB
DeliveryUnitDAO.class 5KB
TobaccoGradeDAO.class 5KB
TobaccoPieceDAO.class 5KB
TobaccoKindDAO.class 5KB
MCarryOverDAO.class 5KB
StoplaceDAO.class 5KB
StuffoutDAO.class 5KB
WeekplanDAO.class 5KB
DeliveryDAO.class 5KB
PDelOutDAO.class 5KB
ProductDAO.class 5KB
StorageDAO.class 5KB
PinStoDAO.class 5KB
BranchDAO.class 5KB
ShiftDAO.class 5KB
UserDAO.class 5KB
ProductDetailId.class 5KB
PCarryOver.class 5KB
FahuoDanweiAction.class 4KB
PDelOut.class 4KB
DeliveryDetailId.class 4KB
StoPlaceAction.class 4KB
共 1634 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
hq025731
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页