增加定时同步U8删除的销售出库单
This commit is contained in:
		
							parent
							
								
									d101a6ff1d
								
							
						
					
					
						commit
						24907cb743
					
				|  | @ -13,7 +13,6 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Component; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | @ -53,7 +52,7 @@ public class OrderU8Controller { | |||
|             result.put("code", ErrorUtils.SUCCESS); | ||||
|             result.put("msg", "操作成功"); | ||||
|         } catch (Exception e) { | ||||
|             logger.debug("U8销售出库单对接:" + e.getMessage()); | ||||
|             logger.error("U8销售出库单对接:" + e.getMessage()); | ||||
|             e.printStackTrace(); | ||||
|             result.put("data", null); | ||||
|             result.put("code", ErrorUtils.DEBUG); | ||||
|  | @ -67,31 +66,40 @@ public class OrderU8Controller { | |||
|      * | ||||
|      * @date 2024/7/22 | ||||
|      */ | ||||
|     public void delOrder() { | ||||
|     public void delOrder(Integer isTime) { | ||||
|         logger.info("only today ? " + isTime); | ||||
|         try { | ||||
|             //查询sqlserver2的008账套 | ||||
|             String time = DateUtil.getDay(); | ||||
|             Map params = new HashMap(); | ||||
|             //第一次不添加时间参数 | ||||
|             if (!"2024-07-24".equals(time)) { | ||||
|                 params.put("isTime", "1"); | ||||
|             Map<String, Object> params = new HashMap<>(); | ||||
|             if (1 == isTime) { | ||||
|                 params.put("isTime", isTime); | ||||
|             } | ||||
|             List<Map> deleteRdRecord32List = customerService.findU8List(params, ".findSqlServer2008List"); | ||||
|             String invoiceInfoIds = ""; | ||||
|             StringBuilder invoiceInfoIds = new StringBuilder(); | ||||
|             if (deleteRdRecord32List.size() > 0) { | ||||
|                 //条件查询出库单主表主键 | ||||
|                 for (Map deleteRdRecordMap : deleteRdRecord32List) { | ||||
|                     Map map = crmInvoiceService.oneById(deleteRdRecordMap, ".selectOneByCondition"); | ||||
|                     if (map != null) { | ||||
|                         invoiceInfoIds +=  map.get("id") + "-"; | ||||
|                         invoiceInfoIds.append(map.get("id")).append("-"); | ||||
|                     } | ||||
|                 } | ||||
|                 //删除子表及关联的主表 | ||||
|                 crmInvoiceService.delInvoiceDetailAndInfoByIds(invoiceInfoIds, ".delInvoiceDetailByIds"); | ||||
|                 crmInvoiceService.delInvoiceDetailAndInfoByIds(invoiceInfoIds, ".delInvoiceInfoByIds"); | ||||
|                 if (invoiceInfoIds.length() > 0 && !"".equals(invoiceInfoIds.toString())) { | ||||
|                     //删除子表及关联的主表 | ||||
|                     boolean flag = crmInvoiceService.delInvoiceDetailAndInfoByIds(invoiceInfoIds.toString(), ".delInvoiceDetailByIds"); | ||||
|                     if (!flag) { | ||||
|                         logger.error("delInvDetailByIds-fail:" + invoiceInfoIds); | ||||
|                     } | ||||
|                     boolean flag1 = crmInvoiceService.delInvoiceDetailAndInfoByIds(invoiceInfoIds.toString(), ".delInvoiceInfoByIds"); | ||||
|                     if (!flag1) { | ||||
|                         logger.error("delInvByIds-fail:" + invoiceInfoIds); | ||||
|                     } | ||||
|                 } else { | ||||
|                     logger.info("no find order:" + invoiceInfoIds.length()); | ||||
|                 } | ||||
|             } | ||||
|         } catch (Exception e) { | ||||
|             logger.debug("delOrderJob-Exception:" + e.getMessage()); | ||||
|             logger.error("delOrderJob-Exception:" + e.getMessage()); | ||||
|             e.printStackTrace(); | ||||
|         } | ||||
|     } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue