feat(deletedata): 新增销售出库单签字功能
- 新增 queryIcGeneralHBySign 方法查询需要签字的销售出库单 - 实现 saleOutSign 方法对销售出库单进行签字 - 添加相关测试用例
This commit is contained in:
parent
ac8c7ac853
commit
b6da932940
|
@ -37,7 +37,7 @@ public class DeleteU8cDataUtilTest3 {
|
||||||
// deleteU8cDataUtil.deleteIcGeneralHV2();
|
// deleteU8cDataUtil.deleteIcGeneralHV2();
|
||||||
|
|
||||||
//取消签字销售订单 *
|
//取消签字销售订单 *
|
||||||
deleteU8cDataUtil.cancelSignatureSoSaleV2();
|
// deleteU8cDataUtil.cancelSignatureSoSaleV2();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.hzya.frame.plugin.lets.util;
|
||||||
|
|
||||||
|
import com.hzya.frame.WebappApplication;
|
||||||
|
import com.hzya.frame.deletedata.DeleteU8cDataUtil;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.plugin.lets.util
|
||||||
|
* @Project:kangarooDataCenterV3
|
||||||
|
* @name:DeleteU8cDataUtilTest
|
||||||
|
* @Date:2024/12/18 18:36
|
||||||
|
* @Filename:DeleteU8cDataUtilTest
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = WebappApplication.class)
|
||||||
|
public class DeleteU8cDataUtilTest4 {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeleteU8cDataUtil deleteU8cDataUtil;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void deleteSoSaleinvoice() {
|
||||||
|
try {
|
||||||
|
//取消签字销售出库单 已测试
|
||||||
|
deleteU8cDataUtil.cancelSignatureIcGeneralHV2("'0001A110000000001TH6', '0001A1100000000VKCOK'");
|
||||||
|
//销售出库单签字 已测试
|
||||||
|
deleteU8cDataUtil.saleOutSign("'0001A110000000001TH6', '0001A1100000000VKCOK'");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -374,6 +374,54 @@ public class DeleteU8cDataUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销售出库单签字
|
||||||
|
*/
|
||||||
|
public void saleOutSign(String cbiztype) {
|
||||||
|
try {
|
||||||
|
DeleteIcGeneralHVo deleteIcGeneralHVo = new DeleteIcGeneralHVo();
|
||||||
|
deleteIcGeneralHVo.setDataSourceCode("lets_u8c");
|
||||||
|
deleteIcGeneralHVo.setCbiztype(cbiztype);
|
||||||
|
List<DeleteU8cDataUtilEntity> soSaleinvoiceEntities = deleteU8cDataUtilDao.queryIcGeneralHBySign(deleteIcGeneralHVo);
|
||||||
|
logger.info("条数:{}", soSaleinvoiceEntities.size());
|
||||||
|
if (soSaleinvoiceEntities != null && soSaleinvoiceEntities.size() > 0) {
|
||||||
|
List<List<DeleteU8cDataUtilEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(soSaleinvoiceEntities, SPLIT_VAR);
|
||||||
|
|
||||||
|
for (int i = 0; i < splitListByCount.size(); i++) {
|
||||||
|
List<DeleteU8cDataUtilEntity> deleteU8cDataUtilEntities = splitListByCount.get(i);
|
||||||
|
Map<String, List<DeleteU8cDataUtilEntity>> stringListMap = groupByDbilldate(deleteU8cDataUtilEntities);
|
||||||
|
|
||||||
|
for (Map.Entry<String, List<DeleteU8cDataUtilEntity>> entry : stringListMap.entrySet()) {
|
||||||
|
String key = entry.getKey();
|
||||||
|
List<DeleteU8cDataUtilEntity> valueList = entry.getValue();
|
||||||
|
List<String> vbillcodeList = valueList.stream().map(DeleteU8cDataUtilEntity::getVbillcode).collect(Collectors.toList());
|
||||||
|
|
||||||
|
String[] split = key.split("@@@@");
|
||||||
|
|
||||||
|
Map<String, Object> objectMap1 = new HashMap<>();
|
||||||
|
objectMap1.put("coperator", "tbadmin");
|
||||||
|
objectMap1.put("date_sign", split[0]);
|
||||||
|
|
||||||
|
Map<String, Object> objectMap2 = new HashMap<>();
|
||||||
|
objectMap2.put("corp", split[1]);
|
||||||
|
objectMap2.put("date_begin", split[0]);
|
||||||
|
objectMap2.put("date_end", split[0]);
|
||||||
|
objectMap2.put("billcode", vbillcodeList);
|
||||||
|
|
||||||
|
Map<String, Object> objectMap3 = new HashMap<>();
|
||||||
|
objectMap3.put("signInfo", objectMap1);
|
||||||
|
objectMap3.put("queryInfo", objectMap2);
|
||||||
|
|
||||||
|
sendU8C("http://39.170.109.90:8088/u8cloud/api/ic/saleout/sign", JSON.toJSONString(objectMap3));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除销售发票
|
* 删除销售发票
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -37,6 +37,13 @@ public interface DeleteU8cDataUtilDao extends IBaseDao<DeleteU8cDataUtilEntity,
|
||||||
*/
|
*/
|
||||||
List<DeleteU8cDataUtilEntity> queryIcGeneralHByCancelSignature(DeleteIcGeneralHVo deleteIcGeneralHVo) throws Exception;
|
List<DeleteU8cDataUtilEntity> queryIcGeneralHByCancelSignature(DeleteIcGeneralHVo deleteIcGeneralHVo) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询需要取消签字的销售出库单
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
List<DeleteU8cDataUtilEntity> queryIcGeneralHBySign(DeleteIcGeneralHVo deleteIcGeneralHVo) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询需要删除的销售订单
|
* 查询需要删除的销售订单
|
||||||
*
|
*
|
||||||
|
|
|
@ -38,6 +38,13 @@ public class DeleteU8cDataUtilDaoImpl extends MybatisGenericDao<DeleteU8cDataUti
|
||||||
return query("com.hzya.frame.deletedata.dao.impl.DeleteU8cDataUtilDaoImpl.queryIcGeneralHByCancelSignature", deleteIcGeneralHVo);
|
return query("com.hzya.frame.deletedata.dao.impl.DeleteU8cDataUtilDaoImpl.queryIcGeneralHByCancelSignature", deleteIcGeneralHVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DS("lets_u8c")
|
||||||
|
@Override
|
||||||
|
public List<DeleteU8cDataUtilEntity> queryIcGeneralHBySign(DeleteIcGeneralHVo deleteIcGeneralHVo) throws Exception {
|
||||||
|
return query("com.hzya.frame.deletedata.dao.impl.DeleteU8cDataUtilDaoImpl.queryIcGeneralHBySign", deleteIcGeneralHVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@DS("lets_u8c")
|
@DS("lets_u8c")
|
||||||
@Override
|
@Override
|
||||||
public List<DeleteU8cDataUtilEntity> querySoSaleByDelete(DeleteSoSaleVo deleteIcGeneralHVo) throws Exception {
|
public List<DeleteU8cDataUtilEntity> querySoSaleByDelete(DeleteSoSaleVo deleteIcGeneralHVo) throws Exception {
|
||||||
|
|
|
@ -71,13 +71,38 @@
|
||||||
b.unitcode
|
b.unitcode
|
||||||
FROM
|
FROM
|
||||||
ic_general_h a
|
ic_general_h a
|
||||||
LEFT JOIN bd_corp b ON b.pk_corp = a.pk_corp
|
LEFT JOIN bd_corp b ON b.pk_corp = a.pk_corp
|
||||||
WHERE
|
WHERE
|
||||||
a.cbiztype IN ( #{cbiztype} )
|
a.cbiztype IN ( ${cbiztype} )
|
||||||
AND ( a.fbillflag = 3 OR a.fbillflag = 4 )
|
AND ( a.fbillflag = 3 OR a.fbillflag = 4 )
|
||||||
AND a.dr = 0
|
AND a.dr = 0
|
||||||
|
AND dbilldate >= '2025-01-01'
|
||||||
|
AND dbilldate <= '2025-02-28'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryIcGeneralHBySign" parameterType="com.hzya.frame.deletedata.vo.DeleteIcGeneralHVo" resultMap="get-IcGeneralHByDelete-result">
|
||||||
|
SELECT
|
||||||
|
a.cgeneralhid,
|
||||||
|
a.vbillcode,
|
||||||
|
a.dbilldate,
|
||||||
|
a.cbiztype,
|
||||||
|
a.fbillflag,
|
||||||
|
a.pk_corp,
|
||||||
|
b.unitname,
|
||||||
|
b.unitcode
|
||||||
|
FROM
|
||||||
|
ic_general_h a
|
||||||
|
LEFT JOIN bd_corp b ON b.pk_corp = a.pk_corp
|
||||||
|
WHERE
|
||||||
|
a.cbiztype IN ( ${cbiztype} )
|
||||||
|
AND ( a.fbillflag = 2 )
|
||||||
|
AND a.dr = 0
|
||||||
|
AND dbilldate >= '2025-01-01'
|
||||||
|
AND dbilldate <= '2025-02-28'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<resultMap id="get-SoSaleByDelete-result" type="com.hzya.frame.deletedata.entity.DeleteU8cDataUtilEntity" >
|
<resultMap id="get-SoSaleByDelete-result" type="com.hzya.frame.deletedata.entity.DeleteU8cDataUtilEntity" >
|
||||||
<result property="vreceiptcode" column="vreceiptcode" jdbcType="VARCHAR"/>
|
<result property="vreceiptcode" column="vreceiptcode" jdbcType="VARCHAR"/>
|
||||||
<result property="pk_corp" column="pk_corp" jdbcType="VARCHAR"/>
|
<result property="pk_corp" column="pk_corp" jdbcType="VARCHAR"/>
|
||||||
|
|
Loading…
Reference in New Issue