package xin.glue.ui.D.D01; import java.sql.CallableStatement; import com.posdata.glue.PosException; import com.posdata.glue.biz.activity.PosActivity; import com.posdata.glue.biz.constants.PosBizControlConstants; import com.posdata.glue.context.PosContext; import com.posdata.glue.dao.PosGenericDao; import com.posdata.glue.dao.vo.PosParameter; import com.posdata.glue.dao.vo.PosRowSet; /** * 板坯组合设计 * @author 万磊 * @date 2019-9-10 */ public class SaveAssembleAddSlab extends PosActivity { public String runActivity(PosContext context) { //从页面获取一系列参数,供更新数据所用 String[] chk = (String[]) context.get("CHK"); String[] ORD_NO = (String[]) context.get("ORD_NO");//板坏号 String[] ORD_SEQ = (String[])context.get("ORD_SEQ"); StringBuffer P_ORD = new StringBuffer(); //组织三个参数群,分别供查询,更新和插入数据所用 //PosParameter parameter = null; CallableStatement cstm = null; PosGenericDao dao = this.getDao("mesdao"); //PosRowSet rowSet = null; if (chk != null) { for (int i = 0; i < chk.length; i++) { if(chk[i] == null || chk[i].equals("false")){ continue; }else{ P_ORD.append(ORD_NO[i]).append("+").append(ORD_SEQ[i]).append("|"); } } try { cstm = dao.getCallableStatement("tbd01_slabdn_addassemble.call"); cstm.setString(1, P_ORD.toString()); cstm.setString(2, ""); cstm.setString(3, ""); cstm.setString(4, ""); cstm.registerOutParameter(5, java.sql.Types.VARBINARY); cstm.registerOutParameter(6, java.sql.Types.VARBINARY); cstm.execute(); //String errorCD = cstm.getString(5); String errorMsg = cstm.getString(6); if(errorMsg != null && !"".equals(errorMsg)){ context.put("errorMsg", errorMsg); return PosBizControlConstants.FAILURE; } }catch(Exception ex) { return PosBizControlConstants.FAILURE; } finally { if(cstm != null) { try { cstm.close(); } catch(Exception e) { e.printStackTrace(); } } } } return PosBizControlConstants.SUCCESS; } }