package com.digione.web.action.admin.aftersales;import java.io.PrintWriter;
import java.sql.Timestamp;
import java.util.Date;import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.ResultPath;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;import com.entity.sale.FactorySaleoutlet;
import com.exception.RefundPercentageException;
import com.exception.ServiceLevelException;
import com.services.sale.aftersales.FactorySaleoutletServerImpl;
import com.web.action.admin.AdminActionBase;
@Namespace(value = "/admin/aftersales")
@Results( { @Result(name = "success", type = "redirectAction", params = {"actionName", "factorysaleoutlet" }) })
@ResultPath(value = "/webpages")
@InterceptorRefs( { @InterceptorRef("checkRightOfAdminStack") })
public class FactorysaleoutletAction  extends AdminActionBase{ private Integer dictId1;
// 品牌字典
private Integer brandDict; 
private Integer areaDict;
private Integer cityDict;
private String companyname; 
private String contactname; 
private String contactphone; 
private String re; 
private Integer inputUser;
private Timestamp inputTime;
private Integer inputuserId;



public Integer getInputuserId() {
return inputuserId;
}
public void setInputuserId(Integer inputuserId) {
this.inputuserId = inputuserId;
}
public Integer getDictId1() {
return dictId1;
}
public void setDictId1(Integer dictId1) {
this.dictId1 = dictId1;
}
public Integer getBrandDict() {
return brandDict;
}
public void setBrandDict(Integer brandDict) {
this.brandDict = brandDict;
}
public Integer getAreaDict() {
return areaDict;
}
public void setAreaDict(Integer areaDict) {
this.areaDict = areaDict;
}
public Integer getCityDict() {
return cityDict;
}
public void setCityDict(Integer cityDict) {
this.cityDict = cityDict;
}
public String getCompanyname() {
return companyname;
}
public void setCompanyname(String companyname) {
this.companyname = companyname;
}
public String getContactname() {
return contactname;
}
public void setContactname(String contactname) {
this.contactname = contactname;
}
public String getContactphone() {
return contactphone;
}
public void setContactphone(String contactphone) {
this.contactphone = contactphone;
}
public String getRe() {
return re;
}
public void setRe(String re) {
this.re = re;
}
public Integer getInputUser() {
return inputUser;
}
public void setInputUser(Integer inputUser) {
this.inputUser = inputUser;
}
public Timestamp getInputTime() {
return inputTime;
}
public void setInputTime(Timestamp inputTime) {
this.inputTime = inputTime;


//

public HttpHeaders index() {
return new DefaultHttpHeaders("index").disableCaching();
// return "index";
}

public HttpHeaders create(){
if(submitFrom == null || submitFrom == 1){
return index();
} else if(submitFrom == 2){
PrintWriter writer = super.getWriter();
try {
FactorySaleoutlet factorysaleoutlet=new FactorySaleoutlet();
// Date date = new Date();
//  Timestamp nousedate = new Timestamp(date.getTime());
//



 
    factorysaleoutlet.setDictId1(dictId1);
// factorysaleoutlet.setBrandDict(this.getBrandDict());
// factorysaleoutlet.setCityDict(this.getCityDict());
// factorysaleoutlet.setAreaDict(this.getAreaDict());
factorysaleoutlet.setCompanyname(companyname);
factorysaleoutlet.setContactname(contactname);
factorysaleoutlet.setContactphone(contactphone);
factorysaleoutlet.setInputTime(inputTime);

         super.getServiceFactory().getFactorySaleoutletServer().creatFactorySaleoutlet(factorysaleoutlet);  //空指针异常位置所在 
    


}catch (Exception e) {
super.log.error(e.getMessage(),e);
}finally{
writer.flush();
writer.close();
writer = null;
}

}
return null;
}

public HttpHeaders show(){



return new DefaultHttpHeaders("editnew").disableCaching();


}


}2011-09-19 12:19:58 [com.web.action.admin.aftersales.FactorysaleoutletAction.create(FactorysaleoutletAction.java:150)] 
java.lang.NullPointerException
at com.web.action.admin.aftersales.FactorysaleoutletAction.create(FactorysaleoutletAction.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)