e77769ceddd25360dc27cc4c7fb5abc27cd32369.svn-base 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. package xin.glue.ui.G.G04;
  2. import java.sql.CallableStatement;
  3. import java.sql.SQLException;
  4. import com.posdata.glue.biz.activity.PosActivity;
  5. import com.posdata.glue.biz.constants.PosBizControlConstants;
  6. import com.posdata.glue.context.PosContext;
  7. import com.posdata.glue.dao.PosGenericDao;
  8. import com.posdata.glue.dao.vo.PosParameter;
  9. import com.posdata.glue.dao.vo.PosRow;
  10. import com.posdata.glue.dao.vo.PosRowSet;
  11. public class SaveReturnSlabLoc extends PosActivity {
  12. public String runActivity(PosContext context) {
  13. String MESSAGES = null;
  14. String[] yardAddr = (String[])context.get("RTN_CUR_STORE_LOC");
  15. String[] slabNo = (String[])context.get("SLAB_NO");
  16. String[] PLT_TRS_EMP_ID = (String[])context.get("PLT_TRS_EMP_ID");
  17. String[] PLT_TRS_EMP_NM = (String[]) context.get("PLT_TRS_EMP_NM");
  18. String[] storelay = new String[10];
  19. PosParameter param = new PosParameter();
  20. PosRowSet rowset = null;
  21. PosGenericDao dao = getDao("mesdao");
  22. if(slabNo == null){
  23. return PosBizControlConstants.SUCCESS;
  24. }
  25. for(int i = 0 ; i< slabNo.length; i++){
  26. param = new PosParameter();
  27. param.setWhereClauseParameter(0, yardAddr[i]);
  28. PosRowSet rowSet = getDao("mesdao").find("UIG040090_STORELAY.select", param);
  29. if(rowSet.hasNext()){
  30. PosRow row = rowSet.next();
  31. storelay[i] = (String)row.getAttribute("STORELAY");
  32. }
  33. param = new PosParameter();
  34. param.setWhereClauseParameter(0, slabNo[i]);
  35. String querysql = "SELECT * FROM KCG_STUFFLIST@XGCX T WHERE T.BILLETNO = ? AND ZXISJS = '0'";
  36. rowset = dao.findByQueryStatement(querysql, param);
  37. if(!rowset.hasNext()){
  38. continue;
  39. }
  40. //板坯从中厚板退回后也要删除产销的未接收的板坯数据 JIANGXIN 20210105
  41. param = new PosParameter();
  42. param.setWhereClauseParameter(0, slabNo[i]);
  43. int count1 = getDao("mesdao").update("UIG040090_06.update", param);
  44. //写出库撤销履历 JIANGXIN 20210113
  45. param = new PosParameter();
  46. param.setWhereClauseParameter(0, slabNo[i]);
  47. int count2 = getDao("mesdao").update("UIG040090_07.update", param);
  48. //删除TBG04_SLAB_TRANSF
  49. param = new PosParameter();
  50. param.setWhereClauseParameter(0, slabNo[i]);
  51. int count3 = getDao("mesdao").update("UIG040090_08.update", param);
  52. /*if(storelay[i] == null){
  53. MESSAGES = " 退回失败 !";
  54. context.put("MESSEGES", MESSAGES);
  55. return PosBizControlConstants.SUCCESS;
  56. }*/
  57. //跺位更新
  58. param = new PosParameter();
  59. param.setWhereClauseParameter(0, yardAddr[i] + storelay[i]);
  60. param.setWhereClauseParameter(1, slabNo[i]);
  61. int uptCnt = getDao("mesdao").update("UIG040090_03.update", param);
  62. param = new PosParameter();
  63. param.setWhereClauseParameter(0, slabNo[i]);
  64. param.setWhereClauseParameter(1, yardAddr[i]);
  65. param.setWhereClauseParameter(2, storelay[i]);
  66. int uptCnt2 = getDao("mesdao").update("UIG040090_SLAB_YARD_02.update",param);
  67. /*param = new PosParameter();
  68. param.setValueParamter(0, slabNo[i]);
  69. int uptCnt3 = getDao("mesdao").delete("UIG040090_SLAB_TRANSF.delete", param);
  70. if(!(uptCnt > 0)||!(uptCnt2 > 0)){
  71. MESSAGES = " 退回失败 !";
  72. context.put("MESSEGES", MESSAGES);
  73. return PosBizControlConstants.SUCCESS;
  74. }*/
  75. CallableStatement cstm = null;
  76. /*财务数据上抛*/
  77. try{
  78. cstm = this.getDao("mesdao").getCallableStatement("UPLOAD_DATA.CAL");
  79. cstm.setString(1, slabNo[i]);
  80. cstm.setString(2, "55A");
  81. cstm.setString(3, "D");
  82. cstm.setString(4, "板坯移送中厚板撤销");
  83. cstm.setString(5, PLT_TRS_EMP_NM == null?"3qAdmin00":PLT_TRS_EMP_NM[0]);
  84. cstm.registerOutParameter(6, java.sql.Types.VARCHAR);
  85. cstm.execute();
  86. String err = cstm.getString(6);
  87. }catch (Exception e) {
  88. // TODO: handle exception
  89. }finally{
  90. if (cstm != null){
  91. try{
  92. cstm.close();
  93. }
  94. catch (SQLException e){
  95. logger.logWarn(e.getMessage(), e);
  96. }
  97. }
  98. }
  99. }
  100. return PosBizControlConstants.SUCCESS;
  101. }
  102. }