# Conflicts:
#	jnpf-java-boot/jnpf-admin/src/main/resources/mapper/scm/BusinessOrderMapper.xml
#	jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/entity/ProductWarehouseEntity.java
jg-waiwang-pro
XI_TENG\xixi_ 4 months ago
commit b63ac856e0

@ -664,7 +664,9 @@
IFNULL(c.purchase_amount,0) as purchaseAmount, IFNULL(c.purchase_amount,0) as purchaseAmount,
IFNULL(c.sale_amount,0) as saleAmount, IFNULL(c.sale_amount,0) as saleAmount,
c.order_no as orderNo, c.order_no as orderNo,
a.spec AS spec1 a.spec AS spec1,
a.id as voucherProductIds
FROM FROM
`jg_voucher_product` a `jg_voucher_product` a
RIGHT JOIN jg_voucher c ON a.voucher_id = c.id AND c.f_delete_mark IS NULL RIGHT JOIN jg_voucher c ON a.voucher_id = c.id AND c.f_delete_mark IS NULL

@ -158,7 +158,8 @@
d.vehicle_number, d.vehicle_number,
a.purchase_contract_no as purchaseContractNo, a.purchase_contract_no as purchaseContractNo,
f.name as productName, f.name as productName,
c.clear_weight c.clear_weight,
c.order_line_id as orderLineId
FROM FROM
jg_voucher a jg_voucher a
LEFT JOIN jg_voucher_vehicle b ON b.voucher_id = a.id AND b.f_delete_mark IS NULL LEFT JOIN jg_voucher_vehicle b ON b.voucher_id = a.id AND b.f_delete_mark IS NULL

@ -3,14 +3,12 @@ package jnpf.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mysql.cj.x.protobuf.MysqlxExpr;
import com.taobao.api.internal.toplink.Pool; import com.taobao.api.internal.toplink.Pool;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.engine.entity.FlowTaskEntity; import jnpf.engine.entity.FlowTaskEntity;
import jnpf.entity.*; import jnpf.entity.*;
import jnpf.mapper.BusinessOrderMapper; import jnpf.mapper.*;
import jnpf.mapper.BusinessOrderProductRelationalMapper;
import jnpf.mapper.InventoryMapper;
import jnpf.mapper.VoucherMapper;
import jnpf.model.yunguan.YunguanPurchaseOrderModel; import jnpf.model.yunguan.YunguanPurchaseOrderModel;
import jnpf.model.yunguan.YunguanPurchaseOrderProductModel; import jnpf.model.yunguan.YunguanPurchaseOrderProductModel;
import jnpf.model.yunguan.YunguanSaleOrderModel; import jnpf.model.yunguan.YunguanSaleOrderModel;
@ -65,6 +63,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import jnpf.util.*; import jnpf.util.*;
import java.util.*; import java.util.*;
import java.util.stream.Stream;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -116,6 +116,8 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
private ContractLService contractLService; private ContractLService contractLService;
@Autowired @Autowired
private SubjectbasicService subjectbasicService; private SubjectbasicService subjectbasicService;
@Resource
private VoucherProductMapper voucherProductMapper;
@Override @Override
public List<BusinessOrderEntity> getList(BusinessOrderPagination businessOrderPagination){ public List<BusinessOrderEntity> getList(BusinessOrderPagination businessOrderPagination){
@ -889,6 +891,9 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
@Override @Override
public List<ProductWarehouseEntity> orderByVoucherInfo(List<String> voucherIds) { public List<ProductWarehouseEntity> orderByVoucherInfo(List<String> voucherIds) {
List<ProductWarehouseEntity> productWarehouseEntityList = businessOrderMapper.orderByVoucher(voucherIds); List<ProductWarehouseEntity> productWarehouseEntityList = businessOrderMapper.orderByVoucher(voucherIds);
for (ProductWarehouseEntity entity : productWarehouseEntityList){
entity.setVoucherProductId(Collections.singletonList(entity.getVoucherProductIds()));
}
productWarehouseEntityList = productWarehouseEntityList.stream().collect(Collectors.toMap(s-> s.getId()+";"+s.getUnit()+";"+s.getOrderNo(),a->a,(o1,o2) -> { productWarehouseEntityList = productWarehouseEntityList.stream().collect(Collectors.toMap(s-> s.getId()+";"+s.getUnit()+";"+s.getOrderNo(),a->a,(o1,o2) -> {
o1.setNetWeight(o1.getNetWeight().add(o2.getNetWeight())); o1.setNetWeight(o1.getNetWeight().add(o2.getNetWeight()));
o1.setGrossWeight(o1.getGrossWeight().add(o2.getGrossWeight())); o1.setGrossWeight(o1.getGrossWeight().add(o2.getGrossWeight()));
@ -896,6 +901,7 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
o1.setBuckleWeight(o1.getBuckleWeight().add(o2.getBuckleWeight())); o1.setBuckleWeight(o1.getBuckleWeight().add(o2.getBuckleWeight()));
o1.setPurchaseAmount(o1.getPurchaseAmount().add(o2.getPurchaseAmount())); o1.setPurchaseAmount(o1.getPurchaseAmount().add(o2.getPurchaseAmount()));
o1.setSaleAmount(o1.getSaleAmount().add(o2.getSaleAmount())); o1.setSaleAmount(o1.getSaleAmount().add(o2.getSaleAmount()));
o1.setVoucherProductId(Stream.concat(o1.getVoucherProductId().stream(),o2.getVoucherProductId().stream()).collect(Collectors.toList()));
return o1; return o1;
})).values().stream().collect(Collectors.toList()); })).values().stream().collect(Collectors.toList());
return productWarehouseEntityList; return productWarehouseEntityList;
@ -1111,12 +1117,8 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
planReceiptNum = planReceiptNum.add(entitys.getBusinessNum()); planReceiptNum = planReceiptNum.add(entitys.getBusinessNum());
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setBusinessOrderId(entity.getId()); entitys.setBusinessOrderId(entity.getId());
if (StringUtils.isNotEmpty(entitys.getOrderNo())){
entitys.setOrdLn(entitys.getOrderNo());
}else {
entitys.setOrdLn(String.valueOf(line)); //运管订单行号 entitys.setOrdLn(String.valueOf(line)); //运管订单行号
line++; line++;
}
if(isSave){ if(isSave){
}else{ }else{
} }
@ -1130,6 +1132,16 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
voucherMapper.updateById(voucherEntity); voucherMapper.updateById(voucherEntity);
} }
} }
//更新凭证单子表与订单子表对应
if (entitys.getVoucherProductId() != null && entitys.getVoucherProductId().size()>0){
for (String voucherProductId : entitys.getVoucherProductId()) {
VoucherProductEntity voucherProductEntity = voucherProductMapper.selectById(voucherProductId);
if (ObjectUtil.isNotEmpty(voucherProductEntity)) {
voucherProductEntity.setOrderLineId(entitys.getOrdLn());
voucherProductMapper.updateById(voucherProductEntity);
}
}
}
} }
//更新采购订单的计划收货数量 //更新采购订单的计划收货数量
entity.setPlanPurchaseNum(planReceiptNum); entity.setPlanPurchaseNum(planReceiptNum);

@ -706,7 +706,7 @@ public class VoucherController {
productEntity.setBuckleWeight(entity.getBuckleWeight()); productEntity.setBuckleWeight(entity.getBuckleWeight());
productEntity.setNetWeight(entity.getNetWeight()); productEntity.setNetWeight(entity.getNetWeight());
productEntity.setClearWeight(entity.getClearWeight()); productEntity.setClearWeight(entity.getClearWeight());
productEntity.setOrderNo(entity.getOrderNo()); productEntity.setOrderNo(entity.getOrderLineId());
} }
entity.setProductWarehouseEntityList(productWarehouseEntity); entity.setProductWarehouseEntityList(productWarehouseEntity);
} }

@ -89,4 +89,6 @@ public class BusinessOrderProductRelationalEntity {
private BigDecimal receivedQuantity; private BigDecimal receivedQuantity;
@TableField(exist = false) @TableField(exist = false)
private String orderNo; private String orderNo;
@TableField(exist = false)
private List<String> voucherProductId;
} }

@ -5,6 +5,8 @@ import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* *
* *
@ -313,5 +315,9 @@ public class ProductWarehouseEntity {
private String orderNo; private String orderNo;
@TableField(exist = false) @TableField(exist = false)
private String spec1; private String spec1;
@TableField(exist = false)
private List<String> voucherProductId;
@TableField(exist = false)
private String voucherProductIds;
} }

@ -223,5 +223,7 @@ public class VoucherEntity {
private String customerName1; private String customerName1;
@TableField(exist = false) @TableField(exist = false)
private String supplierName1; private String supplierName1;
@TableField(exist = false)
private String orderLineId;
} }

@ -76,6 +76,8 @@ public class VoucherProductEntity {
private String deliveryNum; private String deliveryNum;
@TableField("CLEAR_WEIGHT") @TableField("CLEAR_WEIGHT")
private BigDecimal clearWeight; private BigDecimal clearWeight;
@TableField("ORDER_LINE_ID")
private String orderLineId;
/** 运费 **/ /** 运费 **/
@TableField(exist = false) @TableField(exist = false)
private BigDecimal freight; private BigDecimal freight;

@ -66,4 +66,6 @@ public class BusinessOrderProductRelationalModel {
private List<String> voucherIdList; private List<String> voucherIdList;
@JSONField(name = "orderNo") @JSONField(name = "orderNo")
private String orderNo; private String orderNo;
@JSONField(name = "voucherProductId")
private String voucherProductId;
} }

@ -84,4 +84,7 @@ public class DeliveryProductRelationModel {
/** 业务类型 **/ /** 业务类型 **/
@JSONField(name = "businessType") @JSONField(name = "businessType")
private String businessType; private String businessType;
/** 净重 **/
@JSONField(name = "clearWeight")
private BigDecimal clearWeight;
} }

@ -48,5 +48,9 @@ public class VoucherProductModel {
/** 净重 **/ /** 净重 **/
@JSONField(name = "clearWeight") @JSONField(name = "clearWeight")
private String clearWeight; private String clearWeight;
/** 订单行id **/
@JSONField(name = "orderLineId")
private String orderLineId;
} }

@ -1931,6 +1931,7 @@ export default {
item.tax = item.inputTaxRate item.tax = item.inputTaxRate
item.salesMainUnitId = item.unit item.salesMainUnitId = item.unit
item.voucherIdList = voucherIdList.voucherIds item.voucherIdList = voucherIdList.voucherIds
item.voucherProductId = item.voucherProductId
if (item.purchaseAmount !== 0) { if (item.purchaseAmount !== 0) {
item.businessPrice = this.jnpf.floatDiv(item.purchaseAmount, item.netWeight).toFixed(6) item.businessPrice = this.jnpf.floatDiv(item.purchaseAmount, item.netWeight).toFixed(6)
item.taxCount = this.jnpf.floatMul(item.businessNum, item.businessPrice).toFixed(2) // item.taxCount = this.jnpf.floatMul(item.businessNum, item.businessPrice).toFixed(2) //

@ -219,13 +219,17 @@
</el-button> </el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState" <el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row, scope.row.flowState)">详情</el-button> @click="updateHandle(scope.row, scope.row.flowState)">详情</el-button>
<!-- todo 入库通知添加运管标志判断 -->
<template <template
v-if="scope.row.deliveryType == '1' && (scope.row.status == '3' || scope.row.status == '4') && scope.row.flowState == '2' && scope.row.yunguanMark == '200'"> v-if="scope.row.deliveryType == '1' && (scope.row.status == '3' || scope.row.status == '4') && scope.row.flowState == '2'">
<el-button size="mini" type="text" :disabled="!scope.row.flowState" <el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="inBoundNotice(scope.row)">下发入库通知</el-button> @click="inBoundNotice(scope.row)">下发入库通知</el-button>
</template> </template>
<el-button size="mini" type="text" <el-button size="mini" type="text"
@click="downLoadPDF(scope.row.code)">开票文件下载</el-button> @click="downLoadPDF(scope.row.code)">开票文件下载</el-button>
<!-- <template v-if="scope.row.yunguanMark !== '200'">
<el-button size="mini" type="text" @click="repush(scope.row.id)"></el-button>
</template> -->
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
@ -427,6 +431,12 @@ export default {
}) })
}, },
methods: { methods: {
// repush(id){
// let data = {
// id: id
// }
// },
downLoadPDF(code) { downLoadPDF(code) {
window.open( window.open(
this.define.APIURl + this.define.APIURl +

@ -1777,7 +1777,12 @@ export default {
// } // }
// unit.deliveryproductrelationdeliveryUnitOptions = optArray; // unit.deliveryproductrelationdeliveryUnitOptions = optArray;
// } // }
const obj = this.productByOrderList.find(e => e.productId == unit.id && e.ordLn == unit.orderNo) || {}; let obj = {};
if (unit.orderNo) {
obj = this.productByOrderList.find(e => e.productId == unit.id && e.ordLn == unit.orderNo) || {};
} else {
obj = this.productByOrderList.find(e => e.productId == unit.id) || {};
}
unit.salesMainUnitId = obj.salesMainUnitId; unit.salesMainUnitId = obj.salesMainUnitId;
unit.saleNum = obj.businessNum; unit.saleNum = obj.businessNum;
unit.returnUnit = obj.businessPrice; unit.returnUnit = obj.businessPrice;

Loading…
Cancel
Save