📄 updateplanaction.java
字号:
/* 创建日期:Dec 15, 2006
* 作 者:朱 闰
* 公 司:安徽通途信息技术有限公司
*/
package com.tongtu.Action.planManage;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.tongtu.Action.TopBaseAction;
import com.tongtu.Form.PlanForm;
import com.tongtu.Form.UserForm;
import com.tongtu.comm.Decode;
import com.tongtu.util.EnToChin;
import com.tongtu.util.PlanDetail;
import com.tongtu.util.UserInfo;
import com.tongtu.util.UserRole;
public class UpdatePlanAction extends TopBaseAction
{
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm, HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
PlanForm form = (PlanForm) actionForm;
ActionErrors errors = new ActionErrors();
PlanDetail pd = new PlanDetail();
pd.setEndTime(form.getEndTime());
pd.setStartTime(form.getStartTime());
pd.setInvest(form.getInvest());
pd.setMilemeter(form.getMilemeter());
if (form.getNote().length() != 0)
pd.setNote(EnToChin.native2unicode(form.getNote()));
else pd.setNote("");
pd.setPlanType(form.getPlanType());
pd.setRoadName(EnToChin.native2unicode(form.getRoadName()));
pd.setRoadSurfaceType(form.getRoadSurfaceType());
pd.setRoadbedWidth(form.getRoadbedWidth());
if (form.getTownName().length() != 0)
pd.setTownName(EnToChin.native2unicode(form.getTownName()));
else pd.setTownName("");
if (form.getVillageName().length() != 0)
pd.setVillageName(EnToChin.native2unicode(form.getVillageName()));
else pd.setVillageName("");
pd.setProvinceSubsidy(form.getProvinceSubsidy());
pd.setRoadSurfaceWidth(form.getRoadSurfaceWidth());
String villageType = "";
String villagetype =form.getVillageType();
if (villagetype != null)
{
pd.setVillageType(villagetype);
}
else {
String roleList[]=httpServletRequest.getParameterValues("checkbox");
if (roleList!=null){
for (int i=0;i<roleList.length;i++)
{
villageType += roleList[i]+ ";";
}
} else villageType = "0;0;0;0";
pd.setVillageType(villageType);
}
//新增字段
// String box[] = httpServletRequest.getParameterValues("checkbox1");
// for (int i = 0; box!=null && i < box.length;i++){
// int intValue = Integer.parseInt(box[i]);
// if (intValue == 1) pd.setIsPKX(1);
// if (intValue == 2) pd.setIsMZDQ(1);
// if (intValue == 3) pd.setIsGMLQ(1);
// }
String isPKX = httpServletRequest.getParameter("isPKX");
int pkx = 0;
if (isPKX!=null) pkx = Integer.parseInt(isPKX);
pd.setIsPKX(pkx);
String isMZDQ = httpServletRequest.getParameter("isMZDQ");
int mzdq = 0;
if (isMZDQ!=null) mzdq = Integer.parseInt(isMZDQ);
pd.setIsMZDQ(mzdq);
String isGMLQ = httpServletRequest.getParameter("isGMLQ");
int gmlq = 0;
if (isGMLQ!=null) gmlq = Integer.parseInt(isGMLQ);
pd.setIsGMLQ(gmlq);
System.out.println("=====isPKX==" + isPKX + "===isMZDQ==" + isMZDQ + "====isGMLQ==" + isGMLQ);
pd.setJsxz(form.getJsxz());
pd.setJhlx(form.getJhlx());
pd.setZyjsnr(form.getZyjsnr());
pd.setJsdj(form.getJsdj());
pd.setJhyear(form.getJhyear());
if (form.getQl().length() != 0)
pd.setQl(EnToChin.native2unicode(form.getQl()));
else pd.setQl("");
pd.setLjwctz(form.getLjwctz());
pd.setZytz(form.getZytz());
pd.setZytzcgs(form.getZytzcgs());
pd.setZygz(form.getZygz());
pd.setSsqzc(form.getSsqzc());
pd.setGndk(form.getGndk());
pd.setQqgzjz(form.getQqgzjz());
pd.setSjjslc(form.getSjjslc());
pd.setSjwctze(form.getSjwctze());
if (form.getTxzmc().length() != 0)
pd.setTxzmc(EnToChin.native2unicode(form.getTxzmc()));
else pd.setTxzmc("");
if (form.getTjzcmc().length() != 0)
pd.setTjzcmc(EnToChin.native2unicode(form.getTjzcmc()));
else pd.setTjzcmc("");
if (form.getQqgzjz().length() != 0)
pd.setQqgzjz(EnToChin.native2unicode(form.getQqgzjz()));
else pd.setQqgzjz("");
boolean isOk = getPlanHelper().updatePlanInfo(pd, form.getPlanId());
return actionMapping.findForward("success");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -