| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- package xin.glue.ui.G.G04;
- import java.sql.CallableStatement;
- import java.sql.SQLException;
- 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;
- public class SaveZHBslabRep extends PosActivity{
- public String runActivity(PosContext context)
- {
- PosGenericDao dao = this.getDao("mesdao");
- CallableStatement cstm= null;
- String[] DsnSlabNo = (String[])context.get("DSN_SLAB_NO");
- String[] SlabNo = (String[])context.get("SLAB_NO");
- String[] subDsnSlabNo = (String[])context.get("SUB_DSN_SLAB_NO");
- String[] User = (String[])context.get("USER");
- String[] CF = (String[])context.get("CF");
- String[] CC = (String[])context.get("CC");
- String[] DZ = (String[])context.get("DZ");
- String[] PH = (String[])context.get("PH");
- String[] CD = (String[])context.get("CD");
- String[] GD = (String[])context.get("GD");
- String ordType = "";
- if(CD[0] != null && GD[0].equals("Y")){
- ordType = "gd";
- }else if(GD[0] != null && CD[0].equals("Y")){
- ordType = "cd";
- }
- try
- {
- cstm = dao.getCallableStatement("UIH040110.zhb_slab_rep");
- cstm.setString(1, ordType);
- cstm.setString(2, DsnSlabNo[0]);
- cstm.setString(3, subDsnSlabNo[0]);
- cstm.setString(4, SlabNo[0]);
- cstm.setString(5, CF[0]+ "|" + CC[0] + "|" + DZ[0] + "|" + PH[0]);
- cstm.setString(6, User[0]);
- cstm.registerOutParameter(7, java.sql.Types.VARCHAR);
- cstm.execute();
-
- String Ex = cstm.getString(7);
- if(!(Ex == null || Ex.equals(""))){
- context.put("errorMsg",Ex);
- return PosBizControlConstants.FAILURE;
- }
-
- /*财务数据上抛*/
- cstm = this.getDao("mesdao").getCallableStatement("UPLOAD_DATA.CAL");
- cstm.setString(1, SlabNo[0]);
- cstm.setString(2, "11AE");
- cstm.setString(3, "N");
- cstm.setString(4, "板坯挂单");
- cstm.setString(5, User[0]);
- cstm.registerOutParameter(6, java.sql.Types.VARCHAR);
- cstm.execute();
-
- String err = cstm.getString(6);
- if(!org.apache.commons.lang.StringUtils.isBlank(cstm.getString(6))){
- context.put("MESSAGES","数据上传失败:" + err);
- return PosBizControlConstants.FAILURE;
- }
- }
- catch(Exception ex)
- {
- context.put("errorMsg","系统错误");
- return PosBizControlConstants.FAILURE;
- }finally
- {
- if (cstm != null)
- {
- try
- {
- cstm.close();
- }
- catch (SQLException e)
- {
- logger.logWarn(e.getMessage(), e);
- }
- }
- }
- return PosBizControlConstants.SUCCESS;
- }
-
-
- }
|