e91cf4e8822ab6579d64fd8b2d5e65215b3f228e.svn-base 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. package xin.glue.ui.H.H01;
  2. /********
  3. 这里为卷板移送回退单独做个类处理 TL 091224
  4. ************/
  5. import java.math.BigDecimal;
  6. import com.posdata.glue.biz.activity.PosActivity;
  7. import com.posdata.glue.biz.constants.PosBizControlConstants;
  8. import com.posdata.glue.biz.control.PosBizControlIF;
  9. import com.posdata.glue.biz.control.PosBizProvider;
  10. import com.posdata.glue.component.PosConstants;
  11. import com.posdata.glue.context.PosContext;
  12. import com.posdata.glue.dao.vo.PosParameter;
  13. import com.posdata.glue.dao.vo.PosRow;
  14. import com.posdata.glue.dao.vo.PosRowSet;
  15. import com.posdata.glue.msg.PosMESMessageImpl;
  16. import com.posdata.glue.msg.PosMessage;
  17. public class saveYSreturn extends PosActivity{
  18. public String runActivity(PosContext context)
  19. {
  20. // 从页面获取参数数据,供更新页面使用
  21. //行状态
  22. String[] rowStuts = (String[])context.get("rowStatus");
  23. //选择标志
  24. String[] CHK = (String[])context.get("CHK");
  25. //钢卷号
  26. String[] OLD_SAMPL_NO = (String[])context.get("OLD_SAMPL_NO");
  27. //垛位
  28. String[] RTN_CUR_STORE_LOC = (String[])context.get("RTN_CUR_STORE_LOC");
  29. //板加货单号
  30. String[] SHIP_INVNO = (String[])context.get("SHIP_INVNO");
  31. //冷轧货单号
  32. String[] SHIP_INVNO_CR = (String[])context.get("SHIP_INVNO_CR");
  33. //移送退回状态
  34. String[] MOVE_ST = (String[])context.get("MOVE_ST");
  35. //登录人
  36. String[] REG_ID = (String[])context.get("REG_ID");
  37. //合同号
  38. String[] ORD_NO = (String[])context.get("ORD_NO");
  39. //订单号
  40. String[] ORD_SEQ = (String[])context.get("ORD_SEQ");
  41. //流水号,整理进程用
  42. String[] COIL_NO1 = (String[])context.get("COIL_NO");
  43. //钢卷重量
  44. String[] ACT_WGT = (String[])context.get("ACT_WGT");
  45. String MOVE_ST_TMP = null;
  46. for(int i=0;i<rowStuts.length;i++){
  47. //选中的情况,才能够把需要移送的卷迁入移送接口表
  48. if(CHK[i].equals("Y")){
  49. //判断是否垛位存在之前要先判断该状态是否能够进行回退操作
  50. if(MOVE_ST[i].equals("0")){
  51. //这里在退回库之前做状态效验,不为板加待接收状态不能退回
  52. PosParameter paramA = new PosParameter();
  53. paramA.setWhereClauseParameter(0, OLD_SAMPL_NO[i]);
  54. paramA.setWhereClauseParameter(1, SHIP_INVNO[i]);
  55. PosRowSet MOVE_STVo = getDao("mesdao").find("UIH070010_09.select", paramA);
  56. if(MOVE_STVo.hasNext()){
  57. PosRow MOVE_STRow = MOVE_STVo.next();
  58. MOVE_ST_TMP = (String) MOVE_STRow.getAttribute("MOVE_ST");
  59. if(MOVE_ST_TMP.equals("0")){
  60. //这里处理板加接收等待的情况,进行回退操作
  61. //这里要判断输入的垛位信息是否被占用已经垛位信息是否存在
  62. PosParameter param0 = new PosParameter();
  63. param0.setWhereClauseParameter(0, RTN_CUR_STORE_LOC[i]);
  64. PosRowSet CoilYardVo = getDao("mesdao").find("UIH070010_04.select", param0);
  65. if(CoilYardVo.hasNext()){
  66. PosRow CoilYardRow = CoilYardVo.next();
  67. String COIL_NO = (String) CoilYardRow.getAttribute("COIL_NO");
  68. if(COIL_NO == null){
  69. //把界面输入的垛位存在垛位表和公共表,并且需要把钢卷的状态回退到库内
  70. PosParameter param1 = new PosParameter();
  71. param1.setWhereClauseParameter(0, OLD_SAMPL_NO[i]);
  72. param1.setWhereClauseParameter(1, RTN_CUR_STORE_LOC[i]);
  73. getDao("mesdao").update("UIH070010_02.update", param1);
  74. PosParameter param2 = new PosParameter();
  75. param2.setWhereClauseParameter(0, RTN_CUR_STORE_LOC[i]);
  76. param2.setWhereClauseParameter(1, OLD_SAMPL_NO[i]);
  77. getDao("mesdao").update("UIH070010_03.update", param2);
  78. //处理移送接口表
  79. PosParameter param3 = new PosParameter();
  80. //2标志为移送回退的情况
  81. param3.setWhereClauseParameter(0, REG_ID[0]);
  82. param3.setWhereClauseParameter(1, OLD_SAMPL_NO[i]);
  83. param3.setWhereClauseParameter(2, SHIP_INVNO[i]);
  84. getDao("mesdao").update("UIH070010_04.update", param3);
  85. // String - BigDecimal
  86. BigDecimal bd =new BigDecimal(ACT_WGT[i]);
  87. //这里用钢卷流水号来整理进程
  88. SendProg_NIE012070( COIL_NO1[i] ,ORD_NO[i],ORD_SEQ[i],"SFA","SFF","AR",bd);
  89. //进行进程整理,这里改变了进程状态
  90. SendProg_NIE012080();
  91. }else{
  92. //这个垛位上面存在钢卷,请确认后重新输入
  93. logger.logDebug("saveYSreturn 界面输入的垛位上存在钢卷 "+COIL_NO);
  94. String vtemp="COIL_NO";
  95. context.put("rs", vtemp);
  96. }
  97. }else{
  98. //这个垛位实际不存在,在界面给出提示
  99. logger.logDebug("saveYSreturn 界面输入的垛位实际不存在 "+RTN_CUR_STORE_LOC[i]);
  100. String vtemp="CoilYard";
  101. context.put("rs", vtemp);
  102. }
  103. }else{
  104. //再次效验移送状态不为板加接收待机,不能进行热轧退回入库
  105. logger.logDebug("saveYSreturn 界面移送状态不为板加接收待机,不能进行热轧退回入库 "+MOVE_ST_TMP);
  106. String vtemp="MOVE_ST_TMP";
  107. context.put("rs", vtemp);
  108. //有一个不符合条件的,全体不能回退
  109. this.rollbackTransaction("tx1");
  110. }
  111. }
  112. }else if(MOVE_ST[i].equals("4")){
  113. // //这里处理冷轧接收等待的情况,进行回退操作
  114. // //这里要判断输入的垛位信息是否被占用已经垛位信息是否存在
  115. // PosParameter param0 = new PosParameter();
  116. // param0.setWhereClauseParameter(0, RTN_CUR_STORE_LOC[i]);
  117. //
  118. // PosRowSet CoilYardVo = getDao("mesdao").find("UIH070010_04.select", param0);
  119. //
  120. // if(CoilYardVo.hasNext()){
  121. // PosRow CoilYardRow = CoilYardVo.next();
  122. //
  123. // String COIL_NO = (String) CoilYardRow.getAttribute("COIL_NO");
  124. //
  125. // if(COIL_NO == null){
  126. // //把界面输入的垛位存在垛位表和公共表,并且需要把钢卷的状态回退到库内
  127. // PosParameter param1 = new PosParameter();
  128. //
  129. // param1.setWhereClauseParameter(0, OLD_SAMPL_NO[i]);
  130. // param1.setWhereClauseParameter(1, RTN_CUR_STORE_LOC[i]);
  131. //
  132. // getDao("mesdao").update("UIH070010_02.update", param1);
  133. //
  134. // PosParameter param2 = new PosParameter();
  135. //
  136. // param2.setWhereClauseParameter(0, RTN_CUR_STORE_LOC[i]);
  137. // param2.setWhereClauseParameter(1, OLD_SAMPL_NO[i]);
  138. //
  139. // getDao("mesdao").update("UIH070010_03.update", param2);
  140. //
  141. // //处理移送接口表
  142. // PosParameter param3 = new PosParameter();
  143. //
  144. // //2标志为移送回退的情况
  145. // param3.setWhereClauseParameter(0, REG_ID[0]);
  146. // param3.setWhereClauseParameter(1, OLD_SAMPL_NO[i]);
  147. // param3.setWhereClauseParameter(2, SHIP_INVNO_CR[i]);
  148. //
  149. // getDao("mesdao").update("UIH070010_09.update", param3);
  150. //
  151. // }else{
  152. // //这个垛位上面存在钢卷,请确认后重新输入
  153. // logger.logDebug("saveYSreturn 界面输入的垛位上存在钢卷 "+COIL_NO);
  154. // String vtemp="COIL_NO";
  155. // context.put("rs", vtemp);
  156. // }
  157. // }else{
  158. // //这个垛位实际不存在,在界面给出提示
  159. // logger.logDebug("saveYSreturn 界面输入的垛位实际不存在 "+RTN_CUR_STORE_LOC[i]);
  160. // String vtemp="CoilYard";
  161. // context.put("rs", vtemp);
  162. // }
  163. }else{
  164. //这个垛位实际不存在,在界面给出提示
  165. logger.logDebug("saveYSreturn 移送退回的状态不为板加接收等待或者冷轧接收等待,不能进行回退操作 "+MOVE_ST[i]);
  166. String vtemp="MOVE_ST";
  167. context.put("rs", vtemp);
  168. }
  169. }
  170. }
  171. return PosBizControlConstants.SUCCESS;
  172. }
  173. public void SendProg_NIE012070(String MatNo,String sOrdNo,String sOrdSeq,String sProgCd,String sBefProgCd,String sKind,BigDecimal wgt )
  174. {
  175. logger.logDebug("saveBJTransf SendProg_NIE012070 " );
  176. PosContext context = new PosContext();
  177. PosMessage message = new PosMESMessageImpl();
  178. String TcId = "NIE012070";
  179. message.setTCID(TcId);
  180. message.setObject("MSG_ID",TcId);
  181. message.setObject("BEF_ORD_NO",null);
  182. message.setObject("BEF_ORD_SEQ",null);
  183. message.setObject("ORD_NO",sOrdNo);
  184. message.setObject("ORD_SEQ",sOrdSeq);
  185. message.setObject("BEF_PROG_CD",sBefProgCd);
  186. message.setObject("PROG_CD",sProgCd);
  187. message.setObject("MAT_TYPE",sKind);
  188. message.setObject("MAT_NO",MatNo);
  189. message.setObject("WGT", wgt );
  190. message.setObject("PGMID","saveBJTransf");
  191. message.setObject("REG_ID", "UIH070010");
  192. context.setMessage(message);
  193. this.processComponent(PosConstants.CREATE_MESSAGE, context);
  194. String transactionCode = context.getMessage().getTC();
  195. message.setTCID(TcId);
  196. String serviceName = "NIE012070";
  197. String SERVICE_POSTFIX = "-service";
  198. context.put(PosBizControlConstants.SERVICE_NAME, serviceName + SERVICE_POSTFIX);
  199. context.setMessage(message);
  200. PosBizControlIF controller = PosBizProvider.getController();
  201. controller.doSubController(context,false);
  202. }
  203. public void SendProg_NIE012080(){
  204. PosContext context = new PosContext();
  205. PosMessage message = new PosMESMessageImpl();
  206. String TcId = "NIE012080";
  207. message.setTCID(TcId);
  208. message.setObject("MSG_ID",TcId);
  209. message.setObject("AA",null);
  210. context.setMessage(message);
  211. this.processComponent(PosConstants.CREATE_MESSAGE, context);
  212. String transactionCode = context.getMessage().getTC();
  213. message.setTCID(TcId);
  214. String serviceName = "NIE012080";
  215. String SERVICE_POSTFIX = "-service";
  216. context.put(PosBizControlConstants.SERVICE_NAME, serviceName + SERVICE_POSTFIX);
  217. context.setMessage(message);
  218. PosBizControlIF controller = PosBizProvider.getController();
  219. controller.doSubController(context,false);
  220. }
  221. }