学 赵 1 year ago
parent
commit
9986fc40b1
  1. 12
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs
  2. 53
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  3. 17
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/user.js
  4. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/index.html
  5. 1987
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/lib/pinia.esm-browser.js
  6. 3613
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/lib/vue-router.esm-browser.js
  7. 15377
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/lib/vue.esm-browser.js
  8. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/pages/component.html
  9. 102
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js
  10. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-item.js
  11. 126
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  12. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html
  13. 13
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/businessType.js
  14. 200
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js
  15. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/backup.js
  16. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/balance.js
  17. 23
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/inventory.js
  18. 92
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js
  19. 60
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/vmi.js
  20. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_map_group.js
  21. 49
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_sa_detail_service.js
  22. 54
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_sa_service.js
  23. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_se_detail_service.js
  24. 18
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_can_sa_detail_service.js
  25. 48
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/input/hbpo_sa_detail_service.js
  26. 62
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/input/hbpo_sa_service.js
  27. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/input/hbpo_se_detail_service.js
  28. 18
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_can_sa_detail_service.js
  29. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-service.js
  30. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_can_sa_detail_service.js
  31. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/tb_re-parts-relationship_service.js
  32. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
  33. 689
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  34. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js
  35. 12
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/contrast/bj_pub_sa_detail_jobservice.js
  36. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/input/bj_pub_sa_detail_service.js
  37. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/input/bj_pub_sa_service.js
  38. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/input/bj_pub_se_detail_service.js
  39. 40
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/home.js
  40. 12
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/contrast/in_pub_sa_detail_jobservice.js
  41. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/input/in_pub_sa_detail_service.js
  42. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/input/in_pub_sa_service.js
  43. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/input/in_pub_se_detail_service.js
  44. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/inventory/adjust.js
  45. 61
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js
  46. 12
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/bbac_jit_pub_sa_detail_jobservice.js
  47. 12
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/hbpo_jit_pub_sa_detail_jobservice.js
  48. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_sa_detail_service.js
  49. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_sa_service.js
  50. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_se_detail_service.js
  51. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_sa_detail_service.js
  52. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_sa_service.js
  53. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_se_detail_service.js
  54. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/login.js
  55. 24
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/contrast/md_pub_sa_detail_jobservice.js
  56. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/input/md_pub_sa_detail_service.js
  57. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/input/md_pub_sa_service.js
  58. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/input/md_pub_se_detail_service.js
  59. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_ba_detail_service.js
  60. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_ba_service.js
  61. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_can_sa_detail_service.js
  62. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_can_sa_service.js
  63. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_not_sa_service.js
  64. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_pd_detail_service.js
  65. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_pd_service.js
  66. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  67. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  68. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
  69. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  70. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs
  71. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs
  72. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs
  73. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs
  74. 42
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs
  75. 38
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
  76. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs
  77. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs
  78. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs
  79. 39
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  80. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  81. 37
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs
  82. 169
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  83. 6
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  84. 5288
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.Designer.cs
  85. 38
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.cs
  86. 5333
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808062331_20230808-2.Designer.cs
  87. 79
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808062331_20230808-2.cs
  88. 56
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
  89. 17
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
  90. 270
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  91. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

12
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs

@ -33,12 +33,6 @@ public class Startup
JobHostdService.AddService(services); JobHostdService.AddService(services);
services.AddSingleton<JobHostdService>(); services.AddSingleton<JobHostdService>();
services.AddHostedService(o => o.GetRequiredService<JobHostdService>()); services.AddHostedService(o => o.GetRequiredService<JobHostdService>());
services.AddTransient<HBPOSeSyncAppService>();
services.AddTransient<BBACSeSyncAppService>();
services.AddTransient<ZhiGongBBACSeSyncAppService>();
services.AddTransient<ZhiGongHBPOSeSyncAppService>();
services.AddTransient<BeiSeSyncAppService>();
services.AddTransient<YinDuSeSyncAppService>();
services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer)); services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer));
services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer()))); services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer())));
services.AddApplication<SettleAccountHttpApiHostModule>(); services.AddApplication<SettleAccountHttpApiHostModule>();
@ -62,12 +56,6 @@ public class Startup
app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub")); app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub"));
app.ApplicationServices.UseScheduler(scheduler => app.ApplicationServices.UseScheduler(scheduler =>
{ {
scheduler.Schedule<HBPOSeSyncAppService>().EveryMinute();
scheduler.Schedule<BBACSeSyncAppService>().EveryMinute();
scheduler.Schedule<ZhiGongBBACSeSyncAppService>().EveryMinute();
scheduler.Schedule<ZhiGongHBPOSeSyncAppService>().EveryMinute();
scheduler.Schedule<BeiSeSyncAppService>().EveryMinute();
scheduler.Schedule<YinDuSeSyncAppService>().EveryMinute();
}); });
var contentTypeProvider = new FileExtensionContentTypeProvider(); var contentTypeProvider = new FileExtensionContentTypeProvider();
contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); contentTypeProvider.Mappings.Add(".mjs", "text/javascript");

53
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

@ -2,12 +2,25 @@
"App": { "App": {
"CorsOrigins": "https://*.abc.com,http://localhost:9527,http://149.223.116.5:8088" "CorsOrigins": "https://*.abc.com,http://localhost:9527,http://149.223.116.5:8088"
}, },
//"ConnectionStrings": {
// "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#",
// "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService1;user id=sa;Password=1q2w!@#;"
//},
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,13319;Database=BJABP;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True", "Default": "Server=dev.ccwin-in.com,13319;Database=BJABP;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True",
"SettleAccountService": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;", "SettleAccountService": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;"
"WMSBJBMPT": "Server=dev.ccwin-in.com,6208;Database=WMS_BJBMPT_2;User ID=sa;Password=ChangkeTec@2021;Trusted_Connection=False;TrustServerCertificate=True;", //"SettleAccountService": "Server=localhost;Database=BQ_SA;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True",
"questdb": "host=dev.ccwin-in.com;port=10580;username=admin;password=quest;database=vmi;ServerCompatibilityMode=NoTypeLoading;" //"Default": "Server=localhost;Database=BJABP;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True"
}, },
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Serilog": { "Serilog": {
"Using": [], "Using": [],
"MinumumLevel": { "MinumumLevel": {
@ -69,8 +82,15 @@
}, },
"AuthServer": { "AuthServer": {
"Authority": "http://localhost:10582", //"Authority": "http://dev.ccwin-in.com:10580",
"Authority": "http://localhost:44378",
"ClientId": "basic-web", "ClientId": "basic-web",
"ClientSecret": "1q2w3e*" "ClientSecret": "1q2w3e*"
}, },
@ -80,5 +100,28 @@
}, },
"DefaultBranchId": "3FA85F64-5717-4562-B3FC-2C963F66AFA6", "DefaultBranchId": "3FA85F64-5717-4562-B3FC-2C963F66AFA6",
"AllowedHosts": "*" "AllowedHosts": "*",
"ElasticSearch": {
"Url": "http://localhost:9200"
},
"RemoteServices": {
"Default": {
"BaseUrl": "http://149.223.116.5:8091/",
"UseCurrentAccessToken": "true"
}
},
"IdentityClients": {
"Default": {
"GrantType": "client_credentials",
"ClientId": "business-app",
"ClientSecret": "1q2w3e*",
"Authority": "http://149.223.116.5:8066",
"Scope": "InternalGateway IdentityService SettleAccount"
}
}
} }

17
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/user.js

@ -22,21 +22,6 @@ const isLogin = async () => {
return false; return false;
}; };
const login = async (data) => {
const url = "connect-token";
const appStore = useAppStore();
const result = await post(url, data, { headers: { "Content-Type": "application/x-www-form-urlencoded" } }, true);
if (!result.errors) {
appStore.token = result.data.access_token;
setRefreshToken(result.data.refresh_token);
appStore.user = await getUser();
await refreshRouter();
const redirect = router.currentRoute.value.query?.redirect ?? "/";
router.push(redirect);
}
return result;
};
const logout = () => { const logout = () => {
const appStore = useAppStore(); const appStore = useAppStore();
appStore.token = null; appStore.token = null;
@ -87,4 +72,4 @@ const removeRefreshToken = () => {
connection.stop(); connection.stop();
}; };
export { isLogin, login, logout, getAccessToken, setAccessToken, setRefreshToken, getUser, hasPermission }; export { isLogin, logout, getAccessToken, setAccessToken, setRefreshToken, getUser, hasPermission };

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/index.html

@ -46,9 +46,9 @@
<script type="importmap"> <script type="importmap">
{ {
"imports": { "imports": {
"vue": "./lib/vue.esm-browser.js", "vue": "/lib/vue/vue.esm-browser.js",
"vue-router": "./lib/vue-router.esm-browser.js", "vue-router": "/lib/vue-router/vue-router.esm-browser.js",
"pinia": "./lib/pinia.esm-browser.js" "pinia": "/lib/pinia/pinia.esm-browser.js"
} }
} }
</script> </script>

1987
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/lib/pinia.esm-browser.js

File diff suppressed because it is too large

3613
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/lib/vue-router.esm-browser.js

File diff suppressed because it is too large

15377
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/lib/vue.esm-browser.js

File diff suppressed because it is too large

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/pages/component.html

@ -13,9 +13,9 @@
<script type="importmap"> <script type="importmap">
{ {
"imports": { "imports": {
"vue": "../lib/vue.esm-browser.js", "vue": "/lib/vue/vue.esm-browser.js",
"vue-router": "../lib/vue-router.esm-browser.js", "vue-router": "/lib/vue-router/vue-router.esm-browser.js",
"pinia": "../lib/pinia.esm-browser.js" "pinia": "/lib/pinia/pinia.esm-browser.js"
} }
} }
</script> </script>

102
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js

@ -1,8 +1,9 @@
import html from "html"; import html from "html";
import { ref, reactive, watch, onMounted } from "vue"; import { ref, reactive, watch, onMounted, nextTick } from "vue";
import { dayjs } from "element-plus"; import { dayjs } from "element-plus";
import request from "../../request/index.js"; import request from "../../request/index.js";
import { importFunction } from "../../utils/index.js"; import { importFunction, bytesFormat } from "../../utils/index.js";
import { ElMessage, useFormItem } from "element-plus";
export default { export default {
template: html` template: html`
@ -32,20 +33,12 @@ export default {
<template v-else-if="getInput(schema)==='month'"> <template v-else-if="getInput(schema)==='month'">
<el-date-picker v-model="model[prop]" :type="schema.input" :value-format="schema.format" /> <el-date-picker v-model="model[prop]" :type="schema.input" :value-format="schema.format" />
</template> </template>
<el-input <template v-else-if="getInput(schema)==='number'">
:disabled="getDisabled()" <el-input :disabled="getDisabled()" :placeholder="schema.title" v-model="model[prop]" type="number" />
:placeholder="schema.title" </template>
v-model="model[prop]" <template v-else-if="getInput(schema)==='integer'">
type="number" <el-input-number :disabled="getDisabled()" :placeholder="schema.title" v-model="model[prop]" :precision="0" />
v-else-if="getInput(schema)==='number'" </template>
/>
<el-input-number
:disabled="getDisabled()"
:placeholder="schema.title"
v-model="model[prop]"
:precision="0"
v-else-if="getInput(schema)==='integer'"
/>
<template v-else-if="getInput(schema)==='boolean'"> <template v-else-if="getInput(schema)==='boolean'">
<el-select :disabled="getDisabled()" v-model="model[prop]" :placeholder="schema.title" v-if="schema.nullable"> <el-select :disabled="getDisabled()" v-model="model[prop]" :placeholder="schema.title" v-if="schema.nullable">
<el-option prop="select" value="" :label="$t('select')" /> <el-option prop="select" value="" :label="$t('select')" />
@ -54,23 +47,41 @@ export default {
</el-select> </el-select>
<el-switch v-model="model[prop]" type="checked" v-else /> <el-switch v-model="model[prop]" type="checked" v-else />
</template> </template>
<template v-else-if="getInput(schema)==='file'">
<el-upload
ref="uploadRef"
v-model:file-list="model[prop]"
class="upload"
drag
:accept="schema.accept"
:multiple="schema.multiple"
:limit="limit"
:auto-upload="false"
:on-change="handleChange"
>
<template #trigger>
<el-icon style="font-size:4em;">
<ep-upload-filled />
</el-icon>
</template>
<template #tip>
<div class="el-upload__tip">
<div>
单个文件大小限制{{ bytesFormat(size) }}上传数量限制{{ limit }}
<template v-if="schema.accept">上传文件类型{{ schema.accept }}</template>
</div>
</div>
</template>
</el-upload>
</template>
<template v-else> <template v-else>
<el-input
:clearable="!!schema.clearable"
:disabled="getDisabled()"
:placeholder="schema.title"
v-model="model[prop]"
type="password"
show-password
v-if="schema.input==='password'"
/>
<el-input <el-input
:clearable="!!schema.clearable" :clearable="!!schema.clearable"
:disabled="getDisabled()" :disabled="getDisabled()"
:placeholder="schema.title" :placeholder="schema.title"
v-model="model[prop]" v-model="model[prop]"
:type="schema.input??'text'" :type="schema.input??'text'"
v-else :show-password="schema.input==='password'"
/> />
</template> </template>
</template> </template>
@ -96,12 +107,44 @@ export default {
return schema.input ?? schema.type; return schema.input ?? schema.type;
}; };
/*end*/ /*end*/
//options //options
const selectProps = ref({}); const selectProps = ref({});
const selectValues = ref([]); const selectValues = ref([]);
const options = ref([]); const options = ref([]);
//watch
//upload
const fileList = ref([]);
const limit = props.schema.multiple ? props.schema.limit ?? 5 : 1;
const size = props.schema.size ?? 1024 * 1024;
const fileTypes = props.schema.accept?.split(",").map((o) => o.toLowerCase()) ?? [];
const { formItem } = useFormItem();
const handleChange = async (uploadFile, uploadFiles) => {
const ext = uploadFile.name.substr(uploadFile.name.lastIndexOf("."));
const index = uploadFiles.findIndex((o) => o.uid !== uploadFile.uid);
if (props.schema.accept && !fileTypes.some((o) => o === ext)) {
ElMessage.error(`当前文件 ${uploadFile.name} 不是可选文件类型 ${props.schema.accept}`);
uploadFiles.splice(index, 1);
return false;
}
if (uploadFile.size > size) {
ElMessage.error(`当前文件大小 ${bytesFormat(uploadFile.size)} 已超过 ${bytesFormat(size)}`);
uploadFiles.splice(index, 1);
return false;
}
if (uploadFiles.length) {
model[props.prop] = props.schema.multiple ? uploadFiles : uploadFiles[0];
} else {
model[props.prop] = props.schema.multiple ? [] : null;
}
try {
await formItem.validate();
} catch (error) {
console.log(error);
}
};
//watch
watch( watch(
() => model[props.prop], () => model[props.prop],
async (value) => { async (value) => {
@ -143,6 +186,11 @@ export default {
selectProps, selectProps,
selectValues, selectValues,
options, options,
bytesFormat,
fileList,
limit,
size,
handleChange,
}; };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-item.js

@ -10,7 +10,7 @@ export default {
template: html` template: html`
<template v-if="!schema.hidden"> <template v-if="!schema.hidden">
<template v-if="schema.type==='object'"></template> <template v-if="schema.type==='object'"></template>
<template v-else-if="schema.type!=='array'||schema.items.type!=='array'"> <template v-else-if="schema.type!=='array'||schema.items?.type!=='array'">
<el-form-item <el-form-item
:title="prop" :title="prop"
:label="schema.title" :label="schema.title"

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

@ -263,25 +263,15 @@ export default {
</template> </template>
<template v-else-if="editFormMode==='import'"> <template v-else-if="editFormMode==='import'">
<app-form <app-form
mode="import" ref="importFormRef"
mode="update"
label-position="left" label-position="left"
:schema="config.import?.schema" :schema="config.import?.schema"
v-model="importModel" v-model="importModel"
:hideButton="true" :hideButton="true"
:isQueryForm="true" :isQueryForm="true"
style="height:100%;"
> >
<el-form-item :label="$t('文件')" label-width="80px">
<el-upload
ref="uploadRef"
class="upload"
drag
accept=".xlsx"
:auto-upload="false"
:on-change="handleChange"
>
<el-icon class="el-icon--upload"><ep-upload-filled /></el-icon>
</el-upload>
</el-form-item>
</app-form> </app-form>
</template> </template>
<template v-else-if="editFormMode==='filter'"> <template v-else-if="editFormMode==='filter'">
@ -408,6 +398,7 @@ export default {
const tableSchema = ref({}); const tableSchema = ref({});
const tableData = ref([]); const tableData = ref([]);
const editFormRef = ref(null); const editFormRef = ref(null);
const importFormRef = ref(null);
const editFormloading = ref(false); const editFormloading = ref(false);
const editFormMode = ref(null); const editFormMode = ref(null);
const editFormTitle = ref(""); const editFormTitle = ref("");
@ -424,11 +415,27 @@ export default {
businessType: route.meta.businessType, businessType: route.meta.businessType,
}; };
const exportModel = ref(defaultExportModel); const exportModel = ref(defaultExportModel);
const defaultImportModel = config.import?.schema ? schemaToModel(config.import.schema) : {}; //
const importModel = ref(defaultImportModel); config.import ??= { schema: { type: "object", properties: {} } };
const factories = ref([]); config.import.schema.properties.files ??= {
title: "文件",
type: "array",
multiple: true,
input: "file",
accept: ".xlsx",
default: [],
limit: 10,
size: 100 * 1024 * 1024,
rules: [
{
required: true,
trigger: "change",
},
],
};
const defaultImportModel = schemaToModel(config.import.schema);
const importModel = ref(null);
const versions = ref([]); const versions = ref([]);
const fileList = ref([]);
const getSortModel = (model) => { const getSortModel = (model) => {
(model.sorting ?? "") (model.sorting ?? "")
.split(",") .split(",")
@ -575,10 +582,6 @@ export default {
} }
} }
} }
// await post(
// url,
// rows.map((o) => o.id)
// );
await load(); await load();
} else if (item.path === "export") { } else if (item.path === "export") {
//export //export
@ -609,20 +612,7 @@ export default {
importModel.value = Object.assign({}, defaultImportModel); importModel.value = Object.assign({}, defaultImportModel);
editFormloading.value = true; editFormloading.value = true;
editFormTitle.value = `${t(item.path)}${config.query.schema.title}`; editFormTitle.value = `${t(item.path)}${config.query.schema.title}`;
fileList.value = [];
dialogVisible.value = true; dialogVisible.value = true;
// versions.value = (
// await request("settleaccount/centralized-control/get-all", null, { method: "POST" })
// ).data.items.map((o) => ({
// value: o.version,
// label: o.version,
// }));
// factories.value = (
// await request("settleaccount/code-setting/get-all", null, { method: "POST" })
// ).data.items.map((o) => ({
// value: o.project,
// label: o.project,
// }));
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} finally { } finally {
@ -667,38 +657,47 @@ export default {
dialogVisible.value = false; dialogVisible.value = false;
editFormMode.value = null; editFormMode.value = null;
} else if (editFormMode.value === "compare") { } else if (editFormMode.value === "compare") {
// const postData = JSON.parse(JSON.stringify(queryModel.value));
// postData.filters = filterList.value.filter((o) => o.property && o.value);
// delete postData.query["items"];
// delete postData.query["id"];
// const url = `${baseUrl}/${editFormMode.value}?${qs.stringify(exportModel)}`;
// const response = await post(url, postData);
// download(response);
const url = config.edit.compareUrl; const url = config.edit.compareUrl;
await request(url, exportModel.value, { method: config.edit.compareMethod }); await request(url, exportModel.value, { method: config.edit.compareMethod });
dialogVisible.value = false; dialogVisible.value = false;
} else if (editFormMode.value === "import") { } else if (editFormMode.value === "import") {
editFormloading.value = true; try {
const url = config.edit.importUrl; const valid = await importFormRef.value.validate();
const formData = new FormData(); if (valid) {
// formData.append("version", importModel.value.version); editFormloading.value = true;
// // formData.append("factory", importModel.value.factory); const url = config.edit.importUrl;
// Object.keys(importModel.value).forEach((q) => {if(importModel.value) const formData = new FormData();
Object.keys(importModel.value).forEach((q) => { //
if (importModel.value[q]) { if (config.query.schema.properties.businessType?.default) {
formData.append(q, importModel.value[q]); formData.append("businessType", config.query.schema.properties.businessType.default);
}
Object.keys(importModel.value).forEach((propertyName) => {
if (importModel.value[propertyName]) {
const schema = config.import.schema.properties[propertyName];
const value = importModel.value[propertyName];
if (schema?.type === "array") {
importModel.value[propertyName].forEach((item) => {
formData.append(propertyName, schema.input === "file" ? item.raw : item);
});
} else {
formData.append(propertyName, schema.input === "file" ? value.raw : value);
}
}
});
const result = await request(url, formData);
if (result.data?.code === 200) {
editFormloading.value = false;
dialogVisible.value = false;
await load();
} else if (result.data?.code === 400 && result.data.fileName) {
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
} }
}); } catch (error) {
if (config.query.schema.properties.businessType?.default) { console.log(error);
formData.append("businessType", config.query.schema.properties.businessType.default); } finally {
} editFormloading.value = false;
for (let i = 0; i < fileList.value.length; i++) {
formData.append(`files`, fileList.value[i].raw);
} }
await post(url, formData);
editFormloading.value = false;
dialogVisible.value = false;
await load();
} else if (editFormMode.value === "filter") { } else if (editFormMode.value === "filter") {
await load(); await load();
dialogVisible.value = false; dialogVisible.value = false;
@ -728,9 +727,6 @@ export default {
const response = await get(url); const response = await get(url);
download(url, response.filename); download(url, response.filename);
}; };
const handleChange = (uploadFile, uploadFiles) => {
fileList.value = uploadFiles;
};
const getButtonDisabled = async (src, row) => { const getButtonDisabled = async (src, row) => {
if (src) { if (src) {
const method = await importFunction(src); const method = await importFunction(src);
@ -886,6 +882,7 @@ export default {
sortChange, sortChange,
getProp, getProp,
getImportTemplate, getImportTemplate,
importFormRef,
editFormRef, editFormRef,
editFormloading, editFormloading,
editFormMode, editFormMode,
@ -902,10 +899,7 @@ export default {
submit, submit,
showList, showList,
subListQuery, subListQuery,
fileList,
handleChange,
getButtonDisabled, getButtonDisabled,
factories,
versions, versions,
pushfilterList, pushfilterList,
getOperators, getOperators,

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html

@ -49,7 +49,7 @@
"html":"./utils/index.js", "html":"./utils/index.js",
"detect-it":"./lib/detect-it/detect-it.esm.js", "detect-it":"./lib/detect-it/detect-it.esm.js",
"lodash":"./lib/lodash/lodash.esm.js", "lodash":"./lib/lodash/lodash.esm.js",
"vue": "./lib/vue/vue.esm-browser.prod.js", "vue": "./lib/vue/vue.esm-browser.js",
"vue-router": "./lib/vue-router/vue-router.esm-browser.js", "vue-router": "./lib/vue-router/vue-router.esm-browser.js",
"vue-i18n":"./lib/vue-i18n/vue-i18n.esm-browser.prod.js", "vue-i18n":"./lib/vue-i18n/vue-i18n.esm-browser.prod.js",
"pinia": "./lib/pinia/pinia.esm-browser.js", "pinia": "./lib/pinia/pinia.esm-browser.js",

13
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/businessType.js

@ -0,0 +1,13 @@
const options = [
{ value: 0, label: "未定义" },
{ value: 1, label: "JisBBAC" },
{ value: 2, label: "JisHBPO" },
{ value: 3, label: "直供件BBAC" },
{ value: 4, label: "直供件HBPO" },
{ value: 5, label: "买单件BBAC" },
{ value: 6, label: "买单件HBPO" },
{ value: 7, label: "备件" },
{ value: 8, label: "印度件" },
];
const businessType = { title: "业务类型", type: "string", input: "select", options };
export default businessType;

200
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js

@ -0,0 +1,200 @@
import { billType, codeType, changedType, subBillType } from "./inventory.js";
const schema = {
title: "库存事务日志",
type: "object",
properties: {
changedNumber: {
title: "变动单号",
type: "string",
},
changedTime: {
title: "变动时间",
type: "string",
input: "dateTime",
},
changedType,
changedBy: {
title: "变动人",
type: "string",
},
partCode: {
title: "调整LU零件号",
type: "string",
},
customerPartCode: {
title: "调整客户零件号",
type: "string",
},
orderNum: {
title: "EDI原始订单号",
type: "string",
},
billType,
subBillType,
reMark: {
title: "备注",
type: "string",
},
vinCode: {
title: "调整生产码",
type: "string",
},
codeType,
qty: {
title: "调整生产码",
type: "number",
},
billTime: {
title: "发运日期",
type: "string",
},
billNum: {
title: "WMS发运单号",
type: "string",
},
deliverTime: {
title: "订单日期",
type: "string",
input: "datetime",
},
erpToLoc: {
title: "ERP库位",
type: "string",
},
},
};
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/log`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/code-setting-upload-excel-import`;
const exportUrl = `${baseUrl}/export`;
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "通用代码",
type: "object",
properties: {
filters: {
title: "项目",
type: "array",
hidden: true,
items: {
type: "object",
properties: {
logic: {
type: "int",
},
column: {
type: "string",
},
action: {
type: "int",
},
value: {
type: "string",
},
},
},
default: [
{
logic: "and",
column: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "createdDate",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "lu",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "tmpe4",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "vinCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "codeType",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "proType",
action: "like",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
schema: schema,
},
};
}

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/backup.js

@ -10,6 +10,7 @@ const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`; const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/code-setting-upload-excel-import`; const importUrl = `${baseUrl}/code-setting-upload-excel-import`;
const exportUrl = `${baseUrl}/backup-export`; const exportUrl = `${baseUrl}/backup-export`;
const invokeUrl = "settleaccount/vmi/invoke";
const queryMethod = "POST"; const queryMethod = "POST";
const detailsMethod = "POST"; const detailsMethod = "POST";
const createMethod = "POST"; const createMethod = "POST";
@ -17,6 +18,7 @@ const updateMethod = "POST";
const deleteMethod = "POST"; const deleteMethod = "POST";
const importMethod = "POST"; const importMethod = "POST";
const exportMethod = "POST"; const exportMethod = "POST";
const invokeMethod = "POST";
export default function () { export default function () {
return { return {
@ -92,7 +94,7 @@ export default function () {
}, },
{ {
logic: "and", logic: "and",
column: "proType", column: "billType",
action: "like", action: "like",
value: null, value: null,
readOnly: true, readOnly: true,
@ -123,12 +125,14 @@ export default function () {
deleteUrl, deleteUrl,
importUrl, importUrl,
exportUrl, exportUrl,
invokeUrl,
detailsMethod, detailsMethod,
createMethod, createMethod,
updateMethod, updateMethod,
deleteMethod, deleteMethod,
importMethod, importMethod,
exportMethod, exportMethod,
invokeMethod,
schema: schema, schema: schema,
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/balance.js

@ -80,7 +80,7 @@ export default function () {
}, },
{ {
logic: "and", logic: "and",
column: "proType", column: "billType",
action: "like", action: "like",
value: null, value: null,
readOnly: true, readOnly: true,

23
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/inventory.js

@ -16,7 +16,26 @@ const options2 = [
{ value: "08", label: "后左轮眉" }, { value: "08", label: "后左轮眉" },
{ value: "09", label: "后右轮眉" }, { value: "09", label: "后右轮眉" },
]; ];
const proType = { title: "发货类型", type: "number", input: "select", options: options1 }; const options3 = [
{ value: 0, label: "无" },
{ value: 1, label: "保险杠BBAC" },
{ value: 2, label: "保险杠HBPO" },
{ value: 3, label: "买单件保险杠BBAC" },
{ value: 4, label: "买单件保险杠HBPO" },
{ value: 5, label: "买单件小件BBAC" },
{ value: 6, label: "买单件小件HBPO" },
{ value: 7, label: "小件BBAC" },
{ value: 8, label: "小件HBPO" },
{ value: 9, label: "JIT直供件BBAC" },
{ value: 10, label: "JIT直供件HBPO" },
];
const options4 = [
{ value: "In", label: "入库" },
{ value: "Out", label: "出库" },
];
const billType = { title: "发货类型", type: "number", input: "select", options: options1 };
const codeType = { title: "生产码类型", type: "string", input: "select", options: options2 }; const codeType = { title: "生产码类型", type: "string", input: "select", options: options2 };
const subBillType = { title: "发货子类型", type: "number", input: "select", options: options3 };
const changedType = { title: "变动类型", type: "string", input: "select", options: options4 };
export { proType, codeType }; export { billType, codeType, subBillType, changedType };

92
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js

@ -1,4 +1,4 @@
import { proType, codeType } from "./inventory.js"; import { billType, codeType, changedType, subBillType } from "./inventory.js";
//变动单据号、发生时间、生产码类型、、订单号、库位、变动数、EDI顺序号、备注、变动类型(In、Out标识)、发货类型(JIS\JIT\买单件\备件等)、 //变动单据号、发生时间、生产码类型、、订单号、库位、变动数、EDI顺序号、备注、变动类型(In、Out标识)、发货类型(JIS\JIT\买单件\备件等)、
//实扣LU零件号、实扣客户零件号、结算LU零件号、结算客户零件号、实扣生产码、结算生产码 //实扣LU零件号、实扣客户零件号、结算LU零件号、结算客户零件号、实扣生产码、结算生产码
@ -7,38 +7,94 @@ const schema = {
title: "库存事务日志", title: "库存事务日志",
type: "object", type: "object",
properties: { properties: {
orderNumber: { changedNumber: {
title: "变动单号", title: "变动单号",
type: "string", type: "string",
}, },
createdDate: { changedTime: {
title: "发生时间", title: "变动时间",
type: "string", type: "string",
input: "dateTime",
}, },
codeType, changedType,
tmpe4: { changedBy: {
title: "订单号", title: "变动人",
type: "string", type: "string",
}, },
erpToLoc: { partCode: {
title: "库位", title: "实扣厂内零件号",
type: "string", type: "string",
}, },
count: { partCode2: {
title: "变动数", title: "结算厂内零件号",
type: "number", type: "string",
},
customerPartCode: {
title: "结算客户零件号",
type: "string",
}, },
changedType: { realCode: {
title: "变动类型", title: "WMS实发生产码",
type: "string", type: "string",
}, },
proType,
vinCode: { vinCode: {
title: "生产码", title: "EDI订单生产码",
type: "string",
},
settlementVinCode: {
title: "结算生产码",
type: "string",
},
codeType: {
title: "生产码类型",
type: "string",
},
billType,
subBillType,
qty: {
title: "数量",
type: "number",
},
billTime: {
title: "发运日期",
type: "string",
input: "datetime",
},
deliverTime: {
title: "订单日期",
type: "string",
input: "datetime",
},
seq: {
title: "EDI顺序号",
type: "string",
},
orderNum: {
title: "客户订单号",
type: "string",
},
uniqueCode: {
title: "塑件唯一码",
type: "string",
},
matchNumber: {
title: "EDI总成号",
type: "string",
},
pjsNum: {
title: "PJIS生产顺序号",
type: "string",
},
isReplenished: {
title: "是否补货",
type: "boolean",
},
erpToLoc: {
title: "ERP库位",
type: "string", type: "string",
}, },
lu: { configcode: {
title: "LU零件号", title: "配置码",
type: "string", type: "string",
}, },
}, },

60
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/vmi.js

@ -1,4 +1,4 @@
import { proType, codeType } from "./inventory.js"; import { billType, codeType, subBillType } from "./inventory.js";
export default function () { export default function () {
return { return {
@ -10,10 +10,6 @@ export default function () {
// hidden: true, // hidden: true,
// showForList: false, // showForList: false,
// }, // },
erpToLoc: {
title: "ERP库位",
type: "string",
},
lu: { lu: {
title: "LU零件号", title: "LU零件号",
type: "string", type: "string",
@ -27,47 +23,30 @@ export default function () {
type: "string", type: "string",
}, },
codeType, codeType,
proType, billType,
// codeType: {
// title: "生产码类型",
// type: "string",
// input: "select",
// options: [
// { value: "01", label: "前保" },
// { value: "02", label: "后保" },
// { value: "03", label: "门槛" },
// ],
// },
// proType: {
// title: "发货类型",
// type: "string",
// input: "select",
// options: [
// { value: "JIS", label: "JIS" },
// { value: "JIT", label: "JIT" },
// { value: "买单件", label: "买单件" },
// { value: "备件", label: "备件" },
// ],
// },
qty: { qty: {
title: "数量", title: "数量",
type: "string", type: "string",
}, },
shippingDate: { billTime: {
title: "发运日期", title: "发运日期",
type: "string", type: "string",
input: "date", input: "datetime",
}, },
creationTime: { deliverTime: {
title: "订单日期", title: "订单日期",
type: "string", type: "string",
input: "date", input: "datetime",
},
erpToLoc: {
title: "ERP库位",
type: "string",
}, },
seqNumber: { seq: {
title: "EDI顺序号", title: "EDI顺序号",
type: "string", type: "string",
}, },
tmpe4: { orderNum: {
title: "客户订单号", title: "客户订单号",
type: "string", type: "string",
}, },
@ -83,10 +62,23 @@ export default function () {
title: "PJIS生产顺序号", title: "PJIS生产顺序号",
type: "string", type: "string",
}, },
desc: { reMark: {
title: "备注", title: "备注",
type: "string", type: "string",
}, },
configcode: {
title: "配置码",
type: "string",
},
factory: {
title: "工厂",
type: "string",
},
subBillType,
realCode: {
title: "WMS实发生产码",
type: "string",
},
}, },
}; };
} }

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_map_group.js

@ -40,13 +40,11 @@ const exportUrl = "settleaccount/invoice_service/export";
const rejectUrl = "settleaccount/invoice_service/reject"; const rejectUrl = "settleaccount/invoice_service/reject";
const passedUrl = "settleaccount/invoice_service/approval-passed"; const passedUrl = "settleaccount/invoice_service/approval-passed";
const sync_qadUrl = "settleaccount/invoice_service/sync_qad"; const sync_qadUrl = "settleaccount/invoice_service/sync_qad";
const importJsonUrl = "settleaccount/vmi/excel-to-json";
const queryMethod = "POST"; const queryMethod = "POST";
const exportMethod = "POST"; const exportMethod = "POST";
const rejectMethod = "POST"; const rejectMethod = "POST";
const passedMethod = "POST"; const passedMethod = "POST";
const sync_qadMethod = "POST"; const sync_qadMethod = "POST";
const importJsonMethod = "POST";
export default function () { export default function () {
return { return {
@ -111,12 +109,12 @@ export default function () {
rejectUrl, rejectUrl,
passedUrl, passedUrl,
sync_qadUrl, sync_qadUrl,
importJsonUrl, // importJsonUrl,
exportMethod, exportMethod,
rejectMethod, rejectMethod,
passedMethod, passedMethod,
sync_qadMethod, sync_qadMethod,
importJsonMethod, // importJsonMethod,
schema: schema, schema: schema,
}, },
}; };

49
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_sa_detail_service.js

@ -2,39 +2,31 @@ const schema = {
title: "JIS结算数据", title: "JIS结算数据",
type: "object", type: "object",
properties: { properties: {
project: { settleDate: {
title: "项目", title: "结算日期",
type: "string", type: "string",
readOnly: true, input: "dateTime",
showForList: true,
rules: [
{
required: true,
},
],
}, },
value: { groupNum: {
title: "", title: "结算分组号",
type: "string", type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
}, },
description: { deliveryDate: {
title: "描述", title: "到货日期",
type: "string",
input: "dateTime",
},
lu: {
title: "客户零件号",
type: "string",
},
qty: {
title: "结算数量",
type: "number",
},
pn: {
title: "生产号",
type: "string", type: "string",
input: "textarea",
showForList: true,
rules: [
{
required: true,
},
{ max: 60 },
],
}, },
}, },
}; };
@ -42,7 +34,6 @@ const schema = {
const queryUrl = "settleaccount/bbac_sa_service/detail_query"; const queryUrl = "settleaccount/bbac_sa_service/detail_query";
const queryMethod = "POST"; const queryMethod = "POST";
export default function () { export default function () {
return { return {
query: { query: {

54
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_sa_service.js

@ -1,58 +1,42 @@
import version from "../../version.js"; import version from "../../version.js";
import businessType from "../../businessType.js";
const schema = { const schema = {
title: "JIS结算数据", title: "JIS结算数据",
type: "object", type: "object",
properties: { properties: {
version, version,
project: { billNum: {
title: "项目", title: "结算单据",
type: "string", type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
}, },
value: { dnBillNum: {
title: "", title: "出库单号",
type: "string", type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
}, },
description: { state: {
title: "描述", title: "状态",
type: "string",
},
recordCount: {
title: "明细记录行数",
type: "string",
},
site: {
title: "工厂地点",
type: "string", type: "string",
input: "textarea",
showForList: true,
rules: [
{
required: true,
},
{ max: 60 },
],
}, },
businessType,
}, },
}; };
const baseUrl = "settleaccount/bbac_sa_service"; const baseUrl = "settleaccount/bbac_sa_service";
const queryUrl = "settleaccount/bbac_sa_service/get-list"; const queryUrl = "settleaccount/bbac_sa_service/get-list";
const createUrl = "settleaccount/bbac_sa_service/create";
const deleteUrl = `${baseUrl}/delete-list`; const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/code-setting-upload-excel-import`; const importUrl = `${baseUrl}/import`;
const exportUrl = `${baseUrl}/export`;
const queryMethod = "POST"; const queryMethod = "POST";
const createMethod = "POST";
const deleteMethod = "POST"; const deleteMethod = "POST";
const importMethod = "POST"; const importMethod = "POST";
const exportMethod = "POST";
export default function () { export default function () {
return { return {
@ -113,14 +97,10 @@ export default function () {
schema: schema, schema: schema,
}, },
edit: { edit: {
createUrl,
deleteUrl, deleteUrl,
importUrl, importUrl,
exportUrl,
createMethod,
deleteMethod, deleteMethod,
importMethod, importMethod,
exportMethod,
schema: schema, schema: schema,
}, },
}; };

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_se_detail_service.js

@ -114,10 +114,12 @@ const queryUrl = "settleaccount/bbac_se_detail_service/get-list";
// const deleteUrl = `${baseUrl}/delete-list`; // const deleteUrl = `${baseUrl}/delete-list`;
// const importUrl = `${baseUrl}/import`; // const importUrl = `${baseUrl}/import`;
const exportUrl = "settleaccount/bbac_se_detail_service/export"; const exportUrl = "settleaccount/bbac_se_detail_service/export";
const invokeUrl = "settleaccount/bbacse-sync/invoke";
const queryMethod = "POST"; const queryMethod = "POST";
// const deleteMethod = "POST"; // const deleteMethod = "POST";
// const importMethod = "POST"; // const importMethod = "POST";
const exportMethod = "POST"; const exportMethod = "POST";
const invokeMethod = "POST";
export default function () { export default function () {
return { return {
@ -181,9 +183,11 @@ export default function () {
// deleteUrl, // deleteUrl,
// importUrl, // importUrl,
exportUrl, exportUrl,
invokeUrl,
// deleteMethod, // deleteMethod,
// importMethod, // importMethod,
exportMethod, exportMethod,
invokeMethod,
schema: schema, schema: schema,
}, },
}; };

18
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_can_sa_detail_service.js

@ -2,14 +2,14 @@ const schema = {
title: "发票分组号明细", title: "发票分组号明细",
type: "object", type: "object",
properties: { properties: {
settleBillNum: { // settleBillNum: {
title: "关联结算单号", // title: "关联结算单号",
type: "int", // type: "int",
}, // },
site: { // site: {
title: "工厂地点", // title: "工厂地点",
type: "string", // type: "string",
}, // },
version: { version: {
title: "期间", title: "期间",
type: "string", type: "string",
@ -46,7 +46,7 @@ const schema = {
title: "结算数量", title: "结算数量",
type: "decimal", type: "decimal",
}, },
groupNumy: { groupNum: {
title: "结算分组号", title: "结算分组号",
type: "string", type: "string",
}, },

48
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/input/hbpo_sa_detail_service.js

@ -2,39 +2,31 @@ const schema = {
title: "JIS结算数据", title: "JIS结算数据",
type: "object", type: "object",
properties: { properties: {
project: { settleDate: {
title: "项目", title: "结算日期",
type: "string", type: "string",
readOnly: true, input: "dateTime",
showForList: true,
rules: [
{
required: true,
},
],
}, },
value: { groupNum: {
title: "", title: "结算分组号",
type: "string", type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
}, },
description: { deliveryDate: {
title: "描述", title: "到货日期",
type: "string",
input: "dateTime",
},
lu: {
title: "客户零件号",
type: "string",
},
qty: {
title: "结算数量",
type: "number",
},
pn: {
title: "生产号",
type: "string", type: "string",
input: "textarea",
showForList: true,
rules: [
{
required: true,
},
{ max: 60 },
],
}, },
}, },
}; };

62
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/input/hbpo_sa_service.js

@ -1,62 +1,40 @@
import version from "../../version.js"; import version from "../../version.js";
import businessType from "../../businessType.js";
import state from "../../state.js";
const schema = { const schema = {
title: "JIS结算数据", title: "JIS结算数据",
type: "object", type: "object",
properties: { properties: {
version, version,
project: { billNum: {
title: "项目", title: "结算单据",
type: "string", type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
}, },
value: { dnBillNum: {
title: "", title: "出库单号",
type: "string", type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
}, },
description: { state,
title: "描述", recordCount: {
title: "明细记录行数",
type: "string",
},
site: {
title: "工厂地点",
type: "string", type: "string",
input: "textarea",
showForList: true,
rules: [
{
required: true,
},
{ max: 60 },
],
}, },
businessType,
}, },
}; };
const baseUrl = "settleaccount/hbpo_sa_service"; const baseUrl = "settleaccount/hbpo_sa_service";
const queryUrl = `${baseUrl}/get-list`; const queryUrl = "settleaccount/hbpo_sa_service/get-list";
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`; const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/code-setting-upload-excel-import`; const importUrl = `${baseUrl}/import`;
const exportUrl = `${baseUrl}/export`;
const queryMethod = "POST"; const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST"; const deleteMethod = "POST";
const importMethod = "POST"; const importMethod = "POST";
const exportMethod = "POST";
export default function () { export default function () {
return { return {
@ -117,18 +95,10 @@ export default function () {
schema: schema, schema: schema,
}, },
edit: { edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl, deleteUrl,
importUrl, importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod, deleteMethod,
importMethod, importMethod,
exportMethod,
schema: schema, schema: schema,
}, },
}; };

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/input/hbpo_se_detail_service.js

@ -115,8 +115,10 @@ const schema = {
const baseUrl = "settleaccount/hbpo_se_detail_service"; const baseUrl = "settleaccount/hbpo_se_detail_service";
const queryUrl = `${baseUrl}/get-list`; const queryUrl = `${baseUrl}/get-list`;
const exportUrl = `${baseUrl}/export`; const exportUrl = `${baseUrl}/export`;
const invokeUrl = "settleaccount/hbpose-sync/invoke";
const queryMethod = "POST"; const queryMethod = "POST";
const exportMethod = "POST"; const exportMethod = "POST";
const invokeMethod = "POST";
export default function () { export default function () {
return { return {
@ -178,7 +180,9 @@ export default function () {
}, },
edit: { edit: {
exportUrl, exportUrl,
invokeUrl,
exportMethod, exportMethod,
invokeMethod,
schema: schema, schema: schema,
}, },
}; };

18
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_can_sa_detail_service.js

@ -2,14 +2,14 @@ const schema = {
title: "可结算单明细", title: "可结算单明细",
type: "object", type: "object",
properties: { properties: {
settleBillNum: { // settleBillNum: {
title: "关联结算单号", // title: "关联结算单号",
type: "int", // type: "int",
}, // },
site: { // site: {
title: "工厂地点", // title: "工厂地点",
type: "string", // type: "string",
}, // },
version: { version: {
title: "期间", title: "期间",
type: "string", type: "string",
@ -46,7 +46,7 @@ const schema = {
title: "结算数量", title: "结算数量",
type: "decimal", type: "decimal",
}, },
groupNumy: { groupNum: {
title: "结算分组号", title: "结算分组号",
type: "string", type: "string",
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-service.js

@ -42,11 +42,11 @@ const schema = {
const queryUrl = "settleaccount/Job/list"; const queryUrl = "settleaccount/Job/list";
const deleteUrl = "settleaccount/Job/delete"; const deleteUrl = "settleaccount/Job/delete";
const exportUrl = "settleaccount/pub_sa_detail_service/export"; const exportUrl = "settleaccount/getblobfile/download/%s";
const compareUrl = "settleaccount/pub_sa_detail_service/pub-sa-se-compare"; const compareUrl = "settleaccount/pub_sa_detail_service/pub-sa-se-compare";
const queryMethod = "POST"; const queryMethod = "POST";
const deleteMethod = "POST"; const deleteMethod = "POST";
const exportMethod = "POST"; const exportMethod = "GET";
const compareMethod = "POST"; const compareMethod = "POST";
export default function () { export default function () {

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_can_sa_detail_service.js

@ -6,14 +6,14 @@ const schema = {
type: "object", type: "object",
properties: { properties: {
state, state,
settleBillNum: { // settleBillNum: {
title: "关联结算单号", // title: "关联结算单号",
type: "string", // type: "string",
}, // },
site: { // site: {
title: "工厂地点", // title: "工厂地点",
type: "string", // type: "string",
}, // },
businessType: { businessType: {
title: "业务分类", title: "业务分类",
type: "EnumBusinessType", type: "EnumBusinessType",

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/tb_re-parts-relationship_service.js

@ -84,9 +84,6 @@ export default function () {
}, },
table: { table: {
schema: schema, schema: schema,
},
import:{
}, },
edit: { edit: {
importUrl, importUrl,

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js

@ -60,13 +60,15 @@ const getResult = async (response) => {
result.filename = getFileName(response.headers.get("Content-Disposition")); result.filename = getFileName(response.headers.get("Content-Disposition"));
} }
} else { } else {
result.errors = await response.json(); try {
if (result.errors) { result.errors = await response.json();
ElMessageBox.alert( } catch (error) {
`错误:${result.errors?.error?.message ?? messages.get(response.status)}`, console.log(error);
`代码:${result.errors?.error?.code}`
);
} }
ElMessageBox.alert(
`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`,
`${result.errors?.error?.code ?? result.status}`
);
} }
return result; return result;
}; };

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

@ -32,6 +32,15 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
{ {
path: "delete", path: "delete",
meta: { meta: {
@ -61,24 +70,6 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
{ {
path: "export", path: "export",
meta: { meta: {
@ -218,6 +209,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged",
}, },
}, },
], ],
@ -272,6 +264,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged",
}, },
}, },
], ],
@ -557,6 +550,15 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
{ {
path: "delete", path: "delete",
meta: { meta: {
@ -586,24 +588,6 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
{ {
path: "export", path: "export",
meta: { meta: {
@ -743,6 +727,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged",
}, },
}, },
], ],
@ -797,6 +782,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged",
}, },
}, },
], ],
@ -1211,7 +1197,7 @@ export default [
path: "hbpo_jit_pub_sa_detail_service", path: "hbpo_jit_pub_sa_detail_service",
meta: { meta: {
type: "page", type: "page",
title: "4", title: "HBPO结算数据明细",
icon: "file", icon: "file",
isHidden: true, isHidden: true,
}, },
@ -1291,7 +1277,7 @@ export default [
type: "page", type: "page",
title: "BBAC发运与结算比对", title: "BBAC发运与结算比对",
icon: "file", icon: "file",
businessType: 3, // businessType: "ZhiGongJianBBAC",
}, },
children: [ children: [
{ {
@ -1336,6 +1322,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged",
}, },
}, },
], ],
@ -1346,7 +1333,7 @@ export default [
type: "page", type: "page",
title: "HBPO发运与结算比对", title: "HBPO发运与结算比对",
icon: "file", icon: "file",
businessType: 4, // businessType: "ZhiGongJianHBPO",
}, },
children: [ children: [
{ {
@ -1391,6 +1378,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged",
}, },
}, },
], ],
@ -1694,24 +1682,6 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
{ {
path: "export", path: "export",
meta: { meta: {
@ -1778,7 +1748,7 @@ export default [
type: "page", type: "page",
title: "发运与结算比对", title: "发运与结算比对",
icon: "file", icon: "file",
businessType: 7, // businessType: "BeiJian",
}, },
children: [ children: [
{ {
@ -1823,6 +1793,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged",
}, },
}, },
], ],
@ -2126,24 +2097,6 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
{ {
path: "export", path: "export",
meta: { meta: {
@ -2210,7 +2163,7 @@ export default [
type: "page", type: "page",
title: "发运与结算比对", title: "发运与结算比对",
icon: "file", icon: "file",
businessType: 8, // businessType: "YinDuJian",
}, },
children: [ children: [
{ {
@ -2255,6 +2208,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged",
}, },
}, },
], ],
@ -2487,96 +2441,522 @@ export default [
}, },
], ],
}, },
//不知道自主起的名字
{ {
path: "invoice", path: "md",
meta: { meta: {
type: "group", type: "group",
title: "财务审核", title: "买单件HBPO",
icon: "folder", icon: "folder",
}, },
children: [ children: [
{ {
path: "invoice_map_group", path: "input",
meta: { meta: {
type: "page", type: "group",
title: "财务审核", title: "数据输入",
icon: "file", icon: "file",
}, },
children: [ children: [
{ {
path: "query", path: "md_pub_sa_service",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "reject",
meta: {
type: "button",
title: "退回",
icon: "file",
isTop: true,
},
},
{
path: "importInvocie",
meta: { meta: {
type: "button", type: "page",
title: "导入发票号", title: "结算数据",
icon: "file", icon: "file",
isTop: true,
pattern: "paged",
}, },
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "导出",
icon: "file",
isTop: true,
pattern: "paged",
},
},
],
}, },
{ {
path: "passed ", path: "md_pub_sa_detail_service",
meta: { meta: {
type: "button", type: "page",
title: "审核通过", title: "结算数据明细",
icon: "file", icon: "file",
isTop: true, isHidden: true,
pattern: "paged",
}, },
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "导出",
icon: "file",
isTop: true,
pattern: "paged",
},
},
],
}, },
{ {
path: "sync_qad ", path: "md_pub_se_detail_service",
meta: { meta: {
type: "button", type: "page",
title: "同步寄售库至QAD", title: "发运数据",
icon: "file", icon: "file",
isTop: true,
pattern: "paged",
}, },
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "导出",
icon: "file",
isTop: true,
pattern: "paged",
},
},
{
path: "synchronous",
meta: {
type: "button",
title: "手动同步",
icon: "file",
isTop: true,
},
},
],
}, },
], ],
}, },
{ {
path: "invoice_wait_detail", path: "contrast",
meta: { meta: {
type: "page", type: "group",
title: "待开票明细", title: "数据对比",
icon: "file", icon: "file",
isHidden: true,
}, },
children: [ children: [
{ {
path: "query", path: "md_pub_sa_detail_jobservice",
meta: { meta: {
type: "button", type: "page",
title: "查询", title: "发运与结算比对",
icon: "file", icon: "file",
isTop: true, // businessType: "MaiDanJianHBPO",
}, },
}, children: [
], {
}, path: "query",
{ meta: {
path: "invoice_grp", type: "button",
meta: { title: "查询",
type: "page", icon: "file",
isTop: true,
},
},
{
path: "compare",
meta: {
type: "button",
title: "生成对比",
icon: "file",
isTop: true,
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "update-data",
meta: {
type: "button",
title: "更新结算数据状态",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "下载",
icon: "file",
pattern: "paged",
},
},
],
},
],
},
{
path: "settlement",
meta: {
type: "group",
title: "结算开票",
icon: "folder",
},
children: [
{
path: "md_pub_can_sa_service",
meta: {
type: "page",
title: "可结算单",
icon: "file",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "导出",
icon: "file",
isTop: true,
pattern: "paged",
},
},
{
path: "generateInvoice",
meta: {
type: "button",
title: "生成发票数据",
icon: "file",
isTop: true,
pattern: "paged",
},
},
],
},
{
path: "md_pub_not_sa_service",
meta: {
type: "page",
title: "不可结算单",
icon: "file",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "导出",
icon: "file",
isTop: true,
pattern: "paged",
},
},
{
path: "generateSettlementOrder",
meta: {
type: "button",
title: "生成可结算单",
icon: "file",
isTop: true,
pattern: "paged",
},
},
],
},
{
path: "md_pub_ba_service",
meta: {
type: "page",
title: "商务审批",
icon: "file",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "reject",
meta: {
type: "button",
title: "退回",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "导出",
icon: "file",
isTop: true,
pattern: "paged",
},
},
{
path: "received ",
meta: {
type: "button",
title: "客户已收票",
icon: "file",
isTop: true,
pattern: "paged",
},
},
],
},
{
path: "md_pub_ba_detail_service",
meta: {
type: "page",
title: "商务审批明细",
icon: "file",
isHidden: true,
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
],
},
{
path: "md_pub_pd_service",
meta: {
type: "page",
title: "寄售库库存扣减审批",
icon: "file",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "reject",
meta: {
type: "button",
title: "退回",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "导出",
icon: "file",
isTop: true,
pattern: "paged",
},
},
{
path: "approvalPassed ",
meta: {
type: "button",
title: "审核通过",
icon: "file",
isTop: true,
pattern: "paged",
},
},
],
},
{
path: "md_pub_pd_detail_service",
meta: {
type: "page",
title: "寄售库库存扣减审批明细",
icon: "file",
isHidden: true,
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
],
},
],
},
],
},
{
path: "invoice",
meta: {
type: "group",
title: "财务审核",
icon: "folder",
},
children: [
{
path: "invoice_map_group",
meta: {
type: "page",
title: "财务审核",
icon: "file",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "reject",
meta: {
type: "button",
title: "退回",
icon: "file",
isTop: true,
},
},
{
path: "importInvocie",
meta: {
type: "button",
title: "导入发票号",
icon: "file",
isTop: true,
pattern: "paged",
},
},
{
path: "passed ",
meta: {
type: "button",
title: "审核通过",
icon: "file",
isTop: true,
pattern: "paged",
},
},
{
path: "sync_qad ",
meta: {
type: "button",
title: "同步寄售库至QAD",
icon: "file",
isTop: true,
pattern: "paged",
},
},
],
},
{
path: "invoice_wait_detail",
meta: {
type: "page",
title: "待开票明细",
icon: "file",
isHidden: true,
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
],
},
{
path: "invoice_grp",
meta: {
type: "page",
title: "发票分组", title: "发票分组",
icon: "file", icon: "file",
isHidden: true, isHidden: true,
@ -2781,13 +3161,58 @@ export default [
}, },
}, },
{ {
path: "backups", path: "invoke",
meta: { meta: {
type: "button", type: "button",
title: "手动备份", title: "手动备份",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged", },
},
],
},
{
path: "adjust",
meta: {
type: "page",
title: "技术库存调整表",
icon: "file",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "create",
meta: {
type: "button",
title: "新建",
icon: "file",
isTop: true,
},
},
{
path: "update",
meta: {
type: "button",
title: "编辑",
icon: "file",
isTop: true,
},
},
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
}, },
}, },
], ],

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js

@ -129,7 +129,9 @@ const getRules = (parentSchema, property, data) => {
rule.type = property.type; rule.type = property.type;
} }
if (rule.validator) { if (rule.validator) {
rule.validator = validators[rule.validator]; if (rule.validator.constructor === String) {
rule.validator = validators[rule.validator];
}
} }
if (!rule.message) { if (!rule.message) {
if (rule.required) { if (rule.required) {

12
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/contrast/bj_pub_sa_detail_jobservice.js

@ -1,10 +1,11 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/job-service.js"; import useConfig from "../../../models/job-service.js";
import { ref, onMounted, onUnmounted } from "vue";
export default { export default {
components: { AppList }, components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
config.query.schema.title = "发运与结算"; config.query.schema.title = "发运与结算";
@ -12,7 +13,12 @@ export default {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.name.default = "备件结算与发运数据对比"; config.query.schema.properties.name.default = "备件结算与发运数据对比";
config.query.schema.properties.businessType.default = 7; config.query.schema.properties.businessType.default = "BeiJian";
return { config, onCommand }; const appListRef = ref(null);
onMounted(() =>
PubSub.subscribe(config.query.schema.properties.businessType.default, async () => await appListRef.value.load())
);
onUnmounted(() => PubSub.unsubscribe(config.query.schema.properties.businessType.default));
return { config, onCommand, appListRef };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/input/bj_pub_sa_detail_service.js

@ -9,7 +9,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default=7; config.query.schema.properties.businessType.default="BeiJian";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/input/bj_pub_sa_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default=7; config.query.schema.properties.businessType.default="BeiJian";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/input/bj_pub_se_detail_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 7; config.query.schema.properties.businessType.default = "BeiJian";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

40
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/home.js

@ -1,5 +1,43 @@
import html from "html"; import html from "html";
import AppList from "../../../components/list/index.js";
export default { export default {
template: html`<a href="../assets/导入模版.zip" target="blank">导入模板下载</a>`, components: { AppList },
template: html`</app-list :config="config" @command="onCommand"></app-list>
<el-table :data="tableData" border style="width: 100%">
<el-table-column prop="date" label="custoner/type" width="180" />
<el-table-column prop="name" label="BBAC" width="180" />
<el-table-column prop="address" label="HBPO" width="180" />
</el-table>
`,
setup() {
const tableData = [
{
date: "JIS",
name: "√",
address: "√",
},
{
date: "直供件",
name: "√",
address: "√",
},
{
date: "印度件",
name: "√",
address: "",
},
{
date: "备件",
name: "√",
address: "",
},
{
date: "买单件",
name: "对比√ 开票×",
address: "√",
},
];
return { tableData };
},
}; };

12
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/contrast/in_pub_sa_detail_jobservice.js

@ -1,18 +1,24 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/job-service.js"; import useConfig from "../../../models/job-service.js";
import { ref, onMounted, onUnmounted } from "vue";
export default { export default {
components: { AppList }, components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
config.query.schema.title = "发运与结算"; config.query.schema.title = "发运与结算";
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 8; config.query.schema.properties.businessType.default = "YinDuJian";
config.query.schema.properties.name.default = "印度件结算与发运数据对比"; config.query.schema.properties.name.default = "印度件结算与发运数据对比";
return { config, onCommand }; const appListRef = ref(null);
onMounted(() =>
PubSub.subscribe(config.query.schema.properties.name.default, async () => await appListRef.value.load())
);
onUnmounted(() => PubSub.unsubscribe(config.query.schema.properties.businessType.default));
return { config, onCommand, appListRef };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/input/in_pub_sa_detail_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 8; config.query.schema.properties.businessType.default = "YinDuJian";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/input/in_pub_sa_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 8; config.query.schema.properties.businessType.default = "YinDuJian";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/input/in_pub_se_detail_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 8; config.query.schema.properties.businessType.default = "YinDuJian";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/inventory/adjust.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/inventory/adjust.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

61
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js

@ -5,6 +5,7 @@ import useConfig from "../../../models/invoice/invoice_map_group.js";
import request from "../../../request/index.js"; import request from "../../../request/index.js";
import AppTable from "../../components/table/index.js"; import AppTable from "../../components/table/index.js";
import { ElMessageBox } from "element-plus"; import { ElMessageBox } from "element-plus";
import { post } from "../../../request/index.js";
export default { export default {
components: { AppList, AppTable }, components: { AppList, AppTable },
@ -54,9 +55,9 @@ export default {
</span> </span>
</div> </div>
</template> </template>
<el-table :data="invoiceValue"> <el-table :data="invoiceValue" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50"> <el-table-column width="50" type="selection">
<el-checkbox v-model="selectedRows"></el-checkbox> <!-- <el-checkbox v-model="selectedRows" /> -->
</el-table-column> </el-table-column>
<el-table-column property="oldInvBillNum" label="作废发票号" /> <el-table-column property="oldInvBillNum" label="作废发票号" />
<el-table-column property="invBillNum" label="发票号" /> <el-table-column property="invBillNum" label="发票号" />
@ -101,19 +102,21 @@ export default {
</el-dialog> </el-dialog>
<el-dialog v-model="openImport" width="30%"> <el-dialog v-model="openImport" width="30%">
<app-form> <app-form>
<el-form-item :label="$t('文件')" label-width="80px"> <div>
<el-upload <el-form-item :label="$t('文件')" label-width="80px">
ref="uploadRef" <el-upload
class="upload" ref="uploadRef"
drag class="upload"
accept=".xlsx" drag
:auto-upload="false" accept=".xlsx"
:on-change="handleChange" :auto-upload="false"
> :on-change="handleChange"
<el-icon class="el-icon--upload"><ep-upload-filled /></el-icon> >
</el-upload> <el-icon class="el-icon--upload"><ep-upload-filled /></el-icon>
<el-button type="primary" @click="openImportHandler" style="margin-left: 10px;">确定</el-button> </el-upload>
</el-form-item> </el-form-item>
</div>
<el-button type="primary" @click="openImportHandler" style="margin-left: 10px;">确定</el-button>
</app-form> </app-form>
</el-dialog> </el-dialog>
<el-button type="primary" @click="dialogVisible = false" style="margin-left: 10px;">下一页</el-button> <el-button type="primary" @click="dialogVisible = false" style="margin-left: 10px;">下一页</el-button>
@ -133,10 +136,23 @@ export default {
} }
</style>`, </style>`,
setup() { setup() {
const fileList = ref([]);
// const load = async () => {};
// const editFormModel = ref(null);
// const editFormMode = ref(null);
// const defaultImportModel = config.import?.schema ? schemaToModel(config.import.schema) : {};
// const importModel = ref(defaultImportModel);
const openImportHandler = async () => { const openImportHandler = async () => {
const data = {}; const url = "settleaccount/vmi/excel-to-json";
const response = await request("settleaccount/vmi/excel-to-json", data, { method: "POST" }); const method = "POST";
console.log(response.data); const formData = new FormData();
if (config.query.schema.properties.businessType?.default) {
formData.append("businessType", config.query.schema.properties.businessType.default);
}
for (let i = 0; i < fileList.value.length; i++) {
formData.append(`files`, fileList.value[i].raw);
}
await post(url, formData, method);
}; };
const formInline = reactive({ const formInline = reactive({
oldInvBillNum: "", oldInvBillNum: "",
@ -149,6 +165,7 @@ export default {
groupNum: "", groupNum: "",
}); });
//create //create
const invoiceValue = ref([]);
const submitForm = () => { const submitForm = () => {
const newFormInline = { ...formInline }; const newFormInline = { ...formInline };
invoiceValue.value.push(newFormInline); invoiceValue.value.push(newFormInline);
@ -159,12 +176,10 @@ export default {
}; };
//delete //delete
const selectedRows = ref([]); const selectedRows = ref([]);
const invoiceValue = ref([]); const deleteRow = async () => {
const deleteRow = () => {
const indexes = selectedRows.value.map((row) => invoiceValue.value.indexOf(row)); const indexes = selectedRows.value.map((row) => invoiceValue.value.indexOf(row));
indexes.sort((a, b) => b - a);
indexes.forEach((index) => { indexes.forEach((index) => {
invoiceValue.value.splice(index, 1); invoiceValue.value.splice(index, 10000000000);
}); });
selectedRows.value = []; selectedRows.value = [];
}; };

12
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/bbac_jit_pub_sa_detail_jobservice.js

@ -1,18 +1,24 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/job-service.js"; import useConfig from "../../../models/job-service.js";
import { ref, onMounted, onUnmounted } from "vue";
export default { export default {
components: { AppList }, components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
config.query.schema.title = "发运与结算"; config.query.schema.title = "发运与结算";
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 3; config.query.schema.properties.businessType.default = "ZhiGongJianBBAC";
config.query.schema.properties.name.default = "直供件BBAC结算与发运数据对比"; config.query.schema.properties.name.default = "直供件BBAC结算与发运数据对比";
return { config, onCommand }; const appListRef = ref(null);
onMounted(() =>
PubSub.subscribe(config.query.schema.properties.name.default, async () => await appListRef.value.load())
);
onUnmounted(() => PubSub.unsubscribe(config.query.schema.properties.businessType.default));
return { config, onCommand, appListRef };
}, },
}; };

12
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/hbpo_jit_pub_sa_detail_jobservice.js

@ -1,18 +1,24 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/job-service.js"; import useConfig from "../../../models/job-service.js";
import { ref, onMounted, onUnmounted } from "vue";
export default { export default {
components: { AppList }, components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
config.query.schema.title = "发运与结算"; config.query.schema.title = "发运与结算";
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 4; config.query.schema.properties.businessType.default = "ZhiGongJianHBPO";
config.query.schema.properties.name.default = "直供件HBPO结算与发运数据对比"; config.query.schema.properties.name.default = "直供件HBPO结算与发运数据对比";
return { config, onCommand }; const appListRef = ref(null);
onMounted(() =>
PubSub.subscribe(config.query.schema.properties.name.default, async () => await appListRef.value.load())
);
onUnmounted(() => PubSub.unsubscribe(config.query.schema.properties.businessType.default));
return { config, onCommand, appListRef };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_sa_detail_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 3; config.query.schema.properties.businessType.default = "ZhiGongJianBBAC";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_sa_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 3; config.query.schema.properties.businessType.default = "ZhiGongJianBBAC";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_se_detail_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 3; config.query.schema.properties.businessType.default = "ZhiGongJianBBAC";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_sa_detail_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 4; config.query.schema.properties.businessType.default = "ZhiGongJianHBPO";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_sa_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 4; config.query.schema.properties.businessType.default = "ZhiGongJianHBPO";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_se_detail_service.js

@ -10,7 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = 4; config.query.schema.properties.businessType.default = "ZhiGongJianHBPO";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/login.js

@ -1,9 +1,9 @@
import html, { schemaToModel } from "html"; import html, { schemaToModel } from "html";
import { ref, reactive } from "vue"; import { reactive } from "vue";
import AppForm from "../components/form/index.js"; import AppForm from "../components/form/index.js";
import { login, setRefreshToken, getUser, setAccessToken } from "../api/user.js"; import { getUser, setAccessToken } from "../api/user.js";
import router, { refreshRouter } from "../router/index.js"; import router, { refreshRouter } from "../router/index.js";
import request, { post } from "../request/index.js"; import request from "../request/index.js";
import LayoutLogo from "../layouts/logo.js"; import LayoutLogo from "../layouts/logo.js";
import LayoutLocale from "../layouts/locale.js"; import LayoutLocale from "../layouts/locale.js";
import LayoutFooter from "../layouts/footer.js"; import LayoutFooter from "../layouts/footer.js";

24
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/contrast/md_pub_sa_detail_jobservice.js

@ -0,0 +1,24 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/job-service.js";
import { ref, onMounted, onUnmounted } from "vue";
export default {
components: { AppList },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
config.query.schema.properties.businessType.default = "MaiDanJianHBPO";
// config.query.schema.properties.name.default = "直供件BBAC结算与发运数据对比";
const appListRef = ref(null);
onMounted(() =>
PubSub.subscribe(config.query.schema.properties.name.default, async () => await appListRef.value.load())
);
onUnmounted(() => PubSub.unsubscribe(config.query.schema.properties.businessType.default));
return { config, onCommand, appListRef };
},
};

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/input/md_pub_sa_detail_service.js

@ -0,0 +1,16 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_sa_detail_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
config.query.schema.properties.businessType.default = "MaiDanJianHBPO";
return { config, onCommand };
},
};

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/input/md_pub_sa_service.js

@ -0,0 +1,16 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_sa_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
config.query.schema.properties.businessType.default = "MaiDanJianHBPO";
return { config, onCommand };
},
};

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/input/md_pub_se_detail_service.js

@ -0,0 +1,16 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_se_detail_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
config.query.schema.properties.businessType.default = "MaiDanJianHBPO";
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_ba_detail_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_ba_detail_service";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_ba_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_ba_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_can_sa_detail_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_can_sa_detail_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_can_sa_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_can_sa_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_not_sa_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_not_sa_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_pd_detail_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_pd_detail_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/settlement/md_pub_pd_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_pd_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

18
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs

@ -52,9 +52,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public IFormFileCollection Files { get; set; } public IFormFileCollection Files { get; set; }
/// <summary> /// <summary>
/// 是否是备件 /// 业务类别
/// </summary> /// </summary>
public EnumBusinessType BusinessType { get; set; } public EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
} }
/// <summary> /// <summary>
@ -439,5 +445,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 业务类型 /// 业务类型
/// </summary> /// </summary>
public EnumBusinessType BusinessType { get; set; } public EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 发运开始时间
/// </summary>
public DateTime? SeStartDateTime { get; set; }
/// <summary>
/// 发运结束时间
/// </summary>
public DateTime? SeEndDateTime { get; set; }
} }
} }

9
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -115,12 +115,13 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var importDtos = await _exportImporter.UploadExcelImport<BBAC_SA_DETAIL_IMPORT_DTO>(files, _excelImportService); var importDtos = await _exportImporter.UploadExcelImport<BBAC_SA_DETAIL_IMPORT_DTO>(files, _excelImportService);
//买单件BBAC
var importMaiDanJianHBOPDtos = importDtos.FindAll(t => t.PN.Contains("R0"));
//JisBBAC //JisBBAC
var importHBOPDtos = importDtos.FindAll(t => t.PN.Contains("R0") == false); var importHBOPDtos = importDtos.FindAll(t => t.PN.Contains("R0") == false);
//买单件BBAC
var importMaiDanJianHBOPDtos = importDtos.FindAll(t => t.PN.Contains("R0"));
var importBBACSaDetails = ObjectMapper.Map<List<BBAC_SA_DETAIL_IMPORT_DTO>, List<BBAC_SA_DETAIL>>(importHBOPDtos); var importBBACSaDetails = ObjectMapper.Map<List<BBAC_SA_DETAIL_IMPORT_DTO>, List<BBAC_SA_DETAIL>>(importHBOPDtos);
var importMaiDanJianBBACSaDetails = ObjectMapper.Map<List<BBAC_SA_DETAIL_IMPORT_DTO>, List<PUB_SA_DETAIL>>(importHBOPDtos);
//数据校验 //数据校验
var checkList = new List<ErrorExportDto>(); var checkList = new List<ErrorExportDto>();
@ -145,7 +146,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
if (importBBACSaDetails.Any()) if (importBBACSaDetails.Any())
{ {
//await SaDataHandleAsync(importBBACSaDetails); await SaDataHandleAsync(importBBACSaDetails, importMaiDanJianBBACSaDetails);
} }
return new JsonResult(new { Code = 200, Message = "导入成功" }); return new JsonResult(new { Code = 200, Message = "导入成功" });
@ -285,7 +286,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
/// <summary> /// <summary>
/// 结算数据处理 /// 结算数据处理
/// </summary> /// </summary>
private async Task SaDataHandleAsync(List<BBAC_SA_DETAIL> bbacSaDetails) private async Task SaDataHandleAsync(List<BBAC_SA_DETAIL> bbacSaDetails, List<PUB_SA_DETAIL> maiDanJianBBACSaDetails)
{ {
//结算单号 //结算单号
var bbacSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA"); var bbacSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA");

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs

@ -120,6 +120,8 @@ public class PUB_SA_DETAIL_SERVICE : SettleAccountApplicationBase<PUB_SA_DETAIL>
customConditionList.Add(new CustomCondition() { Name = "LU", Value = pubSaSeCompareRequestDto.LU }); customConditionList.Add(new CustomCondition() { Name = "LU", Value = pubSaSeCompareRequestDto.LU });
customConditionList.Add(new CustomCondition() { Name = "PN", Value = pubSaSeCompareRequestDto.PN }); customConditionList.Add(new CustomCondition() { Name = "PN", Value = pubSaSeCompareRequestDto.PN });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName }); customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName });
customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = pubSaSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd 00:00:00") });
customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = pubSaSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") });
var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, pubSaSeCompareRequestDto.Version, string.Empty, CurrentUser, typeof(PubSaSeCompareExportService), customConditionList, (rs) => var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, pubSaSeCompareRequestDto.Version, string.Empty, CurrentUser, typeof(PubSaSeCompareExportService), customConditionList, (rs) =>
{ {

24
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -102,6 +102,11 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
} }
/// <summary>
/// 期间
/// </summary>
private int _version;
#region 导入、导出 #region 导入、导出
/// <summary> /// <summary>
/// 导入 /// 导入
@ -110,6 +115,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
public async Task<IActionResult> ImportByBusinessTypeAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto) public async Task<IActionResult> ImportByBusinessTypeAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto)
{ {
IActionResult result = new JsonResult(null); IActionResult result = new JsonResult(null);
_version = pubSaImportRequestDto.Version;
switch (pubSaImportRequestDto.BusinessType) switch (pubSaImportRequestDto.BusinessType)
{ {
case EnumBusinessType.None: case EnumBusinessType.None:
@ -306,7 +312,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
//客户零件关系 //客户零件关系
var materialRelationships = new List<MaterialRelationship>(); var materialRelationships = new List<MaterialRelationship>();
#region 导入数据转换、数据校验 #region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<PUB_SA_DETAIL_IMPORT_DTO>(files, _excelImportService); var result = await _exportImporter.UploadExcelImport<PUB_SA_DETAIL_IMPORT_DTO>(files, _excelImportService);
@ -332,7 +337,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
} }
#endregion #endregion
#region 处理结算数据 #region 处理结算数据
//销售价格 //销售价格
var priceListEntitys = await _priceListRepository.GetAllAsync(); var priceListEntitys = await _priceListRepository.GetAllAsync();
@ -376,7 +380,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
}); });
#endregion #endregion
#region 入库数据赋值 #region 入库数据赋值
//结算明细 //结算明细
pubSaDetails = importPubSaDetails; pubSaDetails = importPubSaDetails;
@ -605,6 +608,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
importPubSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index); importPubSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
} }
importPubSaDetail.Version = _version;
importPubSaDetail.BusinessType = businessType; importPubSaDetail.BusinessType = businessType;
importPubSaDetail.Site = "XX工厂"; importPubSaDetail.Site = "XX工厂";
importPubSaDetail.KeyCode = importPubSaDetail.PN + importPubSaDetail.LU; importPubSaDetail.KeyCode = importPubSaDetail.PN + importPubSaDetail.LU;
@ -650,7 +654,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
private async Task SeDataEntryAsync(List<PUB_SA_DETAIL> pubSaDetails) private async Task SeDataEntryAsync(List<PUB_SA_DETAIL> pubSaDetails)
{ {
//业务类型 //业务类型
EnumBusinessType businessType = pubSaDetails.First().BusinessType; var pubSaFirstDetail = pubSaDetails.First();
//结算单号 //结算单号
var pubSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA"); var pubSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA");
//结算主表 //结算主表
@ -658,7 +662,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
{ {
BillNum = pubSaBillNum, BillNum = pubSaBillNum,
State = "1", State = "1",
BusinessType = businessType BusinessType = pubSaFirstDetail.BusinessType,
Version = pubSaFirstDetail.Version
}; };
//可结算单号 //可结算单号
var pubCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); var pubCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C");
@ -668,7 +673,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
BillNum = pubCanSaBillNum, BillNum = pubCanSaBillNum,
SettleBillNum = pubSaBillNum, SettleBillNum = pubSaBillNum,
State = SettleBillState., State = SettleBillState.,
BusinessType = businessType BusinessType = pubSa.BusinessType,
Version = pubSa.Version
}; };
#region 入库数据赋值 #region 入库数据赋值
@ -696,7 +702,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
pubCanSaDetails.ForEach(pubCanSaDetail => pubCanSaDetails.ForEach(pubCanSaDetail =>
{ {
pubCanSaDetail.BillNum = pubCanSaDetail.InvGroupNum = pubCanSaBillNum; pubCanSaDetail.BillNum = pubCanSaDetail.InvGroupNum = pubCanSaBillNum;
pubCanSaDetail.BusinessType = businessType;
}); });
await _pubCanSaRepository.InsertAsync(pubCanSa); await _pubCanSaRepository.InsertAsync(pubCanSa);
@ -704,11 +709,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
} }
if (pubNotSaDetails.Count > 0) if (pubNotSaDetails.Count > 0)
{ {
pubNotSaDetails.ForEach(pubNotSaDetail =>
{
pubNotSaDetail.BusinessType = businessType;
});
await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails); await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails);
} }
#endregion #endregion

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs

@ -5,7 +5,9 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Shouldly; using Shouldly;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching; using Volo.Abp.Caching;

11
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs

@ -8,17 +8,18 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary> /// <summary>
/// HBPO发运数据同步服务 /// HBPO发运数据同步
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class BBACSeSyncAppService : ApplicationService, IInvocable public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
{ {
/// <summary> /// <summary>
/// WMS数据上下文 /// WMS数据上下文
@ -48,6 +49,12 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable
_bbacSeDetailRepository = bbacSeDetailRepository; _bbacSeDetailRepository = bbacSeDetailRepository;
} }
[ApiExplorerSettings(IgnoreApi = true)]
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke();
}
[HttpPost] [HttpPost]
public async Task Invoke() public async Task Invoke()
{ {

14
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs

@ -1,8 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -13,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class BeiSeSyncAppService : JitSeSyncAppService public class BeiSeSyncAppService : JitSeSyncAppService, IJobService
{ {
/// <summary> /// <summary>
/// 构造 /// 构造
@ -21,8 +23,9 @@ public class BeiSeSyncAppService : JitSeSyncAppService
public BeiSeSyncAppService( public BeiSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository) VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {
@ -35,4 +38,9 @@ public class BeiSeSyncAppService : JitSeSyncAppService
BusinessType = EnumBusinessType.BeiJian BusinessType = EnumBusinessType.BeiJian
}; };
} }
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke();
}
} }

11
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs

@ -9,17 +9,18 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary> /// <summary>
/// HBPO发运数据同步服务 /// HBPO发运数据同步
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class HBPOSeSyncAppService : ApplicationService, IInvocable //IJobService public class HBPOSeSyncAppService : ApplicationService, IInvocable, IJobService
{ {
/// <summary> /// <summary>
/// WMS数据上下文 /// WMS数据上下文
@ -49,6 +50,12 @@ public class HBPOSeSyncAppService : ApplicationService, IInvocable //IJobService
_hbpoSeDetailRepository = hbpoSeDetailRepository; _hbpoSeDetailRepository = hbpoSeDetailRepository;
} }
[ApiExplorerSettings(IgnoreApi = true)]
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke();
}
[HttpPost] [HttpPost]
public async Task Invoke() public async Task Invoke()
{ {

42
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs

@ -0,0 +1,42 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Volo.Abp.Application.Services;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// 手动同步
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class HandSeSyncAppService : ApplicationService
{
private readonly IServiceProvider _applicationServices;
public HandSeSyncAppService(IHost host)
{
_applicationServices = host.Services ?? throw new ArgumentNullException();
}
/// <summary>
/// 同步
/// </summary>
[HttpPost]
public async Task SyncAsync([FromBody] EnumBusinessType businessType)
{
using var scope = this._applicationServices.CreateScope();
JitSeSyncAppService jitSeSyncAppService = businessType switch
{
EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(),
EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(),
EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService<BeiSeSyncAppService>(),
EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService<YinDuSeSyncAppService>(),
_ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"),
};
await jitSeSyncAppService.Invoke();
}
}

38
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs

@ -7,6 +7,7 @@ using Coravel.Invocable;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -33,17 +34,21 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PUB_SE_DETAIL, Guid> _pubSeDetailRepository; private readonly INormalEfCoreRepository<PUB_SE_DETAIL, Guid> _pubSeDetailRepository;
private readonly IVmiService _vmiService;
/// <summary> /// <summary>
/// 构造 /// 构造
/// </summary> /// </summary>
public JitSeSyncAppService( public JitSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository) INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
VmiAppService vmiService)
{ {
_wmsBJBMPTContext = wmsBJBMPTContext; _wmsBJBMPTContext = wmsBJBMPTContext;
_syncPositionFlagRepository = syncPositionFlagRepository; _syncPositionFlagRepository = syncPositionFlagRepository;
_pubSeDetailRepository = pubSeDetailRepository; _pubSeDetailRepository = pubSeDetailRepository;
_vmiService = vmiService;
} }
/// <summary> /// <summary>
@ -54,6 +59,10 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
[HttpPost] [HttpPost]
public async Task Invoke() public async Task Invoke()
{ {
if (SeSyncConfigInfo == null)
{
return;
}
//同步表名称 //同步表名称
var syncTableName = SeSyncConfigInfo.SyncTableName; var syncTableName = SeSyncConfigInfo.SyncTableName;
//同步发运主类型 //同步发运主类型
@ -96,6 +105,33 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
}; };
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); await _syncPositionFlagRepository.InsertAsync(syncPositionFlag);
} }
pubSeDetails.ForEach(pubSeDetail =>
{
var vmiBalance = new VmiBalance()
{
PartCode = pubSeDetail.PartCode,
VinCode = pubSeDetail.PN,
CustomerPartCode = default,
CodeType = default,
BillType = pubSeDetail.DeliverBillType,
Qty = pubSeDetail.Qty,
BillTime = pubSeDetail.BillTime,
DeliverTime = pubSeDetail.DnBillTime,
ErpToLoc = pubSeDetail.ToErpLocCode,
Seq = default,
OrderNum = pubSeDetail.DnBillNum,
UniqueCode = default,
MatchNumber = default,
PjsNum = default,
Configcode = default,
factory = default,
SubBillType = pubSeDetail.DeliverSubBillType,
RealCode = default,
ReMark = pubSeDetail.Remark,
};
_vmiService.In(logType: Vmi.VmiLogType.Type100, changedNumber: pubSeDetail.DnBillNum, data: vmiBalance);
});
} }
} }
} }

14
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs

@ -1,8 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -13,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class YinDuSeSyncAppService : JitSeSyncAppService public class YinDuSeSyncAppService : JitSeSyncAppService, IJobService
{ {
/// <summary> /// <summary>
/// 构造 /// 构造
@ -21,8 +23,9 @@ public class YinDuSeSyncAppService : JitSeSyncAppService
public YinDuSeSyncAppService( public YinDuSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository) VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {
@ -35,4 +38,9 @@ public class YinDuSeSyncAppService : JitSeSyncAppService
BusinessType = EnumBusinessType.YinDuJian BusinessType = EnumBusinessType.YinDuJian
}; };
} }
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke();
}
} }

15
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs

@ -1,8 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -13,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService, IJobService
{ {
/// <summary> /// <summary>
/// 构造 /// 构造
@ -21,8 +23,9 @@ public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService
public ZhiGongBBACSeSyncAppService( public ZhiGongBBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository) VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {
@ -35,4 +38,10 @@ public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService
BusinessType = EnumBusinessType.ZhiGongJianBBAC BusinessType = EnumBusinessType.ZhiGongJianBBAC
}; };
} }
[HttpPost]
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke();
}
} }

14
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs

@ -1,8 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -13,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService
{ {
/// <summary> /// <summary>
/// 构造 /// 构造
@ -21,8 +23,9 @@ public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService
public ZhiGongHBPOSeSyncAppService( public ZhiGongHBPOSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository) VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {
@ -35,4 +38,9 @@ public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService
BusinessType = EnumBusinessType.ZhiGongJianHBPO BusinessType = EnumBusinessType.ZhiGongJianHBPO
}; };
} }
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke();
}
} }

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

@ -23,6 +23,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Extensions; using Microsoft.OpenApi.Extensions;
using Omu.ValueInjecter; using Omu.ValueInjecter;
using SettleAccount.Domain.BQ;
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;
@ -55,6 +56,7 @@ public interface IVmiService : IApplicationService, ITransientDependency, IJobSe
public class VmiAppService : ApplicationService, IVmiService, IJobService, ITransientDependency public class VmiAppService : ApplicationService, IVmiService, IJobService, ITransientDependency
{ {
private readonly IConfiguration _cfg; private readonly IConfiguration _cfg;
private readonly IServiceProvider _serviceProvider;
private readonly INormalEfCoreRepository<VmiBalance, Guid> _balanceRepository; private readonly INormalEfCoreRepository<VmiBalance, Guid> _balanceRepository;
private readonly INormalEfCoreRepository<VmiLog, Guid> _logRepository; private readonly INormalEfCoreRepository<VmiLog, Guid> _logRepository;
private readonly INormalEfCoreRepository<VmiSnapshot, Guid> _snapshotRepository; private readonly INormalEfCoreRepository<VmiSnapshot, Guid> _snapshotRepository;
@ -63,6 +65,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
private readonly ICurrentUser _currentUser; private readonly ICurrentUser _currentUser;
public VmiAppService(IConfiguration cfg, public VmiAppService(IConfiguration cfg,
IServiceProvider serviceProvider,
INormalEfCoreRepository<VmiBalance, Guid> balanceRepository, INormalEfCoreRepository<VmiBalance, Guid> balanceRepository,
INormalEfCoreRepository<VmiLog, Guid> logRepository, INormalEfCoreRepository<VmiLog, Guid> logRepository,
INormalEfCoreRepository<VmiSnapshot, Guid> snapshotRepository, INormalEfCoreRepository<VmiSnapshot, Guid> snapshotRepository,
@ -71,6 +74,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
ICurrentUser currentUser) ICurrentUser currentUser)
{ {
this._cfg = cfg; this._cfg = cfg;
this._serviceProvider = serviceProvider;
this._balanceRepository = balanceRepository; this._balanceRepository = balanceRepository;
this._logRepository = logRepository; this._logRepository = logRepository;
this._snapshotRepository = snapshotRepository; this._snapshotRepository = snapshotRepository;
@ -124,13 +128,13 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
/// <summary> /// <summary>
/// 定时备份:0 0 8 26 * ? /// 定时备份:0 0 8 26 * ?
/// </summary> /// </summary>
[HttpPost] [NonAction]
[DisableValidation] [DisableValidation]
public virtual Task Invoke(IServiceProvider serviceProvider) public virtual Task Invoke(IServiceProvider serviceProvider)
{ {
//this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", ""); //this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", "");
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/files/vmi")); Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/files/vmi"));
var date = DateTime.Now.ToString("yyyyMMddHH"); var date = DateTime.Now.ToString("yyyyMMddHHmmss");
var connectionString = $"Data Source=wwwroot/files/vmi/{date}.db"; var connectionString = $"Data Source=wwwroot/files/vmi/{date}.db";
using var dbContext = new VmiSqliteContext(connectionString); using var dbContext = new VmiSqliteContext(connectionString);
if (!dbContext.GetService<IRelationalDatabaseCreator>().Exists() && dbContext.Database.EnsureCreated()) if (!dbContext.GetService<IRelationalDatabaseCreator>().Exists() && dbContext.Database.EnsureCreated())
@ -170,6 +174,20 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
return Task.CompletedTask; return Task.CompletedTask;
} }
/// <summary>
/// 定时备份:0 0 8 26 * ?
/// </summary>
[HttpPost("invoke")]
[DisableValidation]
public virtual Task VmiBackup()
{
Task.Run(async () =>
{
await Invoke(_serviceProvider).ConfigureAwait(false);
});
return Task.CompletedTask;
}
/// <summary> /// <summary>
/// 发运入库\反结入库\调整入库 /// 发运入库\反结入库\调整入库
/// </summary> /// </summary>
@ -200,6 +218,8 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
{ {
balance = new VmiBalance(); balance = new VmiBalance();
balance.InjectFrom(data); balance.InjectFrom(data);
// 初始化库存
balance.Qty = data.Qty;
balance.SetId(); balance.SetId();
await _balanceRepository.InsertAsync(balance).ConfigureAwait(false); await _balanceRepository.InsertAsync(balance).ConfigureAwait(false);
} }
@ -207,6 +227,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
{ {
var qty = balance.Qty + data.Qty; var qty = balance.Qty + data.Qty;
balance.InjectFrom(data); balance.InjectFrom(data);
// 加库存
balance.Qty = qty; balance.Qty = qty;
if (balance.Qty == decimal.Zero) if (balance.Qty == decimal.Zero)
{ {
@ -257,13 +278,15 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
{ {
balance = new VmiBalance(); balance = new VmiBalance();
balance.InjectFrom(data); balance.InjectFrom(data);
// 负库存
balance.Qty = -data.Qty;
balance.SetId(); balance.SetId();
await _balanceRepository.InsertAsync(balance).ConfigureAwait(false); await _balanceRepository.InsertAsync(balance).ConfigureAwait(false);
} }
else else
{ {
var qty = balance.Qty - data.Qty; // 减库存
balance.Qty = qty; balance.Qty -= data.Qty; ;
if (balance.Qty == decimal.Zero) if (balance.Qty == decimal.Zero)
{ {
await this._balanceRepository.DeleteAsync(balance).ConfigureAwait(false); await this._balanceRepository.DeleteAsync(balance).ConfigureAwait(false);
@ -352,6 +375,14 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<PagedResultDto<VmiLog>> Log(RequestDto input) public async Task<PagedResultDto<VmiLog>> Log(RequestDto input)
{
var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _logRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
return new PagedResultDto<VmiLog>(totalCount, entities);
//return QueryLogFromTSDb(input);
}
private PagedResultDto<VmiLog> QueryLogFromTSDb(RequestDto input)
{ {
var query = new InfluxHelper(_cfg).Query<VmiLog>().Where(input.Filters.ToLambda<VmiLog>()); var query = new InfluxHelper(_cfg).Query<VmiLog>().Where(input.Filters.ToLambda<VmiLog>());
var count = query.Count(); var count = query.Count();

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -999,6 +999,7 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum)); .ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum));
CreateMap<BBAC_SA_DETAIL_IMPORT_DTO, BBAC_SA_DETAIL>(); CreateMap<BBAC_SA_DETAIL_IMPORT_DTO, BBAC_SA_DETAIL>();
CreateMap<BBAC_SA_DETAIL_IMPORT_DTO, PUB_SA_DETAIL>();
} }
/// <summary> /// <summary>

37
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs

@ -3,6 +3,7 @@ using System;
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace SettleAccount.Domain.BQ; namespace SettleAccount.Domain.BQ;
[Display(Name = "PUB发运数据")] [Display(Name = "PUB发运数据")]
@ -150,6 +151,42 @@ public class PUB_SE_DETAIL :SE_BASE
[Display(Name = "备注")] [Display(Name = "备注")]
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 单据类型
/// </summary>
[DisplayName("单据类型")]
public EnumBillType BillType { get; set; }
/// <summary>
/// 子单据类型
/// </summary>
[DisplayName("子单据类型")]
public EnumSubBillType SubBillType { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[DisplayName("业务类型")]
public EnumProTpe ProType { get; set; }
/// <summary>
/// 事务类型
/// </summary>
[DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; }
/// <summary>
/// 发运主类型
/// </summary>
[DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
/// <summary>
/// 发运子类型
/// </summary>
[DisplayName("发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
public PUB_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, decimal qty, string extend1, string extend2, string extend3, EnumBusinessType businessType, DateTime beginDate, DateTime shippingDate, string wmsBillNum) public PUB_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, decimal qty, string extend1, string extend2, string extend3, EnumBusinessType businessType, DateTime beginDate, DateTime shippingDate, string wmsBillNum)
{ {
Id=guid; Id=guid;

169
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs

@ -1,5 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System; using System;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
using Win.Sfs.SettleAccount.Enums; using Win.Sfs.SettleAccount.Enums;
@ -290,145 +290,42 @@ public class PubSaSeCompareSumExport
public decimal DiffQty => SAQty - SEQty; public decimal DiffQty => SAQty - SEQty;
} }
/// <summary>
/// 直供件BBAC结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDiffExport222 public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport
{ {
/// <summary> }
/// 有结算无发货(无EDI数据)
///有结算无发货(有EDI数据)
///有结算有发货(无EDI数据)
///有结算有发货(无价格信息)
///有结算有发货(有EDI数据)
///无结算有发货(有EDI数据)
///无结算有发货(无EDI数据)
///有结算有发货(有EDI数据)
///有结算有发货(WMS多发)
/// </summary>
[Display(Name = "类别")]
public string Category { get; set; }
[Display(Name = "Wms发货单号")]
public string WmsBillNum { get; set; }
[Display(Name = "发货日期")]
public DateTime ShippingDate { get; set; }
[Display(Name = "生产码")]
public string PN { get; set; }
[Display(Name = "物料号")]
public string MaterialNumber { get; set; }
[Display(Name = "物料描述")]
public string MaterialDes { get; set; }
[Display(Name = "原始LU")]
public string PrimitiveLU { get; set; }
[Display(Name = "替换LU")]
public string ReplaceLU { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
public DateTime CustomerOfflineTime { get; set; }
[Display(Name = "结算数量")]
public decimal SAQty { get; set; }
[Display(Name = "发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// 差异数量
/// </summary>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; }
[Display(Name = "匹配类型")]
public string MateType { get; set; }
[Display(Name = "定价")]
public decimal FixPrice { get; set; }
[Display(Name = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; }
[Display(Name = "日顺序号")]
public string SeqNumber { get; set; }
//[Display(Name = "零件号")]
//public string LU { get; set; } = null!;
[Display(Name = "小总成号")]
public string AssemblyCode { get; set; }
[Display(Name = "注塑码")]
public string InjectionCode { get; set; }
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "替换零件号")]
public string RepLU { get; set; }
/// <summary>
/// 零件号
/// </summary>
[ExporterHeader(DisplayName = "零件号")]
public string SeLU { set; get; }
/// <summary>
/// 生产号
/// </summary>
[ExporterHeader(DisplayName = "生产号")]
public string SePN { set; get; }
/// <summary>
/// 零件号
/// </summary>
[ExporterHeader(DisplayName = "零件号")]
public string SaLU { set; get; }
/// <summary>
/// 生产号
/// </summary>
[ExporterHeader(DisplayName = "生产号")]
public string SaPN { set; get; }
/// <summary> /// <summary>
/// 结算数量 /// 直供件HBPO结算与发运对比明细
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "结算数量")] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public decimal SaQty { set; get; } public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport
{
}
/// <summary> /// <summary>
/// 发运数量 /// 买单件HBPO结算与发运对比明细
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "发运数量")] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public decimal SeQty { set; get; } public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExport
{
}
/// <summary>
/// 备件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport
{
}
/// <summary>
/// 印度件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport
{
} }

6
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -1337,6 +1337,12 @@ namespace Win.Sfs.SettleAccount
//seed //seed
builder.Entity<JobItem>().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" }); builder.Entity<JobItem>().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" });
builder.Entity<JobItem>().HasData(new JobItem("BBACSeSync".ToGuid()) { Name = "BBAC发运数据同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("HBPOSeSync".ToGuid()) { Name = "HBPO发运数据同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.HBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("ZhiGongBBACSeSync".ToGuid()) { Name = "直供件BBAC发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("YinDuSeSync".ToGuid()) { Name = "印度件发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("发运入库".ToGuid()) { Type = VmiType.In, Name = "发运入库", Number = "100" }); //builder.Entity<VmiCategory>().HasData(new VmiCategory("发运入库".ToGuid()) { Type = VmiType.In, Name = "发运入库", Number = "100" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("结算出库".ToGuid()) { Type = VmiType.Out, Name = "结算出库", Number = "200" }); //builder.Entity<VmiCategory>().HasData(new VmiCategory("结算出库".ToGuid()) { Type = VmiType.Out, Name = "结算出库", Number = "200" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" }); //builder.Entity<VmiCategory>().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" });

5288
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.Designer.cs

File diff suppressed because it is too large

38
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.cs

@ -0,0 +1,38 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202308081 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "Cron", "HeartBeat", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), "0 0/30 * * * ? ", null, false, false, "直供件BBAC发运同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" });
migrationBuilder.UpdateData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
column: "ConcurrencyStamp",
value: "210607a13a294958a95ea0faddc6eb65");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"));
migrationBuilder.UpdateData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
column: "ConcurrencyStamp",
value: "f0b58114c8bf4491b657f275bd0631b0");
}
}
}

5333
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808062331_20230808-2.Designer.cs

File diff suppressed because it is too large

79
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808062331_20230808-2.cs

@ -0,0 +1,79 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202308082 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "Cron",
value: "0 0/10 * * * ? ");
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "Cron", "HeartBeat", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[,]
{
{ new Guid("d6d5e1d7-9326-ceea-eed4-fb4039e7ee68"), "0 0/10 * * * ? ", null, false, false, "BBAC发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BBACSeSyncAppService" },
{ new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"), "0 0/10 * * * ? ", null, false, false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.HBPOSeSyncAppService" },
{ new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), "0 0/10 * * * ? ", null, false, false, "直供件HBPO发运同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" },
{ new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), "0 0/10 * * * ? ", null, false, false, "备件发运同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" },
{ new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), "0 0/10 * * * ? ", null, false, false, "印度件发运同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" }
});
migrationBuilder.UpdateData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
column: "ConcurrencyStamp",
value: "7ee5d3ed981d4f87963af8b5654cd9df");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("d6d5e1d7-9326-ceea-eed4-fb4039e7ee68"));
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "Cron",
value: "0 0/30 * * * ? ");
migrationBuilder.UpdateData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
column: "ConcurrencyStamp",
value: "210607a13a294958a95ea0faddc6eb65");
}
}
}

56
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -4149,6 +4149,60 @@ namespace Win.Sfs.SettleAccount.Migrations
IsRunning = false, IsRunning = false,
Name = "库存快照", Name = "库存快照",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService"
},
new
{
Id = new Guid("d6d5e1d7-9326-ceea-eed4-fb4039e7ee68"),
Cron = "0 0/10 * * * ? ",
IsDisabled = false,
IsRunning = false,
Name = "BBAC发运数据同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BBACSeSyncAppService"
},
new
{
Id = new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"),
Cron = "0 0/10 * * * ? ",
IsDisabled = false,
IsRunning = false,
Name = "HBPO发运数据同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.HBPOSeSyncAppService"
},
new
{
Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
Cron = "0 0/10 * * * ? ",
IsDisabled = false,
IsRunning = false,
Name = "直供件BBAC发运同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService"
},
new
{
Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
Cron = "0 0/10 * * * ? ",
IsDisabled = false,
IsRunning = false,
Name = "直供件HBPO发运同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService"
},
new
{
Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
Cron = "0 0/10 * * * ? ",
IsDisabled = false,
IsRunning = false,
Name = "备件发运同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService"
},
new
{
Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
Cron = "0 0/10 * * * ? ",
IsDisabled = false,
IsRunning = false,
Name = "印度件发运同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService"
}); });
}); });
@ -4271,7 +4325,7 @@ namespace Win.Sfs.SettleAccount.Migrations
Id = new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"), Id = new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
BillType = 1, BillType = 1,
ConcurrencyStamp = "f0b58114c8bf4491b657f275bd0631b0", ConcurrencyStamp = "7ee5d3ed981d4f87963af8b5654cd9df",
DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ErpToLoc = "ErpToLoc", ErpToLoc = "ErpToLoc",
OrderNum = "OrderNum", OrderNum = "OrderNum",

17
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs

@ -1,5 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Dapper; using Dapper;
@ -24,8 +22,17 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
/// <summary> /// <summary>
/// 获取差异 /// 获取差异
/// </summary> /// </summary>
public virtual List<PubSaSeCompareDiff> GetDetailDiffReportList(string businessType) public virtual List<PubSaSeCompareDiff> GetDetailDiffReportList(string businessType, string version, string seStartDateTime, string seEndDateTime)
{ {
string strSeWhere = string.Empty;
if (!string.IsNullOrWhiteSpace(seStartDateTime))
{
strSeWhere = $" AND BillTime >= {seStartDateTime} ";
}
if (!string.IsNullOrWhiteSpace(seEndDateTime))
{
strSeWhere = $" AND BillTime <= {seEndDateTime} ";
}
string strSqlText = @$" string strSqlText = @$"
SELECT SELECT
A.WmsBillNum, A.WmsBillNum,
@ -46,8 +53,8 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
'' MateType, '' MateType,
B.Price FixPrice B.Price FixPrice
FROM FROM
(SELECT SUM(QTY) SEQty,LU,PN,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} GROUP BY LU,PN) A (SELECT SUM(QTY) SEQty,LU,PN,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} {strSeWhere} GROUP BY LU,PN) A
FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate FROM Set_PUB_SA_DETAIL WHERE BusinessType = {businessType} GROUP BY LU,PN) B ON A.LU= B.LU AND A.PN= B.PN FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate FROM Set_PUB_SA_DETAIL WHERE BusinessType = {businessType} AND Version = {version} GROUP BY LU,PN) B ON A.LU= B.LU AND A.PN= B.PN
ORDER BY B.SettleDate DESC; ORDER BY B.SettleDate DESC;
"; ";
return DbConnection.Query<PubSaSeCompareDiff>(strSqlText, null, null, true, 1200, null).ToList(); return DbConnection.Query<PubSaSeCompareDiff>(strSqlText, null, null, true, 1200, null).ToList();

270
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

@ -2,14 +2,11 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using EmptyFiles;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions; using Microsoft.OpenApi.Extensions;
using NetTopologySuite.Operation.Buffer;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Shouldly; using Shouldly;
using TaskJob.EventArgs; using TaskJob.EventArgs;
using TaskJob.Interfaces; using TaskJob.Interfaces;
@ -19,7 +16,6 @@ using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Enums; using Win.Sfs.SettleAccount.Enums;
using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Reports;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
@ -32,6 +28,11 @@ namespace SettleAccount.Job.Services.Report
/// </summary> /// </summary>
public class PubSaSeCompareExportService : ITransientDependency, IExportJob public class PubSaSeCompareExportService : ITransientDependency, IExportJob
{ {
/// <summary>
/// HubContext
/// </summary>
private readonly IHubContext<PageHub> _hubContext;
/// <summary> /// <summary>
/// 替换件关系仓储 /// 替换件关系仓储
/// </summary> /// </summary>
@ -61,12 +62,14 @@ namespace SettleAccount.Job.Services.Report
/// 构造 /// 构造
/// </summary> /// </summary>
public PubSaSeCompareExportService( public PubSaSeCompareExportService(
IHubContext<PageHub> hubContext,
INormalEfCoreRepository<TB_RePartsRelationship, Guid> tbRePartsRelationshipRepository, INormalEfCoreRepository<TB_RePartsRelationship, Guid> tbRePartsRelationshipRepository,
INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> pubSeCDetailRepository, INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> pubSeCDetailRepository,
PubSaSeCompareDapperRepository pubSaSeCompareDapperRepository, PubSaSeCompareDapperRepository pubSaSeCompareDapperRepository,
IBlobContainer<MyFileContainer> fileContainer, IBlobContainer<MyFileContainer> fileContainer,
IObjectMapper objectMapper) IObjectMapper objectMapper)
{ {
_hubContext = hubContext;
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
_pubSeCDetailRepository = pubSeCDetailRepository; _pubSeCDetailRepository = pubSeCDetailRepository;
_pubSaSeCompareDapperRepository = pubSaSeCompareDapperRepository; _pubSaSeCompareDapperRepository = pubSaSeCompareDapperRepository;
@ -87,18 +90,21 @@ namespace SettleAccount.Job.Services.Report
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{ {
var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value; var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
var businessType = property.Where(t => t.Name == "BusinessType").FirstOrDefault().Value; var strBusinessType = property.Where(t => t.Name == "BusinessType").FirstOrDefault().Value;
var lu = property.Where(p => p.Name == "LU").FirstOrDefault().Value; var lu = property.Where(p => p.Name == "LU").FirstOrDefault().Value;
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value; var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value;
var seStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
EnumBusinessType businessType = (EnumBusinessType)Enum.Parse(typeof(EnumBusinessType), strBusinessType);
var businessTypeDisplayName = businessType.ToString(); var businessTypeDisplayName = businessType.ToString();
DisplayAttribute attributeOfType = ((EnumBusinessType)Enum.Parse(typeof(EnumBusinessType), businessType)).GetAttributeOfType<DisplayAttribute>(); DisplayAttribute attributeOfType = businessType.GetAttributeOfType<DisplayAttribute>();
if (attributeOfType != null) if (attributeOfType != null)
{ {
businessTypeDisplayName = attributeOfType.Name; businessTypeDisplayName = attributeOfType.Name;
} }
var filename = exportName.FirstOrDefault(); var filename = exportName.FirstOrDefault();
var pubSaSeCompareDiffs = _pubSaSeCompareDapperRepository.GetDetailDiffReportList(businessType); var pubSaSeCompareDiffs = _pubSaSeCompareDapperRepository.GetDetailDiffReportList(strBusinessType, version, seStartDateTime, seEndDateTime);
pubSaSeCompareDiffs.ForEach(p => pubSaSeCompareDiffs.ForEach(p =>
{ {
@ -127,7 +133,7 @@ namespace SettleAccount.Job.Services.Report
#region 二次对比 #region 二次对比
//二次对比(替换零件号) //二次对比(替换零件号)
var repLUs = notHaveSaHaveSes.Select(t => t.SeLU).Distinct().ToList(); var repLUs = notHaveSaHaveSes.Select(t => t.SeLU).Distinct().ToList();
var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && ((int)t.BusinessType).ToString() == businessType).Result; var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && t.BusinessType == businessType).Result;
tbRePartsRelationships.ForEach(tbRePartsRelationship => tbRePartsRelationships.ForEach(tbRePartsRelationship =>
{ {
@ -192,7 +198,6 @@ namespace SettleAccount.Job.Services.Report
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn); pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn);
} }
//结算核对明细
var pubSaSeCompareDetailExports = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExport>>(pubSaSeCompareDiffs); var pubSaSeCompareDetailExports = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExport>>(pubSaSeCompareDiffs);
//结算核对汇总 //结算核对汇总
var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
@ -234,12 +239,99 @@ namespace SettleAccount.Job.Services.Report
SEQty = p.Sum(t => t.SEQty) SEQty = p.Sum(t => t.SEQty)
}).ToList(); }).ToList();
#region MyRegion ExcelExporter excelExporter = new ExcelExporter();
#endregion switch (businessType)
{
case EnumBusinessType.ZhiGongJianBBAC:
{
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportZhiGongJianBBAC>>(pubSaSeCompareDetailExports);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBAC>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.ZhiGongJianHBPO:
{
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportZhiGongJianHBPO>>(pubSaSeCompareDetailExports);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPO>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.MaiDanJianBBAC:
break;
case EnumBusinessType.MaiDanJianHBPO:
{
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDetailExports);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.BeiJian:
{
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportBeiJian>>(pubSaSeCompareDetailExports);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJian>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.YinDuJian:
{
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportYinDuJian>>(pubSaSeCompareDetailExports);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJian>(items, businessTypeDisplayName);
}
break;
default:
break;
}
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);
Notify();
return id.ToString();
}
#region 私有方法
public ExcelExporter BindExcelExporter<T>(List<T> pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, new()
{
//结算核对汇总
var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
{
LU = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//有结算有发运
var haveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
//有结算有发运汇总
var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
{
LU = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//有结算无发运
var haveSaNotHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe);
//有结算无发运
var haveSaNotHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
{
LU = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//无结算有发运
var notHaveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe);
//无结算有发运
var notHaveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
{
LU = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
ExcelExporter excelExporter = new ExcelExporter(); ExcelExporter excelExporter = new ExcelExporter();
var result = excelExporter return excelExporter
.Append(pubSaSeCompareDetailExports, $"{businessTypeDisplayName}结算核对明细输出") .Append(pubSaSeCompareDetailExports, $"{businessTypeDisplayName}结算核对明细输出")
.SeparateBySheet() .SeparateBySheet()
.Append(pubSaSeCompareSumExports, $"{businessTypeDisplayName}结算核对汇总输出") .Append(pubSaSeCompareSumExports, $"{businessTypeDisplayName}结算核对汇总输出")
@ -253,155 +345,13 @@ namespace SettleAccount.Job.Services.Report
.Append(haveSaNotHaveSeExports, $"{businessTypeDisplayName}有结算无发货明细输出") .Append(haveSaNotHaveSeExports, $"{businessTypeDisplayName}有结算无发货明细输出")
.SeparateBySheet() .SeparateBySheet()
.Append(haveSaNotHaveSeSumExports, $"{businessTypeDisplayName}有结算无发货汇总输出") .Append(haveSaNotHaveSeSumExports, $"{businessTypeDisplayName}有结算无发货汇总输出")
.SeparateBySheet() .SeparateBySheet();
.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);
return id.ToString();
} }
/// <summary> private void Notify()
/// 导出(废弃)
/// </summary>
public string ExportFile333(Guid id, List<string> exportName, List<CustomCondition> property)
{ {
return ""; this._hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", "");
// var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
// var _filename = exportName.FirstOrDefault();
// var _ls = _dapperRepository.GetDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber, materialGroup);
// var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version);
// foreach (var itm in _ls)
// {
// itm.InvoiceAmt = Math.Round(itm.InvoiceQty * itm.InvoicePrice, 2);
// itm.DiffPrice = itm.Price - itm.InvoicePrice;
// itm.DiffSettleFisQty = itm.SettledQty;
// }
// _ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList();
// if (!string.IsNullOrEmpty(materialGroup))
// {
// var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
// }
// }
// if (!string.IsNullOrEmpty(kenncode))
// {
// var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList();
// }
// }
// if (!string.IsNullOrEmpty(chassisNumber))
// {
// var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
// }
// }
// if (!string.IsNullOrEmpty(sapCode))
// {
// var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
// }
// }
// if (!string.IsNullOrEmpty(materialCode))
// {
// var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList();
// }
// }
// var _checkList = _erpdapperRepository.GetErrorBillList();
// var query = from itm in _ls
// join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum }
//equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
// from tm1 in temp1.DefaultIfEmpty()
// where tm1 == null
// select itm;
// _ls = query.ToList();
// var _lsSum = _ls.GroupBy(p => new { p.MaterialCode, p.SapMaterialCode, p.MaterialGroup, p.InvoicePrice }).Select(p => new UnInvoiceSettledDetailSum
// {
// MaterialCode = p.Key.MaterialCode,
// SapMaterailCode = p.Key.SapMaterialCode,
// MaterialGroup = p.Key.MaterialGroup,
// SettleQty = p.Sum(itm => itm.SettledQty),
// FisQty = 0,
// DiffQty = -p.Sum(itm => itm.SettledQty),
// Price = p.Key.InvoicePrice,
// DiffAmt = p.Sum(itm => itm.SettledQty) * p.Key.InvoicePrice
// }).ToList();
// var _sumTotal = new UnInvoiceSettledDetailSum()
// {
// SettleQty = _lsSum.Sum(p => p.SettleQty),
// DiffQty = _lsSum.Sum(p => p.DiffQty),
// Price = _lsSum.Sum(p => p.Price),
// DiffAmt = _lsSum.Sum(p => p.DiffAmt)
// };
// _lsSum.Add(_sumTotal);
// var _ls1 = DiffPrice(id, exportName, p_list);
// var report1List = _ls1.Where(p => p.DiffPrice != 0).GroupBy(p => new { p.MaterialGroup, p.MaterialCode, p.MaterialDesc, p.Price, p.InvoicePrice, p.DiffPrice, p.SapMaterialCode })
// .Select(t => new SettleDoorPanelExport { MaterialGroup = t.FirstOrDefault().MaterialGroup, MaterialCode = t.FirstOrDefault().MaterialCode, MaterialDesc = t.FirstOrDefault().MaterialDesc, Price = t.FirstOrDefault().Price, InvoicePrice = t.FirstOrDefault().InvoicePrice, InvoiceDiffPrice = t.FirstOrDefault().DiffPrice, SAPCode = t.FirstOrDefault().SapMaterialCode }).ToList();
// var report2List = _ls1.Where(p => p.DiffPrice != 0).Select(p => new { p.MaterialGroup, DiffAmt = p.DiffPrice * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version });
// var list1 = LSettleSum(id, exportName, p_list);
// var report1 = report2List.ToList();
// foreach (var itm in list1)
// {
// itm.MaterialGroup = itm.MaterialGroup + "(漏结)";
// }
// report1.AddRange(list1);
// ExcelExporter _exporter = new ExcelExporter();//导出Excel
// var result = _exporter
// .Append(_ls, "差异明细表")
// .SeparateBySheet()
// .Append(_lsSum, "数量差异汇总表")
// .SeparateBySheet()
// .Append(report1List, "按物料价格差异明细表")
// .SeparateBySheet()
// .Append(report1, "差异汇总验证表")
// .ExportAppendDataAsByteArray();
// result.ShouldNotBeNull();
// _fileContainer.SaveAsync(_filename, result.Result, true);
// //_outputService.Export<InvoiceSettledDetailDiff>(id, string.Format("大众结算未发运核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _ls);
// return id.ToString();
} }
#endregion
} }
} }

6
code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

@ -20,6 +20,12 @@ namespace SettleAccount.Job
.ForMember(x => x.ReplaceLU, y => y.MapFrom(y => y.ReplaceLU)); .ForMember(x => x.ReplaceLU, y => y.MapFrom(y => y.ReplaceLU));
CreateMap<PubSaSeCompareDiff, PUB_SEC_DETAIL>(); CreateMap<PubSaSeCompareDiff, PUB_SEC_DETAIL>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportBeiJian>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportYinDuJian>();
} }
} }
} }

Loading…
Cancel
Save