合同状态同步
This commit is contained in:
		
							parent
							
								
									3bfb0429a0
								
							
						
					
					
						commit
						7ed12f2025
					
				|  | @ -79,6 +79,7 @@ public class ClosesoUpdateBL extends AbstractNCCRestResource { | |||
| public JSONString ClosesoUpdateBL(JSONString json) { | ||||
|         JSONObject errojson = new JSONObject(); | ||||
|         Set<String> vbillcodes = new HashSet<>(); | ||||
|         Set<String> billcodes = new HashSet<>(); | ||||
|         // 创建map 9-冻结; 10-办结; 11-终止; 8:生效(取消冻结) | ||||
|         Map<String, String> operationMap = new HashMap<>(); | ||||
| 
 | ||||
|  | @ -136,9 +137,8 @@ public JSONString ClosesoUpdateBL(JSONString json) { | |||
|                         "   SET h.vdef1 = '" + operationId + "' "+ | ||||
|                         "   WHERE EXISTS (" + | ||||
|                         "       SELECT 1" + | ||||
|                         "       FROM so_saleorder_b b" + | ||||
|                         " left join bd_defdoc hbd on hbd.pk_defdoc=b.vbdef1 "+ | ||||
|                         "       WHERE b.csaleorderid = h.csaleorderid" + | ||||
|                         "       FROM  bd_defdoc hbd  "+ | ||||
|                         "       WHERE hbd.pk_defdoc=h.VDEF6" + | ||||
|                         "       AND hbd.code = '" + vctcode + "' " + | ||||
|                         "   );"; | ||||
| 
 | ||||
|  | @ -153,10 +153,10 @@ public JSONString ClosesoUpdateBL(JSONString json) { | |||
|                     return ResultMessageUtil.exceptionToJSON(new NullPointerException("vctcode:null")); | ||||
|                 } | ||||
|                 // 根据组织ID和销售订单代码获取销售订单的唯一标识 | ||||
|                 String sql = " select  h.csaleorderid,b.csaleorderbid,h.ts,hbd.code as vbillcode,o.code as pk_org from so_saleorder h  " | ||||
|                 String sql = " select  h.csaleorderid,b.csaleorderbid,h.ts,hbd.code as vbillcode,o.code as pk_org,h.vbillcode as billcode from so_saleorder h  " | ||||
|                         + "left join so_saleorder_b b on h.csaleorderid=b.csaleorderid " | ||||
|                         + "left join org_salesorg o on h.pk_org=o.pk_salesorg " | ||||
|                 +" left join bd_defdoc hbd on hbd.pk_defdoc=b.vbdef1 "+ | ||||
|                 +" left join bd_defdoc hbd on hbd.pk_defdoc=h.VDEF6 "+ | ||||
| 
 | ||||
|                          "where hbd.code='" + vctcode + "' "; | ||||
|                 List<Object[]> result = (List<Object[]>) getQueryService().executeQuery(sql, new ArrayListProcessor()); | ||||
|  | @ -175,9 +175,11 @@ public JSONString ClosesoUpdateBL(JSONString json) { | |||
|                     String ts = (String) row[2]; | ||||
|                     bidsList.add(csaleorderbid + "," + ts); | ||||
|                     String vbillcode = (String) row[3]; | ||||
|                     String billcode = (String) row[5]; | ||||
|                     if (vbillcode != null) { | ||||
|                         pk_org=(String)row[4]; | ||||
|                         vbillcodes.add(vbillcode); | ||||
|                         billcodes.add(billcode); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|  | @ -239,6 +241,14 @@ public JSONString ClosesoUpdateBL(JSONString json) { | |||
| 
 | ||||
|             int succState = updateSaleBSQty(updateSql.toString()); | ||||
| 
 | ||||
|             for (String vbillcode : billcodes){ | ||||
|                 // ¸üÐÂÁ÷³ÌÉú²ú¶©µ¥ | ||||
|                 String updateSql1 = "   UPDATE mm_mo h" + | ||||
|                         "   SET h.vdef5 = '" + operationId + "' "+ | ||||
|                         "   WHERE  h.vsrccode = '" + vbillcode + "' " + | ||||
|                         "   ;"; | ||||
|                 updateSaleBSQty(updateSql1.toString()); | ||||
|             } | ||||
|             // 如果操作成功,设置错误JSON对象的code为0,表示成功 | ||||
|             errojson.put("status", "1"); | ||||
|             errojson.put("message", "销售订单状态修改了"+succState+"条,"+ret2); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue