关系表修改

jg-waiwang-pro
vayne 3 months ago
parent bee34eae3a
commit 9e43a9682f

@ -41,30 +41,22 @@
<select id="queryOutboundProductPurchase" resultMap="OutboundProduct"> <select id="queryOutboundProductPurchase" resultMap="OutboundProduct">
SELECT SELECT
a.*, e.CODE,
b.batch_no, f.NAME,
c.receipt_code AS deliveryCode, g.contract_number AS contractName,
d.CODE, c.ord_ln AS ordLn
e.NAME,
g.contract_name AS contractName,
b.ord_ln AS ordLn
FROM FROM
jg_warehousing_outbound_product a jg_warehousing_outbound a
LEFT JOIN jg_delivery_product_relation b ON a.batch_number = b.batch_no LEFT JOIN jg_warehousing_outbound_product b ON a.id = b.warehousing_outbound_id
LEFT JOIN jg_receipt_order c ON b.order_id = c.id LEFT JOIN jg_delivery_product_relation c ON b.batch_number = c.batch_no
LEFT JOIN jg_business_order d ON c.business_id = d.id LEFT JOIN jg_receipt_order d ON c.order_id = d.id
LEFT JOIN jg_subject_basic e ON d.first_subject_basic_id = e.id LEFT JOIN jg_business_order e ON d.business_id = e.id
LEFT JOIN jg_contract g ON d.contract_id = g.id LEFT JOIN jg_subject_basic f ON e.first_subject_basic_id = f.id
LEFT JOIN jg_warehousing_outbound h ON a.warehousing_outbound_id = h.id LEFT JOIN jg_contract g ON e.contract_id = g.id
LEFT JOIN jg_cw_account_storage i ON h.document_no = i.document_no
WHERE WHERE
i.account_id = #{id} a.id = #{id}
AND b.business_type = '1' AND c.business_type = '1'
AND a.ord_ln =#{ordLn}
AND a.f_delete_mark IS NULL AND a.f_delete_mark IS NULL
GROUP BY
a.ord_ln
</select> </select>
</mapper> </mapper>

@ -19,5 +19,5 @@ public interface WarehousingOutboundProductMapper extends BaseMapper<Warehousing
List<WarehousingOutboundProductEntity> queryOutboundProduct(String id); List<WarehousingOutboundProductEntity> queryOutboundProduct(String id);
List<WarehousingOutboundProductEntity> queryOutboundProductPurchase(@Param("id") String id, @Param("ordLn") String ordLn); List<WarehousingOutboundProductEntity> queryOutboundProductPurchase(@Param("id") String id);
} }

@ -17,6 +17,6 @@ public interface WarehousingOutboundProductService extends IService<WarehousingO
QueryWrapper<WarehousingOutboundProductEntity> getChild(WarehousingOutboundPagination pagination,QueryWrapper<WarehousingOutboundProductEntity> warehousingOutboundProductQueryWrapper); QueryWrapper<WarehousingOutboundProductEntity> getChild(WarehousingOutboundPagination pagination,QueryWrapper<WarehousingOutboundProductEntity> warehousingOutboundProductQueryWrapper);
List<WarehousingOutboundProductEntity> queryOutboundProductInfo(String id); List<WarehousingOutboundProductEntity> queryOutboundProductInfo(String id);
List<WarehousingOutboundProductEntity> queryOutboundProductPurchase(String id,String ordLn); List<WarehousingOutboundProductEntity> queryOutboundProductPurchase(String id);
} }

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
import jnpf.entity.*; import jnpf.entity.*;
import jnpf.mapper.CwsettlementMapper; import jnpf.mapper.CwsettlementMapper;
import jnpf.mapper.DeliveryProductRelationMapper;
import jnpf.mapper.WarehousingOutboundProductMapper; import jnpf.mapper.WarehousingOutboundProductMapper;
import jnpf.model.yunguan.YunguanPurchaseSettlementModel; import jnpf.model.yunguan.YunguanPurchaseSettlementModel;
import jnpf.model.yunguan.YunguanPurchaseSettlementProductModel; import jnpf.model.yunguan.YunguanPurchaseSettlementProductModel;
@ -100,6 +101,14 @@ public class CwsettlementServiceImpl extends ServiceImpl<CwsettlementMapper, Cws
private SettlementRelationPurchaseService settlementRelationPurchaseService; private SettlementRelationPurchaseService settlementRelationPurchaseService;
@Resource @Resource
private SettlementRelationSaleService settlementRelationSaleService; private SettlementRelationSaleService settlementRelationSaleService;
@Resource
private DeliveryProductRelationMapper deliveryProductRelationMapper;
@Autowired
private BusinessOrderService businessOrderService;
@Autowired
private BusinessOrderProductRelationalService businessOrderProductRelationalService;
@Autowired
private BusinessLineService businessLineService;
@Override @Override
public List<CwsettlementEntity> getList(CwsettlementPagination cwsettlementPagination){ public List<CwsettlementEntity> getList(CwsettlementPagination cwsettlementPagination){
@ -1049,52 +1058,77 @@ public class CwsettlementServiceImpl extends ServiceImpl<CwsettlementMapper, Cws
} }
cwsettlementsummaryService.saveOrUpdate(tableField207.get(i)); cwsettlementsummaryService.saveOrUpdate(tableField207.get(i));
if (entity.getType().equals("1") && entity.getBusinessLine().equals("550709408384942213")){ if (entity.getType().equals("1") && entity.getBusinessLine().equals("550709408384942213")) {
if(!isSave){ if (!isSave) {
QueryWrapper<SettlementRelationPurchaseEntity> settlementRelationPurchaseEntityQueryWrapper = new QueryWrapper<>(); QueryWrapper<SettlementRelationPurchaseEntity> settlementRelationPurchaseEntityQueryWrapper = new QueryWrapper<>();
settlementRelationPurchaseEntityQueryWrapper.lambda().eq(SettlementRelationPurchaseEntity::getPurchaseSettlementCode, entity.getCode()); settlementRelationPurchaseEntityQueryWrapper.lambda().eq(SettlementRelationPurchaseEntity::getPurchaseSettlementCode, entity.getCode());
settlementRelationPurchaseService.remove(settlementRelationPurchaseEntityQueryWrapper); settlementRelationPurchaseService.remove(settlementRelationPurchaseEntityQueryWrapper);
} }
SettlementRelationPurchaseEntity settlementRelationPurchaseEntity=new SettlementRelationPurchaseEntity(); SettlementRelationPurchaseEntity settlementRelationPurchaseEntity = new SettlementRelationPurchaseEntity();
//采购结算 for (CwsettlementaccountModel model : cwsettlementForm.getCwsettlementaccountList()) {
QueryWrapper<CwaccountstorageEntity> cwaccountstorageQueryWrapper=new QueryWrapper<>();
cwaccountstorageQueryWrapper.lambda().eq(CwaccountstorageEntity::getAccountId,cwsettlementForm.getCwsettlementaccountList().get(0).getAccountId()); //采购结算
List<CwaccountstorageEntity> cwaccountstorageEntityList=cwaccountstorageService.list(cwaccountstorageQueryWrapper); QueryWrapper<CwaccountstorageEntity> cwaccountstorageQueryWrapper = new QueryWrapper<>();
if (cwaccountstorageEntityList!=null && cwaccountstorageEntityList.size()>0){ cwaccountstorageQueryWrapper.lambda().eq(CwaccountstorageEntity::getAccountId, model.getAccountId());
//入库单的采购订单 cwaccountstorageQueryWrapper.lambda().isNull(CwaccountstorageEntity::getDeleteMark);
QueryWrapper<WarehousingStorageEntity> warehousingStorageQueryWrapper=new QueryWrapper<>(); List<CwaccountstorageEntity> cwaccountstorageEntityList = cwaccountstorageService.list(cwaccountstorageQueryWrapper);
warehousingStorageQueryWrapper.lambda().eq(WarehousingStorageEntity::getDocumentNo,cwaccountstorageEntityList.get(0).getDocumentNo()); for (CwaccountstorageEntity cwaccountstorage : cwaccountstorageEntityList) {
List<WarehousingStorageEntity> warehousingStorageEntityList=warehousingStorageService.list(warehousingStorageQueryWrapper); //入库单的采购订单
if (warehousingStorageEntityList!=null && warehousingStorageEntityList.size()>0){ QueryWrapper<WarehousingStorageEntity> warehousingStorageQueryWrapper = new QueryWrapper<>();
//收货单 warehousingStorageQueryWrapper.lambda().eq(WarehousingStorageEntity::getDocumentNo, cwaccountstorage.getDocumentNo());
QueryWrapper<ReceiptOrderEntity> receiptOrderEntityQueryWrapper=new QueryWrapper<>(); warehousingStorageQueryWrapper.lambda().isNull(WarehousingStorageEntity::getDeleteMark);
receiptOrderEntityQueryWrapper.lambda().eq(ReceiptOrderEntity::getId,warehousingStorageEntityList.get(0).getWarehousingId()); List<WarehousingStorageEntity> warehousingStorageEntityList = warehousingStorageService.list(warehousingStorageQueryWrapper);
List<ReceiptOrderEntity> receiptOrderEntities=receiptOrderService.list(receiptOrderEntityQueryWrapper); if (warehousingStorageEntityList != null && warehousingStorageEntityList.size() > 0) {
if (receiptOrderEntities!=null && receiptOrderEntities.size()>0){ //收货单
settlementRelationPurchaseEntity.setPurchaseSettlementCode(entity.getCode()); //采购结算单 QueryWrapper<ReceiptOrderEntity> receiptOrderEntityQueryWrapper = new QueryWrapper<>();
settlementRelationPurchaseEntity.setReceiptCode(receiptOrderEntities.get(0).getReceiptCode()); //收货单 receiptOrderEntityQueryWrapper.lambda().eq(ReceiptOrderEntity::getId, warehousingStorageEntityList.get(0).getWarehousingId());
settlementRelationPurchaseEntity.setContract(cwsettlementForm.getCwsettlementaccountList().get(0).getContractCode()); receiptOrderEntityQueryWrapper.lambda().isNull(ReceiptOrderEntity::getDeleteMark);
settlementRelationPurchaseEntity.setPurchaseCode(warehousingStorageEntityList.get(0).getBusinessOrderNo()); List<ReceiptOrderEntity> receiptOrderEntities = receiptOrderService.list(receiptOrderEntityQueryWrapper);
settlementRelationPurchaseEntity.setOrdLn( tableField207.get(i).getOrdLn()); //订单行 if (receiptOrderEntities != null && receiptOrderEntities.size() > 0) {
settlementRelationPurchaseEntity.setSettlementSum( tableField207.get(i).getSettlementSum()); //结算量 //采购订单
settlementRelationPurchaseEntity.setSettlementPrice( tableField207.get(i).getSettlementPrice()); //单价量 BusinessOrderEntity businessOrderEntity = businessOrderService.getInfo(receiptOrderEntities.get(0).getBusinessId());
settlementRelationPurchaseEntity.setSettlementCount( tableField207.get(i).getSettlementSubtotal()); //单价量 if (ObjectUtil.isNotEmpty(businessOrderEntity)) {
SubjectbasicEntity subjectbasicEntity =subjectbasicService.getInfo(cwsettlementForm.getCwsettlementsubjectList().get(0).getSubjectId()); //采购订单子表
settlementRelationPurchaseEntity.setSupplier(subjectbasicEntity.getName()); QueryWrapper<BusinessOrderProductRelationalEntity> businessOrderSonQueryWrapper = new QueryWrapper<>();
settlementRelationPurchaseEntity.setPurchaseBusinessLine(entity.getBusinessLine()); businessOrderSonQueryWrapper.lambda().eq(BusinessOrderProductRelationalEntity::getBusinessOrderId, businessOrderEntity.getId());
settlementRelationPurchaseEntity.setPaymentAmount(cwsettlementForm.getPaymentAmount()); //已付款金额 businessOrderSonQueryWrapper.lambda().isNull(BusinessOrderProductRelationalEntity::getDeleteMark);
List<BusinessOrderProductRelationalEntity> businessOrderProductRelationalEntityList = businessOrderProductRelationalService.list(businessOrderSonQueryWrapper);
for (BusinessOrderProductRelationalEntity businessSon : businessOrderProductRelationalEntityList) {
settlementRelationPurchaseEntity.setPurchaseSettlementCode(entity.getCode()); //采购结算单
settlementRelationPurchaseEntity.setReceiptCode(receiptOrderEntities.get(0).getReceiptCode()); //收货单
//采购合同编号
ContractLEntity contractLEntity = contractLService.getInfo(businessOrderEntity.getContractId());
if (ObjectUtil.isNotEmpty(contractLEntity)) {
settlementRelationPurchaseEntity.setContract(contractLEntity.getContractNumber());
}
settlementRelationPurchaseEntity.setPurchaseCode(businessOrderEntity.getCode());
settlementRelationPurchaseEntity.setOrdLn(businessSon.getOrdLn()); //订单行
settlementRelationPurchaseEntity.setSettlementSum(tableField207.get(i).getSettlementSum()); //结算量
settlementRelationPurchaseEntity.setSettlementPrice(tableField207.get(i).getSettlementPrice()); //单价量
settlementRelationPurchaseEntity.setSettlementCount(tableField207.get(i).getSettlementSubtotal()); //单价量
SubjectbasicEntity subjectbasicEntity = subjectbasicService.getInfo(businessOrderEntity.getFirstSubjectBasicId());
if (ObjectUtil.isNotEmpty(subjectbasicEntity)) {
settlementRelationPurchaseEntity.setSupplier(subjectbasicEntity.getName());
}
BusinessLineEntity businessLineEntity = businessLineService.getInfo(businessOrderEntity.getBusinessLineId());
if (ObjectUtil.isNotEmpty(businessLineEntity)) {
settlementRelationPurchaseEntity.setPurchaseBusinessLine(businessLineEntity.getName());
}
settlementRelationPurchaseEntity.setPaymentAmount(cwsettlementForm.getPaymentAmount()); //已付款金额
// settlementRelationPurchaseEntity.setPurchaseBusinessLine(cwsettlementForm.getBusinessLine()); // settlementRelationPurchaseEntity.setPurchaseBusinessLine(cwsettlementForm.getBusinessLine());
settlementRelationPurchaseService.saveOrUpdate(settlementRelationPurchaseEntity); settlementRelationPurchaseService.saveOrUpdate(settlementRelationPurchaseEntity);
}
}
}
} }
} }
} }
}else if(entity.getType().equals("2") && entity.getBusinessLine().equals("550709408384942213")){ }else if(entity.getType().equals("2") && entity.getBusinessLine().equals("550709408384942213")){
if(!isSave){ if(!isSave){
@ -1105,52 +1139,60 @@ public class CwsettlementServiceImpl extends ServiceImpl<CwsettlementMapper, Cws
SettlementRelationSaleEntity settlementRelationSaleEntity=new SettlementRelationSaleEntity(); SettlementRelationSaleEntity settlementRelationSaleEntity=new SettlementRelationSaleEntity();
//销售结算 for (CwsettlementaccountModel model : cwsettlementForm.getCwsettlementaccountList()) {
//入库单的采购订单
List<WarehousingOutboundProductEntity> warehousingOutboundProductList =warehousingOutboundProductService.queryOutboundProductPurchase(cwsettlementForm.getCwsettlementaccountList().get(0).getAccountId(), tableField207.get(i).getOrdLn());
if (warehousingOutboundProductList!=null && warehousingOutboundProductList.size()>0){
settlementRelationSaleEntity.setPurchaseCode(warehousingOutboundProductList.get(0).getCode()); //采购订单
settlementRelationSaleEntity.setContract(warehousingOutboundProductList.get(0).getContractName()); //采购合同
settlementRelationSaleEntity.setSupplier(warehousingOutboundProductList.get(0).getName()); //供应商
settlementRelationSaleEntity.setOrdLn(warehousingOutboundProductList.get(0).getOrdLn()); //供应商
}
QueryWrapper<CwaccountstorageEntity> cwaccountstorageQueryWrapper=new QueryWrapper<>();
cwaccountstorageQueryWrapper.lambda().eq(CwaccountstorageEntity::getAccountId,cwsettlementForm.getCwsettlementaccountList().get(0).getAccountId());
List<CwaccountstorageEntity> cwaccountstorageEntityList=cwaccountstorageService.list(cwaccountstorageQueryWrapper);
if (cwaccountstorageEntityList!=null && cwaccountstorageEntityList.size()>0){
//销售结算 //销售结算
QueryWrapper<WarehousingOutboundEntity> warehousingOutboundQueryWrapper=new QueryWrapper<>(); QueryWrapper<CwaccountstorageEntity> cwaccountstorageQueryWrapper = new QueryWrapper<>();
warehousingOutboundQueryWrapper.lambda().eq(WarehousingOutboundEntity::getDocumentNo,cwaccountstorageEntityList.get(0).getDocumentNo()); cwaccountstorageQueryWrapper.lambda().eq(CwaccountstorageEntity::getAccountId, model.getAccountId());
List<WarehousingOutboundEntity> warehousingOutboundEntityList=warehousingOutboundService.list(warehousingOutboundQueryWrapper); List<CwaccountstorageEntity> cwaccountstorageEntityList = cwaccountstorageService.list(cwaccountstorageQueryWrapper);
if (warehousingOutboundEntityList!=null && warehousingOutboundEntityList.size()>0){ for (CwaccountstorageEntity cwaccountstorageEntity : cwaccountstorageEntityList) {
//收货单 //销售结算
QueryWrapper<DeliveryOrderEntity> deliveryOrderQueryWrapper=new QueryWrapper<>(); QueryWrapper<WarehousingOutboundEntity> warehousingOutboundQueryWrapper = new QueryWrapper<>();
deliveryOrderQueryWrapper.lambda().eq(DeliveryOrderEntity::getId,warehousingOutboundEntityList.get(0).getWarehousingId()); warehousingOutboundQueryWrapper.lambda().eq(WarehousingOutboundEntity::getDocumentNo, cwaccountstorageEntity.getDocumentNo());
List<DeliveryOrderEntity> deliveryOrderEntityList=deliveryOrderService.list(deliveryOrderQueryWrapper); List<WarehousingOutboundEntity> warehousingOutboundEntityList = warehousingOutboundService.list(warehousingOutboundQueryWrapper);
if (deliveryOrderEntityList!=null && deliveryOrderEntityList.size()>0){ if (warehousingOutboundEntityList != null && warehousingOutboundEntityList.size() > 0) {
settlementRelationSaleEntity.setSettlementCode(entity.getCode()); //销售结算单 //发货单
settlementRelationSaleEntity.setDeliveryCode(deliveryOrderEntityList.get(0).getDeliveryCode()); //发货单 DeliveryOrderEntity deliveryOrderEntity = deliveryOrderService.getInfo(warehousingOutboundEntityList.get(0).getWarehousingId());
settlementRelationSaleEntity.setSaleContract(cwsettlementForm.getCwsettlementaccountList().get(0).getContractCode()); if (ObjectUtil.isNotEmpty(deliveryOrderEntity)) {
settlementRelationSaleEntity.setSaleCode(warehousingOutboundEntityList.get(0).getBusinessOrderNo()); BusinessOrderEntity businessOrderEntity = businessOrderService.getInfo(deliveryOrderEntity.getBusinessId());
settlementRelationSaleEntity.setSaleOrdLn( tableField207.get(i).getOrdLn()); //订单行 List<WarehousingOutboundProductEntity> warehousingOutboundProductList = warehousingOutboundProductService.queryOutboundProductPurchase(model.getAccountId());
settlementRelationSaleEntity.setSaleSettlementSum( tableField207.get(i).getSettlementSum()); //结算量 for (WarehousingOutboundProductEntity warehousingOutboundProductEntity : warehousingOutboundProductList) {
settlementRelationSaleEntity.setSettlementPrice( tableField207.get(i).getSettlementPrice()); //单价量 settlementRelationSaleEntity.setPurchaseCode(warehousingOutboundProductEntity.getCode()); //采购订单
settlementRelationSaleEntity.setSettlementCount( tableField207.get(i).getSettlementSubtotal()); //单价量 settlementRelationSaleEntity.setContract(warehousingOutboundProductEntity.getContractName()); //采购合同编号
SubjectbasicEntity subjectbasicEntity =subjectbasicService.getInfo(cwsettlementForm.getCwsettlementsubjectList().get(0).getSubjectId()); settlementRelationSaleEntity.setSupplier(warehousingOutboundProductEntity.getName()); //供应商
settlementRelationSaleEntity.setCustomer(subjectbasicEntity.getName()); settlementRelationSaleEntity.setOrdLn(warehousingOutboundProductEntity.getOrdLn()); //供应商
settlementRelationSaleEntity.setPurchaseBusinessLine(entity.getBusinessLine());
settlementRelationSaleEntity.setPaymentAmount(cwsettlementForm.getPaymentAmount()); //已收款金额 settlementRelationSaleEntity.setSettlementCode(entity.getCode()); //销售结算单
} settlementRelationSaleEntity.setDeliveryCode(deliveryOrderEntity.getDeliveryCode()); //发货单
settlementRelationSaleService.saveOrUpdate(settlementRelationSaleEntity); if (ObjectUtil.isNotEmpty(businessOrderEntity)){
settlementRelationSaleEntity.setSaleCode(businessOrderEntity.getCode());
ContractLEntity contractLEntity = contractLService.getInfo(businessOrderEntity.getContractId());
SubjectbasicEntity subjectbasicEntity = subjectbasicService.getInfo(businessOrderEntity.getFirstSubjectBasicId());
BusinessLineEntity businessLineEntity = businessLineService.getInfo(businessOrderEntity.getBusinessLineId());
if (ObjectUtil.isNotEmpty(contractLEntity)){
settlementRelationSaleEntity.setSaleContract(contractLEntity.getContractNumber());//合同号
}
if(ObjectUtil.isNotEmpty(subjectbasicEntity)) {
settlementRelationSaleEntity.setCustomer(subjectbasicEntity.getName());//客户
}
if (ObjectUtil.isNotEmpty(businessLineEntity)){
settlementRelationSaleEntity.setPurchaseBusinessLine(businessLineEntity.getName());//业务线
}
}
settlementRelationSaleEntity.setSaleOrdLn(tableField207.get(i).getOrdLn()); //订单行
settlementRelationSaleEntity.setSaleSettlementSum(tableField207.get(i).getSettlementSum()); //结算量
settlementRelationSaleEntity.setSettlementPrice(tableField207.get(i).getSettlementPrice()); //单价量
settlementRelationSaleEntity.setSettlementCount(tableField207.get(i).getSettlementSubtotal()); //单价量
settlementRelationSaleEntity.setPaymentAmount(cwsettlementForm.getPaymentAmount()); //已收款金额
}
}
settlementRelationSaleService.saveOrUpdate(settlementRelationSaleEntity);
}
}
} }
}
} }
} }

@ -151,6 +151,7 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
} }
List<String> allRuleIDlist = new ArrayList<>(); List<String> allRuleIDlist = new ArrayList<>();
String ruleOp =""; String ruleOp ="";
ruleJson= null;
if (ObjectUtil.isNotEmpty(ruleJson)){ if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>(); List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>(); List<List<String>> intersectionRuleList = new ArrayList<>();
@ -536,7 +537,8 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
Field declaredField = voucherEntity.getClass().getDeclaredField(strs[0]); Field declaredField = voucherEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true); declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value(); String value = declaredField.getAnnotation(TableField.class).value();
voucherQueryWrapper="asc".equals(voucherPagination.getSort().toLowerCase())?voucherQueryWrapper.orderByAsc(value):voucherQueryWrapper.orderByDesc(value); // voucherQueryWrapper="asc".equals(voucherPagination.getSort().toLowerCase())?voucherQueryWrapper.orderByAsc(value):voucherQueryWrapper.orderByDesc(value);
voucherPagination.setSidx("a."+value);
} catch (NoSuchFieldException e) { } catch (NoSuchFieldException e) {
e.printStackTrace(); e.printStackTrace();
} }

@ -68,7 +68,7 @@ public class WarehousingOutboundProductServiceImpl extends ServiceImpl<Warehousi
} }
@Override @Override
public List<WarehousingOutboundProductEntity> queryOutboundProductPurchase(String id, String ordLn) { public List<WarehousingOutboundProductEntity> queryOutboundProductPurchase(String id) {
return warehousingOutboundProductMapper.queryOutboundProductPurchase(id,ordLn); return warehousingOutboundProductMapper.queryOutboundProductPurchase(id);
} }
} }

@ -22,6 +22,8 @@ import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel; import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import java.math.RoundingMode;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import jnpf.model.QueryModel; import jnpf.model.QueryModel;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -735,6 +737,9 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
if (deliveryOrderForm.getDeliveryProductRelationList()!=null){ if (deliveryOrderForm.getDeliveryProductRelationList()!=null){
//统计发货数量 //统计发货数量
BigDecimal countNum = BigDecimal.ZERO; BigDecimal countNum = BigDecimal.ZERO;
//发货关系表,最后一次相减得出含税小计
int size = 0;
BigDecimal SaleAmountCount = BigDecimal.ZERO;
// List<WarehousingStorageProductEntity> tableField119 = JsonUtil.getJsonToList(receiptOrderForm.getDeliveryProductRelationList(),WarehousingStorageProductEntity.class); // List<WarehousingStorageProductEntity> tableField119 = JsonUtil.getJsonToList(receiptOrderForm.getDeliveryProductRelationList(),WarehousingStorageProductEntity.class);
for(DeliveryProductRelationModel entitys : deliveryOrderForm.getDeliveryProductRelationList()){ for(DeliveryProductRelationModel entitys : deliveryOrderForm.getDeliveryProductRelationList()){
countNum = countNum.add(entitys.getDeliveryNum()); countNum = countNum.add(entitys.getDeliveryNum());
@ -778,31 +783,32 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
deliveryRelationEntity.setSaleOrdLn(entitys.getOrdLn()); //订单行号 deliveryRelationEntity.setSaleOrdLn(entitys.getOrdLn()); //订单行号
deliveryRelationEntity.setDeliveryNum(entitys.getDeliveryNum()); //数量 deliveryRelationEntity.setDeliveryNum(entitys.getDeliveryNum()); //数量
deliveryRelationEntity.setSalePrice(entitys.getReturnUnit());//采购单价 deliveryRelationEntity.setSalePrice(entitys.getReturnUnit());//采购单价
deliveryRelationEntity.setSaleCount(entitys.getTaxCount()); //金额 if (size == deliveryOrderForm.getDeliveryProductRelationList().size()-1){
// deliveryRelationEntity.setDeliveryCode(deliveryOrder.getDeliveryCode()); deliveryRelationEntity.setSaleCount(countNum.subtract(SaleAmountCount));
}else {
deliveryRelationEntity.setSaleCount(entitys.getReturnUnit().multiply(entitys.getDeliveryNum()).setScale(2, RoundingMode.HALF_UP)); //金额
SaleAmountCount = SaleAmountCount.add(deliveryRelationEntity.getSaleCount());
}
size++;
QueryWrapper<DeliveryProductRelationEntity> queryWrapper=new QueryWrapper<>(); QueryWrapper<DeliveryProductRelationEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(DeliveryProductRelationEntity::getBusinessType,"1"); queryWrapper.lambda().eq(DeliveryProductRelationEntity::getBusinessType,"1");
queryWrapper.lambda().eq(DeliveryProductRelationEntity::getBatchNo,entitys.getBatchNo()); queryWrapper.lambda().eq(DeliveryProductRelationEntity::getBatchNo,entitys.getBatchNo());
List<DeliveryProductRelationEntity> deliveryProductRelationEntities=deliveryProductRelationService.list(queryWrapper); List<DeliveryProductRelationEntity> deliveryProductRelationEntities=deliveryProductRelationService.list(queryWrapper);
if (deliveryProductRelationEntities!=null && deliveryProductRelationEntities.size()>0){ if (deliveryProductRelationEntities!=null && deliveryProductRelationEntities.size()>0){
// DeliveryOrderEntity deliveryOrderEntity =deliveryOrderService.getInfo( deliveryProductRelationEntities.get(0).getOrderId()); ReceiptOrderEntity receiptOrderEntity = receiptOrderService.getInfo(deliveryProductRelationEntities.get(0).getOrderId());
QueryWrapper<ReceiptOrderEntity> receiptOrderEntityQueryWrapper=new QueryWrapper<>();
receiptOrderEntityQueryWrapper.lambda().eq(ReceiptOrderEntity::getId,deliveryProductRelationEntities.get(0).getOrderId());
List<ReceiptOrderEntity> deliveryOrderEntityList=receiptOrderService.list(receiptOrderEntityQueryWrapper);
deliveryRelationEntity.setPurchaseOrdLn(deliveryProductRelationEntities.get(0).getOrdLn()); //采购订单行 deliveryRelationEntity.setPurchaseOrdLn(deliveryProductRelationEntities.get(0).getOrdLn()); //采购订单行
//销售收货采购对应 //销售收货采购对应
BusinessOrderEntity businessOrderEntity1 = businessOrderService.getInfo(deliveryOrderEntityList.get(0).getBusinessId()); BusinessOrderEntity businessOrderEntity1 = businessOrderService.getInfo(receiptOrderEntity.getBusinessId());
if (ObjectUtil.isNotEmpty(businessOrderEntity1)){ if (ObjectUtil.isNotEmpty(businessOrderEntity1)){
deliveryRelationEntity.setPurchaseCode(businessOrderEntity1.getCode()); //订单 deliveryRelationEntity.setPurchaseCode(businessOrderEntity1.getCode()); //订单
ContractLEntity contractLEntity = contractLService.getInfo(businessOrderEntity1.getContractId()); ContractLEntity contractLEntity = contractLService.getInfo(businessOrderEntity1.getContractId());
if (ObjectUtil.isNotEmpty(contractLEntity)){ if (ObjectUtil.isNotEmpty(contractLEntity)){
deliveryRelationEntity.setPurchaseContract(contractLEntity.getContractNumber()); //合同 deliveryRelationEntity.setPurchaseContract(contractLEntity.getContractNumber()); //合同
} }
deliveryRelationEntity.setBusinessLine(businessOrderEntity1.getBusinessLineId());//业务线 // deliveryRelationEntity.setBusinessLine(businessOrderEntity1.getBusinessLineId());//业务线
SubjectbasicEntity subjectbasicEntity=subjectbasicService.getInfo(businessOrderEntity1.getFirstSubjectBasicId()); SubjectbasicEntity subjectbasicEntity=subjectbasicService.getInfo(businessOrderEntity1.getFirstSubjectBasicId());
if (ObjectUtil.isNotEmpty(subjectbasicEntity)){ if (ObjectUtil.isNotEmpty(subjectbasicEntity)){
deliveryRelationEntity.setSupplier(subjectbasicEntity.getName()); //供应商 deliveryRelationEntity.setSupplier(subjectbasicEntity.getName()); //供应商

@ -4,10 +4,7 @@ import baiduUtils.BeanMergeUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import jnpf.entity.*; import jnpf.entity.*;
import jnpf.mapper.CwaccountvoucherMapper; import jnpf.mapper.*;
import jnpf.mapper.VoucherMapper;
import jnpf.mapper.WarehousingNotificationMapper;
import jnpf.mapper.WarehousingStorageMapper;
import jnpf.model.receiptorder.DeliveryProductRelationModel; import jnpf.model.receiptorder.DeliveryProductRelationModel;
import jnpf.model.receiptorder.ReceiptOrderForm; import jnpf.model.receiptorder.ReceiptOrderForm;
import jnpf.model.receiptrelation.ReceiptRelationForm; import jnpf.model.receiptrelation.ReceiptRelationForm;
@ -100,6 +97,8 @@ public class WarehousingStorageServiceImpl extends ServiceImpl<WarehousingStorag
private SubjectbasicService subjectbasicService; private SubjectbasicService subjectbasicService;
@Resource @Resource
private ReceiptRelationService receiptRelationService; private ReceiptRelationService receiptRelationService;
@Resource
private BusinessLineMapper businessLineMapper;
@Override @Override
public List<WarehousingStorageEntity> getList(WarehousingStoragePagination warehousingStoragePagination){ public List<WarehousingStorageEntity> getList(WarehousingStoragePagination warehousingStoragePagination){
return getTypeList(warehousingStoragePagination,warehousingStoragePagination.getDataType()); return getTypeList(warehousingStoragePagination,warehousingStoragePagination.getDataType());
@ -931,7 +930,10 @@ public class WarehousingStorageServiceImpl extends ServiceImpl<WarehousingStorag
if (ObjectUtil.isNotEmpty(contractLEntity)){ if (ObjectUtil.isNotEmpty(contractLEntity)){
receiptRelationEntity.setPurchaseContract(contractLEntity.getContractNumber()); //合同 receiptRelationEntity.setPurchaseContract(contractLEntity.getContractNumber()); //合同
} }
receiptRelationEntity.setBusinessLine(businessOrderEntity1.getBusinessLineId());//业务线 BusinessLineEntity businessLineEntity = businessLineMapper.selectById(businessOrderEntity1.getBusinessLineId());
if (ObjectUtil.isNotEmpty(businessLineEntity)) {
receiptRelationEntity.setBusinessLine(businessLineEntity.getName());//业务线名称
}
SubjectbasicEntity subjectbasicEntity=subjectbasicService.getInfo(businessOrderEntity1.getFirstSubjectBasicId()); SubjectbasicEntity subjectbasicEntity=subjectbasicService.getInfo(businessOrderEntity1.getFirstSubjectBasicId());
if (ObjectUtil.isNotEmpty(subjectbasicEntity)){ if (ObjectUtil.isNotEmpty(subjectbasicEntity)){
receiptRelationEntity.setSupplier(subjectbasicEntity.getName()); //供应商 receiptRelationEntity.setSupplier(subjectbasicEntity.getName()); //供应商

@ -1975,13 +1975,13 @@ export default {
data.forEach((val, index) => { data.forEach((val, index) => {
this.dataForm.isTransferSource.push(val.id) this.dataForm.isTransferSource.push(val.id)
val.businessOrderProductRelationalList.forEach((item, index) => { val.businessOrderProductRelationalList.forEach((item, index) => {
item.salePrice = item.salePrice ? item.salePrice : 0
if (this.dataForm.businessOrderProductRelationalList.length == 0) { if (this.dataForm.businessOrderProductRelationalList.length == 0) {
// this.dataForm.businessOrderProductRelationalList.push(item); // this.dataForm.businessOrderProductRelationalList.push(item);
item.salePrice = item.salePrice ? item.salePrice : 0
let item1 = { let item1 = {
productId: item.productId, productId: item.productId,
businessNum: item.businessNum, businessNum: item.businessNum,
businessPrice: undefined,
name: item.name, name: item.name,
spec: item.spec, spec: item.spec,
code: item.code, code: item.code,
@ -2070,7 +2070,7 @@ export default {
data.forEach((val, index) => { data.forEach((val, index) => {
this.dataForm.isTransferSource.push(val.id) this.dataForm.isTransferSource.push(val.id)
val.businessOrderProductRelationalList.forEach((item, index) => { val.businessOrderProductRelationalList.forEach((item, index) => {
item.salePrice = item.salePrice ? item.salePrice : 0
if (this.dataForm.businessOrderProductRelationalList.length == 0) { if (this.dataForm.businessOrderProductRelationalList.length == 0) {
// this.dataForm.businessOrderProductRelationalList.push(item); // this.dataForm.businessOrderProductRelationalList.push(item);
let item1 = { let item1 = {

Loading…
Cancel
Save