diff --git a/code/.gitignore b/code/.gitignore
index 07d8289e..4e191f0f 100644
--- a/code/.gitignore
+++ b/code/.gitignore
@@ -1,24 +1,5 @@
-<<<<<<< HEAD
-################################################################################
-# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。
-################################################################################
-
-/src/.vs/SettleAccount/DesignTimeBuild/.dtbcache.v2
-/.vs/slnx.sqlite
-/src/.vs/SmartFactorySuite/DesignTimeBuild/.dtbcache.v2
-/src/.vs/SmartFactorySuite/v16/.suo
-/src/.vs/SettleAccount/v16/.suo
-
-
-/*.rar
-/src/Shared
-/.vs/Win.Sfs.SmartSettlementSystem.PG/v17/.suo
-/src/.vs/SettleAccount/v17/.suo
-/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20220226.txt
-/src/.vs/SettleAccount/v17/.futdcache.v1
-/src/.vs/SettleAccount/v17/fileList.bin
-=======
*.bak
+*.log
#fe
node_modules/
@@ -28,10 +9,11 @@ dist/
.vs/
bin/
obj/
+[Ll]og/
+[Ll]ogs/
*.suo
*.user
*.db
*.db-shm
*.db-wal
->>>>>>> c0f08a7ed0ffc663a2852d4c0da54a983f033a2f
diff --git a/code/WebApp/vanilla/api/user.js b/code/WebApp/vanilla/api/user.js
index e830bbdd..d245865a 100644
--- a/code/WebApp/vanilla/api/user.js
+++ b/code/WebApp/vanilla/api/user.js
@@ -1,5 +1,5 @@
import router from "../router/index.js";
-import { get, post } from "../request/index.js";
+import request, { get, post } from "../request/index.js";
import jwt_decode from "../lib/jwt-decode/jwt-decode.esm.js";
import qs from "../lib/qs/shim.js";
import { useAppStore } from "../store/index.js";
@@ -46,7 +46,9 @@ const logout = () => {
};
const getUser = async () => {
- const result = await get("abp/application-configuration");
+ const result = await request("abp/application-configuration", null, {
+ method: "GET",
+ });
const data = result.data;
const user = {};
user.id = data.currentUser.id;
diff --git a/code/WebApp/vanilla/app.js b/code/WebApp/vanilla/app.js
index 9f35eb2c..34b69c72 100644
--- a/code/WebApp/vanilla/app.js
+++ b/code/WebApp/vanilla/app.js
@@ -6,12 +6,11 @@ import { Suspense, reactive, onMounted } from "vue";
export default {
components: { ElConfigProvider, Suspense },
- template: html`
+ template: html`
- Loading...
- `,
+ `,
setup() {
const localeMap = reactive(
new Map([
diff --git a/code/WebApp/vanilla/components/form/form-input.js b/code/WebApp/vanilla/components/form/form-input.js
index a99cc6c0..87d16b3d 100644
--- a/code/WebApp/vanilla/components/form/form-input.js
+++ b/code/WebApp/vanilla/components/form/form-input.js
@@ -1,15 +1,16 @@
import html from "html";
-import { ref, reactive, watch } from "vue";
+import { ref, reactive, watch, onMounted } from "vue";
import { dayjs } from "element-plus";
-import { post } from "../../request/index.js";
+import request, { post } from "../../request/index.js";
export default {
template: html`
- {{dayjs(model[prop]).format('YYYY-MM-DD HH:mm:ss')}}
- {{dayjs(model[prop]).format('YYYY-MM-DD')}}
+ {{dayjs(model[prop]).format('YYYY-MM-DD HH:mm:ss')}}
+ {{dayjs(model[prop]).format('YYYY-MM-DD')}}
+ ******
{{model[prop]}}
@@ -55,28 +56,25 @@ export default {
v-model="model[prop]"
type="password"
show-password
- v-if="schema.format==='password'"
+ v-if="schema.input==='password'"
/>
`,
- props: ["modelValue", "schema", "prop", "isReadOnly"],
+ props: ["modelValue", "schema", "prop", "isReadOnly", "mode"],
emit: ["update:modelValue"],
- async setup(props, context) {
+ setup(props, context) {
const model = reactive(props.modelValue);
watch(model, (value) => {
context.emit("update:modelValue", value);
});
/*start*/
const getDisabled = () => {
- if (props.isReadOnly && props.isReadOnly === true) {
+ if (props.mode === "details") {
return true;
}
- if (props.schema.displayOnly) {
- return true;
- }
- if (props.mode === "update" && props.schema.addOnly) {
+ if (props.mode === "update" && props.schema.readOnly) {
return true;
}
return false;
@@ -89,20 +87,22 @@ export default {
const selectProps = ref({});
const selectValues = ref([]);
const options = ref([]);
- if (props.schema.options) {
- options.value = props.schema.options;
- } else if (props.schema.url) {
- try {
- const url = `${props.schema.url}`;
- const result = await post(url, { queryAll: true, query: { isReadonly: null, isDisabled: null, order: null } });
- options.value = result.data?.items.map((o) => ({
- value: o[props.schema.value],
- label: o[props.schema.label],
- }));
- } catch (error) {
- console.log(error);
+ onMounted(async () => {
+ if (props.schema.options) {
+ options.value = props.schema.options;
+ } else if (props.schema.url) {
+ try {
+ const url = `${props.schema.url}`;
+ const result = await request(url, null, { method: "GET" });
+ options.value = result.data?.items.map((o) => ({
+ value: o[props.schema.value],
+ label: o[props.schema.label],
+ }));
+ } catch (error) {
+ console.log(error);
+ }
}
- }
+ });
return {
model,
getDisabled,
diff --git a/code/WebApp/vanilla/components/form/form-item.js b/code/WebApp/vanilla/components/form/form-item.js
index ae49e013..1616337b 100644
--- a/code/WebApp/vanilla/components/form/form-item.js
+++ b/code/WebApp/vanilla/components/form/form-item.js
@@ -1,11 +1,13 @@
import html from "html";
import { defineAsyncComponent, ref, reactive, watch } from "vue";
+import { format } from "../../utils/index.js";
+import { messages } from "../../utils/validation.js";
export default {
name: "formItem",
components: { AppFormInput: defineAsyncComponent(() => import("./form-input.js")) },
template: html`
-
+
-
+
`,
props: ["modelValue", "mode", "parentSchema", "schema", "prop", "errors"],
emit: ["update:modelValue"],
- async setup(props, context) {
+ setup(props, context) {
const model = reactive(props.modelValue);
watch(model, (value) => {
context.emit("update:modelValue", value);
@@ -63,18 +65,18 @@ export default {
}
if (!rule.message) {
if (rule.required) {
- rule.message = format(schema.messages.required, property.title);
+ rule.message = format(messages.required, property.title);
} else if (rule.pattern) {
- rule.message = format(schema.messages.pattern, property.title);
+ rule.message = format(messages.pattern, property.title);
} else if (property.type === "string" || property.type === "number" || property.type === "array") {
if (rule.len) {
- rule.message = format(schema.messages[property.type].len, property.title, rule.len);
+ rule.message = format(messages[property.type].len, property.title, rule.len);
} else if (rule.min) {
- rule.message = format(schema.messages[property.type].min, property.title, rule.min);
+ rule.message = format(messages[property.type].min, property.title, rule.min);
} else if (rule.max) {
- rule.message = format(schema.messages[property.type].max, property.title, rule.max);
+ rule.message = format(messages[property.type].max, property.title, rule.max);
} else if (rule.range) {
- rule.message = format(schema.messages[property.type].range, property.title, rule.range);
+ rule.message = format(messages[property.type].range, property.title, rule.range);
}
}
}
diff --git a/code/WebApp/vanilla/components/icon/index.js b/code/WebApp/vanilla/components/icon/index.js
index af87437d..2f446c3d 100644
--- a/code/WebApp/vanilla/components/icon/index.js
+++ b/code/WebApp/vanilla/components/icon/index.js
@@ -14,29 +14,23 @@ export default {
default: "file",
},
},
- async setup(props) {
+ setup(props) {
const svg = ref(null);
+ const appStore = useAppStore();
onMounted(async () => {
if (!props.name.startsWith("ep-")) {
try {
const url = `./assets/icons/${props.name}.svg`;
- navigator.locks.request(url, async () => {
- const appStore = useAppStore();
- if (appStore.cache.has(url)) {
- svg.value = appStore.cache.get(url);
- } else {
- const response = await fetch(url);
- if (response.ok && response.status === 200) {
- svg.value = await response.text();
- appStore.cache.set(url, svg.value);
- }
- }
- });
+ if (!appStore.cache.has(url)) {
+ const response = await fetch(url);
+ const result = await response.text();
+ appStore.cache.set(url, result);
+ }
+ svg.value = appStore.cache.get(url);
} catch (error) {
console.log(error);
- if (!svg.value) {
- svg.value = ``;
- }
+ } finally {
+ svg.value ??= ``;
}
}
});
diff --git a/code/WebApp/vanilla/components/list/index.js b/code/WebApp/vanilla/components/list/index.js
index 7b64f541..d9d4125b 100644
--- a/code/WebApp/vanilla/components/list/index.js
+++ b/code/WebApp/vanilla/components/list/index.js
@@ -3,10 +3,11 @@ import request, { get, post } from "../../request/index.js";
import { defineAsyncComponent, ref, reactive, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
-import { listToTree, schemaToModel } from "../../utils/index.js";
+import { listToTree, schemaToModel, importFunction } from "../../utils/index.js";
import qs from "../../lib/qs/shim.js";
import VueOfficeExcel from "@vue-office/excel";
import { camelCase, capitalize } from "lodash";
+import { useAppStore } from "../../store/index.js";
export default {
name: "AppList",
@@ -40,6 +41,7 @@ export default {
:class="item.meta.htmlClass??'el-button--primary'"
v-if="item.meta.isTop"
@click="click(item,selectedRows)"
+ :disabled="item.meta.disabled && item.meta.disabled(selectedRows)"
>
{{item.meta.title}}
@@ -68,7 +70,7 @@ export default {
border
fit
>
-
+
{{ (pageModel.pageIndex - 1) * pageModel.pageSize + scope.$index + 1 }}
@@ -89,7 +91,7 @@ export default {
-
+
@@ -99,7 +101,7 @@ export default {
{{item.title}}
-
+
@@ -120,6 +122,7 @@ export default {
:class="item.meta.htmlClass??'el-button--primary'"
v-if="!item.meta.isTop"
@click="click(item,[scope.row])"
+ :disabled="item.meta.disabled && item.meta.disabled(scope.row)"
>
{{item.meta.title}}
@@ -136,7 +139,7 @@ export default {
@@ -321,13 +324,13 @@ export default {
`,
props: ["modelValue", "config", "querySchema", "controller", "query", "buttons"],
emits: ["command"],
- async setup(props, context) {
- // 变量定义
- //// 配置
- const config = ref(props.config);
- //// 分页
+ setup(props, context) {
+ /*变量定义*/
+ // 配置
+ const config = reactive(props.config);
+ // 分页
const pageModel = reactive({
- sizeList: [20, 50, 100],
+ sizeList: [1, 50, 100],
pageIndex: 1,
pageSize: 10,
total: 0,
@@ -348,9 +351,12 @@ export default {
const route = useRoute();
const router = useRouter();
const { t } = useI18n();
+ const appStore = useAppStore();
+ // 注释一下代码暂停权限验证
+ // const buttons = ref(props.buttons ?? route.meta.children.filter((o) => o.meta.hasPermission));
+ // 添加下行代码暂停权限验证
const buttons = ref(props.buttons ?? route.meta.children);
const baseUrl = props.controller ?? `${route.meta.path}`;
- const indexUrl = props.indexUrl ?? `${baseUrl}/index`;
const queryModel = ref({});
const sortColumns = ref(new Map());
const querySchema = ref(props.querySchema);
@@ -405,7 +411,7 @@ export default {
queryModel.value.orderBy = Array.from(sortColumns.value)
.map((o) => capitalize(o[0]) + (o[1] === "ascending" ? "" : ` DESC`))
.join(",");
- await load(indexUrl);
+ await load();
};
const showColumn = (item, prop) => {
return (
@@ -417,10 +423,16 @@ export default {
};
const handleSelectionChange = (rows) => (selectedRows.value = rows);
- const load = async (url) => {
+ const load = async () => {
tableLoading.value = true;
try {
- const url = config.value.query.url;
+ const url = config.query.url;
+ const method = config.query.method;
+ //
+ queryModel.value = schemaToModel(config.query.schema);
+ queryModel.value.maxResultCount = pageModel.pageSize;
+ queryModel.value.skipCount = (pageModel.pageIndex - 1) * pageModel.pageSize;
+ //
const postData = JSON.parse(JSON.stringify(queryModel.value));
postData.filters = queryList.value.filter((o) => o.property && o.value);
if (postData.items) {
@@ -429,60 +441,62 @@ export default {
if (postData.query?.id) {
delete postData.query["id"];
}
- const listData = (await request(url, postData, { method: config.value.query.method.toUpperCase() })).data;
+ const listData = (await request(url, postData, { method })).data;
const items = listData.items;
if (tableSchema.value.isTree) {
items = listToTree(listData.items);
}
tableData.value = items;
+ pageModel.total = listData.totalCount;
//data.value = listData;
- queryModel.tableKey.value = !tableKey.value;
+ tableKey.value = !tableKey.value;
} catch (error) {
console.log(error);
} finally {
tableLoading.value = false;
}
};
- const onPageIndexChange = async () => {
- await load(indexUrl);
- };
- const onPageSizeChange = async () => await load(indexUrl);
+ const onPageIndexChange = async () => await load();
+ const onPageSizeChange = async () => await load();
const click = async (item, rows) => {
editFormloading.value = true;
editFormMode.value = item.path ?? item;
context.emit("command", item, rows);
if (item.path === "index") {
//list
- await load(indexUrl);
+ await load();
} else if (item.path === "details") {
//details
const url = `${baseUrl}/${item.path}?${qs.stringify({ id: rows[0].id })}`;
editFormSchema.value = (await get(url)).data;
editFormModel.value = (await post(url)).data;
- editFormTitle.value = `${querySchema.value?.title}${t("details")}`;
+ editFormTitle.value = `${config.edit.schema.title}${t("details")}`;
dialogVisible.value = true;
} else if (item.path === "create" || item.path === "update") {
//create
- let url = `${baseUrl}/${item.path}`;
- if (item.path === "update") {
- url = `${url}?${qs.stringify({ id: rows[0].id })}`;
+ if (item.path === "create") {
+ editFormModel.value = schemaToModel(config.edit.schema);
+ } else {
+ const url = `${config.edit.updateUrl ?? config.query.url}/${rows[0].id}`;
+ editFormModel.value = (await request(url, null, { method: "GET" })).data;
+ editFormModel.value.id = rows[0].id;
}
- const vm = (await get(url)).data;
- editFormSchema.value = vm.schema;
- editFormModel.value = vm.model;
- editFormTitle.value = `${t(item.path)}${querySchema.value?.title}`;
+ editFormTitle.value = `${t(item.path)}${config.edit.schema.title}`;
dialogVisible.value = true;
} else if (item.path === "delete") {
//delete
- if (!rows.length) {
+ if (item.meta.isTop) {
+ // 批量删除
return;
+ } else {
+ // 单个删除
}
const url = `${baseUrl}/${item.path}`;
- await post(
- url,
- rows.map((o) => o.id)
- );
- await load(indexUrl);
+ // await post(
+ // url,
+ // rows.map((o) => o.id)
+ // );
+ await load();
} else if (item.path === "export") {
//export
editFormTitle.value = `${t(item.path)}${querySchema.value?.title}`;
@@ -505,12 +519,17 @@ export default {
const valid = await editFormRef.value.validate();
if (valid) {
editFormloading.value = true;
- const url = `${baseUrl}/${editFormMode.value}`;
- const result = await post(url, editFormModel.value);
+ let url =
+ (editFormMode.value === "create" ? config.edit.createUrl : config.edit.updateUrl) ?? config.query.url;
+ if (editFormMode.value === "update") {
+ url = `${url}/${editFormModel.value.id}`;
+ }
+ const method = editFormMode.value === "create" ? config.edit.createMethod : config.edit.updateMethod;
+ const result = await request(url, editFormModel.value, { method });
if (result.errors) {
model.errors = result.errors; //??
} else {
- await load(indexUrl);
+ await load();
editFormMode.value = null;
dialogVisible.value = false;
}
@@ -543,9 +562,9 @@ export default {
const response = await post(url, formData);
editFormloading.value = false;
dialogVisible.value = false;
- await load(indexUrl);
+ await load();
} else if (editFormMode.value === "filter") {
- await load(indexUrl);
+ await load();
dialogVisible.value = false;
}
};
@@ -596,7 +615,21 @@ export default {
const handleChange = (uploadFile, uploadFiles) => {
fileList.value = uploadFiles;
};
+ const getButtonDisabled = async (src, row) => {
+ if (src) {
+ const method = await importFunction(src);
+ return src.startsWith("async") ? await method(row) : method(row);
+ }
+ return false;
+ };
onMounted(async () => {
+ if (route.meta.children?.length) {
+ for (const item of route.meta.children) {
+ if (item.meta.disabled?.constructor === String) {
+ item.meta.disabled = await importFunction(item.meta.disabled);
+ }
+ }
+ }
pushQueryList();
// if (!querySchema.value) {
// const vm = (await get(indexUrl)).data;
@@ -609,17 +642,16 @@ export default {
// getSortModel(data.value);
// getColumns(vm.schema.properties.query);
// }
- if (!config.value) {
+ if (!config) {
//
}
- getColumns(config.value.table.schema);
- queryModel.value = schemaToModel(config.value.query.schema);
+ getColumns(config.table.schema);
if (props.query) {
Object.assign(queryModel.value.query, props.query);
}
// getSortModel(data.value);
// getColumns(vm.schema.properties.query);
- await load(indexUrl);
+ await load();
});
return {
config,
@@ -664,6 +696,7 @@ export default {
pushQueryList,
fileList,
handleChange,
+ getButtonDisabled,
};
},
};
diff --git a/code/WebApp/vanilla/config/settings.js b/code/WebApp/vanilla/config/settings.js
index c913e2a8..b1ced859 100644
--- a/code/WebApp/vanilla/config/settings.js
+++ b/code/WebApp/vanilla/config/settings.js
@@ -1,4 +1,5 @@
export default {
enableLocale: false,
baseURL: "http://dev.ccwin-in.com:10582/api",
+ //baseURL: "http://localhost:10130/api",
};
diff --git a/code/WebApp/vanilla/models/code-setting.js b/code/WebApp/vanilla/models/code-setting.js
new file mode 100644
index 00000000..561da745
--- /dev/null
+++ b/code/WebApp/vanilla/models/code-setting.js
@@ -0,0 +1,86 @@
+const schema = {
+ title: "通用代码",
+ type: "object",
+ properties: {
+ userName: {
+ title: "项目",
+ type: "string",
+ readOnly: true,
+ showForList: true,
+ rules: [
+ {
+ required: true,
+ },
+ ],
+ },
+ userName: {
+ title: "值",
+ type: "string",
+ readOnly: true,
+ showForList: true,
+ rules: [
+ {
+ required: true,
+ },
+ ],
+ },
+ name: {
+ title: "描述",
+ type: "string",
+ showForList: true,
+ rules: [
+ {
+ required: true,
+ },
+ ],
+ },
+ },
+};
+
+const url = "base/code-settings";
+const createUrl = url;
+const updateUrl = url;
+const deleteUrl = url;
+const method = "GET";
+const createMethod = "POST";
+const updateMethod = "PUT";
+const deleteMethod = "DELETE";
+
+export default function () {
+ return {
+ query: {
+ url,
+ method,
+ schema: {
+ title: "通用代码",
+ type: "object",
+ properties: {
+ filter: {
+ title: "项目",
+ type: "string",
+ },
+ skipCount: {
+ hidden: true,
+ default: 0,
+ },
+ maxResultCount: {
+ hidden: true,
+ default: 10,
+ },
+ },
+ },
+ },
+ table: {
+ schema: schema,
+ },
+ edit: {
+ createUrl,
+ updateUrl,
+ deleteUrl,
+ createMethod,
+ updateMethod,
+ deleteMethod,
+ schema: schema,
+ },
+ };
+}
diff --git a/code/WebApp/vanilla/models/login.js b/code/WebApp/vanilla/models/login.js
index f4cf7243..928f1309 100644
--- a/code/WebApp/vanilla/models/login.js
+++ b/code/WebApp/vanilla/models/login.js
@@ -20,7 +20,7 @@ export default function () {
password: {
title: "密码",
type: "string",
- format: "password",
+ input: "password",
rules: [
{
required: true,
diff --git a/code/WebApp/vanilla/models/role.js b/code/WebApp/vanilla/models/role.js
index c574f7c3..e65832bb 100644
--- a/code/WebApp/vanilla/models/role.js
+++ b/code/WebApp/vanilla/models/role.js
@@ -23,7 +23,7 @@ export default function () {
return {
query: {
url: "identity/roles",
- method: "get",
+ method: "GET",
schema: {
title: "用户",
type: "object",
diff --git a/code/WebApp/vanilla/models/user.js b/code/WebApp/vanilla/models/user.js
index 6eee1306..8c2fcfa9 100644
--- a/code/WebApp/vanilla/models/user.js
+++ b/code/WebApp/vanilla/models/user.js
@@ -5,6 +5,7 @@ const schema = {
userName: {
title: "用户名",
type: "string",
+ readOnly: true,
showForList: true,
rules: [
{
@@ -16,16 +17,11 @@ const schema = {
},
],
},
- phoneNumber: {
- title: "电话",
+ password: {
+ title: "密码",
type: "string",
+ readOnly: true,
input: "password",
- showForList: true,
- rules: [
- {
- required: true,
- },
- ],
},
name: {
title: "姓名",
@@ -37,8 +33,8 @@ const schema = {
},
],
},
- email: {
- title: "邮箱",
+ phoneNumber: {
+ title: "电话",
type: "string",
showForList: true,
rules: [
@@ -47,31 +43,45 @@ const schema = {
},
],
},
- roleNames: {
- title: "角色",
- type: "array",
- input: "select",
- multiple: true,
- },
- password: {
- title: "密码",
+ email: {
+ title: "邮箱",
type: "string",
- input: "password",
+ showForList: true,
rules: [
{
required: true,
- message: "密码不能为空",
},
],
},
+ // roleNames: {
+ // title: "角色",
+ // type: "array",
+ // input: "select",
+ // multiple: true,
+ // url: "identity/roles/all",
+ // value: "name",
+ // label: "name",
+ // items: {
+ // type: "string",
+ // },
+ // },
},
};
+const url = "base/user";
+const createUrl = url;
+const updateUrl = url;
+const deleteUrl = "api/identity/users";
+const method = "GET";
+const createMethod = "POST";
+const updateMethod = "PUT";
+const deleteMethod = "DELETE";
+
export default function () {
return {
query: {
- url: "base/user",
- method: "get",
+ url,
+ method,
schema: {
title: "用户",
type: "object",
@@ -93,6 +103,16 @@ export default function () {
},
table: {
schema: schema,
+ selectable: (o) => o.name !== "admin",
+ },
+ edit: {
+ createUrl,
+ updateUrl,
+ deleteUrl,
+ createMethod,
+ updateMethod,
+ deleteMethod,
+ schema: schema,
},
};
}
diff --git a/code/WebApp/vanilla/request/index.js b/code/WebApp/vanilla/request/index.js
index 9f22fc74..dc9e51e3 100644
--- a/code/WebApp/vanilla/request/index.js
+++ b/code/WebApp/vanilla/request/index.js
@@ -17,7 +17,7 @@ const addToken = async (options) => {
};
const getUrl = (url) => {
- if (url.indexOf("/") === 0) {
+ if (url.startsWith("http")) {
return url;
}
let result = settings.baseURL;
@@ -111,13 +111,27 @@ async function request(url, data, options, withoutToken = false) {
url = getUrl(url);
let defaultOptions = {
method: "POST",
- headers: { "Accept-Language": "zh-Hans" },
+ headers: {
+ "Accept-Language": "zh-Hans",
+ },
};
if (options) {
Object.assign(defaultOptions, options);
}
- if (defaultOptions.method !== "GET" && !(data instanceof FormData)) {
- defaultOptions.headers["Content-Type"] = "application/json";
+ if (defaultOptions.method === "GET" && data) {
+ url = `${url}?${qs.stringify(data)}`;
+ } else {
+ if (defaultOptions.headers["Content-Type"]?.startsWith("application/x-www-form-urlencoded")) {
+ defaultOptions.body = qs.stringify(data);
+ } else if (defaultOptions.headers["Content-Type"]?.startsWith("application/json")) {
+ defaultOptions.body = JSON.stringify(data);
+ } else if (data instanceof FormData) {
+ delete defaultOptions.headers["Content-Type"];
+ defaultOptions.body = data;
+ } else if (data) {
+ defaultOptions.headers["Content-Type"] = "application/json";
+ defaultOptions.body = JSON.stringify(data);
+ }
}
if (!withoutToken) {
await addToken(defaultOptions);
diff --git a/code/WebApp/vanilla/router/index.js b/code/WebApp/vanilla/router/index.js
index 8d1fcca7..61294c3d 100644
--- a/code/WebApp/vanilla/router/index.js
+++ b/code/WebApp/vanilla/router/index.js
@@ -49,11 +49,14 @@ router.beforeEach(async (to, from, next) => {
if (!(await isLogin())) {
next({ path: "/login", query: { redirect: to.fullPath } });
} else {
- if (!to.meta.public && to.meta.hasPermission === false) {
- next({ path: "/403", query: { redirect: to.fullPath } });
- } else {
- next();
- }
+ // 注释以下代码暂停权限验证
+ // if (!to.meta.public && to.meta.hasPermission === false) {
+ // next({ path: "/403", query: { redirect: to.fullPath } });
+ // } else {
+ // next();
+ // }
+ // 添加一下代码暂停权限验证
+ next();
}
} else {
next();
diff --git a/code/WebApp/vanilla/router/routes.js b/code/WebApp/vanilla/router/routes.js
index 040b068e..1dafad91 100644
--- a/code/WebApp/vanilla/router/routes.js
+++ b/code/WebApp/vanilla/router/routes.js
@@ -52,50 +52,71 @@ export default [
title: "删除",
icon: "file",
permission: "AbpIdentity.Users.Delete",
- },
- },
- ],
- },
- {
- path: "role",
- meta: {
- type: "page",
- title: "角色管理",
- icon: "file",
- permission: "AbpIdentity.Users",
- },
- children: [
- {
- path: "create",
- meta: {
- type: "button",
- title: "新建",
- icon: "file",
- permission: "AbpIdentity.Users.Create",
isTop: true,
},
},
{
- path: "update",
+ path: "%s/reset-password",
meta: {
type: "button",
- title: "编辑",
- icon: "file",
- htmlClass: "el-button--primary",
- permission: "AbpIdentity.Users.Update",
- },
- },
- {
- path: "delete",
- meta: {
- type: "button",
- title: "删除",
+ title: "重置密码",
icon: "file",
- permission: "AbpIdentity.Users.Delete",
+ permission: "reset-password?",
+ method: "PUT",
},
},
],
},
+ // {
+ // path: "role",
+ // meta: {
+ // type: "page",
+ // title: "角色管理",
+ // icon: "file",
+ // permission: "AbpIdentity.Users",
+ // },
+ // children: [
+ // {
+ // path: "create",
+ // meta: {
+ // type: "button",
+ // title: "新建",
+ // icon: "file",
+ // permission: "AbpIdentity.Users.Create",
+ // isTop: true,
+ // },
+ // },
+ // {
+ // path: "update",
+ // meta: {
+ // type: "button",
+ // title: "编辑",
+ // icon: "file",
+ // htmlClass: "el-button--primary",
+ // permission: "AbpIdentity.Users.Update",
+ // disabled: `(o) => o.isStatic`,
+ // },
+ // },
+ // {
+ // path: "delete",
+ // meta: {
+ // type: "button",
+ // title: "删除",
+ // icon: "file",
+ // permission: "AbpIdentity.Users.Delete",
+ // disabled: `(o) => o.isStatic`,
+ // },
+ // },
+ // ],
+ // },
+ {
+ path: "code-setting",
+ meta: {
+ type: "page",
+ title: "通用代码",
+ icon: "file",
+ },
+ },
],
},
];
diff --git a/code/WebApp/vanilla/utils/index.js b/code/WebApp/vanilla/utils/index.js
index 17c53dba..2c8dcb77 100644
--- a/code/WebApp/vanilla/utils/index.js
+++ b/code/WebApp/vanilla/utils/index.js
@@ -120,5 +120,28 @@ function getFileName(contentDisposition) {
return decodeURIComponent(/filename\*=UTF-8''([\w%\-\.]+)(?:; ?|$)/i.exec(contentDisposition)[1]);
}
+async function importModule(input) {
+ const dataUri = `data:text/javascript;charset=utf-8,${encodeURIComponent(input)}`;
+ const result = await import(dataUri /* @vite-ignore */);
+ return result.default;
+}
+
+// await importFunction('()=>console.log(123)');
+async function importFunction(input) {
+ const src = input ?? `()=>{}`;
+ const result = await importModule(`export default ${src}`);
+ return result;
+}
+
export default html;
-export { persentFormat, bytesFormat, format, schemaToModel, listToTree, treeToList, getProp, getFileName };
+export {
+ persentFormat,
+ bytesFormat,
+ format,
+ schemaToModel,
+ listToTree,
+ treeToList,
+ getProp,
+ getFileName,
+ importFunction,
+};
diff --git a/code/WebApp/vanilla/utils/validation.js b/code/WebApp/vanilla/utils/validation.js
new file mode 100644
index 00000000..5155c275
--- /dev/null
+++ b/code/WebApp/vanilla/utils/validation.js
@@ -0,0 +1,113 @@
+const messages = {
+ default: "%s验证失败",
+ required: "%s是必填项",
+ enum: "%s必须是%s之一",
+ whitespace: "%s不能为空",
+ // date: {
+ // format: '%s date %s is invalid for format %s',
+ // parse: '%s date could not be parsed, %s is invalid ',
+ // invalid: '%s date %s is invalid',
+ // },
+ types: {
+ string: "%s不是有效的字符串",
+ method: "%s不是有效的函数",
+ array: "%s不是有效的数组",
+ object: "%s不是有效的对象",
+ number: "%s不是有效的数字",
+ date: "%s不是有效的日期",
+ boolean: "%s不是有效的布尔值",
+ integer: "%s不是有效的整数",
+ float: "%s不是有效的浮点数",
+ regexp: "%s不是有效的正则表达式",
+ email: "%s不是有效的邮箱",
+ url: "%s不是有效的 url",
+ hex: "%s不是有效的十六进制",
+ },
+ string: {
+ len: "%s长度必须是%s",
+ min: "%s最小长度为%s",
+ max: "%s最大长度为%s",
+ range: "%s长度必须在%s和%s之间",
+ },
+ number: {
+ len: "%s必须等于%s",
+ min: "%s不小于%s",
+ max: "%s不大于%s",
+ range: "%s必须在%s和%s之间",
+ },
+ array: {
+ len: "%s的数量必须是%s",
+ min: "%s的数量不小于%s",
+ max: "%s的数量不大于%s",
+ range: "%s的数量必须在%s和%s之间",
+ },
+ pattern: {
+ mismatch: "%s的值 %s 不匹配模式 %s",
+ },
+ clone: function clone() {
+ const cloned = JSON.parse(JSON.stringify(this));
+ cloned.clone = this.clone;
+ return cloned;
+ },
+ //
+ compare: "%s 和 %s 输入必须一致",
+ true: "%s必须选中",
+ remote: "%s远程验证失败",
+};
+
+const validators = {
+ compare(rule, value, callback, source, options) {
+ const errors = [];
+ if (value && value !== rule.data[rule.compare]) {
+ const message = format(options.messages.compare, rule.title, rule.schema.properties[rule.compare].title);
+ errors.push(new Error(message));
+ }
+ callback(errors);
+ },
+ true(rule, value, callback, source, options) {
+ const errors = [];
+ if (!value) {
+ const message = format(options.messages.true, rule.title);
+ errors.push(new Error(message));
+ }
+ callback(errors);
+ },
+ remote(rule, value, callback, source, options) {
+ const errors = [];
+ const message = format(options.messages.remote, rule.title);
+ if (!value) {
+ callback(errors);
+ } else {
+ const config = {
+ url: rule.url,
+ method: rule.method ?? "GET",
+ };
+ const data = { [rule.field]: value };
+ if (config.method === "GET") {
+ config.params = data;
+ } else {
+ config.data = data;
+ }
+ request
+ .request(config)
+ .then((response) => {
+ if (response.status === 200) {
+ if (response.data.code) {
+ if (response.data.code !== 200) {
+ errors.push(new Error(1 + response.data.message));
+ }
+ }
+ } else {
+ errors.push(new Error(2 + response.data));
+ }
+ callback(errors);
+ })
+ .catch((o) => {
+ errors.push(o.response?.data?.message ?? message ?? o.message);
+ callback(errors);
+ });
+ }
+ },
+};
+
+export { messages };
diff --git a/code/WebApp/vanilla/views/base-data/code-setting.js b/code/WebApp/vanilla/views/base-data/code-setting.js
new file mode 100644
index 00000000..bab632ca
--- /dev/null
+++ b/code/WebApp/vanilla/views/base-data/code-setting.js
@@ -0,0 +1,28 @@
+import AppList from "../../components/list/index.js";
+import html from "html";
+import useConfig from "../../models/code-setting.js";
+import request from "../../request/index.js";
+import { format } from "../../utils/index.js";
+import { ElMessage } from "element-plus";
+
+export default {
+ components: { AppList },
+ template: html``,
+ setup() {
+ // 变量定义
+ const config = useConfig();
+ // 函数定义
+ const onCommand = async (item, rows) => {
+ console.log(item.path, item, rows);
+ if (item.path === "%s/reset-password") {
+ const url = format(item.path, rows[0].id);
+ await request(`base/user/${url}`, null, { method: item.meta.method });
+ ElMessage({
+ type: "info",
+ message: format("用户%s的密码已经成功重置为123456", rows[0].userName),
+ });
+ }
+ };
+ return { config, onCommand };
+ },
+};
diff --git a/code/WebApp/vanilla/views/base-data/user.js b/code/WebApp/vanilla/views/base-data/user.js
index 414d4630..e6df244e 100644
--- a/code/WebApp/vanilla/views/base-data/user.js
+++ b/code/WebApp/vanilla/views/base-data/user.js
@@ -1,6 +1,9 @@
import AppList from "../../components/list/index.js";
import html from "html";
import useConfig from "../../models/user.js";
+import request from "../../request/index.js";
+import { format } from "../../utils/index.js";
+import { ElMessage } from "element-plus";
export default {
components: { AppList },
@@ -9,8 +12,16 @@ export default {
// 变量定义
const config = useConfig();
// 函数定义
- const onCommand = (item, rows) => {
+ const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
+ if (item.path === "%s/reset-password") {
+ const url = format(item.path, rows[0].id);
+ await request(`base/user/${url}`, null, { method: item.meta.method });
+ ElMessage({
+ type: "info",
+ message: format("用户%s的密码已经成功重置为123456", rows[0].userName),
+ });
+ }
};
return { config, onCommand };
},
diff --git a/code/WebApp/vanilla/views/login.js b/code/WebApp/vanilla/views/login.js
index fbd59cd1..0f1c2a05 100644
--- a/code/WebApp/vanilla/views/login.js
+++ b/code/WebApp/vanilla/views/login.js
@@ -3,7 +3,7 @@ import { ref, reactive } from "vue";
import AppForm from "../components/form/index.js";
import { login, setRefreshToken, getUser, setAccessToken } from "../api/user.js";
import router, { refreshRouter } from "../router/index.js";
-import { post } from "../request/index.js";
+import request, { post } from "../request/index.js";
import LayoutLogo from "../layouts/logo.js";
import LayoutLocale from "../layouts/locale.js";
import LayoutFooter from "../layouts/footer.js";
@@ -26,27 +26,24 @@ export default {
`,
- async setup() {
+ setup() {
const schema = reactive(useLoginModel());
const model = reactive(schemaToModel(schema));
const submit = async (callback, loading) => {
try {
- const url = "connect-token";
+ const url = "base/token";
const appStore = useAppStore();
- const result = await post(
- url,
- model,
- { headers: { "Content-Type": "application/x-www-form-urlencoded" } },
- true
- );
+ const result = await request(url, model, { method: "POST" }, true);
if (!result.errors) {
- appStore.token = result.data.access_token;
- setAccessToken(appStore.token);
- //setRefreshToken(result.data.refresh_token);
- appStore.user = await getUser();
- await refreshRouter();
- const redirect = router.currentRoute.value.query?.redirect ?? "/";
- router.push(redirect);
+ appStore.token = result.data.accessToken;
+ if (appStore.token) {
+ setAccessToken(appStore.token);
+ //setRefreshToken(result.data.refresh_token);
+ appStore.user = await getUser();
+ await refreshRouter();
+ const redirect = router.currentRoute.value.query?.redirect ?? "/";
+ router.push(redirect);
+ }
}
callback(result.errors);
} catch (error) {
diff --git a/code/src/AuthServer/AuthServer.Host/appsettings.json b/code/src/AuthServer/AuthServer.Host/appsettings.json
index 1a4089cd..ca902997 100644
--- a/code/src/AuthServer/AuthServer.Host/appsettings.json
+++ b/code/src/AuthServer/AuthServer.Host/appsettings.json
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
- "Default": "Server=dev.ccwin-in.com,13319;Database=BJABP;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True"
+ "Default": "Server=localhost;Database=BJABP;User ID=sa;Password=aA123456!;Trusted_Connection=False;TrustServerCertificate=True"
},
"CorsOrigins": "http://localhost:9527,http://dev.ccwin-in.com:10588,http://localhost:44307",
"ElasticSearch": {
diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/UserManagement/IUserAppService.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/UserManagement/IUserAppService.cs
index d1efe788..83a58daa 100644
--- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/UserManagement/IUserAppService.cs
+++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/UserManagement/IUserAppService.cs
@@ -1,9 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading.Tasks;
-using BaseService.BaseData.Permissions.Dto;
+using BaseService.BaseData.Permissions.Dto;
using BaseService.RelationData.Dto;
+using System;
+using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Identity;
@@ -17,7 +15,7 @@ namespace BaseService.Systems.UserManagement
///
///
///
- Task GetAsync(Guid id);
+ Task GetAsync(Guid id);
///
/// 获取当前登录用户信息
@@ -61,7 +59,6 @@ namespace BaseService.Systems.UserManagement
///
Task GetAuthConfigAsync(Guid branchId);
-
///
/// 重置当前登录用户的密码
///
@@ -70,6 +67,5 @@ namespace BaseService.Systems.UserManagement
///
//Task ResetPasswordCurrentUser(Guid id, IdentityUserCreateDto input);
Task ResetPasswordAsync(Guid id);
-
}
-}
+}
\ No newline at end of file
diff --git a/code/src/Modules/BaseService/BaseService.Application/BaseService.Application.csproj b/code/src/Modules/BaseService/BaseService.Application/BaseService.Application.csproj
index 7bf3e650..081c9073 100644
--- a/code/src/Modules/BaseService/BaseService.Application/BaseService.Application.csproj
+++ b/code/src/Modules/BaseService/BaseService.Application/BaseService.Application.csproj
@@ -7,7 +7,9 @@
+
+
diff --git a/code/src/Modules/BaseService/BaseService.Application/UserManagement/TokenAppService.cs b/code/src/Modules/BaseService/BaseService.Application/UserManagement/TokenAppService.cs
new file mode 100644
index 00000000..18a3c671
--- /dev/null
+++ b/code/src/Modules/BaseService/BaseService.Application/UserManagement/TokenAppService.cs
@@ -0,0 +1,55 @@
+using IdentityModel.Client;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using System.ComponentModel.DataAnnotations;
+using System.Net.Http;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Services;
+
+namespace BaseService.UserManagement
+{
+ [Route("api/base/token")]
+ public class UserAppService : ApplicationService
+ {
+ private readonly IHttpClientFactory _httpClientFactory;
+ private readonly IConfiguration _configuration;
+
+ public UserAppService(IHttpClientFactory httpClientFactory, IConfiguration configuration)
+ {
+ this._httpClientFactory = httpClientFactory;
+ this._configuration = configuration;
+ }
+
+ [HttpPost, AllowAnonymous, IgnoreAntiforgeryToken]
+ public async Task CreateAsync(LoginModel model)
+ {
+ var address = _configuration["AuthServer:Authority"];
+ var clientId = _configuration["AuthServer:ClientId"];
+ var clientSecret = _configuration["AuthServer:ClientSecret"];
+
+ var result = await _httpClientFactory.CreateClient().RequestPasswordTokenAsync(new PasswordTokenRequest
+ {
+ Address = $"{address.TrimEnd('/')}/connect/token",
+ GrantType = "password",
+ ClientId = clientId,
+ ClientSecret = clientSecret,
+ UserName = model.UserName,
+ Password = model.Password
+ }).ConfigureAwait(false);
+
+ return result;
+ }
+
+ public class LoginModel
+ {
+ [Display]
+ [Required]
+ public string UserName { get; set; }
+
+ [Display]
+ [Required]
+ public string Password { get; set; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs
index b70e6b1c..609fc6ad 100644
--- a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs
+++ b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs
@@ -1,16 +1,15 @@
using BaseService.BaseData;
-using BaseService.Permissions;
+using BaseService.BaseData.Permissions.Dto;
using BaseService.RelationBaseData;
+using BaseService.RelationData.Dto;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.EntityFrameworkCore;
+using Omu.ValueInjecter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using BaseService.BaseData.Permissions.Dto;
-using BaseService.RelationData.Dto;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
@@ -38,6 +37,7 @@ namespace BaseService.Systems.UserManagement
//权限提供者类
private readonly IAbpAuthorizationPolicyProvider _abpAuthorizationPolicyProvider;
+
private readonly IAuthorizationService _authorizationService;
protected ICurrentUser CurrentUsers { get; }
@@ -71,9 +71,11 @@ namespace BaseService.Systems.UserManagement
[HttpGet]
[Route("{id}")]
- public async Task GetAsync(Guid id)
+ public async Task GetAsync(Guid id)
{
- var dto = ObjectMapper.Map(await UserManager.GetByIdAsync(id));
+ var user = await UserManager.GetByIdAsync(id);
+ var dto = Mapper.Map(user);
+ dto.RoleNames = (await UserRepository.GetRoleNamesAsync(id)).ToArray();
return dto;
}
@@ -196,7 +198,7 @@ namespace BaseService.Systems.UserManagement
//获取用户的所有分支
var branchRoles = await GetUserBranchRolesAsync(CurrentUsers.GetId());
var groupBranchRoles = branchRoles.GroupBy(x => x.BranchId)
- .Select(y => new {xx = new {BranchId = y.Key}, items = y});
+ .Select(y => new { xx = new { BranchId = y.Key }, items = y });
foreach (var group in groupBranchRoles
)
{
@@ -225,7 +227,7 @@ namespace BaseService.Systems.UserManagement
//获取用户的所有分支
var branchRoles = await GetUserBranchRolesAsync(userId);
var groupBranchRoles = branchRoles.GroupBy(x => x.BranchId)
- .Select(y => new {xx = new {BranchId = y.Key}, items = y});
+ .Select(y => new { xx = new { BranchId = y.Key }, items = y });
foreach (var group in groupBranchRoles)
{
var mybranchrole = new BranchRoleDto
@@ -241,8 +243,6 @@ namespace BaseService.Systems.UserManagement
return new ListResultDto(branchList);
}
-
-
///
/// 根据用户ID,获取当前登录用户的所有权限信息,带角色名称
///
@@ -373,7 +373,6 @@ namespace BaseService.Systems.UserManagement
return authConfig;
}
-
///
/// 重置密码功能
///
diff --git a/code/src/Modules/BaseService/BaseService.Host/.config/dotnet-tools.json b/code/src/Modules/BaseService/BaseService.Host/.config/dotnet-tools.json
new file mode 100644
index 00000000..812c6cdb
--- /dev/null
+++ b/code/src/Modules/BaseService/BaseService.Host/.config/dotnet-tools.json
@@ -0,0 +1,12 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "dotnet-ef": {
+ "version": "7.0.8",
+ "commands": [
+ "dotnet-ef"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/code/src/Modules/BaseService/BaseService.Host/BaseServiceHostModule.cs b/code/src/Modules/BaseService/BaseService.Host/BaseServiceHostModule.cs
index a35e0903..40e83e97 100644
--- a/code/src/Modules/BaseService/BaseService.Host/BaseServiceHostModule.cs
+++ b/code/src/Modules/BaseService/BaseService.Host/BaseServiceHostModule.cs
@@ -1,39 +1,40 @@
-using System.Linq;
+using BaseService.EntityFrameworkCore;
+using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.DataProtection;
+using Microsoft.AspNetCore.Identity;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using StackExchange.Redis;
using Microsoft.OpenApi.Models;
+using StackExchange.Redis;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Claims;
using Volo.Abp;
+using Volo.Abp.AspNetCore.MultiTenancy;
+using Volo.Abp.AspNetCore.Mvc;
+using Volo.Abp.AspNetCore.Mvc.AntiForgery;
+using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Auditing;
using Volo.Abp.Autofac;
+using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
-using Volo.Abp.AspNetCore.MultiTenancy;
-using System;
-using Volo.Abp.TenantManagement;
-using Volo.Abp.Threading;
-using Volo.Abp.Data;
-using Volo.Abp.AspNetCore.Serilog;
-using Volo.Abp.PermissionManagement.HttpApi;
-using Microsoft.AspNetCore.Cors;
using Volo.Abp.MultiTenancy;
-using BaseService.EntityFrameworkCore;
-using System.Collections.Generic;
-using Microsoft.AspNetCore.Authentication.JwtBearer;
+using Volo.Abp.PermissionManagement.HttpApi;
using Volo.Abp.Security.Claims;
-using System.Security.Claims;
-using Volo.Abp.AspNetCore.Mvc;
-using Microsoft.Extensions.Configuration;
-using Microsoft.AspNetCore.Identity;
+using Volo.Abp.TenantManagement;
+using Volo.Abp.Threading;
+
//using Win.Sfs.SettleAccount;
//using Win.Sfs.BaseData;
//using BaseData;
-
namespace BaseService
{
[DependsOn(
@@ -45,8 +46,8 @@ namespace BaseService
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpTenantManagementHttpApiModule),
typeof(AbpIdentityHttpApiModule),
- // typeof(BaseDataHttpApiModule),
- //typeof(BaseDataApplicationContractsModule),
+ // typeof(BaseDataHttpApiModule),
+ //typeof(BaseDataApplicationContractsModule),
//typeof(SettleAccountHttpApiModule),
typeof(AbpAspNetCoreSerilogModule)
)]
@@ -56,12 +57,15 @@ namespace BaseService
public override void ConfigureServices(ServiceConfigurationContext context)
{
+ context.Services.AddHttpClient();
+ Configure(O => O.AutoValidate = false);
+
var configuration = context.Services.GetConfiguration();
ConfigureConventionalControllers();
-
+
ConfigureMultiTenancy();
-
+
ConfigureJwt(context, configuration);
ConfigureSwagger(context);
@@ -73,7 +77,7 @@ namespace BaseService
ConfigureAuditing();
ConfigureCros(context, configuration);
-
+
ConfigureLocalization();
ConfigurePasswordSet(context);
@@ -87,6 +91,7 @@ namespace BaseService
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文"));
});
}
+
///
/// 设置密码强度
///
@@ -148,7 +153,6 @@ namespace BaseService
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
-
}
private void ConfigureDbContext()
@@ -160,15 +164,15 @@ namespace BaseService
{
context.Services.AddSwaggerGen(options =>
{
- options.SwaggerDoc("v1", new OpenApiInfo {Title = "BaseService Service API", Version = "v1"});
+ options.SwaggerDoc("v1", new OpenApiInfo { Title = "BaseService Service API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName);
options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
{
- Description = "请输入JWT令牌,例如:Bearer 12345abcdef",
+ Description = "请输入 JWT Token",
Name = "Authorization",
In = ParameterLocation.Header,
- Type = SecuritySchemeType.ApiKey,
+ Type = SecuritySchemeType.Http,
Scheme = "Bearer"
});
@@ -177,16 +181,9 @@ namespace BaseService
{
new OpenApiSecurityScheme
{
- Reference = new OpenApiReference
- {
- Type = ReferenceType.SecurityScheme,
- Id = "Bearer"
- },
- Scheme = "oauth2",
- Name = "Bearer",
- In = ParameterLocation.Header,
+ Reference = new OpenApiReference {Type = ReferenceType.SecurityScheme, Id = "Bearer"}
},
- new List()
+ new string[] { }
}
});
});
@@ -224,6 +221,7 @@ namespace BaseService
;
});
}
+
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
@@ -273,4 +271,4 @@ namespace BaseService
});
}
}
-}
+}
\ No newline at end of file
diff --git a/code/src/Modules/BaseService/BaseService.Host/appsettings.json b/code/src/Modules/BaseService/BaseService.Host/appsettings.json
index 8050d6cc..5901cf11 100644
--- a/code/src/Modules/BaseService/BaseService.Host/appsettings.json
+++ b/code/src/Modules/BaseService/BaseService.Host/appsettings.json
@@ -1,11 +1,15 @@
{
"AuthServer": {
- "Authority": "http://dev.ccwin-in.com:10580"
+ "Authority": "http://dev.ccwin-in.com:10580",
+ //"Authority": "http://localhost:10130",
+ "ClientId": "basic-web",
+ "ClientSecret": "1q2w3e*"
},
"App": {
"CorsOrigins": "http://localhost:9527,http://dev.ccwin-in.com:10588,http://localhost:44307"
},
"ConnectionStrings": {
+ //"Default": "Server=localhost;Database=BJABP;User ID=sa;Password=aA123456!;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"
},
"ElasticSearch": {
@@ -19,22 +23,7 @@
"Default": "Warning"
}
},
-<<<<<<< HEAD
- //"Settings": {
- // "Abp.Localization.DefaultLanguage": "zh-Hans",
- // "Abp.Identity.Password.RequireNonAlphanumeric": "false", //ȥ�����ĸ����
- // "Abp.Identity.Password.RequireUppercase": "false", //ȥ���д����
- // "Abp.Identity.Password.RequireLowercase": "false", //ȥ��Сд
- // "Abp.Identity.Password.RequiredLength": "1",
- // "Abp.Identity.SignIn.RequireConfirmedEmail": "true",
- // //�����û�����
- // "Abp.Identity.Lockout.AllowedForNewUsers": "true",
- // "Abp.Identity.Lockout.MaxFailedAccessAttempts": "3"
- //},
- "AllowedHosts": "*"
-=======
"AllowedHosts": "*",
"RePassword": "111111"
->>>>>>> 1c2946500765850db29fa7d216f5e55e2e4de888
}
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Properties/launchSettings.json b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Properties/launchSettings.json
index 8341e6cc..13d6e5ef 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Properties/launchSettings.json
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Properties/launchSettings.json
@@ -6,7 +6,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
- "applicationUrl": "http://localhost:44379"
+ "applicationUrl": "http://localhost:44378"
},
"Docker": {
"commandName": "Docker",
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs
index 0f499a4a..2bb82598 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs
@@ -358,7 +358,7 @@ namespace Win.Sfs.SettleAccount
var xmlapppath = Path.Combine(AppContext.BaseDirectory, "SettleAccount.Application.xml");
if (File.Exists(xmlapppath))
{
- options.IncludeXmlComments(xmlapppath);
+ options.IncludeXmlComments(xmlapppath, true);
}
xmlapppath = Path.Combine(AppContext.BaseDirectory, "SettleAccount.Application.Contracts.xml");
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs
new file mode 100644
index 00000000..bb1f79c7
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs
@@ -0,0 +1,155 @@
+using Magicodes.ExporterAndImporter.Core;
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
+{
+ ///
+ /// BBAC发运
+ ///
+ public class BBAC_SE_DETAIL_DTO
+ {
+ ///
+ /// 期间
+ ///
+ [Display(Name = "期间")]
+ public int Version { set; get; }
+
+ ///
+ /// 发货时间
+ ///
+ [Display(Name = "发货时间")]
+ public DateTime ShippingDate { set; get; }
+
+ ///
+ /// 发运单号
+ ///
+ [Display(Name = "发运单号")]
+ public string WmsBillNum { set; get; }
+
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ public string LU { get; set; }
+
+ ///
+ /// 生产号
+ ///
+ [Display(Name = "生产号")]
+ public string PN { get; set; }
+
+ ///
+ /// 组合键值(LU+PN)
+ ///
+ [Display(Name = "组合键值(LU+PN)")]
+ public string KeyCode { get; set; }
+
+ ///
+ /// 数量
+ ///
+ [Display(Name = "数量")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 日顺序号
+ ///
+ [Display(Name = "日顺序号")]
+ public string SeqNumber { get; set; }
+
+ ///
+ /// 小总成号
+ ///
+ [Display(Name = "小总成号")]
+ public string AssemblyCode { get; set; }
+
+ ///
+ /// 注塑码
+ ///
+ [Display(Name = "注塑码")]
+ public string InjectionCode { get; set; }
+
+ ///
+ /// 订单时间
+ ///
+ [Display(Name = "订单时间")]
+ public DateTime BeginDate { get; set; }
+ }
+
+ ///
+ /// 导出
+ ///
+ public class BBAC_SE_DETAIL_EXPORT_DTO
+ {
+ ///
+ /// 期间
+ ///
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public int Version { set; get; }
+
+ ///
+ /// 发货时间
+ ///
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public DateTime ShippingDate { set; get; }
+
+ ///
+ /// 发运单号
+ ///
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public string WmsBillNum { set; get; }
+
+ ///
+ /// 零件号
+ ///
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public string LU { get; set; }
+
+ ///
+ /// 生产号
+ ///
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public string PN { get; set; }
+
+ ///
+ /// 组合键值(LU+PN)
+ ///
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public string KeyCode { get; set; }
+
+ ///
+ /// 数量
+ ///
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 日顺序号
+ ///
+ [Display(Name = "日顺序号")]
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public string SeqNumber { get; set; }
+
+ ///
+ /// 小总成号
+ ///
+ [Display(Name = "小总成号")]
+ [ExporterHeader(DisplayName = "小总成号")]
+ public string AssemblyCode { get; set; }
+
+ ///
+ /// 注塑码
+ ///
+ [Display(Name = "注塑码")]
+ [ExporterHeader(DisplayName = "注塑码")]
+ public string InjectionCode { get; set; }
+
+ ///
+ /// 订单时间
+ ///
+ [Display(Name = "订单时间")]
+ [ExporterHeader(DisplayName = "订单时间")]
+ public DateTime BeginDate { get; set; }
+ }
+
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs
new file mode 100644
index 00000000..596807e6
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs
@@ -0,0 +1,136 @@
+using Magicodes.ExporterAndImporter.Core;
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
+{
+ ///
+ /// BBAC的EDI数据
+ ///
+ public class BBAC_SE_EDI_DTO
+ {
+ ///
+ /// LU+生产码
+ ///
+ [Display(Name = "LU+生产码")]
+ public string KeyCode { get; set; } = null!;
+
+ ///
+ /// 期间
+ ///
+ [Display(Name = "期间")]
+ public int Version { get; set; }
+
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ public string LU { get; set; } = null!;
+
+ ///
+ /// 生产码
+ ///
+ [Display(Name = "生产码")]
+ public string PN { get; set; } = null!;
+
+ ///
+ /// 日顺序号
+ ///
+ [Display(Name = "日顺序号")]
+ public string SeqNumber { get; set; } = null!;
+
+ ///
+ /// 小总成号
+ ///
+ [Display(Name = "小总成号")]
+ public string AssemblyCode { get; set; } = null!;
+
+ ///
+ /// 注塑码
+ ///
+ [Display(Name = "注塑码")]
+ public string InjectionCode { get; set; } = null!;
+
+ ///
+ /// EDI数量
+ ///
+ [Display(Name = "EDI数量")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 订货时间
+ ///
+ [Display(Name = "订货时间")]
+ public DateTime BeginDate { get; set; }
+ }
+
+ ///
+ /// 导出
+ ///
+ public class BBAC_SE_EDI_EXPORT_DTO
+ {
+ ///
+ /// LU+生产码
+ ///
+ [Display(Name = "LU+生产码")]
+ [ExporterHeader(DisplayName = "LU+生产码")]
+ public string KeyCode { get; set; } = null!;
+
+ ///
+ /// 期间
+ ///
+ [Display(Name = "期间")]
+ [ExporterHeader(DisplayName = "期间")]
+ public int Version { get; set; }
+
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ [ExporterHeader(DisplayName = "零件号")]
+ public string LU { get; set; } = null!;
+
+ ///
+ /// 生产码
+ ///
+ [Display(Name = "生产码")]
+ [ExporterHeader(DisplayName = "生产码")]
+ public string PN { get; set; } = null!;
+
+ ///
+ /// 日顺序号
+ ///
+ [Display(Name = "日顺序号")]
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public string SeqNumber { get; set; } = null!;
+
+ ///
+ /// 小总成号
+ ///
+ [Display(Name = "小总成号")]
+ [ExporterHeader(DisplayName = "小总成号")]
+ public string AssemblyCode { get; set; } = null!;
+
+ ///
+ /// 注塑码
+ ///
+ [Display(Name = "注塑码")]
+ [ExporterHeader(DisplayName = "注塑码")]
+ public string InjectionCode { get; set; } = null!;
+
+ ///
+ /// EDI数量
+ ///
+ [Display(Name = "EDI数量")]
+ [ExporterHeader(DisplayName = "EDI数量")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 订货时间
+ ///
+ [Display(Name = "订货时间")]
+ [ExporterHeader(DisplayName = "订货时间")]
+ public DateTime BeginDate { get; set; }
+ }
+
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs
new file mode 100644
index 00000000..bfd3bea6
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs
@@ -0,0 +1,166 @@
+using Magicodes.ExporterAndImporter.Core;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
+{
+ ///
+ /// HBPO发运单
+ ///
+ public class HBPO_SE_DETAIL_DTO
+ {
+ ///
+ /// 期间
+ ///
+ [Display(Name = "期间")]
+ public int Version { set; get; }
+
+ ///
+ /// 发货时间
+ ///
+ [Display(Name = "发货时间")]
+ public DateTime ShippingDate { set; get; }
+
+ ///
+ /// 发运单号
+ ///
+ [Display(Name = "发运单号")]
+ public string WmsBillNum { set; get; }
+
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ public string LU { get; set; }
+
+ ///
+ /// 生产号
+ ///
+ [Display(Name = "生产号")]
+ public string PN { get; set; }
+
+ ///
+ /// 组合键值(LU+PN)
+ ///
+ [Display(Name = "组合键值(LU+PN)")]
+ public string KeyCode { get; set; }
+
+ ///
+ /// 数量
+ ///
+ [Display(Name = "数量")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 日顺序号
+ ///
+ [Display(Name = "日顺序号")]
+ public string SeqNumber { get; set; }
+
+ ///
+ /// 小总成号
+ ///
+ [Display(Name = "小总成号")]
+ public string AssemblyCode { get; set; }
+
+ ///
+ /// 注塑码
+ ///
+ [Display(Name = "注塑码")]
+ public string InjectionCode { get; set; }
+
+ ///
+ /// 订单时间
+ ///
+ [Display(Name = "订单时间")]
+ public DateTime BeginDate { get; set; }
+ }
+
+ ///
+ /// 导出
+ ///
+ public class HBPO_SE_DETAIL_EXPORT_DTO
+ {
+ ///
+ /// 期间
+ ///
+ [Display(Name = "期间")]
+ [ExporterHeader(DisplayName = "期间")]
+ public int Version { set; get; }
+
+ ///
+ /// 发货时间
+ ///
+ [Display(Name = "发货时间")]
+ [ExporterHeader(DisplayName = "发货时间")]
+ public DateTime ShippingDate { set; get; }
+
+ ///
+ /// 发运单号
+ ///
+ [Display(Name = "发运单号")]
+ [ExporterHeader(DisplayName = "发运单号")]
+ public string WmsBillNum { set; get; }
+
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ [ExporterHeader(DisplayName = "零件号")]
+ public string LU { get; set; }
+
+ ///
+ /// 生产号
+ ///
+ [Display(Name = "生产号")]
+ [ExporterHeader(DisplayName = "生产号")]
+ public string PN { get; set; }
+
+ ///
+ /// 组合键值(LU+PN)
+ ///
+ [Display(Name = "组合键值(LU+PN)")]
+ [ExporterHeader(DisplayName = "组合键值(LU+PN)")]
+ public string KeyCode { get; set; }
+
+ ///
+ /// 数量
+ ///
+ [Display(Name = "数量")]
+ [ExporterHeader(DisplayName = "数量")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 日顺序号
+ ///
+ [Display(Name = "日顺序号")]
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public string SeqNumber { get; set; }
+
+ ///
+ /// 小总成号
+ ///
+ [Display(Name = "小总成号")]
+ [ExporterHeader(DisplayName = "小总成号")]
+ public string AssemblyCode { get; set; }
+
+ ///
+ /// 注塑码
+ ///
+ [Display(Name = "注塑码")]
+ [ExporterHeader(DisplayName = "注塑码")]
+ public string InjectionCode { get; set; }
+
+ ///
+ /// 订单时间
+ ///
+ [Display(Name = "订单时间")]
+ [ExporterHeader(DisplayName = "订单时间")]
+ public DateTime BeginDate { get; set; }
+ }
+
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs
new file mode 100644
index 00000000..e0405c23
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs
@@ -0,0 +1,65 @@
+using Magicodes.ExporterAndImporter.Core;
+using System.ComponentModel.DataAnnotations;
+using Win.Sfs.Shared.DtoBase;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
+{
+ ///
+ /// 采购价格单
+ ///
+ public class PURCHASE_PRICE_DTO
+ {
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ public string LU { get; set; }
+
+ ///
+ /// 价格
+ ///
+ [Display(Name = "价格")]
+ public decimal Price { get; set; }
+ }
+
+ ///
+ /// 导入
+ ///
+ public class PURCHASE_PRICE_IMPORT_DTO
+ {
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ [ImporterHeader(Name = "零件号")]
+ public string LU { get; set; }
+
+ ///
+ /// 价格
+ ///
+ [Display(Name = "价格")]
+ [ImporterHeader(Name = "价格")]
+ public decimal Price { get; set; }
+ }
+
+ ///
+ /// 导出
+ ///
+ public class PURCHASE_PRICE_EXPORT_DTO
+ {
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ [ExporterHeader(DisplayName = "零件号")]
+ public string LU { get; set; }
+
+ ///
+ /// 价格
+ ///
+ [Display(Name = "价格")]
+ [ExporterHeader(DisplayName = "价格")]
+ public decimal Price { get; set; }
+ }
+
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/RequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/RequestDto.cs
new file mode 100644
index 00000000..d01a0557
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/RequestDto.cs
@@ -0,0 +1,8 @@
+using Win.Sfs.Shared.DtoBase;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
+{
+ public class RequestDto : RequestDtoBase
+ {
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs
new file mode 100644
index 00000000..3f14d49f
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs
@@ -0,0 +1,104 @@
+using Magicodes.ExporterAndImporter.Core;
+using System.ComponentModel.DataAnnotations;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
+{
+ ///
+ /// 客户替换件关系
+ ///
+ public class TB_RePartsRelationship_DTO
+ {
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ public string LU { set; get; }
+
+ ///
+ /// 替换零件号
+ ///
+ [Display(Name = "替换零件号")]
+ public string RepLU { set; get; }
+
+ ///
+ /// 客户编码
+ ///
+ [Display(Name = "客户编码")]
+ public string ClientCode { set; get; }
+
+ ///
+ /// 业务类型
+ ///
+ [Display(Name = "业务类型")]
+ public string BusinessType { set; get; }
+ }
+
+ ///
+ /// 导入
+ ///
+ public class TB_RePartsRelationship_IMPORT_DTO
+ {
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ [ImporterHeader(Name = "零件号")]
+ public string LU { set; get; }
+
+ ///
+ /// 替换零件号
+ ///
+ [Display(Name = "替换零件号")]
+ [ImporterHeader(Name = "替换零件号")]
+ public string RepLU { set; get; }
+
+ ///
+ /// 客户编码
+ ///
+ [Display(Name = "客户编码")]
+ [ImporterHeader(Name = "客户编码")]
+ public string ClientCode { set; get; }
+
+ ///
+ /// 业务类型
+ ///
+ [Display(Name = "业务类型")]
+ [ImporterHeader(Name = "业务类型")]
+ public string BusinessType { set; get; }
+ }
+
+ ///
+ /// 导出
+ ///
+ public class TB_RePartsRelationship_EXPORT_DTO
+ {
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ [ExporterHeader(DisplayName = "零件号")]
+ public string LU { set; get; }
+
+ ///
+ /// 替换零件号
+ ///
+ [Display(Name = "替换零件号")]
+ [ExporterHeader(DisplayName = "替换零件号")]
+ public string RepLU { set; get; }
+
+ ///
+ /// 客户编码
+ ///
+ [Display(Name = "客户编码")]
+ [ExporterHeader(DisplayName = "客户编码")]
+ public string ClientCode { set; get; }
+
+ ///
+ /// 业务类型
+ ///
+ [Display(Name = "业务类型")]
+ [ExporterHeader(DisplayName = "业务类型")]
+ public string BusinessType { set; get; }
+ }
+
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Controls/CentralizedControlDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Controls/CentralizedControlDtoBase.cs
index 2cb1abf7..ec330e85 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Controls/CentralizedControlDtoBase.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Controls/CentralizedControlDtoBase.cs
@@ -1,4 +1,5 @@
+using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -96,6 +97,35 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
}
+ ///
+ /// 导出Dto
+ ///
+ public class CentralizedControlExportDto
+ {
+ ///
+ /// 年度
+ ///
+ [ExporterHeader(DisplayName = "年度")]
+ public string Year { get; protected set; }
+
+ ///
+ /// 期间
+ ///
+ [ExporterHeader(DisplayName = "期间")]
+ public string Period { set; get; }
+
+ ///
+ /// 版本
+ ///
+ [ExporterHeader(DisplayName = "版本")]
+ public string Version { set; get; }
+
+ ///
+ /// 是否开放状态
+ ///
+ [ExporterHeader(DisplayName = "是否开放状态")]
+ public int State { set; get; }
+ }
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/IMaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/IMaterialRelationshipAppService.cs
index 4eb83bf6..1e08ca1c 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/IMaterialRelationshipAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/IMaterialRelationshipAppService.cs
@@ -1,22 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Volo.Abp.Application.Services;
-using Win.Sfs.SettleAccount.MaterialRelationships;
-using Win.Sfs.Shared.ApplicationBase;
-
-namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
+namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
{
- public interface IMaterialRelationshipAppService : ICrudAppService,
- IBranchBaseDataAppService
-
+ public interface IMaterialRelationshipAppService
{
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs
index d9ea22d1..51f1625b 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs
@@ -109,146 +109,67 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships
}
- ///
- /// FIS
- ///
- public class MaterialRelationshipRequestDto : RequestDtoBase, IBranch
- {
- ///
- /// ERP物料号
- ///
-
- public virtual string ErpMaterialCode { get; set; }
- ///
- /// 物料描述
- ///
- public virtual string MaterialDesc { get; set; }
- ///
- /// 物料属性
- ///
- public virtual string MaterialProperty { get; set; }
-
- ///
- /// 结算物料号
- ///
- public virtual string SettleMaterialCode { get; set; }
-
-
- ///
- /// 发货看板物料号
- ///
- public virtual string ShipMaterailCode { get; set; }
-
- public virtual Guid BranchId { get; set; }
-
- ///
- /// 估价类
- ///
- public virtual string AppraisalCategory { get; set; }
-
-
- public virtual Guid ParentId { get; set; }
-
- public virtual Guid UserId { get; set; }
- }
///
/// FIS
///
public class MaterialRelationshipExportDto
{
-
///
- /// ERP物料号
- ///
- [ExporterHeaderAttribute(DisplayName = "ERP物料号")]
-
- public virtual string ErpMaterialCode { get; set; }
- ///
- /// 物料描述
+ /// 厂内物料号
///
- [ExporterHeaderAttribute(DisplayName = "ERP物料描述")]
- public virtual string MaterialDesc { get; set; }
+ [ExporterHeaderAttribute(DisplayName = "厂内物料号")]
+ public string ErpMaterialCode { get; set; }
- [ExporterHeaderAttribute(DisplayName = "估价类")]
- ///
- /// 估价类
- ///
- public virtual string AppraisalCategory { get; set; }
///
- /// 物料属性
+ /// 厂内物料描述
///
- [ExporterHeaderAttribute(DisplayName = "物料属性")]
-
- public virtual string MaterialProperty { get; set; }
+ [ExporterHeaderAttribute(DisplayName = "厂内物料描述")]
+ public string MaterialDesc { get; set; }
///
- /// 结算物料号
+ /// 客户物料号
///
[ExporterHeaderAttribute(DisplayName = "客户物料号")]
-
- public virtual string SettleMaterialCode { get; set; }
-
+ public string SettleMaterialCode { get; set; }
///
- /// 发货看板物料号
+ /// 客户物料描述
///
- [ExporterHeaderAttribute(DisplayName = "发货看板物料号")]
-
- public virtual string ShipMaterailCode { get; set; }
-
-
-
+ [ExporterHeaderAttribute(DisplayName = "客户物料描述")]
+ public virtual string MaterialProperty { get; set; }
}
+
[ImportProject(Name = "零件匹配关系")]
public class MaterialRelationshipImportDto
{
///
- /// ERP物料号
+ /// 厂内物料号
///
- [ImporterHeader(Name = "ERP物料号")]
+ [ImporterHeader(Name = "厂内物料号")]
[Required(ErrorMessage = "{0}是必填项")]
[MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
- public virtual string ErpMaterialCode { get; set; }
- ///
- /// 物料描述
- ///
- [ImporterHeader(Name = "ERP物料描述")]
- //[Required(ErrorMessage = "{0}是必填项")]
- [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
- public virtual string MaterialDesc { get; set; }
- ///
- /// 物料属性
- ///
- [ImporterHeader(Name = "物料属性")]
- //[Required(ErrorMessage = "{0}是必填项")]
- [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
- public virtual string MaterialProperty { get; set; }
+ public string ErpMaterialCode { get; set; }
///
- /// 结算物料号
+ /// 厂内物料描述
///
- [ImporterHeader(Name = "结算物料号")]
- //[Required(ErrorMessage = "{0}是必填项")]
+ [ImporterHeader(Name = "厂内物料描述")]
[MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
- public virtual string SettleMaterialCode { get; set; }
-
+ public string MaterialDesc { get; set; }
///
- /// 发货看板物料号
+ /// 客户物料号
///
- [ImporterHeader(Name = "发货看板物料号")]
- //[Required(ErrorMessage = "{0}是必填项")]
- [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
- public virtual string ShipMaterailCode { get; set; }
-
+ [ImporterHeader(Name = "客户物料号")]
+ public string SettleMaterialCode { get; set; }
- [ImporterHeader(Name = "估价类")]
///
- /// 估价类
+ /// 客户物料描述
///
- public virtual string AppraisalCategory { get; set; }
+ [ImporterHeader(Name = "客户物料描述")]
+ public virtual string MaterialProperty { get; set; }
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs
new file mode 100644
index 00000000..2f7f9e68
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs
@@ -0,0 +1,80 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using SettleAccount.Domain.BQ;
+using Shouldly;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Application.Services;
+using Win.Sfs.BaseData.ImportExcelCommon;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+using Win.Sfs.SettleAccount.ExcelImporter;
+using Win.Sfs.Shared.RepositoryBase;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ
+{
+ ///
+ /// BBAC发运单
+ ///
+ [AllowAnonymous]
+ [Route("api/settleaccount/BBAC_SE_DETAIL_SERVICE")]
+ public class BBAC_SE_DETAIL_SERVICE : ApplicationService
+ {
+ ///
+ /// BBAC发运单仓储
+ ///
+ private readonly INormalEfCoreRepository _repository;
+
+ ///
+ /// excel服务
+ ///
+ private readonly IExcelImportAppService _excelImportService;
+
+ ///
+ /// 构造
+ ///
+ public BBAC_SE_DETAIL_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService)
+ {
+ _repository = repository;
+ _excelImportService = excelImportService;
+ }
+
+ #region 导出
+ ///
+ /// 导出
+ ///
+ [HttpPost]
+ [Route("Export")]
+ public async Task ExportAsync(RequestDto input)
+ {
+ string fileName = $"BBAC发运单_{Guid.NewGuid()}.xlsx";
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExcelExporter(dtos);
+ result.ShouldNotBeNull();
+
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
+ return fileName;
+ }
+ #endregion
+
+ #region 查询
+ ///
+ /// 获取列表
+ ///
+ [HttpPost]
+ [Route("list")]
+ public async Task> GetListAsync(RequestDto input)
+ {
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
+ var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
+ }
+ #endregion
+
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs
index 83228735..a7791e30 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs
@@ -1,17 +1,80 @@
using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Mvc;
+using SettleAccount.Domain.BQ;
+using Shouldly;
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
+using Win.Sfs.BaseData.ImportExcelCommon;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+using Win.Sfs.SettleAccount.ExcelImporter;
+using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
+ ///
+ /// BBAC的EDI数据
+ ///
[AllowAnonymous]
[Route("api/settleaccount/bbac_se_edi_service")]
public class BBAC_SE_EDI_SERVICE : ApplicationService
{
+ ///
+ /// BBAC的EDI数据仓储
+ ///
+ private readonly INormalEfCoreRepository _repository;
+
+ ///
+ /// excel服务
+ ///
+ private readonly IExcelImportAppService _excelImportService;
+
+ ///
+ /// 构造
+ ///
+ public BBAC_SE_EDI_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService)
+ {
+ _repository = repository;
+ _excelImportService = excelImportService;
+ }
+
+ #region 导出
+ ///
+ /// 导出
+ ///
+ [HttpPost]
+ [Route("Export")]
+ public async Task ExportAsync(RequestDto input)
+ {
+ string fileName = $"BBAC的EDI数据_{Guid.NewGuid()}.xlsx";
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExcelExporter(dtos);
+ result.ShouldNotBeNull();
+
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
+ return fileName;
+ }
+ #endregion
+
+ #region 查询
+ ///
+ /// 获取列表
+ ///
+ [HttpPost]
+ [Route("list")]
+ public async Task> GetListAsync(RequestDto input)
+ {
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
+ var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
+ }
+ #endregion
+
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs
new file mode 100644
index 00000000..e67248dc
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs
@@ -0,0 +1,77 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using SettleAccount.Domain.BQ;
+using Shouldly;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Application.Services;
+using Win.Sfs.BaseData.ImportExcelCommon;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+using Win.Sfs.SettleAccount.ExcelImporter;
+using Win.Sfs.Shared.RepositoryBase;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ
+{
+ ///
+ /// HBPO发运单
+ ///
+ [AllowAnonymous]
+ [Route("api/settleaccount/HBPO_SE_DETAIL_SERVICE")]
+ public class HBPO_SE_DETAIL_SERVICE : ApplicationService
+ {
+ ///
+ /// HBPO发运单仓储
+ ///
+ private readonly INormalEfCoreRepository _repository;
+
+ ///
+ /// excel服务
+ ///
+ private readonly IExcelImportAppService _excelImportService;
+
+ public HBPO_SE_DETAIL_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService)
+ {
+ _repository = repository;
+ _excelImportService = excelImportService;
+ }
+
+ #region 导出
+ ///
+ /// 导出
+ ///
+ [HttpPost]
+ [Route("Export")]
+ public async Task ExportAsync(RequestDto input)
+ {
+ string fileName = $"HBPO发运单_{Guid.NewGuid()}.xlsx";
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExcelExporter(dtos);
+ result.ShouldNotBeNull();
+
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
+ return fileName;
+ }
+ #endregion
+
+ #region 查询
+ ///
+ /// 获取列表
+ ///
+ [HttpPost]
+ [Route("list")]
+ public async Task> GetListAsync(RequestDto input)
+ {
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
+ var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
+ }
+ #endregion
+
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs
index 0c8729f4..40fdbf9e 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs
@@ -9,6 +9,9 @@ using Volo.Abp.Application.Services;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
+ ///
+ /// HBPO的EDI数据
+ ///
[AllowAnonymous]
[Route("api/settleaccount/hbpo_se_edi_service")]
public class HBPO_SE_EDI_SERVICE : ApplicationService
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs
new file mode 100644
index 00000000..56bc276b
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs
@@ -0,0 +1,129 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using SettleAccount.Domain.BQ;
+using Shouldly;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Caching;
+using Win.Abp.Snowflakes;
+using Win.Sfs.BaseData.ImportExcelCommon;
+using Win.Sfs.SettleAccount.CommonManagers;
+using Win.Sfs.SettleAccount.Constant;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+using Win.Sfs.SettleAccount.ExcelImporter;
+using Win.Sfs.SettleAccount.ExportReports;
+using Win.Sfs.Shared.RepositoryBase;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ
+{
+ ///
+ /// 采购价格单
+ ///
+ [AllowAnonymous]
+ [Route("api/settleaccount/PURCHASE_PRICE_LIST_Service")]
+ public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase
+ {
+ ///
+ /// 采购价格单仓储
+ ///
+ private readonly INormalEfCoreRepository _repository;
+
+ public PURCHASE_PRICE_SERVICE(
+ INormalEfCoreRepository repository,
+ IDistributedCache cache,
+ IExcelImportAppService excelImportService,
+ ISnowflakeIdGenerator snowflakeIdGenerator,
+ ICommonManager commonManager
+ ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
+ {
+ _repository = repository;
+ }
+
+ #region 导入、导出
+ ///
+ /// 导入
+ ///
+ [HttpPost]
+ [Route("Import")]
+ public async Task ImportAsync([FromForm] IFormFileCollection files)
+ {
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
+ var _ls = ObjectMapper.Map, List>(result);
+ List _errorList = new List();
+ var checkList = new List();
+
+ if (_ls.Count > 0)
+ {
+ var query = from arc in _ls
+ group arc by new { arc.LU }
+ into g
+ where g.Count() > 1
+
+ select g;
+ foreach (var itm in query)
+ {
+ checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("物料号{0}有重复", itm.Key.LU), string.Empty));
+ }
+ }
+ foreach (var itm in _ls)
+ {
+ var _first = _repository.FirstOrDefault(p => p.LU == itm.LU);
+ if (_first != null)
+ {
+ _first.Update(itm.Price);
+ await _repository.UpdateAsync(_first);
+ }
+ else
+ {
+ await _repository.InsertAsync(itm);
+ }
+ }
+ if (checkList.Count > 0)
+ {
+ return await ExportErrorReportAsync(checkList);
+ }
+ return ApplicationConsts.SuccessStr;
+ }
+
+ ///
+ /// 导出
+ ///
+ [HttpPost]
+ [Route("Export")]
+ public async Task ExportAsync(RequestDto input)
+ {
+ string fileName = $"采购价格单_{Guid.NewGuid()}.xlsx";
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExcelExporter(dtos);
+ result.ShouldNotBeNull();
+
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
+ return fileName;
+ }
+ #endregion
+
+ #region CURD
+ ///
+ /// 获取列表
+ ///
+ [HttpPost]
+ [Route("list")]
+ public async Task> GetListAsync(RequestDto input)
+ {
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
+ var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
+ }
+ #endregion
+
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs
new file mode 100644
index 00000000..030a409b
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs
@@ -0,0 +1,126 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using SettleAccount.Domain.BQ;
+using Shouldly;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Caching;
+using Win.Abp.Snowflakes;
+using Win.Sfs.BaseData.ImportExcelCommon;
+using Win.Sfs.SettleAccount.CommonManagers;
+using Win.Sfs.SettleAccount.Constant;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+using Win.Sfs.SettleAccount.ExcelImporter;
+using Win.Sfs.SettleAccount.ExportReports;
+using Win.Sfs.Shared.RepositoryBase;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ
+{
+ ///
+ /// 客户替换件关系
+ ///
+ [AllowAnonymous]
+ [Route("api/settleaccount/[controller]/[action]")]
+ public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase
+ {
+ ///
+ /// 客户替换件关系仓储
+ ///
+ private readonly INormalEfCoreRepository _repository;
+
+ public TB_RePartsRelationship_SERVICE(
+ INormalEfCoreRepository repository,
+ IDistributedCache cache,
+ IExcelImportAppService excelImportService,
+ ISnowflakeIdGenerator snowflakeIdGenerator,
+ ICommonManager commonManager
+ ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
+ {
+ _repository = repository;
+ }
+
+ #region 导入、导出
+ ///
+ /// 导入
+ ///
+ [HttpPost]
+ public async Task ImportAsync([FromForm] IFormFileCollection files)
+ {
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
+ var _ls = ObjectMapper.Map, List>(result);
+ List _errorList = new List();
+ var checkList = new List();
+
+ if (_ls.Count > 0)
+ {
+ var query = from arc in _ls
+ group arc by new { arc.LU }
+ into g
+ where g.Count() > 1
+
+ select g;
+ foreach (var itm in query)
+ {
+ checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("物料号{0}有重复", itm.Key.LU), string.Empty));
+ }
+ }
+ foreach (var itm in _ls)
+ {
+ var _first = _repository.FirstOrDefault(p => p.LU == itm.LU);
+ if (_first != null)
+ {
+ _first.Update(itm.LU, itm.RepLU, itm.ClientCode, itm.BusinessType);
+ await _repository.UpdateAsync(_first);
+ }
+ else
+ {
+ await _repository.InsertAsync(itm);
+ }
+ }
+ if (checkList.Count > 0)
+ {
+ return await ExportErrorReportAsync(checkList);
+ }
+ return ApplicationConsts.SuccessStr;
+ }
+
+ ///
+ /// 导出
+ ///
+ [HttpPost]
+ public async Task ExportAsync(RequestDto input)
+ {
+ string fileName = $"客户替换件关系_{Guid.NewGuid()}.xlsx";
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExcelExporter(dtos);
+ result.ShouldNotBeNull();
+
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
+ return fileName;
+ }
+ #endregion
+
+ #region CURD
+ ///
+ /// 获取列表
+ ///
+ [HttpGet]
+ public async Task> GetListAsync(RequestDto input)
+ {
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
+ var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
+ }
+ #endregion
+
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs
index 8105950b..dd2bcfae 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs
@@ -1,102 +1,55 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Threading.Tasks;
-using EFCore.BulkExtensions;
-using Magicodes.ExporterAndImporter.Core;
-using Magicodes.ExporterAndImporter.Csv;
-using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.Caching.Distributed;
using Shouldly;
-using Volo.Abp;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
-using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
-using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping;
-using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
-using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.Boms;
-using Win.Sfs.SettleAccount.Entities.Controls;
using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.SettleAccount.ExcelImporter;
-using Win.Sfs.SettleAccount.ExportReports;
-using Win.Sfs.Shared.CacheBase;
-using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
-using Win.Utils;
namespace Win.Sfs.SettleAccount.Boms
{
-
///
/// BOM
///
- //[Authorize(SettleAccountPermissions.Boms.Default)]
[AllowAnonymous]
- [Route("api/settleaccount/bom")]
+ [Route("api/settleaccount/[controller]/[action]")]
public class BomAppService : SettleAccountApplicationBase
{
///
- /// BOM�ִ�
+ /// BOMִ
///
private readonly INormalEfCoreRepository _repository;
- private readonly IGuidGenerator _guidGenerator;
-
- private readonly IObjectMapper _objectMapper;
-
- private readonly IExcelImportAppService _excelImportService;
-
- private readonly ISettleAccountBranchEfCoreRepository _materialRepository;
-
- private readonly ISettleAccountBranchEfCoreRepository _importColumnMapRepository;
-
- private readonly ISettleAccountBranchEfCoreRepository _versionRepository;
-
///
- /// ���췽��
+ ///
///
public BomAppService(
INormalEfCoreRepository repository,
- IGuidGenerator guidGenerator,
- IObjectMapper objectMapper,
- IExcelImportAppService excelImportService,
- ISnowflakeIdGenerator snowflakeIdGenerator,
- ICommonManager commonManager,
- ISettleAccountBranchEfCoreRepository versionRepository,
- ISettleAccountBranchEfCoreRepository materialRepository,
- ISettleAccountBranchEfCoreRepository importColumnMapRepository,
- IDistributedCache cache
- ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager)
+ IDistributedCache cache,
+ IExcelImportAppService excelImportService,
+ ISnowflakeIdGenerator snowflakeIdGenerator,
+ ICommonManager commonManager
+ ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager)
{
_repository = repository;
-
- _guidGenerator = guidGenerator;
- _objectMapper = objectMapper;
-
- _excelImportService = excelImportService;
- _versionRepository = versionRepository;
- _materialRepository = materialRepository;
- _importColumnMapRepository = importColumnMapRepository;
}
- #region ���롢����
+ #region
///
- /// ����
+ ///
///
[HttpPost]
- [Route("Export")]
public virtual async Task ExportAsync(BomRequestDto input)
{
string _fileName = string.Format("BOM_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd"));
@@ -104,14 +57,14 @@ namespace Win.Sfs.SettleAccount.Boms
0, true);
var dtoDetails = ObjectMapper.Map, List >(entities);
- //������������
+ //
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExcelExporter(dtoDetails);
result.ShouldNotBeNull();
- //���浼���ļ�����������ɶ�����
+ //浼ļɶ
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
@@ -125,10 +78,9 @@ namespace Win.Sfs.SettleAccount.Boms
#region CURD
///
- /// ��ȡ�б�
+ /// ȡб
///
- [HttpPost]
- [Route("list")]
+ [HttpGet]
public async Task> GetListAsync(BomRequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
@@ -138,13 +90,13 @@ namespace Win.Sfs.SettleAccount.Boms
}
#endregion
- #region ԭ������������
- // #region ���뵼������
+ #region ԭ
+ // #region 뵼
// ///
- // /// ���빦��
+ // /// 빦
// ///
- // /// �ϴ����ļ�(ǰ���Ѿ�����ֻ���ϴ�һ������)
+ // /// ϴļ(ǰѾֻϴһ)
// ///
// [HttpPost]
// [Route("ExcelImport-Map")]
@@ -169,7 +121,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// if (itm.Count > 1)
// {
- // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("���ܵ��븸����{0},�ӱ���{1}���ظ�����", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
+ // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ܵ븸{0},ӱ{1}ظ", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
// }
// }
// var _id = GuidGenerator.Create();
@@ -179,7 +131,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
// {
- // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("���������ݲ��������Ϻ�{0}��", itm.ParentItemCode), string.Empty));
+ // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("ݲϺ{0}", itm.ParentItemCode), string.Empty));
// continue;
// }
// itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id, factory);
@@ -198,9 +150,9 @@ namespace Win.Sfs.SettleAccount.Boms
// ///
- // /// ���빦��
+ // /// 빦
// ///
- // /// �ϴ����ļ�(ǰ���Ѿ�����ֻ���ϴ�һ������)
+ // /// ϴļ(ǰѾֻϴһ)
// ///
// [HttpPost]
// [Route("ExcelImport")]
@@ -224,7 +176,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// if (itm.Count > 1)
// {
- // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("���ܵ��븸����{0},�ӱ���{1}���ظ�����", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
+ // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ܵ븸{0},ӱ{1}ظ", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
// }
// }
// var _id = GuidGenerator.Create();
@@ -234,7 +186,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
// {
- // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("���������ݲ��������Ϻ�{0}��", itm.ParentItemCode), string.Empty));
+ // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("ݲϺ{0}", itm.ParentItemCode), string.Empty));
// continue;
// }
// itm.SetValue(GuidGenerator.Create(),branchId,year,period,version,_id,factory);
@@ -249,7 +201,7 @@ namespace Win.Sfs.SettleAccount.Boms
// return ApplicationConsts.SuccessStr;
// }
// ///
- // /// �����ļ�
+ // /// ļ
// ///
// ///
// ///
@@ -260,7 +212,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// IExporter _csv = new CsvExporter();
// IExporter _excel = new ExcelExporter();
- // //�������ϰ汾��������������ȫ����
+ // //ϰ汾ȫ
// if (input.ParentId != Guid.Empty)
// {
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
@@ -273,23 +225,23 @@ namespace Win.Sfs.SettleAccount.Boms
// 0, true);
// var dtoDetails = ObjectMapper.Map, List>(entities);
// string _fileName = string.Empty;
- // //������������
+ // //
// byte[] result = null;
// switch (input.FileType)
// {
// case 0:
- // _fileName = string.Format("��Ʒ�ṹ_{0}.csv", input.UserId.ToString());
+ // _fileName = string.Format("Ʒṹ_{0}.csv", input.UserId.ToString());
// result = await _csv.ExportAsByteArray(dtoDetails);
// break;
// case 1:
- // _fileName = string.Format("��Ʒ�ṹ_{0}.xlsx", input.UserId.ToString());
+ // _fileName = string.Format("Ʒṹ_{0}.xlsx", input.UserId.ToString());
// result = await _excel.ExportAsByteArray(dtoDetails);
// break;
// }
// result.ShouldNotBeNull();
- // //���浼���ļ�����������ɶ�����
+ // //浼ļɶ
// await _excelImportService.SaveBlobAsync(
// new SaveExcelImportInputDto
// {
@@ -302,13 +254,13 @@ namespace Win.Sfs.SettleAccount.Boms
// #endregion
// ///
- // /// ��ID��ȡΨһʵ��
+ // /// IDȡΨһʵ
// ///
// ///
- // /// ����ʵ��ȫ������
+ // /// ʵȫ
// ///
// /// ID
- // /// ʵ��DTO
+ // /// ʵDTO
// [HttpGet]
// [Route("{id}")]
//[Authorize(SettleAccountPermissions.Boms.Default)]
@@ -339,9 +291,9 @@ namespace Win.Sfs.SettleAccount.Boms
// }
// ///
- // /// ��ȡʵ������
+ // /// ȡʵ
// ///
- // /// ʵ������
+ // /// ʵ
// [HttpGet]
// [Route("count")]
//[Authorize(SettleAccountPermissions.Boms.Default)]
@@ -353,10 +305,10 @@ namespace Win.Sfs.SettleAccount.Boms
// ///
- // /// ɾ��ʵ��
+ // /// ɾʵ
// ///
// /// ID
- // /// ��
+ // ///
// [HttpDelete]
// [Route("{id}")]
//[Authorize(SettleAccountPermissions.Boms.Delete)]
@@ -368,10 +320,10 @@ namespace Win.Sfs.SettleAccount.Boms
// }
// ///
- // /// ��IDsɾ��ʵ���б�
+ // /// IDsɾʵб
// ///
// /// IDs
- // /// �Ƿ�ִ�гɹ�
+ // /// Ƿִгɹ
// [HttpPost]
// [Route("delete")]
//[Authorize(SettleAccountPermissions.Boms.Delete)]
@@ -390,13 +342,13 @@ namespace Win.Sfs.SettleAccount.Boms
// /////
// ///
- // /// ����ɸѡ������ȡʵ���б�
+ // /// ɸѡȡʵб
// ///
// ///
- // /// ������������:ɸѡ�����б�,��������,��������,ҳ��
+ // /// :ɸѡб,,,ҳ
// ///
- // /// ��������
- // /// ʵ��DTO�б�
+ // ///
+ // /// ʵDTOб
// [HttpPost]
// [Route("list")]
// [Authorize(SettleAccountPermissions.Boms.Default)]
@@ -420,13 +372,13 @@ namespace Win.Sfs.SettleAccount.Boms
// /////
// ///
- // /// ����ɸѡ������ȡʵ���б�
+ // /// ɸѡȡʵб
// ///
// ///
- // /// ������������:ɸѡ�����б�,��������,��������,ҳ��
+ // /// :ɸѡб,,,ҳ
// ///
- // /// ��������
- // /// ʵ��DTO�б�
+ // ///
+ // /// ʵDTOб
// [HttpPost]
// [Route("listVersion")]
// [Authorize(SettleAccountPermissions.Boms.Default)]
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs
index f175ca8b..1f2fcb96 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs
@@ -35,7 +35,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
///
[Authorize(SettleAccountPermissions.CodeSettings.Default)]
- [Route("api/settleaccount/CodeSetting")]
+ [Route("api/settleaccount/[controller]/[action]")]
public class CodeSettingAppService : SettleAccountApplicationBase, ICodeSettingAppService
{
private readonly ISettleAccountBranchEfCoreRepository _mapRepository;
@@ -70,9 +70,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// 上传的文件(前端已经限制只能上传一个附件)
///
[HttpPost]
- [Route("ExcelImport-Map")]
[DisableRequestSizeLimit]
- [Authorize(SettleAccountPermissions.CodeSettings.Create)]
public async Task CodeSettingUploadExcelImportMap([FromForm] IFormFileCollection files)
{
@@ -107,9 +105,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// 上传的文件(前端已经限制只能上传一个附件)
///
[HttpPost]
- [Route("ExcelImport")]
[DisableRequestSizeLimit]
- [Authorize(SettleAccountPermissions.CodeSettings.Create)]
public async Task CodeSettingUploadExcelImport([FromForm] IFormFileCollection files)
{
@@ -148,7 +144,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// ID
/// 实体DTO
[HttpGet]
- [Route("{id}")]
virtual public async Task GetAsync(Guid id)
{
var result = await _repository.GetAsync(id);
@@ -184,8 +179,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
///
/// 请求条件
/// 实体DTO列表
- [HttpPost]
- [Route("list")]
+ [HttpGet]
virtual public async Task> GetListAsync(CodeSettingRequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
@@ -203,7 +197,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
///
/// 实体总数
[HttpGet]
- [Route("count")]
virtual public async Task GetTotalCountAsync(Guid branchId)
{
return await _repository.GetCountAsync(branchId);
@@ -214,7 +207,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
///
/// 实体DTO列表
[HttpGet]
- [Route("all")]
virtual public async Task> GetAllAsync(Guid branchId)
{
var entities = await _repository.GetAllAsync(branchId, true);
@@ -270,8 +262,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// 实体DTO
[HttpPost]
- [Route("")]
- [Authorize(SettleAccountPermissions.CodeSettings.Create)]
virtual public async Task CreateAsync(CodeSettingCreateDto input)
{
var _first = _repository.Where(p => p.Project == input.Project && p.Value==input.Value).FirstOrDefault();
@@ -305,7 +295,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
[HttpPost]
- [Route("Export")]
virtual public async Task ExportAsync(CodeSettingRequestDto input)
{
string _fileName = string.Format("通用代码设置_{0}.xlsx",DateTime.Now.ToString("yyyyMMdd"));
@@ -339,9 +328,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// ID
/// 修改实体DTO
/// 实体DTO
- [HttpPut]
- [Route("{id}")]
- [Authorize(SettleAccountPermissions.CodeSettings.Update)]
+ [HttpPost]
virtual public async Task UpdateAsync(Guid id, CodeSettingUpdateDto input)
{
var _first = _repository.Where(p => p.Project == input.Project && p.Value == input.Value).FirstOrDefault();
@@ -364,9 +351,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
///
/// ID
/// 无
- [HttpDelete]
- [Route("{id}")]
- [Authorize(SettleAccountPermissions.CodeSettings.Delete)]
+ [HttpPost]
virtual public async Task DeleteAsync(Guid id)
{
var entity = await GetFromCacheAsync(id);
@@ -380,8 +365,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// IDs
/// 是否执行成功
[HttpPost]
- [Route("delete")]
- [Authorize(SettleAccountPermissions.CodeSettings.Delete)]
virtual public async Task DeleteListAsync(List ids)
{
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs
index da1c845d..cb19ee9b 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs
@@ -1,43 +1,24 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using EFCore.BulkExtensions;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.Caching.Distributed;
using Shouldly;
-using Volo.Abp;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
-using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
-using Volo.Abp.Domain.Repositories;
-using Volo.Abp.Guids;
-using Volo.Abp.ObjectMapping;
-using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
-using Win.Sfs.SettleAccount.Constant;
-using Win.Sfs.SettleAccount.Entities.CodeSettings;
-using Win.Sfs.SettleAccount.Entities.ImportMap;
-using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.SettleAccount.ExcelImporter;
-using Win.Sfs.Shared.CacheBase;
using Win.Sfs.Shared.RepositoryBase;
-using Win.Utils;
namespace Win.Sfs.SettleAccount.Entities.Controls
{
///
/// 期间设置
///
- //[Authorize(SettleAccountPermissions.CentralizedControls.Default)]
[AllowAnonymous]
- [Route("api/settleaccount/CentralizedControl")]
+ [Route("api/settleaccount/[controller]/[action]")]
public class CentralizedControlAppService : SettleAccountApplicationBase
{
///
@@ -45,16 +26,11 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
///
private readonly INormalEfCoreRepository _repository;
- private readonly ISettleAccountBranchEfCoreRepository _mapRepository;
-
- private readonly IExcelImportAppService _excelImportService;
///
- /// 构建方法
+ /// 构造
///
public CentralizedControlAppService(
INormalEfCoreRepository repository,
- IGuidGenerator guidGenerator,
- IObjectMapper objectMapper,
IDistributedCache cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
@@ -62,15 +38,33 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_repository = repository;
- _excelImportService = excelImportService;
}
+ #region 导出
+ ///
+ /// 导出
+ ///
+ [HttpPost]
+ public async Task ExportAsync(CentralizedControlRequestDto input)
+ {
+ string fileName = $"期间设置_{Guid.NewGuid()}.xlsx";
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExcelExporter(dtos);
+ result.ShouldNotBeNull();
+
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
+ return fileName;
+ }
+ #endregion
+
#region CURD
///
/// 获取列表
///
- [HttpPost]
- [Route("list")]
+ [HttpGet]
public async Task> GetListAsync(CentralizedControlRequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
@@ -81,8 +75,10 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
#endregion
#region 开启、关闭
+ ///
+ /// 开启版本
+ ///
[HttpPost]
- [Route("open")]
public async Task OpenVersion(List ids)
{
var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id));
@@ -93,11 +89,10 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
return true;
}
- [HttpPost]
- [Route("close")]
///
/// 关闭版本
///
+ [HttpPost]
public async Task ClosedVersion(List ids)
{
var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id));
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs
index 0799658f..a94034d5 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs
@@ -47,6 +47,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
[Authorize(SettleAccountPermissions.Boms.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/ErpShipping")]
+ [ApiExplorerSettings(IgnoreApi = true)]
public class ErpShippingAppService : SettleAccountApplicationBase
{
private readonly IGuidGenerator _guidGenerator;
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErrorListBill/ErrorBillAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErrorListBill/ErrorBillAppService.cs
index 74fdd97a..7119c3b6 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErrorListBill/ErrorBillAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErrorListBill/ErrorBillAppService.cs
@@ -45,6 +45,7 @@ namespace Win.Sfs.SettleAccount.Entities.ErrorBills
// [Authorize(SettleAccountPermissions.ErrorBills.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/ErrorBill")]
+ [ApiExplorerSettings(IgnoreApi = true)]
public class ErrorBillAppService : SettleAccountApplicationBase
{
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/FISes/FISAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/FISes/FISAppService.cs
index a55828dd..50786880 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/FISes/FISAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/FISes/FISAppService.cs
@@ -44,6 +44,7 @@ namespace Win.Sfs.SettleAccount.FISes
///
//[Authorize(SettleAccountPermissions.FISs.Default)]
//[AllowAnonymous]
+ [ApiExplorerSettings(IgnoreApi = true)]
[Route("api/settleaccount/fis")]
public class FISAppService : SettleAccountApplicationBase, IFISAppService
{
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Factories/FactoryAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Factories/FactoryAppService.cs
index 66e90a7c..1f80c2c3 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Factories/FactoryAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Factories/FactoryAppService.cs
@@ -32,7 +32,8 @@ namespace Win.Sfs.SettleAccount.Entities.Factories
///
/// 区域相关应用服务
///
- [Authorize(SettleAccountPermissions.Factorys.Default)]
+ [ApiExplorerSettings(IgnoreApi = true)]
+ [Authorize(SettleAccountPermissions.Factorys.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/Factory")]
public class FactoryAppService : SettleAccountApplicationBase, IFactoryAppService
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Inventories/InventoryDetailAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Inventories/InventoryDetailAppService.cs
index 05c6cf5b..eaf038b1 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Inventories/InventoryDetailAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Inventories/InventoryDetailAppService.cs
@@ -38,6 +38,7 @@ namespace Win.Sfs.SettleAccount.InventoryDetails
///
/// Ӧ÷
///
+ [ApiExplorerSettings(IgnoreApi = true)]
[Authorize(SettleAccountPermissions.InventoryDetails.Default)]
[Route("api/settleaccount/InventoryDetail")]
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs
index 3f029460..7fc58cd3 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs
@@ -41,6 +41,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices
///
/// 发票汇总导入
///
+ [ApiExplorerSettings(IgnoreApi = true)]
[Route("api/settleaccount/Invoices")]
[Authorize(SettleAccountPermissions.Invoices.Default)]
public class InvoiceAppService : SettleAccountApplicationBase,IInvoiceAppService
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ItemInvoicePrices/ItemInvoicePriceAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ItemInvoicePrices/ItemInvoicePriceAppService.cs
index 49a9c6e2..a3d8b078 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ItemInvoicePrices/ItemInvoicePriceAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ItemInvoicePrices/ItemInvoicePriceAppService.cs
@@ -48,6 +48,7 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices
///
//[Authorize(SettleAccountPermissions.ItemInvoicePrices.Default)]
//[AllowAnonymous]
+ [ApiExplorerSettings(IgnoreApi = true)]
[Route("api/settleaccount/ItemInvoicePrice")]
public class ItemInvoicePriceAppService : SettleAccountApplicationBase, IItemInvoicePriceAppService
{
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
index a25df6aa..ab9c8b2c 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
@@ -1,97 +1,75 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using EFCore.BulkExtensions;
-using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Caching.Distributed;
using Shouldly;
-using Volo.Abp;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
-using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
-using Volo.Abp.Domain.Repositories;
-using Volo.Abp.Guids;
-using Volo.Abp.ObjectMapping;
-using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
-using Win.Sfs.SettleAccount.Entities.ImportMap;
-using Win.Sfs.SettleAccount.Entities.MaterialRelationships;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.MaterialRelationships;
-using Win.Sfs.Shared.CacheBase;
-using Win.Utils;
+using Win.Sfs.Shared.DtoBase;
+using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
{
///
- /// 区域相关应用服务
+ /// 客户零件关系
///
- //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)]
- //[AllowAnonymous]
- [Route("api/settleaccount/MaterialRelationship")]
- public class MaterialRelationshipAppService : SettleAccountApplicationBase, IMaterialRelationshipAppService
+ [AllowAnonymous]
+ [Route("api/settleaccount/[controller]/[action]")]
+ public class MaterialRelationshipAppService : SettleAccountApplicationBase
{
+ ///
+ /// 客户零件关系仓储
+ ///
+ private readonly INormalEfCoreRepository _repository;
- private readonly ISettleAccountBranchEfCoreRepository _mapRepository;
- private readonly IExcelImportAppService _excelImportService;
- private readonly ISettleAccountBranchEfCoreRepository _repository;
///
- /// 构建方法
+ /// 构造
///
- /// 构建UID
- /// 自动map
- /// 仓储接口
- /// 缓存
- public MaterialRelationshipAppService(IGuidGenerator guidGenerator,
- IObjectMapper objectMapper,
- ISettleAccountBranchEfCoreRepository repository,
- ISettleAccountBranchEfCoreRepository mapRepository,
+ public MaterialRelationshipAppService(
+ INormalEfCoreRepository repository,
IDistributedCache cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager)
{
- _mapRepository = mapRepository;
_repository = repository;
- _excelImportService = excelImportService;
}
+ #region 导入、导出
///
- /// 导入功能
+ /// 导入
///
- /// 上传的文件(前端已经限制只能上传一个附件)
- ///
[HttpPost]
- [Route("ExcelImport-Map")]
- [DisableRequestSizeLimit]
- public async Task MaterialRelationshipUploadExcelImportMap([FromForm] IFormFileCollection files)
+ public async Task ImportAsync([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
- var mapList=_mapRepository.Where(p => p.ProjectName == SettleAccountModuleName.MaterialRelationship).ToList();
- var result = await _exportImporter.ExtendExcelImport(files, _excelImportService,mapList);
+ var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
var _ls = ObjectMapper.Map, List>(result);
List _errorList = new List();
var checkList = new List();
+
if (_ls.Count > 0)
{
var query = from arc in _ls
group arc by new { arc.ErpMaterialCode }
- into g
+ into g
where g.Count() > 1
select g;
foreach (var itm in query)
{
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty));
- // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode));
}
}
foreach (var itm in _ls)
@@ -104,307 +82,392 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
}
else
{
- checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty));
- //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode));
- //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
- //await _repository.InsertAsync(itm);
+ await _repository.InsertAsync(itm);
}
- //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
-
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
-
return ApplicationConsts.SuccessStr;
}
-
-
///
- /// 导入功能
+ /// 导出
///
- /// 上传的文件(前端已经限制只能上传一个附件)
- ///
[HttpPost]
- [Route("ExcelImport")]
- [DisableRequestSizeLimit]
- public async Task MaterialRelationshipUploadExcelImport([FromForm] IFormFileCollection files)
+ public async Task ExportAsync(RequestDtoBase input)
{
-
+ string fileName = $"客户零件关系_{Guid.NewGuid()}.xlsx";
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
+ var dtos = ObjectMapper.Map, List>(entities);
ExportImporter _exportImporter = new ExportImporter();
- var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
- var _ls = ObjectMapper.Map, List>(result);
- List _errorList = new List();
- var checkList = new List();
-
- if (_ls.Count > 0)
- {
- var query=from arc in _ls
- group arc by new { arc.ErpMaterialCode}
- into g
- where g.Count() >1
-
- select g;
- foreach (var itm in query)
- {
- checkList.Add(new ErrorExportDto(string.Empty,string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty));
- // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode));
- }
- }
- foreach (var itm in _ls)
- {
- var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode );
- if (_first != null)
- {
- _first.Update(itm.MaterialDesc,itm.MaterialProperty,itm.SettleMaterialCode,itm.ShipMaterailCode);
- await _repository.UpdateAsync(_first);
- }
- else
- {
- checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty));
- //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode));
- //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
- //await _repository.InsertAsync(itm);
- }
- //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
-
- }
- if (checkList.Count > 0)
- {
- return await ExportErrorReportAsync(checkList);
- }
+ var result = await _exportImporter.ExcelExporter(dtos);
+ result.ShouldNotBeNull();
- return ApplicationConsts.SuccessStr;
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
+ return fileName;
}
+ #endregion
-
-
+ #region CURD
///
- /// 按ID获取唯一实体
+ /// 获取列表
///
- ///
- /// 返回实体全部属性
- ///
- /// ID
- /// 实体DTO
[HttpGet]
- [Route("{id}")]
- virtual public async Task GetAsync(Guid id)
+ public async Task> GetListAsync(RequestDtoBase input)
{
- var result = await GetFromCacheAsync(id);
- var dto = ObjectMapper.Map(result);
- return dto;
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
+ var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
}
+ #endregion
-
- private async Task GetFromCacheAsync(Guid id)
- {
- var result = await _repository.GetAsync(id);
-
-
- return result;
- }
+ #region 原方法(废弃)
+ /////
+ ///// 导入功能
+ /////
+ ///// 上传的文件(前端已经限制只能上传一个附件)
+ /////
+ //[HttpPost]
+ //[Route("ExcelImport-Map")]
+ //[DisableRequestSizeLimit]
+ //public async Task MaterialRelationshipUploadExcelImportMap([FromForm] IFormFileCollection files)
+ //{
+ // ExportImporter _exportImporter = new ExportImporter();
+ // var mapList = _mapRepository.Where(p => p.ProjectName == SettleAccountModuleName.MaterialRelationship).ToList();
+ // var result = await _exportImporter.ExtendExcelImport(files, _excelImportService, mapList);
+ // var _ls = ObjectMapper.Map, List>(result);
+ // List _errorList = new List();
+ // var checkList = new List();
+ // if (_ls.Count > 0)
+ // {
+ // var query = from arc in _ls
+ // group arc by new { arc.ErpMaterialCode }
+ // into g
+ // where g.Count() > 1
+
+ // select g;
+ // foreach (var itm in query)
+ // {
+ // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty));
+ // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode));
+ // }
+ // }
+ // foreach (var itm in _ls)
+ // {
+ // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode);
+ // if (_first != null)
+ // {
+ // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode);
+ // await _repository.UpdateAsync(_first);
+ // }
+ // else
+ // {
+ // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty));
+ // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode));
+ // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
+ // //await _repository.InsertAsync(itm);
+ // }
+ // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
+
+ // }
+ // if (checkList.Count > 0)
+ // {
+ // return await ExportErrorReportAsync(checkList);
+ // }
+
+ // return ApplicationConsts.SuccessStr;
+ //}
- private async Task GetCountAsync(MaterialRelationshipRequestDto input)
- {
- return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
- }
+ /////
+ ///// 导入功能
+ /////
+ ///// 上传的文件(前端已经限制只能上传一个附件)
+ /////
+ //[HttpPost]
+ //[Route("ExcelImport")]
+ //[DisableRequestSizeLimit]
+ //public async Task MaterialRelationshipUploadExcelImport([FromForm] IFormFileCollection files)
+ //{
+
+
+ // ExportImporter _exportImporter = new ExportImporter();
+ // var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
+ // var _ls = ObjectMapper.Map, List>(result);
+ // List _errorList = new List();
+ // var checkList = new List();
+
+ // if (_ls.Count > 0)
+ // {
+ // var query = from arc in _ls
+ // group arc by new { arc.ErpMaterialCode }
+ // into g
+ // where g.Count() > 1
+
+ // select g;
+ // foreach (var itm in query)
+ // {
+ // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty));
+ // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode));
+ // }
+ // }
+ // foreach (var itm in _ls)
+ // {
+ // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode);
+ // if (_first != null)
+ // {
+ // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode);
+ // await _repository.UpdateAsync(_first);
+ // }
+ // else
+ // {
+ // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty));
+ // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode));
+ // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
+ // //await _repository.InsertAsync(itm);
+ // }
+ // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
+
+ // }
+ // if (checkList.Count > 0)
+ // {
+ // return await ExportErrorReportAsync(checkList);
+ // }
+
+ // return ApplicationConsts.SuccessStr;
+ //}
/////
+ ///// 按ID获取唯一实体
+ /////
+ /////
+ ///// 返回实体全部属性
+ /////
+ ///// ID
+ ///// 实体DTO
+ //[HttpGet]
+ //[Route("{id}")]
+ //virtual public async Task GetAsync(Guid id)
+ //{
+ // var result = await GetFromCacheAsync(id);
+ // var dto = ObjectMapper.Map(result);
+ // return dto;
+ //}
- ///
- /// 根据筛选条件获取实体列表
- ///
- ///
- /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
- ///
- /// 请求条件
- /// 实体DTO列表
- [HttpPost]
- [Route("list")]
- virtual public async Task> GetListAsync(MaterialRelationshipRequestDto input)
- {
- var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
- input.SkipCount, true);
- var totalCount = await GetCountAsync(input);
- var dtos = ObjectMapper.Map, List>(entities);
+ //private async Task GetFromCacheAsync(Guid id)
+ //{
+ // var result = await _repository.GetAsync(id);
- return new PagedResultDto(totalCount, dtos);
- }
+ // return result;
+ //}
- ///
- /// 获取实体总数
- ///
- /// 实体总数
- [HttpGet]
- [Route("count")]
- virtual public async Task GetTotalCountAsync(Guid branchId)
- {
- return await _repository.GetCountAsync(branchId);
- }
- ///
- /// 获取全部实体列表
- ///
- /// 实体DTO列表
- [HttpGet]
- [Route("all")]
- virtual public async Task> GetAllAsync(Guid branchId)
- {
- var entities = await _repository.GetAllAsync(branchId, true);
+ //private async Task GetCountAsync(MaterialRelationshipRequestDto input)
+ //{
+ // return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
+ //}
- var dtos = ObjectMapper.Map, List>(entities);
- return new ListResultDto(dtos);
- }
+ ///////
+ /////
+ ///// 根据筛选条件获取实体列表
+ /////
+ /////
+ ///// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
+ /////
+ ///// 请求条件
+ ///// 实体DTO列表
+ //[HttpPost]
+ //[Route("list")]
+ //virtual public async Task> GetListAsync(MaterialRelationshipRequestDto input)
+ //{
+ // var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
+ // input.SkipCount, true);
+
+ // var totalCount = await GetCountAsync(input);
+ // var dtos = ObjectMapper.Map, List>(entities);
+
+ // return new PagedResultDto(totalCount, dtos);
+ //}
-
- ///
- /// 新增实体
- ///
- /// 新增实体DTO
- /// 实体DTO
+ /////
+ ///// 获取实体总数
+ /////
+ ///// 实体总数
+ //[HttpGet]
+ //[Route("count")]
+ //virtual public async Task GetTotalCountAsync(Guid branchId)
+ //{
+ // return await _repository.GetCountAsync(branchId);
+ //}
- [HttpPost]
- [Route("")]
- virtual public async Task CreateAsync(MaterialRelationshipCreateDto input)
- {
+ /////
+ ///// 获取全部实体列表
+ /////
+ ///// 实体DTO列表
+ //[HttpGet]
+ //[Route("all")]
+ //virtual public async Task> GetAllAsync(Guid branchId)
+ //{
+ // var entities = await _repository.GetAllAsync(branchId, true);
- var _first = _repository.Where(p => p.ErpMaterialCode == input.ErpMaterialCode ).FirstOrDefault();
+ // var dtos = ObjectMapper.Map, List>(entities);
- if (_first != null)
- {
- throw new BusinessException("001", "已经存数据请修改后创建");
- }
+ // return new ListResultDto(dtos);
+ //}
- var entity = new MaterialRelationship(
- GuidGenerator.Create(),
- input.BranchId,
- input.ErpMaterialCode,
- input.MaterialDesc,
- input.MaterialProperty,
- input.SettleMaterialCode,
- input.ShipMaterailCode,
- input.AppraisalCategory
-
- );
- await _repository.InsertAsync(entity);
+ /////
+ ///// 新增实体
+ /////
+ ///// 新增实体DTO
+ ///// 实体DTO
- ////create cache
- //await Cache.SetAsync(entity.Id.ToString(), entity,
- // CacheStrategyConst.FIVE_MINUTES);
+ //[HttpPost]
+ //[Route("")]
+ //virtual public async Task CreateAsync(MaterialRelationshipCreateDto input)
+ //{
- var dto = ObjectMapper.Map(entity);
- return dto;
- }
+ // var _first = _repository.Where(p => p.ErpMaterialCode == input.ErpMaterialCode).FirstOrDefault();
- ///
- /// 修改实体
- ///
- /// ID
- /// 修改实体DTO
- /// 实体DTO
- [HttpPut]
- [Route("{id}")]
- virtual public async Task UpdateAsync(Guid id, MaterialRelationshipUpdateDto input)
- {
- var entity = await _repository.GetAsync(id);
- if (entity != null)
- {
- entity.Update( input.MaterialDesc, input.MaterialProperty, input.SettleMaterialCode, input.ShipMaterailCode);
+ // if (_first != null)
+ // {
+ // throw new BusinessException("001", "已经存数据请修改后创建");
+ // }
- await _repository.UpdateAsync(entity);
-
- var dto = ObjectMapper.Map(entity);
- return dto;
- }
- else
- {
- return null;
- }
+ // var entity = new MaterialRelationship(
+ // GuidGenerator.Create(),
+ // input.BranchId,
+ // input.ErpMaterialCode,
- }
+ // input.MaterialDesc,
+ // input.MaterialProperty,
+ // input.SettleMaterialCode,
+ // input.ShipMaterailCode,
+ // input.AppraisalCategory
- ///
- /// 删除实体
- ///
- /// ID
- /// 无
- [HttpDelete]
- [Route("{id}")]
- virtual public async Task DeleteAsync(Guid id)
- {
- var entity = await GetFromCacheAsync(id);
- await Cache.DeleteAsync(id.ToString());
- await _repository.DeleteAsync(id);
- }
- ///
- /// 按IDs删除实体列表
- ///
- /// IDs
- /// 是否执行成功
- [HttpPost]
- [Route("delete")]
- virtual public async Task DeleteListAsync(List ids)
- {
- var _query = _repository.Where(p => ids.Contains(p.Id));
- int i = await _query.BatchDeleteAsync();
+ // );
- if (i == 0)
- {
- return false;
- }
- return true;
- }
- [HttpPost]
- [Route("Export")]
- virtual public async Task ExportAsync(MaterialRelationshipRequestDto input)
- {
- //var _userId = CurrentUser.Id.Value.ToString();
- string _fileName = string.Format("零件关系_{0}.xlsx",Guid.NewGuid().ToString());
- var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
- 0, true);
+ // await _repository.InsertAsync(entity);
- var dtoDetails = ObjectMapper.Map, List>(entities);
+ // ////create cache
+ // //await Cache.SetAsync(entity.Id.ToString(), entity,
+ // // CacheStrategyConst.FIVE_MINUTES);
- //声明导出容器
- ExportImporter _exportImporter = new ExportImporter();
+ // var dto = ObjectMapper.Map(entity);
+ // return dto;
- var result = await _exportImporter.ExcelExporter(dtoDetails);
+ //}
- result.ShouldNotBeNull();
+ /////
+ ///// 修改实体
+ /////
+ ///// ID
+ ///// 修改实体DTO
+ ///// 实体DTO
+ //[HttpPut]
+ //[Route("{id}")]
+ //virtual public async Task UpdateAsync(Guid id, MaterialRelationshipUpdateDto input)
+ //{
+ // var entity = await _repository.GetAsync(id);
+ // if (entity != null)
+ // {
+ // entity.Update(input.MaterialDesc, input.MaterialProperty, input.SettleMaterialCode, input.ShipMaterailCode);
+
+ // await _repository.UpdateAsync(entity);
+
+
+ // var dto = ObjectMapper.Map(entity);
+ // return dto;
+ // }
+ // else
+ // {
+ // return null;
+ // }
+
+ //}
- //保存导出文件到服务器存成二进制
- await _excelImportService.SaveBlobAsync(
- new SaveExcelImportInputDto
- {
- Name = _fileName,
- Content = result
- }
- );
- return _fileName;
- }
+ /////
+ ///// 删除实体
+ /////
+ ///// ID
+ ///// 无
+ //[HttpDelete]
+ //[Route("{id}")]
+ //virtual public async Task DeleteAsync(Guid id)
+ //{
+ // var entity = await GetFromCacheAsync(id);
+ // await Cache.DeleteAsync(id.ToString());
+ // await _repository.DeleteAsync(id);
+ //}
+
+ /////
+ ///// 按IDs删除实体列表
+ /////
+ ///// IDs
+ ///// 是否执行成功
+ //[HttpPost]
+ //[Route("delete")]
+ //virtual public async Task DeleteListAsync(List ids)
+ //{
+ // var _query = _repository.Where(p => ids.Contains(p.Id));
+ // int i = await _query.BatchDeleteAsync();
+
+ // if (i == 0)
+ // {
+ // return false;
+ // }
+ // return true;
+ //}
+ //[HttpPost]
+ //[Route("Export")]
+ //virtual public async Task ExportAsync(MaterialRelationshipRequestDto input)
+ //{
+ // //var _userId = CurrentUser.Id.Value.ToString();
+ // string _fileName = string.Format("零件关系_{0}.xlsx", Guid.NewGuid().ToString());
+ // var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
+ // 0, true);
+
+ // var dtoDetails = ObjectMapper.Map, List>(entities);
+
+ // //声明导出容器
+ // ExportImporter _exportImporter = new ExportImporter();
+
+ // var result = await _exportImporter.ExcelExporter(dtoDetails);
+
+ // result.ShouldNotBeNull();
+
+ // //保存导出文件到服务器存成二进制
+ // await _excelImportService.SaveBlobAsync(
+ // new SaveExcelImportInputDto
+ // {
+ // Name = _fileName,
+ // Content = result
+ // }
+ // );
+ // return _fileName;
+ //}
+ #endregion
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipTHAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipTHAppService.cs
index afa51279..bab519e5 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipTHAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipTHAppService.cs
@@ -30,6 +30,7 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
//[AllowAnonymous]
//[Authorize(SettleAccountPermissions.MaterialRelationships.Default)]
+ [ApiExplorerSettings(IgnoreApi = true)]
[Route("api/settleaccount/MaterialRelationshipDetail")]
public class MaterialRelationshipTHAppService : ApplicationService
/*, IMaterialRelationshipTHAppService*/
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs
index fcf5fba2..466616c6 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs
@@ -1,7 +1,5 @@
using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.EntityFrameworkCore;
using Shouldly;
using System;
using System.Collections.Generic;
@@ -10,16 +8,8 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
-using Win.Sfs.SettleAccount.Boms;
using Win.Sfs.SettleAccount.CommonManagers;
-using Win.Sfs.SettleAccount.Constant;
-using Win.Sfs.SettleAccount.Entities.Boms;
-using Win.Sfs.SettleAccount.Entities.ImportMap;
-using Win.Sfs.SettleAccount.Entities.Prices;
-using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.ExcelImporter;
-using Win.Sfs.SettleAccount.ExportReports;
-using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.Materials
@@ -27,50 +17,27 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
///
/// 物料主数据
///
- //[Authorize(SettleAccountPermissions.Materials.Default)]
[AllowAnonymous]
- [Route("api/settleaccount/Material")]
+ [Route("api/settleaccount/[controller]/[action]")]
public class MaterialAppService : SettleAccountApplicationBase
{
- private readonly IExcelImportAppService _excelImportService;
+ ///
+ /// 物料主数据仓储
+ ///
private readonly INormalEfCoreRepository _repository;
- private readonly ISettleAccountBranchEfCoreRepository _bomRepository;
- private readonly ISettleAccountBranchEfCoreRepository _bomversionRepository;
- private readonly ISettleAccountBranchEfCoreRepository _priceRepository;
- private readonly ISettleAccountBranchEfCoreRepository _priceversionRepository;
- private readonly ISettleAccountBranchEfCoreRepository _mapRepository;
- private readonly ISettleAccountBranchEfCoreRepository _relationshipRepository;
-
///
- /// 构建方法
+ /// 构造
///
public MaterialAppService(
INormalEfCoreRepository repository,
- ISettleAccountBranchEfCoreRepository mapRepository,
- ISettleAccountBranchEfCoreRepository bomRepository,
- ISettleAccountBranchEfCoreRepository bomversionRepository,
- TaskJobService service,
- ISettleAccountBranchEfCoreRepository relationshipRepository,
- ISettleAccountBranchEfCoreRepository priceRepository,
- ISettleAccountBranchEfCoreRepository priceversionRepository,
-
- IDistributedCache cache,
+ IDistributedCache cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
-
- ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager)
+ ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager)
{
- _priceRepository = priceRepository;
- _priceversionRepository = priceversionRepository;
- _bomRepository = bomRepository;
- _excelImportService = excelImportService;
- _repository = repository;
- _relationshipRepository = relationshipRepository;
- _mapRepository = mapRepository;
- _bomversionRepository = bomversionRepository;
-
+ _repository = repository;
}
#region 导入、导出
@@ -78,9 +45,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
/// 导出
///
[HttpPost]
- [Route("Export")]
- //[Authorize(SettleAccountPermissions.Materials.Default)]
- public virtual async Task ExportAsync(MaterialRequestDto input)
+ public async Task ExportAsync(MaterialRequestDto input)
{
string _fileName = string.Format("物料主数据_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd"));
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue,
@@ -110,9 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
///
/// 获取列表
///
- [HttpPost]
- [Route("list")]
- //[Authorize(SettleAccountPermissions.Materials.Default)]
+ [HttpGet]
virtual public async Task> GetListAsync(MaterialRequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount,
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prebatch/PrebatchAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prebatch/PrebatchAppService.cs
index 5e414290..d5fd17e0 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prebatch/PrebatchAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prebatch/PrebatchAppService.cs
@@ -37,6 +37,7 @@ namespace Win.Sfs.SettleAccount.Prebatches
/// 区域相关应用服务
///
//[Authorize(SettleAccountPermissions.Prebatchs.Default)]
+ [ApiExplorerSettings(IgnoreApi = true)]
[AllowAnonymous]
[Route("api/settleaccount/Prebatch")]
public class PrebatchAppService : SettleAccountApplicationBase, IPrebatchAppService
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
index 2f8c4a80..558877c2 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
@@ -4,39 +4,28 @@ using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.OpenApi.Extensions;
-using NPOI.SS.UserModel;
-using SettleAccount.Job.Services.Report;
using Shouldly;
using System;
using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.IO;
using System.Linq;
-using System.Reflection;
-using System.Text;
using System.Threading.Tasks;
-using TaskJob.EventArgs;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
-using Volo.Abp.Uow;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Constant;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.ExcelImporter;
-using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.Prices
{
///
- /// 标准价格单-相关应用服务
+ /// 销售价格单
///
- //[Authorize(SettleAccountPermissions.PriceLists.Default)]
- [Route("api/SettleAccount/PriceList")]
[AllowAnonymous]
+ [Route("api/settleaccount/[controller]/[action]")]
public class PriceListAppService : ApplicationService
- /*, IPriceListAppService*/
{
private readonly PriceListManager _priceListManager;
private readonly IExcelImportAppService _excelImportService;
@@ -56,22 +45,20 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
}
#region 导入、导出
- ///
- /// 获取导入模板
- ///
- [HttpPost("import-template")]
- public virtual async Task ImportTemplateAsync()
- {
- await Task.CompletedTask;
- return new Microsoft.AspNetCore.Mvc.OkResult();
- }
+ /////
+ ///// 获取导入模板
+ /////
+ //[HttpPost("import-template")]
+ //public virtual async Task ImportTemplateAsync()
+ //{
+ // await Task.CompletedTask;
+ // return new Microsoft.AspNetCore.Mvc.OkResult();
+ //}
///
/// 导入
///
[HttpPost]
- [Route("Import")]
- //[Authorize(SettleAccountPermissions.PriceLists.Create)]
public virtual async Task ImportAsync([FromForm] IFormFileCollection files, string version)
{
ExportImporter _exportImporter = new ExportImporter();
@@ -101,9 +88,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导出
///
[HttpPost]
- [Route("Export")]
- //[Authorize(SettleAccountPermissions.PriceLists.Default)]
- public virtual async Task ExportAsync(TB_PRICE_LIST_RequestDto input)
+ public virtual async Task ExportAsync(RequestDto input)
{
IExporter _csv = new CsvExporter();
@@ -118,18 +103,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
string _fileName = string.Empty;
//声明导出容器
- byte[] result = null;
- switch (input.FileType)
- {
- case 0:
- _fileName = string.Format("销售价格单_{0}.xlsx", Guid.NewGuid().ToString());
- result = await _csv.ExportAsByteArray(dtoDetails);
- break;
- case 1:
- _fileName = string.Format("销售价格单_{0}.xlsx", Guid.NewGuid().ToString());
- result = await _excel.ExportAsByteArray(dtoDetails);
- break;
- }
+ _fileName = string.Format("销售价格单_{0}.xlsx", Guid.NewGuid().ToString());
+ byte[] result = await _excel.ExportAsByteArray(dtoDetails);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
@@ -148,17 +123,11 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
///
/// 获取列表
///
- [HttpPost]
- [Route("list")]
- //[Authorize(SettleAccountPermissions.PriceLists.Default)]
- public virtual async Task> GetListAsync(TB_PRICE_LIST_RequestDto input)
+ [HttpGet]
+ public virtual async Task> GetListAsync(RequestDto input)
{
- if (!string.IsNullOrEmpty(input.Version))
- {
- input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
- }
var entitys = await _priceListManager.GetListAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
- var totalCount = await GetCountAsync(input);
+ var totalCount = await _priceListManager.GetCountAsync(input.Filters, GuidGenerator.Create());
var dtos = ObjectMapper.Map, List>(entitys);
return new PagedResultDto(totalCount, dtos);
}
@@ -166,9 +135,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
///
/// 删除
///
- [HttpDelete]
- [Route("{id}")]
- //[Authorize(SettleAccountPermissions.PriceLists.Delete)]
+ [HttpPost]
virtual public async Task DeleteAsync(Guid id)
{
await _priceListManager.DeleteAsync(id);
@@ -178,170 +145,160 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 批量删除
///
[HttpPost]
- [Route("delete")]
- //[Authorize(SettleAccountPermissions.PriceLists.Delete)]
virtual public async Task DeleteListAsync(List ids)
{
return await _priceListManager.DeleteListAsync(ids);
}
#endregion
- #region 私有方法
- ///
- /// 获取总数
- ///
- private async Task GetCountAsync(TB_PRICE_LIST_RequestDto input)
- {
- return await _priceListManager.GetCountAsync(input.Filters, GuidGenerator.Create());
- }
- #endregion
-
-
-
-
-
- ///
- /// 获取总数
- ///
- private async Task GetCountAsync(PriceListRequestDto input)
- {
- return await _priceListManager.GetCountAsync(input.Filters, GuidGenerator.Create());
- }
-
-
- ///
- /// 结算总成和ERP总成价格对比
- ///
- /// 上传的文件(前端已经限制只能上传一个附件)
- ///
- [HttpGet]
- [Route("BomDiffPrice-Make")]
- [DisableRequestSizeLimit]
- [Authorize(SettleAccountPermissions.PriceLists.Default)]
-
- public async Task SettledPartAndErpPartPriceDiffMake(string version, string customerCode)
- {
-
- List customConditionList = new List();
-
- customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" });
- customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
- customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode) ? string.Empty : customerCode });
-
- var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
- {
-
- });
- return _taskid;
- }
-
- [HttpPost]
- [Route("job/list")]
- [Authorize(SettleAccountPermissions.PriceLists.Default)]
- [UnitOfWork(false)]
- virtual public async Task> GetListAsync(JobRequestDto input)
- {
- return await _service.GetListAsync(input);
- }
-
- ///
- /// 按ID获取唯一实体
- ///
- ///
- /// 返回实体全部属性
- ///
- /// ID
- /// 实体DTO
-
- [HttpGet]
- [Route("{id}")]
- /// [Authorize(SettleAccountPermissions.PriceLists.Default)]
- virtual public async Task GetAsync(Guid id)
- {
- var result = await _priceListManager.GetAsync(id); ;
- var dto = ObjectMapper.Map(result);
- return dto;
-
- }
-
-
-
-
-
- ///
- /// 根据筛选条件获取实体列表
- ///
- ///
- /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
- ///
- /// 请求条件
- /// 实体DTO列表
- [HttpPost]
- [Route("versionlist")]
- // [Authorize(SettleAccountPermissions.PriceLists.Default)]
- virtual public async Task> GetVersionListAsync(PriceListRequestDto input)
- {
-
-
- var entities = await _priceListManager.GetVersionListAsync(input.Filters, input.Sorting, input.MaxResultCount,input.SkipCount);
- var totalCount = await GetCountAsync(input);
- var dtos = ObjectMapper.Map, List>(entities);
- return new PagedResultDto(totalCount, dtos);
- }
-
-
-
-
- ///
- /// 获取实体总数
- ///
- /// 实体总数
- [HttpGet]
- [Route("count")]
- //[Authorize(SettleAccountPermissions.PriceLists.Default)]
- virtual public async Task GetTotalCountAsync(Guid branchId)
- {
- return await _priceListManager.GetCountAsync(new List(), branchId);
- }
- ///
- /// 获取全部实体列表
- ///
- /// 实体DTO列表
- [HttpGet]
- [Route("all")]
- //[Authorize(SettleAccountPermissions.PriceLists.Default)]
- virtual public async Task> GetAllAsync(Guid branchId)
- {
- var entities = await _priceListManager.GetAllAsync(branchId);
- var dtos = ObjectMapper.Map, List>(entities);
- return new ListResultDto(dtos);
- }
-
- ///
- /// 修改实体
- ///
- /// ID
- /// 修改实体DTO
- /// 实体DTO
- [HttpPut]
- [Route("{id}")]
- [Authorize(SettleAccountPermissions.PriceLists.Update)]
- virtual public async Task UpdateAsync(Guid id, PriceListDto input)
- {
- var entity = new PriceList(
+ #region 原方法(废弃)
+ // ///
+ // /// 获取总数
+ // ///
+ // private async Task GetCountAsync(PriceListRequestDto input)
+ // {
+ // return await _priceListManager.GetCountAsync(input.Filters, GuidGenerator.Create());
+ // }
- );
- var _ent = await _priceListManager.UpdateAsync(id, entity);
+ // ///
+ // /// 结算总成和ERP总成价格对比
+ // ///
+ // /// 上传的文件(前端已经限制只能上传一个附件)
+ // ///
+ // [HttpGet]
+ // [Route("BomDiffPrice-Make")]
+ // [DisableRequestSizeLimit]
+ // [Authorize(SettleAccountPermissions.PriceLists.Default)]
+
+ // public async Task SettledPartAndErpPartPriceDiffMake(string version, string customerCode)
+ // {
+ // List customConditionList = new List();
- var dto = ObjectMapper.Map(_ent);
- return dto;
- }
+ // customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" });
+ // customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
+ // customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode) ? string.Empty : customerCode });
+
+ // var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
+ // {
+
+ // });
+ // return _taskid;
+ // }
+
+ // [HttpPost]
+ // [Route("job/list")]
+ // [Authorize(SettleAccountPermissions.PriceLists.Default)]
+ // [UnitOfWork(false)]
+ // virtual public async Task> GetListAsync(JobRequestDto input)
+ // {
+ // return await _service.GetListAsync(input);
+ // }
+
+ // ///
+ // /// 按ID获取唯一实体
+ // ///
+ // ///
+ // /// 返回实体全部属性
+ // ///
+ // /// ID
+ // /// 实体DTO
+
+ // [HttpGet]
+ // [Route("{id}")]
+ // /// [Authorize(SettleAccountPermissions.PriceLists.Default)]
+ // virtual public async Task GetAsync(Guid id)
+ // {
+ // var result = await _priceListManager.GetAsync(id); ;
+ // var dto = ObjectMapper.Map(result);
+ // return dto;
+
+ // }
+
+
+
+
+
+ // ///
+ // /// 根据筛选条件获取实体列表
+ // ///
+ // ///
+ // /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
+ // ///
+ // /// 请求条件
+ // /// 实体DTO列表
+ // [HttpPost]
+ // [Route("versionlist")]
+ //// [Authorize(SettleAccountPermissions.PriceLists.Default)]
+ // virtual public async Task> GetVersionListAsync(PriceListRequestDto input)
+ // {
+
+
+ // var entities = await _priceListManager.GetVersionListAsync(input.Filters, input.Sorting, input.MaxResultCount,input.SkipCount);
+ // var totalCount = await GetCountAsync(input);
+ // var dtos = ObjectMapper.Map, List>(entities);
+ // return new PagedResultDto(totalCount, dtos);
+ // }
+
+
+
+
+
+
+ // ///
+ // /// 获取实体总数
+ // ///
+ // /// 实体总数
+ // [HttpGet]
+ // [Route("count")]
+ // //[Authorize(SettleAccountPermissions.PriceLists.Default)]
+ // virtual public async Task GetTotalCountAsync(Guid branchId)
+ // {
+ // return await _priceListManager.GetCountAsync(new List(), branchId);
+ // }
+
+ // ///
+ // /// 获取全部实体列表
+ // ///
+ // /// 实体DTO列表
+ // [HttpGet]
+ // [Route("all")]
+ // //[Authorize(SettleAccountPermissions.PriceLists.Default)]
+ // virtual public async Task> GetAllAsync(Guid branchId)
+ // {
+ // var entities = await _priceListManager.GetAllAsync(branchId);
+ // var dtos = ObjectMapper.Map, List>(entities);
+ // return new ListResultDto(dtos);
+ // }
+
+
+ // ///
+ // /// 修改实体
+ // ///
+ // /// ID
+ // /// 修改实体DTO
+ // /// 实体DTO
+ // [HttpPut]
+ // [Route("{id}")]
+ // [Authorize(SettleAccountPermissions.PriceLists.Update)]
+ // virtual public async Task UpdateAsync(Guid id, PriceListDto input)
+ // {
+ // var entity = new PriceList(
+
+ // );
+
+ // var _ent = await _priceListManager.UpdateAsync(id, entity);
+
+
+ // var dto = ObjectMapper.Map(_ent);
+ // return dto;
+ // }
+ #endregion
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
index 17de68ad..e6a307ba 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
@@ -1,14 +1,18 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Shouldly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Caching;
+using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
-using Win.Sfs.SettleAccount.Bases;
+using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
-using Win.Sfs.SettleAccount.Entities.ImportMap;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.RepositoryBase;
@@ -17,29 +21,24 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
///
/// 备件价格
///
- //[Authorize(SettleAccountPermissions.PriceLists.Default)]
[AllowAnonymous]
- [Route("api/SettleAccount/PriceListBJ")]
- public class PriceListAppServiceBJ : CurdBaseAppService
+ [Route("api/settleaccount/[controller]/[action]")]
+ public class PriceListAppServiceBJ : SettleAccountApplicationBase
{
private readonly INormalEfCoreRepository _repository;
private readonly PriceListManagerBJ _priceListManagerBJ;
- private readonly IExcelImportAppService _excelImportService;
- private readonly ISettleAccountBranchEfCoreRepository _mapRepository;
public PriceListAppServiceBJ(
INormalEfCoreRepository repository,
PriceListManagerBJ priceListManagerBJ,
+ IDistributedCache cache,
IExcelImportAppService excelImportService,
- ISettleAccountBranchEfCoreRepository mapRepository
-
- ) :base(repository: repository, excelImportService: excelImportService)
+ ISnowflakeIdGenerator snowflakeIdGenerator,
+ ICommonManager commonManager
+ ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_repository = repository;
_priceListManagerBJ = priceListManagerBJ;
- _excelImportService = excelImportService;
-
- _mapRepository = mapRepository;
}
#region 导入、导出
@@ -47,8 +46,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导入
///
[HttpPost]
- [Route("Import")]
- public override async Task ImportAsync([FromForm] IFormFileCollection files, string version)
+ public async Task ImportAsync([FromForm] IFormFileCollection files, string version)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
@@ -68,6 +66,38 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
await _priceListManagerBJ.ImportAsync(_ls.ToList(), version);
return ApplicationConsts.SuccessStr;
}
+
+ ///
+ /// 导出
+ ///
+ [HttpPost]
+ public async Task ExportAsync(RequestDto input)
+ {
+ string fileName = $"备件价格_{Guid.NewGuid()}.xlsx";
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExcelExporter(dtos);
+ result.ShouldNotBeNull();
+
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
+ return fileName;
+ }
+ #endregion
+
+ #region CURD
+ ///
+ /// 获取列表
+ ///
+ [HttpGet]
+ public async Task> GetListAsync(RequestDto input)
+ {
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
+ var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
+ }
#endregion
#region 原有的方法之后废弃删除
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs
index 2fe00504..839dd426 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs
@@ -36,6 +36,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch
///
/// 总成与结算件关系
///
+ [ApiExplorerSettings(IgnoreApi = true)]
[AllowAnonymous]
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs
index 0d087b65..ef9458f1 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs
@@ -51,6 +51,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
///
/// 大众准时化结算明细导入-R3已结
///
+ [ApiExplorerSettings(IgnoreApi = true)]
[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/SettleAccount")]
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettlementParts/SettlementPartAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettlementParts/SettlementPartAppService.cs
index 57ff7cee..08435e55 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettlementParts/SettlementPartAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettlementParts/SettlementPartAppService.cs
@@ -40,6 +40,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts
///
//[Authorize(SettleAccountPermissions.SettlementParts.Default)]
//[AllowAnonymous]
+ [ApiExplorerSettings(IgnoreApi = true)]
[Route("api/settleaccount/SettlementPart")]
public class SettlementPartAppService : SettleAccountApplicationBase, ISettlementPartAppService
{
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs
index 3a4aec7d..3e588d04 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs
@@ -29,6 +29,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
///
/// 红旗主机场明细导入
///
+ [ApiExplorerSettings(IgnoreApi = true)]
[Authorize(SettleAccountPermissions.HQ_HPlatform.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/UnHQSettle")]
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
index d118845d..2cd48043 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
@@ -6,7 +6,7 @@
net5.0
Win.Sfs.SettleAccount
false
- False
+ True
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
index 55f77c1b..2fd169f7 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
@@ -54,6 +54,8 @@ using Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts;
using Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput;
using Win.Sfs.SettleAccount.Errors;
using Win.Sfs.SettleAccount.Entities.Errors;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+using SettleAccount.Domain.BQ;
namespace Win.Sfs.SettleAccount
{
@@ -132,6 +134,12 @@ namespace Win.Sfs.SettleAccount
#endregion
+ CreateMapPURCHASE_PRICE();
+ CreateMapTB_RePartsRelationship();
+ CreateMapBBAC_SE_DETAIL();
+ CreateMapBBAC_SE_EDI();
+ CreateMapHBPO_SE_DETAIL();
+ CreateMapHBPO_SE_EDI();
}
#region BQ
@@ -630,9 +638,15 @@ namespace Win.Sfs.SettleAccount
CreateMap();
}
+ ///
+ /// 期间设置
+ ///
private void CreateMapCentralizedControl()
{
CreateMap().ReverseMap();
+ CreateMap();
+
+
CreateMap();
CreateMap();
@@ -728,5 +742,62 @@ namespace Win.Sfs.SettleAccount
}
#endregion
+
+ ///
+ /// 采购价格单
+ ///
+ private void CreateMapPURCHASE_PRICE()
+ {
+ CreateMap();
+ CreateMap();
+ CreateMap();
+ }
+
+ ///
+ /// 客户替换件关系
+ ///
+ private void CreateMapTB_RePartsRelationship()
+ {
+ CreateMap();
+ CreateMap();
+ CreateMap();
+ }
+
+ ///
+ /// BBAC发运单
+ ///
+ private void CreateMapBBAC_SE_DETAIL()
+ {
+ CreateMap();
+ CreateMap();
+ }
+
+ ///
+ /// BBAC EDI
+ ///
+ private void CreateMapBBAC_SE_EDI()
+ {
+ CreateMap();
+ CreateMap();
+ }
+
+ ///
+ /// HBPO发运单
+ ///
+ private void CreateMapHBPO_SE_DETAIL()
+ {
+ CreateMap();
+ CreateMap();
+ }
+
+ ///
+ /// HBPO EDI
+ ///
+ private void CreateMapHBPO_SE_EDI()
+ {
+ //CreateMap();
+ //CreateMap();
+ }
+
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PURCHASE_PRICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PURCHASE_PRICE.cs
index 03638929..c5f01d9e 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PURCHASE_PRICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PURCHASE_PRICE.cs
@@ -1,11 +1,33 @@
-using System.ComponentModel.DataAnnotations;
-
-
+using System;
+using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Domain.Entities.Auditing;
namespace SettleAccount.Domain.BQ;
+///
+/// 采购价格单
+///
[Display(Name = "采购价格单")]
-
-public class PURCHASE_PRICE
+public class PURCHASE_PRICE : FullAuditedAggregateRoot
{
+ ///
+ /// 物料号
+ ///
+ [Display(Name = "物料号")]
+ public string LU { get; set; }
+
+ ///
+ /// 价格
+ ///
+ [Display(Name = "价格")]
+ public decimal Price { get; set; }
+
+ ///
+ /// 更新
+ ///
+ public void Update(decimal price)
+ {
+ Price = price;
+ }
+
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs
index 53e58ea5..42388ae4 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs
@@ -1,12 +1,12 @@
-using System.ComponentModel.DataAnnotations;
-
-
+using System;
+using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Domain.Entities.Auditing;
namespace SettleAccount.Domain.BQ;
[Display(Name = "客户替换件关系")]
-public class TB_RePartsRelationship
+public class TB_RePartsRelationship : FullAuditedAggregateRoot
{
///
/// 取值字段【零件号】
@@ -32,4 +32,13 @@ public class TB_RePartsRelationship
ClientCode = clientCode;
BusinessType = businessType;
}
+
+ public void Update(string lU, string repLU, string clientCode, string businessType)
+ {
+ LU = lU;
+ RepLU = repLU;
+ ClientCode = clientCode;
+ BusinessType = businessType;
+ }
+
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Controls/CentralizedControl.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Controls/CentralizedControl.cs
index ad3f3fa7..27dc7461 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Controls/CentralizedControl.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Controls/CentralizedControl.cs
@@ -1,12 +1,11 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.Controls
{
+ ///
+ /// 期间设置
+ ///
public class CentralizedControl: FullAuditedAggregateRootBase
{
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs
index 4120b314..30ee7f0a 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs
@@ -1,24 +1,39 @@
using System;
-using System.ComponentModel.DataAnnotations;
using Win.Sfs.Shared.DomainBase;
-
-using Win.Sfs.Shared.Constant;
namespace Win.Sfs.SettleAccount.MaterialRelationships
{
///
- /// 物料关系
+ /// 客户零件关系
///
public class MaterialRelationship : FullAuditedAggregateRootBase
{
///
- /// ERP物料号
+ /// 厂内物料号
///
public string ErpMaterialCode { get; set; }
+
///
- /// 物料描述
+ /// 厂内物料描述
///
public string MaterialDesc { get; set; }
+
+ ///
+ /// 客户物料号
+ ///
+ public string SettleMaterialCode { get; set; }
+
+
+
+
+
+
+
+
+
+
+
+
///
/// 物料属性
///
@@ -27,10 +42,10 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships
- ///
- /// 结算物料号
- ///
- public string SettleMaterialCode { get; set; }
+ /////
+ ///// 结算物料号
+ /////
+ //public string SettleMaterialCode { get; set; }
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
index 38de8a70..c61aa067 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
@@ -80,7 +80,10 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureBomVersion(options);
//期间
builder.ConfigureCentralizedControl(options);
-
+ //采购价格单
+ builder.ConfigurePURCHASE_PRICE(options);
+ //客户替换件关系
+ builder.ConfigureTB_RePartsRelationship(options);
#endregion
@@ -322,21 +325,46 @@ namespace Win.Sfs.SettleAccount
});
}
+
+ ///
+ /// 采购价格单
+ ///
+ private static void ConfigurePURCHASE_PRICE(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
+ {
+ builder.Entity(b =>
+ {
+ b.ToTable($"{options.TablePrefix}_PURCHASE_PRICE", options.Schema);
+ b.ConfigureByConvention();
+ });
+ }
+
+
+ ///
+ /// 客户替换件关系
+ ///
+ private static void ConfigureTB_RePartsRelationship(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
+ {
+ builder.Entity(b =>
+ {
+ b.ToTable($"{options.TablePrefix}_TB_RePartsRelationship", options.Schema);
+ b.ConfigureByConvention();
+ });
+ }
#endregion
-
+
#region 北汽
-
-
+
+
///
/// 一汽轿车平台验收结算明细-导入
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711073528_20230711-2.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711073528_20230711-2.Designer.cs
new file mode 100644
index 00000000..22b91f7b
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711073528_20230711-2.Designer.cs
@@ -0,0 +1,3807 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.Abp.EntityFrameworkCore;
+using Win.Sfs.SettleAccount;
+
+namespace Win.Sfs.SettleAccount.Migrations
+{
+ [DbContext(typeof(SettleAccountDbContext))]
+ [Migration("20230711073528_20230711-2")]
+ partial class _202307112
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
+ .HasAnnotation("Relational:MaxIdentifierLength", 128)
+ .HasAnnotation("ProductVersion", "5.0.8")
+ .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Category")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_NOT_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Category")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property