feat(deletedata): 新增应收单处理功能
- 在 DeleteU8cDataUtilDao 中添加了 abandonmentAccountsReceivableDocV2 方法,用于查询应收单 - 在 DeleteU8cDataUtil 中实现了 unApprovalDeleteAccountsReceivable 方法,用于弃审和删除应收单 - 新增了 ArapDjzbVo 类,用于存储应收单信息 - 在 DeleteSoSaleVo 中添加了 spzt 和 spztnull 字段,用于筛选应收单状态
This commit is contained in:
parent
8de9240c03
commit
e7a43b9833
|
@ -52,10 +52,14 @@ public class DeleteU8cDataUtil {
|
||||||
|
|
||||||
private static final Object LOCK_OBJECT = new Object();
|
private static final Object LOCK_OBJECT = new Object();
|
||||||
|
|
||||||
|
private static final Object LOCK_OBJECT2 = new Object();
|
||||||
|
|
||||||
private static final Integer SPLIT_VAR = 1000;
|
private static final Integer SPLIT_VAR = 1000;
|
||||||
|
|
||||||
private static Integer MARK = 0;
|
private static Integer MARK = 0;
|
||||||
|
|
||||||
|
private static Integer MARK2 = 0;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
deleteTargetU8cData();
|
deleteTargetU8cData();
|
||||||
|
@ -68,27 +72,27 @@ public class DeleteU8cDataUtil {
|
||||||
synchronized (LOCK_OBJECT) {
|
synchronized (LOCK_OBJECT) {
|
||||||
if (MARK == 0) {
|
if (MARK == 0) {
|
||||||
MARK = 1;
|
MARK = 1;
|
||||||
//删除销售发票
|
|
||||||
// deleteSoSaleinvoice();
|
|
||||||
//删除销售出库单
|
//删除销售出库单
|
||||||
// deleteIcGeneralH();
|
cancelSignatureSoSaleReadExcel20250528V2();
|
||||||
//删除销售订单
|
|
||||||
// deleteSoSale();
|
|
||||||
//取消签字销售出库单 已测试
|
|
||||||
// cancelSignatureIcGeneralHV2("'0001A110000000001TH6', '0001A1100000000VKCOK'");
|
|
||||||
//销售出库单签字 已测试
|
|
||||||
// saleOutSign("'0001A110000000001TH6', '0001A1100000000VKCOK'");
|
|
||||||
|
|
||||||
// cancelSignatureSoSaleReadExcelV2();
|
|
||||||
|
|
||||||
// cancelSignatureSoSaleReadExcel20250528V2();
|
|
||||||
// abandonmentReviewSoSaleinvoice2505282107();
|
|
||||||
// cancelSignatureSoSaleReadExcel2505282140V2();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, "删除销售订单 2025-05-07");
|
}, "删除销售出库单 2025-05-29");
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
||||||
|
Thread thread2 = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
synchronized (LOCK_OBJECT2) {
|
||||||
|
if (MARK2 == 0) {
|
||||||
|
MARK2 = 1;
|
||||||
|
//删除销售发票
|
||||||
|
abandonmentReviewSoSaleinvoice2505282107();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, "删除销售发票 2025-05-29");
|
||||||
|
thread2.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1241,8 +1245,8 @@ public class DeleteU8cDataUtil {
|
||||||
|
|
||||||
//判断是否还存在需要删除的发票
|
//判断是否还存在需要删除的发票
|
||||||
List<DeleteU8cDataUtilEntity> soSaleinvoiceEntities2All = new ArrayList<>();
|
List<DeleteU8cDataUtilEntity> soSaleinvoiceEntities2All = new ArrayList<>();
|
||||||
List<DeleteU8cDataUtilEntity> deleteU8cDataUtilEntities2 = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V2();
|
// List<DeleteU8cDataUtilEntity> deleteU8cDataUtilEntities2 = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V2();
|
||||||
List<List<DeleteU8cDataUtilEntity>> lists2 = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities2, 999);
|
List<List<DeleteU8cDataUtilEntity>> lists2 = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities, 999);
|
||||||
for (int i = 0; i < lists2.size(); i++) {
|
for (int i = 0; i < lists2.size(); i++) {
|
||||||
List<DeleteU8cDataUtilEntity> deleteU8cDataUtilEntities1 = lists2.get(i);
|
List<DeleteU8cDataUtilEntity> deleteU8cDataUtilEntities1 = lists2.get(i);
|
||||||
String concatenatedIds = deleteU8cDataUtilEntities1.stream().map(DeleteU8cDataUtilEntity::getCsaleid).map(csaleid -> "'" + csaleid + "'").collect(Collectors.joining(","));
|
String concatenatedIds = deleteU8cDataUtilEntities1.stream().map(DeleteU8cDataUtilEntity::getCsaleid).map(csaleid -> "'" + csaleid + "'").collect(Collectors.joining(","));
|
||||||
|
@ -1442,4 +1446,109 @@ public class DeleteU8cDataUtil {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 弃审+删除应收单
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
public void unApprovalDeleteAccountsReceivable() {
|
||||||
|
try {
|
||||||
|
//确定销售订单范围、19648
|
||||||
|
List<DeleteU8cDataUtilEntity> deleteU8cDataUtilEntities = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V2();
|
||||||
|
if (deleteU8cDataUtilEntities.size() > 0) {
|
||||||
|
List<List<DeleteU8cDataUtilEntity>> lists = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities, 500);
|
||||||
|
for (int i = 0; i < lists.size(); i++) {
|
||||||
|
List<DeleteU8cDataUtilEntity> deleteU8cDataUtilEntities1 = lists.get(i);
|
||||||
|
String concatenatedIds = deleteU8cDataUtilEntities1.stream().map(DeleteU8cDataUtilEntity::getCsaleid).map(csaleid -> "'" + csaleid + "'").collect(Collectors.joining(","));
|
||||||
|
//查询需要弃审的应收单
|
||||||
|
Map<String, List<Map<String, String>>> mapList = new HashMap();
|
||||||
|
List<Map<String, String>> mapList1 = new ArrayList<>();
|
||||||
|
|
||||||
|
DeleteSoSaleVo deleteSoSaleVo = new DeleteSoSaleVo();
|
||||||
|
deleteSoSaleVo.setCsaleid(concatenatedIds);
|
||||||
|
deleteSoSaleVo.setSpzt("1");
|
||||||
|
List<ArapDjzbVo> arapDjzbVos = deleteU8cDataUtilDao.abandonmentAccountsReceivableDocV2(deleteSoSaleVo);
|
||||||
|
if (arapDjzbVos != null && arapDjzbVos.size() > 0) {
|
||||||
|
for (int j = 0; j < arapDjzbVos.size(); j++) {
|
||||||
|
ArapDjzbVo arapDjzbVo = arapDjzbVos.get(j);
|
||||||
|
|
||||||
|
Map<String, String> 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<ArapDjzbVo> arapDjzbVos2 = deleteU8cDataUtilDao.abandonmentAccountsReceivableDocV2(deleteSoSaleVo2);
|
||||||
|
for (int j = 0; j < arapDjzbVos2.size(); j++) {
|
||||||
|
ArapDjzbVo arapDjzbVo = arapDjzbVos2.get(j);
|
||||||
|
|
||||||
|
Map<String, String> stringStringMap = new HashMap<>();
|
||||||
|
stringStringMap.put("coperator", "tbadmin");
|
||||||
|
|
||||||
|
Map<String, String> stringStringMap2 = new HashMap<>();
|
||||||
|
stringStringMap2.put("dwbm", arapDjzbVo.getUnitcode());
|
||||||
|
stringStringMap2.put("djbh_from", arapDjzbVo.getDjbh());
|
||||||
|
stringStringMap2.put("djbh_to", arapDjzbVo.getDjbh());
|
||||||
|
|
||||||
|
Map<String, Map<String, String>> 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<ArapDjzbVo> arapDjzbVosAll = new ArrayList<>();
|
||||||
|
List<DeleteU8cDataUtilEntity> deleteU8cDataUtilEntities2 = deleteU8cDataUtilDao.cancelSignatureSoSaleReadExcel20250528V2();
|
||||||
|
if (deleteU8cDataUtilEntities2.size() > 0) {
|
||||||
|
List<List<DeleteU8cDataUtilEntity>> lists = SplitListByCountUtil.splitListByCount(deleteU8cDataUtilEntities2, 999);
|
||||||
|
for (int i = 0; i < lists.size(); i++) {
|
||||||
|
List<DeleteU8cDataUtilEntity> 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<ArapDjzbVo> arapDjzbVos = deleteU8cDataUtilDao.abandonmentAccountsReceivableDocV2(deleteSoSaleVo);
|
||||||
|
arapDjzbVosAll.addAll(arapDjzbVos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (arapDjzbVosAll.size() > 0) {
|
||||||
|
unApprovalDeleteAccountsReceivable();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 汇总相同时间+公司的单据
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
// private void repairSoSaleDepartment(List<ArapDjzbVo> arapDjzbVos) {
|
||||||
|
// Map<String, List<ArapDjzbVo>> resultMap = new HashMap<>();
|
||||||
|
// for (ArapDjzbVo entity : arapDjzbVos) {
|
||||||
|
// String dbilldate = entity.getDbilldate();
|
||||||
|
// String unitcode = entity.getUnitcode();
|
||||||
|
// // 如果 map 中不包含该日期,则创建一个新的列表
|
||||||
|
// resultMap.computeIfAbsent(dbilldate + "@@@@" + unitcode, k -> new ArrayList<>()).add(entity);
|
||||||
|
// }
|
||||||
|
// return resultMap;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,7 @@ package com.hzya.frame.deletedata.dao;
|
||||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
import com.hzya.frame.deletedata.entity.DeleteU8cDataUtilEntity;
|
import com.hzya.frame.deletedata.entity.DeleteU8cDataUtilEntity;
|
||||||
//import com.hzya.frame.deletedata.vo.DeleteArapDjzbVo;
|
//import com.hzya.frame.deletedata.vo.DeleteArapDjzbVo;
|
||||||
import com.hzya.frame.deletedata.vo.DeleteIcGeneralHVo;
|
import com.hzya.frame.deletedata.vo.*;
|
||||||
import com.hzya.frame.deletedata.vo.DeleteSoSaleVo;
|
|
||||||
import com.hzya.frame.deletedata.vo.QueryCorrectDeptIdVo;
|
|
||||||
import com.hzya.frame.deletedata.vo.UpdateSoSaleCdeptId;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -117,4 +114,11 @@ public interface DeleteU8cDataUtilDao extends IBaseDao<DeleteU8cDataUtilEntity,
|
||||||
* @author liuyang
|
* @author liuyang
|
||||||
*/
|
*/
|
||||||
void updateCdeptid(UpdateSoSaleCdeptId updateSoSaleCdeptId) throws Exception;
|
void updateCdeptid(UpdateSoSaleCdeptId updateSoSaleCdeptId) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据销售订单查找应收单
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
List<ArapDjzbVo> abandonmentAccountsReceivableDocV2(DeleteSoSaleVo deleteSoSaleVo) throws Exception;
|
||||||
}
|
}
|
|
@ -102,5 +102,11 @@ public class DeleteU8cDataUtilDaoImpl extends MybatisGenericDao<DeleteU8cDataUti
|
||||||
public void updateCdeptid(UpdateSoSaleCdeptId updateSoSaleCdeptId) throws Exception {
|
public void updateCdeptid(UpdateSoSaleCdeptId updateSoSaleCdeptId) throws Exception {
|
||||||
update("com.hzya.frame.deletedata.dao.impl.DeleteU8cDataUtilDaoImpl.updateCdeptid", updateSoSaleCdeptId);
|
update("com.hzya.frame.deletedata.dao.impl.DeleteU8cDataUtilDaoImpl.updateCdeptid", updateSoSaleCdeptId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DS("lets_u8c")
|
||||||
|
@Override
|
||||||
|
public List<ArapDjzbVo> abandonmentAccountsReceivableDocV2(DeleteSoSaleVo deleteSoSaleVo) throws Exception {
|
||||||
|
return (List<ArapDjzbVo>) selectList("com.hzya.frame.deletedata.dao.impl.DeleteU8cDataUtilDaoImpl.abandonmentAccountsReceivableDocV2", deleteSoSaleVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -369,5 +369,67 @@
|
||||||
<update id="updateCdeptid" parameterType="com.hzya.frame.deletedata.vo.UpdateSoSaleCdeptId">
|
<update id="updateCdeptid" parameterType="com.hzya.frame.deletedata.vo.UpdateSoSaleCdeptId">
|
||||||
update so_sale set cdeptid=#{cdeptid} where csaleid = #{csaleid} and dr = 0
|
update so_sale set cdeptid=#{cdeptid} where csaleid = #{csaleid} and dr = 0
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!--根据销售订单主键,查询对应的应收单-->
|
||||||
|
<select id="abandonmentAccountsReceivableDocV2" parameterType="com.hzya.frame.deletedata.vo.DeleteSoSaleVo" resultMap="abandonmentAccountsReceivableDocV2ResultMap">
|
||||||
|
SELECT
|
||||||
|
a.djbh,
|
||||||
|
a.djrq,
|
||||||
|
a.dwbm,
|
||||||
|
a.vouchid,
|
||||||
|
a.spzt,
|
||||||
|
b.unitname,
|
||||||
|
b.unitcode
|
||||||
|
FROM
|
||||||
|
arap_djzb a
|
||||||
|
LEFT JOIN bd_corp b ON a.DWBM = b.pk_corp
|
||||||
|
WHERE
|
||||||
|
a.vouchid IN (
|
||||||
|
SELECT
|
||||||
|
vouchid
|
||||||
|
FROM
|
||||||
|
arap_djfb
|
||||||
|
WHERE
|
||||||
|
ddlx IN (
|
||||||
|
SELECT
|
||||||
|
a.csaleid
|
||||||
|
FROM
|
||||||
|
so_saleinvoice a
|
||||||
|
LEFT JOIN bd_corp b ON b.pk_corp = a.pk_corp
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
AND a.csaleid IN (
|
||||||
|
SELECT
|
||||||
|
csaleid
|
||||||
|
FROM
|
||||||
|
so_saleinvoice_b
|
||||||
|
WHERE
|
||||||
|
csourcebillid IN (
|
||||||
|
${csaleid}
|
||||||
|
)
|
||||||
|
AND dr = 0
|
||||||
|
)
|
||||||
|
AND a.dr = 0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
<if test="spzt!=null and spzt!=''">
|
||||||
|
AND a.spzt in (${spzt})
|
||||||
|
</if>
|
||||||
|
<if test="spztnull!=null and spztnull='1'">
|
||||||
|
AND a.spzt is null
|
||||||
|
</if>
|
||||||
|
AND a.spzt in (${spzt})
|
||||||
|
AND a.dr = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<resultMap id="abandonmentAccountsReceivableDocV2ResultMap" type="com.hzya.frame.deletedata.vo.ArapDjzbVo">
|
||||||
|
<result property="djbh" column="djbh" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dwbm" column="dwbm" jdbcType="VARCHAR"/>
|
||||||
|
<result property="vouchid" column="vouchid" jdbcType="VARCHAR"/>
|
||||||
|
<result property="spzt" column="spzt" jdbcType="VARCHAR"/>
|
||||||
|
<result property="unitname" column="unitname" jdbcType="VARCHAR"/>
|
||||||
|
<result property="unitcode" column="unitcode" jdbcType="VARCHAR"/>
|
||||||
|
<result property="djrq" column="djrq" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.hzya.frame.deletedata.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.deletedata.vo
|
||||||
|
* @Project:kangarooDataCenterV3
|
||||||
|
* @name:ArapDjzbVo
|
||||||
|
* @Date:2025/5/29 15:55
|
||||||
|
* @Filename:ArapDjzbVo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ArapDjzbVo {
|
||||||
|
private String djbh;
|
||||||
|
private String dwbm;
|
||||||
|
private String vouchid;
|
||||||
|
private String spzt;
|
||||||
|
private String unitname;
|
||||||
|
private String unitcode;
|
||||||
|
private String djrq;
|
||||||
|
}
|
|
@ -20,6 +20,24 @@ public class DeleteSoSaleVo extends BaseEntity {
|
||||||
private String unitname;
|
private String unitname;
|
||||||
private String unitcode;
|
private String unitcode;
|
||||||
private String csaleids;
|
private String csaleids;
|
||||||
|
private String spzt;
|
||||||
|
private String spztnull;
|
||||||
|
|
||||||
|
public String getSpztnull() {
|
||||||
|
return spztnull;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpztnull(String spztnull) {
|
||||||
|
this.spztnull = spztnull;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpzt() {
|
||||||
|
return spzt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpzt(String spzt) {
|
||||||
|
this.spzt = spzt;
|
||||||
|
}
|
||||||
|
|
||||||
public String getCsaleids() {
|
public String getCsaleids() {
|
||||||
return csaleids;
|
return csaleids;
|
||||||
|
|
Loading…
Reference in New Issue