diff --git a/service/src/main/java/com/hzya/frame/deletedata/DeleteU8cDataUtil.java b/service/src/main/java/com/hzya/frame/deletedata/DeleteU8cDataUtil.java index b10c166d..0d16af5a 100644 --- a/service/src/main/java/com/hzya/frame/deletedata/DeleteU8cDataUtil.java +++ b/service/src/main/java/com/hzya/frame/deletedata/DeleteU8cDataUtil.java @@ -65,7 +65,7 @@ public class DeleteU8cDataUtil { @PostConstruct public void init() { - deleteTargetU8cData(); +// deleteTargetU8cData(); } public void deleteTargetU8cData() { @@ -112,13 +112,13 @@ public class DeleteU8cDataUtil { //修复销售订单部门字段错误问题 repairSoSaleDepartment(); //销售订单审核 - salesOrderReviewV2(); +// salesOrderReviewV2(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("等待线程完成时中断", e); } } - }, "U8C单据逻辑处理"); + }, "U8C单据逻辑处理:修复销售订单部门字段错误问题"); thread000.start(); } @@ -1420,7 +1420,7 @@ public class DeleteU8cDataUtil { //注意⚠️这里只能审核已经修复完毕的销售订单!并且处理自由状态 List deleteU8cDataUtilEntities = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V3(); if (deleteU8cDataUtilEntities.size() > 0) { - List> lists = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities, 100); + List> lists = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities, 500); for (int i = 0; i < lists.size(); i++) { List deleteU8cDataUtilEntities1 = lists.get(i); String concatenatedIds = deleteU8cDataUtilEntities1.stream().map(DeleteU8cDataUtilEntity::getCsaleid).map(csaleid -> "'" + csaleid + "'").collect(Collectors.joining(",")); @@ -1462,12 +1462,15 @@ public class DeleteU8cDataUtil { //再次确认是否存在已经修复完毕,但未审核的销售订单 List deleteU8cDataUtilEntities22All = new ArrayList<>(); List deleteU8cDataUtilEntities2 = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V3(); - if (deleteU8cDataUtilEntities2 != null) { + if (deleteU8cDataUtilEntities2 != null && deleteU8cDataUtilEntities2.size() > 0) { List> lists = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities2, 999); for (int i = 0; i < lists.size(); i++) { List deleteU8cDataUtilEntities1 = lists.get(i); String concatenatedIds = deleteU8cDataUtilEntities1.stream().map(DeleteU8cDataUtilEntity::getCsaleid).map(csaleid -> "'" + csaleid + "'").collect(Collectors.joining(",")); + if (concatenatedIds == null || "".equals(concatenatedIds.trim())) { + throw new Exception("concatenatedIds == null || \"\".equals(concatenatedIds)"); + } DeleteSoSaleVo deleteSoSaleVo = new DeleteSoSaleVo(); deleteSoSaleVo.setDataSourceCode("lets_u8c"); deleteSoSaleVo.setCsaleids(concatenatedIds); @@ -1490,89 +1493,89 @@ public class DeleteU8cDataUtil { * * @author liuyang */ - public void unApprovalDeleteAccountsReceivable() { - try { - //确定销售订单范围、19648 - List deleteU8cDataUtilEntities = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V2(); - if (deleteU8cDataUtilEntities.size() > 0) { - List> lists = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities, 500); - for (int i = 0; i < lists.size(); i++) { - List deleteU8cDataUtilEntities1 = lists.get(i); - String concatenatedIds = deleteU8cDataUtilEntities1.stream().map(DeleteU8cDataUtilEntity::getCsaleid).map(csaleid -> "'" + csaleid + "'").collect(Collectors.joining(",")); - //查询需要弃审的应收单 - Map>> mapList = new HashMap(); - List> mapList1 = new ArrayList<>(); - - DeleteSoSaleVo deleteSoSaleVo = new DeleteSoSaleVo(); - deleteSoSaleVo.setCsaleid(concatenatedIds); - deleteSoSaleVo.setSpzt("1"); - List arapDjzbVos = deleteU8cDataUtilDao.abandonmentAccountsReceivableDocV2(deleteSoSaleVo); - if (arapDjzbVos != null && arapDjzbVos.size() > 0) { - for (int j = 0; j < arapDjzbVos.size(); j++) { - ArapDjzbVo arapDjzbVo = arapDjzbVos.get(j); - - Map stringStringMap = new HashMap<>(); - stringStringMap.put("djbh", arapDjzbVo.getDjbh());//单据编码 - stringStringMap.put("dwbm", arapDjzbVo.getUnitcode());//公司编码 - stringStringMap.put("operatedate", arapDjzbVo.getDjrq());//单据日期 - stringStringMap.put("operatorid", "18846145294");//操作人编码 - mapList1.add(stringStringMap); - } - } - - if (mapList1.size() > 0) { - mapList.put("bills", mapList1); -// sendU8C("http://39.170.109.90:8088/u8cloud/api/arap/ys/unaudit", JSON.toJSONString(mapList), mapList1.size()); - } - - //删除应收单 - DeleteSoSaleVo deleteSoSaleVo2 = new DeleteSoSaleVo(); - deleteSoSaleVo2.setCsaleid(concatenatedIds); -// deleteSoSaleVo2.setSpzt("1"); - deleteSoSaleVo2.setSpztnull("1");//a.spzt is null - List arapDjzbVos2 = deleteU8cDataUtilDao.abandonmentAccountsReceivableDocV2(deleteSoSaleVo2); - for (int j = 0; j < arapDjzbVos2.size(); j++) { - ArapDjzbVo arapDjzbVo = arapDjzbVos2.get(j); - - Map stringStringMap = new HashMap<>(); - stringStringMap.put("coperator", "tbadmin"); - - Map stringStringMap2 = new HashMap<>(); - stringStringMap2.put("dwbm", arapDjzbVo.getUnitcode()); - stringStringMap2.put("djbh_from", arapDjzbVo.getDjbh()); - stringStringMap2.put("djbh_to", arapDjzbVo.getDjbh()); - - Map> stringStringMap3 = new HashMap<>(); - stringStringMap3.put("deleteinfo", stringStringMap); - stringStringMap3.put("queryinfo", stringStringMap2); -// sendU8C("http://39.170.109.90:8088/u8cloud/api/arap/ys/delete", JSON.toJSONString(stringStringMap3), 1); - } - } - } - - //判断是否存在失败的应收单 - List arapDjzbVosAll = new ArrayList<>(); - List deleteU8cDataUtilEntities2 = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V2(); - if (deleteU8cDataUtilEntities2.size() > 0) { - List> lists = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities2, 999); - for (int i = 0; i < lists.size(); i++) { - List deleteU8cDataUtilEntities1 = lists.get(i); - String concatenatedIds = deleteU8cDataUtilEntities1.stream().map(DeleteU8cDataUtilEntity::getCsaleid).map(csaleid -> "'" + csaleid + "'").collect(Collectors.joining(",")); - - DeleteSoSaleVo deleteSoSaleVo = new DeleteSoSaleVo(); - deleteSoSaleVo.setCsaleid(concatenatedIds); - deleteSoSaleVo.setSpzt("0,1,2,null"); - List arapDjzbVos = deleteU8cDataUtilDao.abandonmentAccountsReceivableDocV2(deleteSoSaleVo); - arapDjzbVosAll.addAll(arapDjzbVos); - } - } - if (arapDjzbVosAll.size() > 0) { - unApprovalDeleteAccountsReceivable(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } +// public void unApprovalDeleteAccountsReceivable() { +// try { +// //确定销售订单范围、19648 +// List deleteU8cDataUtilEntities = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V2(); +// if (deleteU8cDataUtilEntities.size() > 0) { +// List> lists = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities, 500); +// for (int i = 0; i < lists.size(); i++) { +// List deleteU8cDataUtilEntities1 = lists.get(i); +// String concatenatedIds = deleteU8cDataUtilEntities1.stream().map(DeleteU8cDataUtilEntity::getCsaleid).map(csaleid -> "'" + csaleid + "'").collect(Collectors.joining(",")); +// //查询需要弃审的应收单 +// Map>> mapList = new HashMap(); +// List> mapList1 = new ArrayList<>(); +// +// DeleteSoSaleVo deleteSoSaleVo = new DeleteSoSaleVo(); +// deleteSoSaleVo.setCsaleid(concatenatedIds); +// deleteSoSaleVo.setSpzt("1"); +// List arapDjzbVos = deleteU8cDataUtilDao.abandonmentAccountsReceivableDocV2(deleteSoSaleVo); +// if (arapDjzbVos != null && arapDjzbVos.size() > 0) { +// for (int j = 0; j < arapDjzbVos.size(); j++) { +// ArapDjzbVo arapDjzbVo = arapDjzbVos.get(j); +// +// Map stringStringMap = new HashMap<>(); +// stringStringMap.put("djbh", arapDjzbVo.getDjbh());//单据编码 +// stringStringMap.put("dwbm", arapDjzbVo.getUnitcode());//公司编码 +// stringStringMap.put("operatedate", arapDjzbVo.getDjrq());//单据日期 +// stringStringMap.put("operatorid", "18846145294");//操作人编码 +// mapList1.add(stringStringMap); +// } +// } +// +// if (mapList1.size() > 0) { +// mapList.put("bills", mapList1); +//// sendU8C("http://39.170.109.90:8088/u8cloud/api/arap/ys/unaudit", JSON.toJSONString(mapList), mapList1.size()); +// } +// +// //删除应收单 +// DeleteSoSaleVo deleteSoSaleVo2 = new DeleteSoSaleVo(); +// deleteSoSaleVo2.setCsaleid(concatenatedIds); +//// deleteSoSaleVo2.setSpzt("1"); +// deleteSoSaleVo2.setSpztnull("1");//a.spzt is null +// List arapDjzbVos2 = deleteU8cDataUtilDao.abandonmentAccountsReceivableDocV2(deleteSoSaleVo2); +// for (int j = 0; j < arapDjzbVos2.size(); j++) { +// ArapDjzbVo arapDjzbVo = arapDjzbVos2.get(j); +// +// Map stringStringMap = new HashMap<>(); +// stringStringMap.put("coperator", "tbadmin"); +// +// Map stringStringMap2 = new HashMap<>(); +// stringStringMap2.put("dwbm", arapDjzbVo.getUnitcode()); +// stringStringMap2.put("djbh_from", arapDjzbVo.getDjbh()); +// stringStringMap2.put("djbh_to", arapDjzbVo.getDjbh()); +// +// Map> stringStringMap3 = new HashMap<>(); +// stringStringMap3.put("deleteinfo", stringStringMap); +// stringStringMap3.put("queryinfo", stringStringMap2); +//// sendU8C("http://39.170.109.90:8088/u8cloud/api/arap/ys/delete", JSON.toJSONString(stringStringMap3), 1); +// } +// } +// } +// +// //判断是否存在失败的应收单 +// List arapDjzbVosAll = new ArrayList<>(); +// List deleteU8cDataUtilEntities2 = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V2(); +// if (deleteU8cDataUtilEntities2.size() > 0) { +// List> lists = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities2, 999); +// for (int i = 0; i < lists.size(); i++) { +// List deleteU8cDataUtilEntities1 = lists.get(i); +// String concatenatedIds = deleteU8cDataUtilEntities1.stream().map(DeleteU8cDataUtilEntity::getCsaleid).map(csaleid -> "'" + csaleid + "'").collect(Collectors.joining(",")); +// +// DeleteSoSaleVo deleteSoSaleVo = new DeleteSoSaleVo(); +// deleteSoSaleVo.setCsaleid(concatenatedIds); +// deleteSoSaleVo.setSpzt("0,1,2,null"); +// List arapDjzbVos = deleteU8cDataUtilDao.abandonmentAccountsReceivableDocV2(deleteSoSaleVo); +// arapDjzbVosAll.addAll(arapDjzbVos); +// } +// } +// if (arapDjzbVosAll.size() > 0) { +// unApprovalDeleteAccountsReceivable(); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } /** * 汇总相同时间+公司的单据 @@ -1589,4 +1592,4 @@ public class DeleteU8cDataUtil { // } // return resultMap; // } -} +} \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/deletedata/dao/impl/DeleteU8cDataUtilDaoImpl.java b/service/src/main/java/com/hzya/frame/deletedata/dao/impl/DeleteU8cDataUtilDaoImpl.java index 1cede6a9..d8dbc09b 100644 --- a/service/src/main/java/com/hzya/frame/deletedata/dao/impl/DeleteU8cDataUtilDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/deletedata/dao/impl/DeleteU8cDataUtilDaoImpl.java @@ -58,6 +58,12 @@ public class DeleteU8cDataUtilDaoImpl extends MybatisGenericDao querySoSaleByDeletev2(DeleteSoSaleVo deleteSoSaleVo) throws Exception { + if (deleteSoSaleVo.getCsaleids() == null || "".equals(deleteSoSaleVo.getCsaleids())) { + throw new Exception("deleteSoSaleVo.getCsaleids() == null || \"\".equals(deleteSoSaleVo.getCsaleids())"); + } +// if (deleteSoSaleVo.getFstatus() == null || "".equals(deleteSoSaleVo.getFstatus())) { +// throw new Exception("deleteSoSaleVo.getFstatus() == null || \"\".equals(deleteSoSaleVo.getFstatus())"); +// } return query("com.hzya.frame.deletedata.dao.impl.DeleteU8cDataUtilDaoImpl.querySoSaleByDeletev2", deleteSoSaleVo); } @@ -109,6 +115,7 @@ public class DeleteU8cDataUtilDaoImpl extends MybatisGenericDao) selectList("com.hzya.frame.deletedata.dao.impl.DeleteU8cDataUtilDaoImpl.abandonmentAccountsReceivableDocV2", deleteSoSaleVo); } + @DS("lets_u8c") @Override public List cancelSignatureSoSaleReadExcel20250528V3() throws Exception { return query("com.hzya.frame.deletedata.dao.impl.DeleteU8cDataUtilDaoImpl.cancelSignatureSoSaleReadExcel20250528V3", new DeleteU8cDataUtilEntity()); diff --git a/service/src/main/java/com/hzya/frame/deletedata/entity/DeleteU8cDataUtilEntity.xml b/service/src/main/java/com/hzya/frame/deletedata/entity/DeleteU8cDataUtilEntity.xml index a13de414..8cf8a81e 100644 --- a/service/src/main/java/com/hzya/frame/deletedata/entity/DeleteU8cDataUtilEntity.xml +++ b/service/src/main/java/com/hzya/frame/deletedata/entity/DeleteU8cDataUtilEntity.xml @@ -311,7 +311,7 @@ AND a.cdeptid NOT IN ( SELECT pk_deptdoc FROM bd_deptdoc WHERE deptname = '业务部门' AND dr = 0 ) AND a.cdeptid IS NOT NULL and a.pk_corp != c.pk_corp - -- and a.csaleid = '1001A1100000000FC70H' + -- and a.csaleid = '1001A1100000000FBSGV'