wanggang 1 year ago
parent
commit
dac6ff9b18
  1. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  2. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
  3. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/finance.js
  4. 43
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory.js
  5. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/unable.js
  6. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/usable.js
  7. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  8. 59
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js
  9. 60
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js
  10. 45
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/vmi.js
  11. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

5
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js

@ -104,8 +104,9 @@ export default {
<el-table-column :prop="key+'.'+key2"> <el-table-column :prop="key+'.'+key2">
<template #header="scope">{{item2.title}}</template> <template #header="scope">{{item2.title}}</template>
<template #default="scope"> <template #default="scope">
<app-form-input mode="details" :schema="item2" :prop="key+'.'+key2" v-model="scope.row[key]" /> <template v-if="scope.row[key]">
{{scope.row[key][key2]}} <app-form-input mode="details" :schema="item2" :prop="key2" v-model="scope.row[key]" />
</template>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js

@ -1,4 +1,4 @@
import businessType, { version, state2 } from "../_options.js"; import businessType, { state2 } from "../_options.js";
const state = Object.assign({}, state2); const state = Object.assign({}, state2);
state.input = "tabs"; state.input = "tabs";
@ -65,7 +65,7 @@ export default function (businessType, type) {
service = "invoice_service"; service = "invoice_service";
} }
const queryUrl = `settleaccount/${service}/main-query`; const queryUrl = `settleaccount/${service}/main-query`;
const exportUrl = `settleaccount/invoice_service/export-detail`; const exportUrl = `settleaccount/${service}/export-detail`;
const invoiceUrl = `settleaccount/${service}/generate-invoice`; const invoiceUrl = `settleaccount/${service}/generate-invoice`;
const receivedUrl = `settleaccount/${service}/received`; const receivedUrl = `settleaccount/${service}/received`;
const rejectUrl = `settleaccount/${service}/reject`; const rejectUrl = `settleaccount/${service}/reject`;

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/finance.js

@ -1,3 +1,4 @@
//财务审核
import version from "../version.js"; import version from "../version.js";
import { state2 } from "../state.js"; import { state2 } from "../state.js";
import businessType from "../businessType.js"; import businessType from "../businessType.js";

43
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/finance-detail.js → code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory.js

@ -1,3 +1,4 @@
//库存扣减
import { version, state3 } from "../_options.js"; import { version, state3 } from "../_options.js";
const schema = { const schema = {
@ -7,8 +8,9 @@ const schema = {
version, version,
state: state3, state: state3,
billNum: { billNum: {
title: "结算单号", title: "发票号",
type: "string", type: "string",
link: true,
}, },
settleBillNum: { settleBillNum: {
title: "关联结算单号", title: "关联结算单号",
@ -17,6 +19,7 @@ const schema = {
invGroupNum: { invGroupNum: {
title: "发票分组号", title: "发票分组号",
type: "string", type: "string",
link: true,
}, },
site: { site: {
title: "地点", title: "地点",
@ -34,8 +37,17 @@ export default function (businessType) {
} else { } else {
service = "p-uB_PD_SERVICE"; service = "p-uB_PD_SERVICE";
} }
const queryUrl = `settleaccount/${service}/detail-query`;
const queryUrl = `settleaccount/${service}/main-query`;
const detailUrl = `settleaccount/${service}/detail-query`;
const exportUrl = `settleaccount/${service}/export`;
const approvalUrl = `settleaccount/${service}/approval-passed`;
const rejectUrl = `settleaccount/${service}/reject`;
const queryMethod = "POST"; const queryMethod = "POST";
const detailMethod = "POST";
const exportMethod = "POST";
const approvalMethod = "POST";
const rejectMethod = "POST";
return { return {
query: { query: {
@ -70,22 +82,29 @@ export default function (businessType) {
default: [ default: [
{ {
logic: "and", logic: "and",
action: "like", column: "version",
column: "partCode", action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billNum",
action: "equal",
value: null, value: null,
readOnly: true, readOnly: true,
}, },
{ {
logic: "and", logic: "and",
action: "like", column: "invGroupNum",
column: "pn", action: "equal",
value: null, value: null,
readOnly: true, readOnly: true,
}, },
{ {
logic: "and", logic: "and",
action: "like", column: "invGroupNum",
column: "groupNum", action: "equal",
value: null, value: null,
readOnly: true, readOnly: true,
}, },
@ -113,6 +132,14 @@ export default function (businessType) {
schema: schema, schema: schema,
}, },
edit: { edit: {
detailUrl,
detailMethod,
exportUrl,
exportMethod,
approvalUrl,
approvalMethod,
rejectUrl,
rejectMethod,
schema: schema, schema: schema,
}, },
}; };

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/unable.js

@ -1,3 +1,4 @@
//不可结算明细
import { version, state } from "../_options.js"; import { version, state } from "../_options.js";
const schema = { const schema = {

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/usable.js

@ -1,3 +1,4 @@
//可计算单
import { version, state } from "../_options.js"; import { version, state } from "../_options.js";
const schema = { const schema = {

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js

@ -95,7 +95,7 @@ function createCommerceCheckList(path, business, client, title = "商务审批")
function createVmiOutCheckList(path, business, client, title = "寄售库库存扣减审批") { function createVmiOutCheckList(path, business, client, title = "寄售库库存扣减审批") {
return { return {
...createPage(path, `title=${title}&businessType=${business}&client=${client}`), ...createPage(path, `title=${title}&businessType=${business}&client=${client}`),
component: "/settle/vmi", component: "/settle/inventory",
children: [ children: [
createButton("query", "title=查询&isTop=true"), createButton("query", "title=查询&isTop=true"),
createButton("compare", "title=扣减审核通过&isTop=true"), createButton("compare", "title=扣减审核通过&isTop=true"),
@ -335,7 +335,7 @@ export default [
children: [ children: [
{ {
...createPage("finance", `title=财务审核`), ...createPage("finance", `title=财务审核`),
component: "/settle/vmi", component: "/settle/finance",
children: [ children: [
createButton("query", "title=查询&isTop=true"), createButton("query", "title=查询&isTop=true"),
createButton("import", "title=导入开票文件&isTop=true"), createButton("import", "title=导入开票文件&isTop=true"),

59
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js

@ -0,0 +1,59 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import { ref } from "vue";
import request, { getUrl } from "../../request/index.js";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js";
export default {
components: { AppList, AppCheck },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :businessType="businessType" :data="data" />`,
setup() {
const appListRef = ref(null);
const visable = ref(false);
const data = ref(null);
const route = useRoute();
const businessType = route.meta.businessType;
const config = useConfig(businessType, "cai-wu");
const onCommand = async (item, rows) => {
if (item.path === "approval" || item.path === "reject" || item.path === "receive") {
if (rows.length > 0) {
const message =
item.path === "approval"
? `确认审核通过选中的${rows.length}行数据吗?`
: item.path === "reject"
? `确认退回选中的${rows.length}行数据吗?`
: `确认选中的${rows.length}行数据客户已收票吗?`;
const data = item.path === "approval" ? rows.map((o) => o.invbillNum) : item.path === "reject" ? rows[0]["invGroupNum"] : rows.map((o) => o.invbillNum);
const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
}
} else if (item.path === "export-group") {
const url = config.edit.exportUrl;
const method = config.edit.exportMethod;
const postData = {
filters: [
{
logic: "and",
column: "invGroupNum",
action: "equal",
value: rows[0]["invGroupNum"],
},
],
};
await appListRef.value.onClick(async () => {
const response = await request(url, postData, { method }, true);
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
});
} else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
}
console.log(item.path, item, rows);
};
return { appListRef, config, onCommand, visable, data, businessType };
},
};

60
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js

@ -0,0 +1,60 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import { ref } from "vue";
import request, { getUrl } from "../../request/index.js";
import useConfig from "../../models/settle/inventory.js";
import AppCheck from "./_check.js";
export default {
components: { AppList, AppCheck },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :businessType="businessType" :data="data" :isBusiness="true" />`,
setup() {
const appListRef = ref(null);
const visable = ref(false);
const data = ref(null);
const route = useRoute();
const businessType = route.meta.businessType;
const config = useConfig(businessType, "shang-wu");
const onCommand = async (item, rows) => {
if (item.path === "approval" || item.path === "reject" || item.path === "receive") {
if (rows.length > 0) {
const message =
item.path === "approval"
? `确认审核通过选中的${rows.length}行数据吗?`
: item.path === "reject"
? `确认退回选中的${rows.length}行数据吗?`
: `确认选中的${rows.length}行数据客户已收票吗?`;
const data = item.path === "approval" ? rows.map((o) => o.invbillNum) : item.path === "reject" ? rows[0]["invGroupNum"] : rows.map((o) => o.invbillNum);
const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
}
} else if (item.path === "export-group") {
const url = config.edit.exportUrl;
const method = config.edit.exportMethod;
const postData = {
filters: [
{
logic: "and",
column: "invGroupNum",
action: "equal",
value: rows[0]["invGroupNum"],
},
],
};
await appListRef.value.onClick(async () => {
const response = await request(url, postData, { method }, true);
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
});
} else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
}
console.log(item.path, item, rows);
};
return { appListRef, config, onCommand, visable, data, businessType };
},
};

45
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/vmi.js

@ -2,22 +2,59 @@ import AppList from "../../components/list/index.js";
import html from "html"; import html from "html";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { ref } from "vue"; import { ref } from "vue";
import useConfig from "../../models/settle/commerce.js"; import request, { getUrl } from "../../request/index.js";
import useConfig from "../../models/settle/inventory.js/index.js";
import AppCheck from "./_check.js"; import AppCheck from "./_check.js";
export default { export default {
components: { AppList, AppCheck }, components: { AppList, AppCheck },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" />`, template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :businessType="businessType" :data="data" :isBusiness="true" />`,
setup() { setup() {
const appListRef = ref(null); const appListRef = ref(null);
const visable = ref(false); const visable = ref(false);
const data = ref(null); const data = ref(null);
const route = useRoute(); const route = useRoute();
const businessType = route.meta.businessType; const businessType = route.meta.businessType;
const config = useConfig(businessType, "cai-wu"); const config = useConfig(businessType, "shang-wu");
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
if (item.path === "approval" || item.path === "reject" || item.path === "receive") {
if (rows.length > 0) {
const message =
item.path === "approval"
? `确认审核通过选中的${rows.length}行数据吗?`
: item.path === "reject"
? `确认退回选中的${rows.length}行数据吗?`
: `确认选中的${rows.length}行数据客户已收票吗?`;
const data = item.path === "approval" ? rows.map((o) => o.invbillNum) : item.path === "reject" ? rows[0]["invGroupNum"] : rows.map((o) => o.invbillNum);
const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
}
} else if (item.path === "export-group") {
const url = config.edit.exportUrl;
const method = config.edit.exportMethod;
const postData = {
filters: [
{
logic: "and",
column: "invGroupNum",
action: "equal",
value: rows[0]["invGroupNum"],
},
],
};
await appListRef.value.onClick(async () => {
const response = await request(url, postData, { method }, true);
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
});
} else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
}
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { appListRef, config, onCommand, visable, data }; return { appListRef, config, onCommand, visable, data, businessType };
}, },
}; };

15
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -25,6 +25,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Extensions; using Microsoft.OpenApi.Extensions;
using Omu.ValueInjecter; using Omu.ValueInjecter;
using Polly; using Polly;
using RestSharp.Extensions;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
@ -708,13 +709,12 @@ public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransien
{ {
using var scope = _serviceProvider.CreateScope(); using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>(); var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var query = db.Set<VmiMessage>().AsQueryable(); using var transaction = db.Database.BeginTransaction();
using var dc = db.CreateLinqToDBConnection();
dc.BeginTransaction();
try try
{ {
var messages = db.Set<VmiMessage>().Where(o => !o.isConsumed).OrderBy(o => o.Number).ToList();
var repo = db.Set<VmiBalance>(); var repo = db.Set<VmiBalance>();
foreach (var message in query) foreach (var message in messages)
{ {
var log = JsonSerializer.Deserialize<VmiLog>(message.Message); var log = JsonSerializer.Deserialize<VmiLog>(message.Message);
var balance = db.Set<VmiBalance>().FirstOrDefault( var balance = db.Set<VmiBalance>().FirstOrDefault(
@ -736,7 +736,8 @@ public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransien
else else
{ {
var logType = log.LogType; var logType = log.LogType;
var qty = balance.Qty + log.Qty;
var qty = balance.Qty;// + log.ty
if (logType == VmiLogType.Type100) if (logType == VmiLogType.Type100)
{ {
//发运入库,负库存字段需要更新 //发运入库,负库存字段需要更新
@ -773,12 +774,12 @@ public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransien
} }
message.isConsumed = true; message.isConsumed = true;
} }
dc.Transaction.Commit(); transaction.Commit();
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine(ex.ToString()); Console.WriteLine(ex.ToString());
dc.Transaction.Rollback(); transaction.Rollback();
throw; throw;
} }
} }

Loading…
Cancel
Save