丽知:新增公司三对一方法

This commit is contained in:
zhengyf 2024-10-26 14:15:09 +08:00
parent 29a17362b2
commit 6417c9c1fd
1 changed files with 35 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.stream.Collectors;
/**
* 查询U8C实体工具类返回对象
@ -280,4 +281,38 @@ public class QueryU8CEntityUtil {
return bdCostsubjEntityList.get(0);
}
////////////////////////////////////////////////////////////////////////////////////////存货分类-收支项目结束
////////////////////////////////////////////////////////////////////////////////////////公司自定义档案查询
/**
* 公司三对一
* KS 上海棵丝网络科技有限公司
* YX 杭州言禧电子商务有限公司
* YD 杭州盈达电子商务有限公司
* 都传到 YD,杭州盈达电子商务有限公司
* SELECT * FROM BD_DEFDOC WHERE pk_defdoclist=(SELECT pk_defdoclist FROM BD_DEFDOCLIST WHERE doclistcode='GSDY')-- 0001A11000000004XB42
* @param corpCode 公司编码
* @return corpCode 如果时需要转换的会自动转换如果不需要返回原始公司编码
*/
public String queryBdDefDocByPkDefDocList(String corpCode){
Assert.notNull(corpCode,"公司三对一,入参公司不能为空!!!");
BdDefdocEntity bdDefdocEntity = new BdDefdocEntity();
bdDefdocEntity.setPkDefdoclist("0001A11000000004XB42");
bdDefdocEntity.setDr(0);
bdDefdocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
List<BdDefdocEntity> bdDefdocEntityList = iBdDefdocDao.query(bdDefdocEntity);
if (bdDefdocEntityList.size() == 0) {
Assert.state(false,"根据自定义档案列表编码GSDY主键[0001A11000000004XB42],未查询到自定义档案");
}
List<String> corpCollect = bdDefdocEntityList.stream().map(BdDefdocEntity::getDoccode).collect(Collectors.toList());
if(corpCollect.contains(corpCode)){
String memo = bdDefdocEntityList.get(0).getMemo();
String[] split = memo.split(",");
corpCode=split[0];
}
return corpCode;
}
////////////////////////////////////////////////////////////////////////////////////////公司自定义档案查询
}