非长协管控,结算单重量,销售显示物料编码,销售查询,结算单条件判断

jg-waiwang-pro
XI_TENG\xixi_ 3 months ago
parent 4c625ec64d
commit 96f36fff22

@ -257,7 +257,8 @@
c.f_full_name AS enterpriseName, c.f_full_name AS enterpriseName,
d.contract_name AS relatedContractName, d.contract_name AS relatedContractName,
e.name AS secondCustomName, e.name AS secondCustomName,
h.name AS businessName h.name AS businessName,
a.contract_num AS contractNum
FROM FROM
jg_contract a jg_contract a
LEFT JOIN jg_subject_basic b ON a.subject = b.id LEFT JOIN jg_subject_basic b ON a.subject = b.id
@ -288,7 +289,8 @@
d.contract_name AS relatedContractName, d.contract_name AS relatedContractName,
e.name AS secondSupplyName, e.name AS secondSupplyName,
f.name AS thirdSupplyName, f.name AS thirdSupplyName,
h.name AS businessName h.name AS businessName,
a.contract_num AS contractNum
FROM FROM
jg_contract a jg_contract a
LEFT JOIN jg_subject_basic b ON a.subject = b.id LEFT JOIN jg_subject_basic b ON a.subject = b.id
@ -1306,4 +1308,15 @@
f_delete_mark IS NULL AND business_order_id = #{id} f_delete_mark IS NULL AND business_order_id = #{id}
</select> </select>
<select id="queryBusinessContractSum" resultType="java.math.BigDecimal">
SELECT
SUM(plan_purchase_num) AS plan_purchase_num
FROM
jg_business_order
WHERE
contract_id = #{id}
</select>
</mapper> </mapper>

@ -102,6 +102,7 @@
SELECT SELECT
a.product_id productId, a.product_id productId,
b.spec spec, b.spec spec,
b.code code,
a.inventory_unit_id inventoryUnitId, a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId, a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit, a.sales_main_unit_id settlementUnit,
@ -144,6 +145,7 @@
SELECT SELECT
a.product_id productId, a.product_id productId,
b.spec spec, b.spec spec,
b.code code,
a.inventory_unit_id inventoryUnitId, a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId, a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit, a.sales_main_unit_id settlementUnit,
@ -186,6 +188,7 @@
SELECT SELECT
a.product_id productId, a.product_id productId,
b.spec spec, b.spec spec,
b.code code,
a.inventory_unit_id inventoryUnitId, a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId, a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit, a.sales_main_unit_id settlementUnit,
@ -228,6 +231,7 @@
SELECT SELECT
a.product_id productId, a.product_id productId,
b.spec spec, b.spec spec,
b.code code,
a.inventory_unit_id inventoryUnitId, a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId, a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit, a.sales_main_unit_id settlementUnit,
@ -270,6 +274,7 @@
SELECT SELECT
a.product_id productId, a.product_id productId,
b.spec spec, b.spec spec,
b.code code,
a.inventory_unit_id inventoryUnitId, a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId, a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit, a.sales_main_unit_id settlementUnit,
@ -309,6 +314,7 @@
SELECT SELECT
a.product_id productId, a.product_id productId,
b.spec spec, b.spec spec,
b.code code,
a.inventory_unit_id inventoryUnitId, a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId, a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit, a.sales_main_unit_id settlementUnit,
@ -351,6 +357,7 @@
SELECT SELECT
a.product_id productId, a.product_id productId,
b.spec spec, b.spec spec,
b.code code,
a.inventory_unit_id inventoryUnitId, a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId, a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit, a.sales_main_unit_id settlementUnit,
@ -390,6 +397,7 @@
SELECT SELECT
a.product_id productId, a.product_id productId,
b.spec spec, b.spec spec,
b.code code,
a.inventory_unit_id inventoryUnitId, a.inventory_unit_id inventoryUnitId,
a.sales_main_unit_id purchaseUnitId, a.sales_main_unit_id purchaseUnitId,
a.sales_main_unit_id settlementUnit, a.sales_main_unit_id settlementUnit,

@ -84,4 +84,6 @@ public interface BusinessOrderMapper extends BaseMapper<BusinessOrderEntity> {
//销售业务线带出合同信息 //销售业务线带出合同信息
List<ContractLEntity> queryBusinessContractSale(@Param("businessLine") String businessLine,@Param("organize") String organize,@Param("contractNumber") String contractNumber); List<ContractLEntity> queryBusinessContractSale(@Param("businessLine") String businessLine,@Param("organize") String organize,@Param("contractNumber") String contractNumber);
BigDecimal queryBusinessContractSum(@Param("id") String id);
} }

@ -112,4 +112,6 @@ public interface BusinessOrderService extends IService<BusinessOrderEntity> {
//根据业务线带出销售合同 //根据业务线带出销售合同
List<ContractLEntity> queryBusinessContractSaleInfo(String businessLine,String contractNumber); List<ContractLEntity> queryBusinessContractSaleInfo(String businessLine,String contractNumber);
BigDecimal queryBusinessContractSum(String id);
} }

@ -318,6 +318,21 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
} }
if(ObjectUtil.isNotEmpty(businessOrderPagination.getContractNumber())){
businessOrderNum++;
String value = String.valueOf(businessOrderPagination.getContractNumber());
businessOrderQueryWrapper.eq("c.contract_number",value);
}
if(ObjectUtil.isNotEmpty(businessOrderPagination.getCustomer())){
businessOrderNum++;
String value = String.valueOf(businessOrderPagination.getCustomer());
businessOrderQueryWrapper.eq("d.name",value);
}
if(ObjectUtil.isNotEmpty(businessOrderPagination.getDeliveryType())){ if(ObjectUtil.isNotEmpty(businessOrderPagination.getDeliveryType())){
businessOrderNum++; businessOrderNum++;
@ -1602,6 +1617,11 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
return businessOrderMapper.queryBusinessContractSale(businessLine,organize,contractNumber); return businessOrderMapper.queryBusinessContractSale(businessLine,organize,contractNumber);
} }
@Override
public BigDecimal queryBusinessContractSum(String id) {
return businessOrderMapper.queryBusinessContractSum(id);
}
public void getExcel(List<HashMap<String, Object>> list, String templateFilePath,String settlements,BigDecimal amount) throws Exception { public void getExcel(List<HashMap<String, Object>> list, String templateFilePath,String settlements,BigDecimal amount) throws Exception {
String[] strings = settlements.split("_"); String[] strings = settlements.split("_");
settlements=strings[0]; settlements=strings[0];

@ -1179,10 +1179,16 @@ public class BusinessOrderController {
for (ContractLEntity entity : list){ for (ContractLEntity entity : list){
List<ProductByContractModel> productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId()); List<ProductByContractModel> productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId());
if (entity.getIsLongAgreement().equals("1")){ //1是非长协 if (entity.getIsLongAgreement().equals("1")){ //1是非长协
QueryWrapper<BusinessOrderEntity> businessOrderEntityQueryWrapper = new QueryWrapper<>(); BigDecimal planSum =businessOrderService.queryBusinessContractSum(entity.getId());
businessOrderEntityQueryWrapper.lambda().eq(BusinessOrderEntity::getContractId,entity.getId()); if (entity.getContractNum()==null){
List<BusinessOrderEntity> businessOrderEntityList = businessOrderService.list(businessOrderEntityQueryWrapper); entity.setContractNum(BigDecimal.ZERO);
if (businessOrderEntityList!=null && businessOrderEntityList.size()>0){ }
if (planSum==null){
planSum=BigDecimal.ZERO;
}
int comparisonResult = planSum.compareTo(entity.getContractNum());
if (comparisonResult!=-1){
entity.setIslang("1"); entity.setIslang("1");
} }
} }
@ -1207,6 +1213,20 @@ public class BusinessOrderController {
List<ContractLEntity> list= businessOrderService.queryPurchaseContractInfo(businessLineId); List<ContractLEntity> list= businessOrderService.queryPurchaseContractInfo(businessLineId);
for (ContractLEntity entity : list){ for (ContractLEntity entity : list){
List<ProductByContractModel> productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId()); List<ProductByContractModel> productByContractModelList = businessOrderService.queryProductByContractInfo(entity.getId());
if (entity.getIsLongAgreement().equals("1")){ //1是非长协
BigDecimal planSum =businessOrderService.queryBusinessContractSum(entity.getId());
if (entity.getContractNum()==null){
entity.setContractNum(BigDecimal.ZERO);
}
if (planSum==null){
planSum=BigDecimal.ZERO;
}
int comparisonResult = planSum.compareTo(entity.getContractNum());
if (comparisonResult!=-1){
entity.setIslang("1");
}
}
entity.setProductByContractModelList(productByContractModelList); entity.setProductByContractModelList(productByContractModelList);
QueryWrapper<SubjectbasicEntity> subjectQueryWrapper = new QueryWrapper<>(); QueryWrapper<SubjectbasicEntity> subjectQueryWrapper = new QueryWrapper<>();
subjectQueryWrapper.lambda().eq(SubjectbasicEntity::getId,entity.getSubject()); subjectQueryWrapper.lambda().eq(SubjectbasicEntity::getId,entity.getSubject());

@ -83,6 +83,9 @@ public class CwaccountsummaryEntity {
@TableField("ORGANIZE_JSON_ID") @TableField("ORGANIZE_JSON_ID")
private String organizeJsonId; private String organizeJsonId;
@TableField(value = "CODE" , updateStrategy = FieldStrategy.IGNORED)
private String code;
@TableField("ord_ln") @TableField("ord_ln")
private String ordLn; private String ordLn;
@TableField("business_code") @TableField("business_code")

@ -60,6 +60,8 @@ public class CwaccountvoucherEntity {
private String productName; private String productName;
@TableField(value = "SPEC" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "SPEC" , updateStrategy = FieldStrategy.IGNORED)
private String spec; private String spec;
@TableField(value = "UNIT" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "UNIT" , updateStrategy = FieldStrategy.IGNORED)
private String unit; private String unit;
@TableField(value = "GROSS_WEIGHT" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "GROSS_WEIGHT" , updateStrategy = FieldStrategy.IGNORED)
@ -153,4 +155,7 @@ public class CwaccountvoucherEntity {
@TableField(exist = false) @TableField(exist = false)
private BigDecimal storageNumber; private BigDecimal storageNumber;
@TableField(exist = false)
private String code;
} }

@ -30,6 +30,8 @@ public class CwsettlementsummaryEntity {
private String productId; private String productId;
@TableField(value = "SPEC" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "SPEC" , updateStrategy = FieldStrategy.IGNORED)
private String spec; private String spec;
@TableField(value = "CODE" , updateStrategy = FieldStrategy.IGNORED)
private String code;
@TableField(value = "RATE" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "RATE" , updateStrategy = FieldStrategy.IGNORED)
private String rate; private String rate;
@TableField(value = "SETTLEMENT_UNIT" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "SETTLEMENT_UNIT" , updateStrategy = FieldStrategy.IGNORED)

@ -87,5 +87,9 @@ public class BusinessOrderPagination extends Pagination {
@JsonProperty("contractNumber") @JsonProperty("contractNumber")
private String contractNumber; private String contractNumber;
/** 合同编码 */
@JsonProperty("customer")
private String customer;
} }

@ -25,6 +25,9 @@ public class CwaccountsummaryModel {
/** 规格 **/ /** 规格 **/
@JSONField(name = "spec") @JSONField(name = "spec")
private String spec; private String spec;
/** 编码 **/
@JSONField(name = "code")
private String code;
/** 库存单位 **/ /** 库存单位 **/
@JSONField(name = "inventoryUnitId") @JSONField(name = "inventoryUnitId")
private String inventoryUnitId; private String inventoryUnitId;

@ -55,6 +55,9 @@ public class CwaccountvoucherModel {
/** 规格 **/ /** 规格 **/
@JSONField(name = "spec") @JSONField(name = "spec")
private String spec; private String spec;
/** 编码 **/
@JSONField(name = "code")
private String code;
/** 单位 **/ /** 单位 **/
@JSONField(name = "unit") @JSONField(name = "unit")
private String unit; private String unit;

@ -25,6 +25,9 @@ public class CwsettlementsummaryModel {
/** 规格 **/ /** 规格 **/
@JSONField(name = "spec") @JSONField(name = "spec")
private String spec; private String spec;
/** 编码 **/
@JSONField(name = "code")
private String code;
/** 结算单位 **/ /** 结算单位 **/
@JSONField(name = "settlementUnit") @JSONField(name = "settlementUnit")
private String settlementUnit; private String settlementUnit;

@ -948,6 +948,21 @@
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="规格" v-if="judgeShow('cwaccountsummary-spec')" prop="spec"
align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountsummaryList-spec')"></span>编码
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.code"
@change="changeData('cwaccountsummary-spec',scope.$index)" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算单位" v-if="judgeShow('cwaccountsummary-settlementUnit')" <el-table-column label="结算单位" v-if="judgeShow('cwaccountsummary-settlementUnit')"
prop="settlementUnit" align="center" width="150"> prop="settlementUnit" align="center" width="150">
<template slot="header"> <template slot="header">
@ -1371,6 +1386,7 @@ export default {
productId: '', productId: '',
productIdOptions: [], productIdOptions: [],
spec: '', spec: '',
code: '',
specOptions: [], specOptions: [],
inventoryUnitId: '', inventoryUnitId: '',
inventoryUnitIdOptions: [], inventoryUnitIdOptions: [],
@ -2700,7 +2716,7 @@ export default {
found.otherExpenses = this.jnpf.floatSub(Number(found.otherExpenses), Number(cur.otherExpenses)).toFixed(2); found.otherExpenses = this.jnpf.floatSub(Number(found.otherExpenses), Number(cur.otherExpenses)).toFixed(2);
} }
} else { } else {
acc.push({ productId: cur.productId, productName: cur.productName, spec: cur.spec, rate: cur.rate, settlementSum: cur.settlementSum, settlementTotal: cur.taxCount, settlementUnit: cur.unit, settlementPrice: cur.businessPrice, settlementSubtotal: cur.taxCount, settlementPriceNo: cur.notTaxPrice, settlementSubtotalNo: cur.notTaxCount, otherType: cur.otherType, otherExpenses: cur.otherExpenses, settlementTotal: cur.taxCount, settlementTotalNo: cur.notTaxCount, businessOrderId: cur.businessOrderId, orderNo: cur.orderNo }) acc.push({ productId: cur.productId, productName: cur.productName, spec: cur.spec, code: cur.code, rate: cur.rate, settlementSum: cur.settlementSum, settlementTotal: cur.taxCount, settlementUnit: cur.unit, settlementPrice: cur.businessPrice, settlementSubtotal: cur.taxCount, settlementPriceNo: cur.notTaxPrice, settlementSubtotalNo: cur.notTaxCount, otherType: cur.otherType, otherExpenses: cur.otherExpenses, settlementTotal: cur.taxCount, settlementTotalNo: cur.notTaxCount, businessOrderId: cur.businessOrderId, orderNo: cur.orderNo })
} }
return acc return acc
}, []) }, [])

@ -1516,6 +1516,21 @@
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="规格" v-if="judgeShow('cwsettlementsummary-spec')" prop="spec"
align="center" width="150">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwsettlementsummaryList-spec')"></span>编码
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.code"
@change="changeData('cwsettlementsummary-spec',scope.$index)"
placeholder="请输入" :disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算单位" v-if="judgeShow('cwsettlementsummary-settlementUnit')" <el-table-column label="结算单位" v-if="judgeShow('cwsettlementsummary-settlementUnit')"
prop="settlementUnit" align="center" width="150"> prop="settlementUnit" align="center" width="150">
<template slot="header"> <template slot="header">
@ -1933,6 +1948,7 @@ export default {
productId: '', productId: '',
productIdOptions: [], productIdOptions: [],
spec: '', spec: '',
code: '',
itemNmInv: '', itemNmInv: '',
specOptions: [], specOptions: [],
settlementUnit: '', settlementUnit: '',
@ -2626,7 +2642,7 @@ export default {
found.otherExpenses = this.jnpf.floatSub(Number(found.otherExpenses), Number(cur.otherExpenses)).toFixed(2); found.otherExpenses = this.jnpf.floatSub(Number(found.otherExpenses), Number(cur.otherExpenses)).toFixed(2);
} }
} else { } else {
acc.push({ productId: cur.productId, productName: cur.productName, spec: cur.spec, rate: cur.rate, settlementSum: cur.settlementSum, settlementTotal: cur.settlementTotal, settlementUnit: cur.settlementUnit, settlementPrice: cur.settlementPrice, settlementSubtotal: cur.settlementSubtotal, settlementPriceNo: cur.settlementPriceNo, settlementSubtotalNo: cur.settlementSubtotalNo, otherType: cur.otherType, otherExpenses: cur.otherExpenses, settlementTotal: cur.settlementTotal, settlementTotalNo: cur.settlementTotalNo }) acc.push({ productId: cur.productId, productName: cur.productName, spec: cur.spec, code: cur.code, rate: cur.rate, settlementSum: cur.settlementSum, settlementTotal: cur.settlementTotal, settlementUnit: cur.settlementUnit, settlementPrice: cur.settlementPrice, settlementSubtotal: cur.settlementSubtotal, settlementPriceNo: cur.settlementPriceNo, settlementSubtotalNo: cur.settlementSubtotalNo, otherType: cur.otherType, otherExpenses: cur.otherExpenses, settlementTotal: cur.settlementTotal, settlementTotalNo: cur.settlementTotalNo })
} }
return acc return acc
}, []) }, [])

@ -136,6 +136,9 @@
</el-table-column> </el-table-column>
<el-table-column prop="docmentNum" label="单据数" align="center" width="150"> <el-table-column prop="docmentNum" label="单据数" align="center" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="settlementSum" label="结算数量" align="center" width="150">
</el-table-column>
<el-table-column prop="settlementAmount" label="应收/应付合计(含税)" align="center" width="150"> <el-table-column prop="settlementAmount" label="应收/应付合计(含税)" align="center" width="150">
</el-table-column> </el-table-column>
<!-- <el-table-column prop="paymentAmount" label="已付金额" align="center" width="150"> <!-- <el-table-column prop="paymentAmount" label="已付金额" align="center" width="150">
@ -586,7 +589,7 @@ export default {
if (index === 0) { if (index === 0) {
sums[index] = '合计'; sums[index] = '合计';
return; return;
} else if (["docmentNum", "settledAmount", "settlementAmount", "settlementExpenses", "paymentAmount", } else if (["docmentNum", "settledAmount", "settlementSum", "settlementAmount", "settlementExpenses", "paymentAmount",
"prepaidDeductionAmount", "returnAmount", "marginAmount", "underpaymentAmount", "overdueAmount", "prepaidDeductionAmount", "returnAmount", "marginAmount", "underpaymentAmount", "overdueAmount",
"payableAmount", "currentMarginAmount", "currentUnderpaymentAmount", "settlableAmount", "applyAmount" "payableAmount", "currentMarginAmount", "currentUnderpaymentAmount", "settlableAmount", "applyAmount"
].includes(column.property)) { ].includes(column.property)) {

@ -2159,6 +2159,16 @@ export default {
} }
} }
} }
if (this.dataForm.islang == "1") {
this.$message({
message: '该合同是非长协合同,并且采购数量已经大于合同数量,无法再做采购订单',
type: 'error',
duration: 3000
})
isOk = false
}
if (!this.settlementinfoExist()) return if (!this.settlementinfoExist()) return
if (!this.businessorderproductrelationalExist()) return if (!this.businessorderproductrelationalExist()) return
return isOk return isOk

@ -2112,10 +2112,10 @@ export default {
} }
} }
} }
debugger
if (this.dataForm.islang == "1") { if (this.dataForm.islang == "1") {
this.$message({ this.$message({
message: '该合同是非长协合同,并且已经做了订单,请重新选择合同', message: '该合同是非长协合同,并且销售数量已经大于合同数量,无法再做销售订单',
type: 'error', type: 'error',
duration: 3000 duration: 3000
}) })

@ -37,6 +37,20 @@
</JnpfSelect> </JnpfSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="客户">
<el-input v-model="query.customer" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="销售合同编码">
<el-input v-model="query.contractNumber" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="状态"> <el-form-item label="状态">
<JnpfSelect v-model="query.status" placeholder="请选择" clearable <JnpfSelect v-model="query.status" placeholder="请选择" clearable
@ -111,6 +125,9 @@
</el-table-column> </el-table-column>
<el-table-column prop="contractNumber" label="关联合同号" align="center" width="150"> <el-table-column prop="contractNumber" label="关联合同号" align="center" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="counterpartOrderCode" label="对方订单号" align="center" width="150">
</el-table-column>
<!-- <template v-if="this.deliveryType == '1'"> <!-- <template v-if="this.deliveryType == '1'">
<el-table-column prop="result" label="校验结果" sortable align="center" width="100"> <el-table-column prop="result" label="校验结果" sortable align="center" width="100">
</el-table-column> </el-table-column>
@ -299,6 +316,8 @@ export default {
orderType: undefined, orderType: undefined,
code: undefined, code: undefined,
urgentOrder: undefined, urgentOrder: undefined,
customer: undefined,
contractNumber: undefined,
createOrderDate: undefined, createOrderDate: undefined,
status: undefined, status: undefined,
businessType: "2", businessType: "2",

Loading…
Cancel
Save