丽知:仅退款"FANG-Q-L", "XZJJ", "dy-FQL", "pdd-yanxi", "DLTer"新增参考售价
This commit is contained in:
parent
d503154d6e
commit
b40ed31d7f
|
@ -12,9 +12,7 @@ import com.hzya.frame.plugin.lets.constant.OverallConstant;
|
|||
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
|
||||
import com.hzya.frame.plugin.lets.dao.IOnlyAfterSalesBDao;
|
||||
import com.hzya.frame.plugin.lets.dao.IOnlyAfterSalesHDao;
|
||||
import com.hzya.frame.plugin.lets.entity.BdCubasdocEntity;
|
||||
import com.hzya.frame.plugin.lets.entity.OnlyAfterSalesBEntity;
|
||||
import com.hzya.frame.plugin.lets.entity.OnlyAfterSalesHEntity;
|
||||
import com.hzya.frame.plugin.lets.entity.*;
|
||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
||||
import com.hzya.frame.plugin.lets.ofsvo.QueryReturnOrderRequestVO;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.ArapDjzb;
|
||||
|
@ -65,6 +63,8 @@ import java.util.stream.Collectors;
|
|||
@Service("refundOnlyPluginInitializerToB")
|
||||
public class RefundOnlyPluginInitializerToB extends PluginBaseEntity {
|
||||
|
||||
private List<String> referenceShopList = Arrays.asList("FANG-Q-L", "XZJJ", "dy-FQL", "pdd-yanxi", "DLTer");
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(RefundOnlyPluginInitializerToB.class);
|
||||
|
||||
@Override
|
||||
|
@ -364,6 +364,8 @@ public class RefundOnlyPluginInitializerToB extends PluginBaseEntity {
|
|||
* 因为优惠金额在表头,先按单据便利一变,具体分摊金额拆到每行,在去汇总
|
||||
*/
|
||||
public void implement(List<RerturnGoodsOrderSearchData> filterReturnGoodsOrders) throws Exception {
|
||||
|
||||
boolean isReferenceShop = false;
|
||||
//分摊分摊后的子表
|
||||
List<RerturnGoodsOrderSearchDetails> allDetail = new ArrayList<>();
|
||||
List<RerturnGoodsOrderSearchHeader> allHeader = new ArrayList<>();
|
||||
|
@ -449,6 +451,10 @@ public class RefundOnlyPluginInitializerToB extends PluginBaseEntity {
|
|||
|
||||
//zyx1店铺
|
||||
parentvo.setZyx1(split[1]);
|
||||
|
||||
if (referenceShopList.contains(split[1])) {
|
||||
isReferenceShop = true;
|
||||
}
|
||||
//zyx2来源平台
|
||||
parentvo.setZyx2(entry.getValue().get(0).getSourcePlatformCode());
|
||||
//zyx3 收发类别 销售出库,写死:SALES
|
||||
|
@ -457,7 +463,6 @@ public class RefundOnlyPluginInitializerToB extends PluginBaseEntity {
|
|||
parentvo.setZyx16("1");
|
||||
|
||||
|
||||
|
||||
//子表,需要通过多个主表的id找到多个子表,且退货金额==0的不要
|
||||
List<RerturnGoodsOrderSearchDetails> ofsDetails = new ArrayList<>();
|
||||
for (RerturnGoodsOrderSearchHeader rerturnGoodsOrderSearchHeader : entry.getValue()) {
|
||||
|
@ -524,6 +529,40 @@ public class RefundOnlyPluginInitializerToB extends PluginBaseEntity {
|
|||
//sum:zyx7 商家优惠
|
||||
// BigDecimal sum_zyx7 = new BigDecimal(0);
|
||||
|
||||
//查询是否需要参考售价
|
||||
if (isReferenceShop) {
|
||||
//查询存货基本档案,管理档案,取参考售价
|
||||
BdInvbasdocEntity bdInvbasdocEntity = queryU8CEntityUtil.queryBdInvbasdocByCode(kk);
|
||||
if (bdInvbasdocEntity == null) {
|
||||
Assert.state(false, "根据存货编码:{},查询存货基本档案失败。", kk);
|
||||
}
|
||||
BdInvmandocEntity bdInvmandocEntity = queryU8CEntityUtil.queryBdInvmandocByPkInvbasdocAndPkCorp(bdInvbasdocEntity.getPkInvbasdoc(), split[0]);
|
||||
if (bdInvmandocEntity == null) {
|
||||
Assert.state(false, "根据公司编码:{},存货主键:{},查询存货管理档案失败。", bdInvbasdocEntity.getPkInvbasdoc(), split[0]);
|
||||
}
|
||||
//参考售价
|
||||
BigDecimal refsaleprice = new BigDecimal(bdInvmandocEntity.getRefsaleprice());
|
||||
for (RerturnGoodsOrderSearchDetails detail : vv) {
|
||||
sum_jfbbje = sum_jfbbje.add(refsaleprice);
|
||||
|
||||
BigDecimal sj = refsaleprice.multiply(new BigDecimal(0.13)).setScale(2, RoundingMode.FLOOR);
|
||||
sum_jfbbsj = sum_jfbbsj.add(sj);
|
||||
|
||||
BigDecimal ws = refsaleprice.subtract(sj);
|
||||
sum_wbfbbje = sum_wbfbbje.add(ws);
|
||||
|
||||
if (detail.getPlatformDiscounts() != null) {
|
||||
sum_zyx4 = sum_zyx4.add(new BigDecimal(detail.getPlatformDiscounts()));
|
||||
}
|
||||
if (detail.getPayDiscounts() != null) {
|
||||
sum_zyx5 = sum_zyx5.add(new BigDecimal(detail.getPayDiscounts()));
|
||||
}
|
||||
if (detail.getExpertDiscounts() != null) {
|
||||
sum_zyx6 = sum_zyx6.add(new BigDecimal(detail.getExpertDiscounts()));
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
//金额计算
|
||||
for (RerturnGoodsOrderSearchDetails detail : vv) {
|
||||
sum_jfbbje = sum_jfbbje.add(new BigDecimal(detail.getTotalAmount()));
|
||||
|
@ -557,6 +596,8 @@ public class RefundOnlyPluginInitializerToB extends PluginBaseEntity {
|
|||
sum_zyx6 = sum_zyx6.add(new BigDecimal(detail.getExpertDiscounts()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
childrenn.setJfbbje("-" + sum_jfbbje);
|
||||
childrenn.setJfybje("-" + sum_jfbbje);
|
||||
childrenn.setJfbbsj("-" + sum_jfbbsj);
|
||||
|
@ -750,6 +791,7 @@ public class RefundOnlyPluginInitializerToB extends PluginBaseEntity {
|
|||
|
||||
/**
|
||||
* 公司转换
|
||||
*
|
||||
* @param allHeader
|
||||
*/
|
||||
public void transCorp(List<RerturnGoodsOrderSearchHeader> allHeader) {
|
||||
|
@ -765,11 +807,13 @@ public class RefundOnlyPluginInitializerToB extends PluginBaseEntity {
|
|||
* TOC仅退款:JTK TOB仅退款:BJTK
|
||||
* parentvo.setXslxbm("JTK");
|
||||
* 非b及c
|
||||
*
|
||||
* @param parentvo
|
||||
* @param shop
|
||||
*/
|
||||
@Autowired
|
||||
private ShopTobOrToCUtil shopTobOrToCUtil;
|
||||
|
||||
public String checkFlow(ArapDjzbVO.Parentt parentvo, String shop) {
|
||||
String tobShop = shopTobOrToCUtil.getCommaShop("TOB");
|
||||
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
||||
|
|
Loading…
Reference in New Issue