8c78185bc677bd4aebb5e92f9cbda525656fe373.svn-base 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. package xin.glue.ui.G.G04;
  2. import com.posdata.glue.biz.activity.PosActivity;
  3. import com.posdata.glue.biz.constants.PosBizControlConstants;
  4. import com.posdata.glue.context.PosContext;
  5. import com.posdata.glue.dao.vo.PosParameter;
  6. import com.posdata.glue.dao.vo.PosRow;
  7. import com.posdata.glue.dao.vo.PosRowSet;
  8. /**
  9. *
  10. * @auth: wangxiaoyan
  11. * @date: 2009-1-9
  12. * @desc: 删除行车命令后的善后工作 修改行车命令涉及到的 原板坯位置 行车命令状态修改为DELETE 3
  13. */
  14. public class XinDeleteCraneOrder extends PosActivity {
  15. public String runActivity(PosContext context) {
  16. // 从页面获取参数数据,供更新页面使用
  17. // 制定行车命令所需: 原位置;目的位置;移动块数,行车编号
  18. String[] fromAddress = (String[])context.get("FROM_ADDR");
  19. String[] slabCnt = (String[])context.get("SLAB_CNT");
  20. String[] toAddress = (String[])context.get("TO_ADDR");
  21. if(fromAddress == null||slabCnt== null||toAddress== null)return PosBizControlConstants.SUCCESS;
  22. // 记录要移动的板坯的数组
  23. String[] ArrSlabNo = new String[4];
  24. // 记录要移动的板坯的数组
  25. String[] ArrStorlay = new String[4];
  26. // 行车命令选定移动的板坯块数
  27. int intCnt = Integer.parseInt(slabCnt[0]);
  28. int i = 0;
  29. int j = 0;
  30. PosParameter param1 = new PosParameter();
  31. param1.setWhereClauseParameter(0, fromAddress[0]);
  32. PosRowSet YardVO = getDao("mesdao").find("UIG040043_06.select", param1);
  33. // 获得要移动的板坯,一个跺位从上到下获取 intCnt 块板坯数
  34. while(YardVO.hasNext()) {
  35. PosRow YardROW = YardVO.next();
  36. ArrSlabNo[i] = (String)YardROW.getAttribute("SLAB_NO");
  37. i++;
  38. if ( i == intCnt ) break;
  39. }
  40. param1 = new PosParameter();
  41. param1.setWhereClauseParameter(0, toAddress[0]);
  42. YardVO = getDao("mesdao").find("UIG040043_toAddr_delete.select", param1);
  43. //获得要放置板坯的层,一个跺位从下往上获取 inCnt 个层位置
  44. while(YardVO.hasNext()) {
  45. PosRow YardROW = YardVO.next();
  46. ArrStorlay[j] = (String)YardROW.getAttribute("STORELAY");
  47. j++;
  48. if ( j == intCnt ) break;
  49. }
  50. // 下面对制定命令涉及到的 板坯原位置,目的位置 进行控制 删除行车命令,则状态为3
  51. for ( int jj = 0; jj < intCnt ; jj++) {
  52. PosParameter param3 = new PosParameter();
  53. param3.setValueParamter(0, "");
  54. param3.setValueParamter(1, ArrSlabNo[jj]);
  55. param3.setValueParamter(2, fromAddress[0]);
  56. getDao("mesdao").insert("UIG040041_01.update", param3);
  57. param3 = new PosParameter();
  58. param3.setValueParamter(0, "");
  59. param3.setValueParamter(1, ArrStorlay[jj]);
  60. param3.setValueParamter(2, toAddress[0]);
  61. getDao("mesdao").update("UIG040041_02.update", param3);
  62. }
  63. return PosBizControlConstants.SUCCESS;
  64. }
  65. }