关系表修改

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

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

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

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

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

@ -4,10 +4,7 @@ import baiduUtils.BeanMergeUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import jnpf.entity.*;
import jnpf.mapper.CwaccountvoucherMapper;
import jnpf.mapper.VoucherMapper;
import jnpf.mapper.WarehousingNotificationMapper;
import jnpf.mapper.WarehousingStorageMapper;
import jnpf.mapper.*;
import jnpf.model.receiptorder.DeliveryProductRelationModel;
import jnpf.model.receiptorder.ReceiptOrderForm;
import jnpf.model.receiptrelation.ReceiptRelationForm;
@ -100,6 +97,8 @@ public class WarehousingStorageServiceImpl extends ServiceImpl<WarehousingStorag
private SubjectbasicService subjectbasicService;
@Resource
private ReceiptRelationService receiptRelationService;
@Resource
private BusinessLineMapper businessLineMapper;
@Override
public List<WarehousingStorageEntity> getList(WarehousingStoragePagination warehousingStoragePagination){
return getTypeList(warehousingStoragePagination,warehousingStoragePagination.getDataType());
@ -931,7 +930,10 @@ public class WarehousingStorageServiceImpl extends ServiceImpl<WarehousingStorag
if (ObjectUtil.isNotEmpty(contractLEntity)){
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());
if (ObjectUtil.isNotEmpty(subjectbasicEntity)){
receiptRelationEntity.setSupplier(subjectbasicEntity.getName()); //供应商

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

Loading…
Cancel
Save