Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all backend api that return results #242

Merged
merged 17 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
693f5ca
fix: update basic module return response correct code #236
Jzow Nov 29, 2023
ced1646
fix: update financial module return response correct code #236
Jzow Nov 29, 2023
ff4c20a
fix: update product module return response correct code #236
Jzow Nov 29, 2023
24a5cdb
fix: update purchase module return response correct code #236
Jzow Nov 29, 2023
f901557
fix: update retail module return response correct code #236
Jzow Nov 29, 2023
f7fe625
fix: update sale module return response correct code #236
Jzow Nov 29, 2023
ec62a7f
fix: update system module return response correct code #236
Jzow Nov 29, 2023
942f380
fix: update warehouse module return response correct code #236
Jzow Nov 29, 2023
78ac285
fix: remove the message from the view code of the sale module #236
Jzow Nov 29, 2023
9f87790
fix: remove the message from the view code of the retail module #236
Jzow Nov 29, 2023
610cd33
fix: remove the message from the view code of the purchase module #236
Jzow Nov 29, 2023
250c771
fix: remove the message from the view code of the product module #236
Jzow Nov 29, 2023
9eab867
fix: remove the message from the view code of the financial module #236
Jzow Nov 29, 2023
6db9174
fix: remove the message from the view code of the warehouse module #236
Jzow Nov 29, 2023
8055a75
fix: update validCodes add api return correct code #236
Jzow Nov 29, 2023
ffa39a5
fix: fix bug of toAdvanceChargeVO method collectedAmount npe error
Jzow Nov 29, 2023
b1f9f27
fix: update code enum content
Jzow Nov 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import lombok.extern.slf4j.Slf4j
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Propagation
import org.springframework.transaction.annotation.Transactional
import java.math.BigDecimal
import java.time.LocalDateTime

@Service
Expand Down Expand Up @@ -172,6 +173,7 @@ open class AdvanceChargeServiceImpl(
advanceChargeDTO?.remark?.let { like(FinancialMain::getRemark, it) }
advanceChargeDTO?.startDate?.let { ge(FinancialMain::getCreateTime, it) }
advanceChargeDTO?.endDate?.let { le(FinancialMain::getCreateTime, it) }
eq(FinancialMain::getType, "收预付款")
eq(FinancialMain::getDeleteFlag, CommonConstants.NOT_DELETED)
}

Expand All @@ -198,7 +200,7 @@ open class AdvanceChargeServiceImpl(
financialPersonnel = financialPerson?.name ?: "",
memberName = member?.memberName,
totalAmount = this.totalAmount,
collectedAmount = this.changeAmount,
collectedAmount = this.changeAmount ?: BigDecimal.ZERO,
status = this.status,
remark = this.remark
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public enum FinancialCodeEnum {

DELETE_ACCOUNT_ERROR("F0502", "删除账户失败"),

UPDATE_ACCOUNT_STATUS_SUCCESS("F0004", "修改账号状态成功"),
UPDATE_ACCOUNT_STATUS_SUCCESS("F0004", "账户状态修改成功"),

UPDATE_ACCOUNT_STATUS_ERROR("F0503", "修改账号状态失败"),
UPDATE_ACCOUNT_STATUS_ERROR("F0503", "账户状态修改失败"),

ADD_ADVANCE_SUCCESS("F0005", "新增预收款成功"),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ package com.wansenai.utils.enums
*/
enum class CustomerCodeEnum(val code: String, val msg: String) {

ADD_CUSTOMER_SUCCESS("U0001", "供应商添加成功"),
ADD_CUSTOMER_ERROR("U0500", "供应商添加失败"),
ADD_CUSTOMER_SUCCESS("U0001", "客户添加成功"),
ADD_CUSTOMER_ERROR("U0500", "客户添加失败"),

UPDATE_CUSTOMER_SUCCESS("U0002", "供应商修改成功"),
UPDATE_CUSTOMER_ERROR("U0501", "供应商修改失败"),
UPDATE_CUSTOMER_SUCCESS("U0002", "客户资料修改成功"),
UPDATE_CUSTOMER_ERROR("U0501", "客户资料修改失败"),

DELETE_CUSTOMER_SUCCESS("U0003", "供应商删除成功"),
DELETE_CUSTOMER_ERROR("U0504", "供应商删除失败"),
DELETE_CUSTOMER_SUCCESS("U0003", "客户删除成功"),
DELETE_CUSTOMER_ERROR("U0504", "客户删除失败"),

UPDATE_CUSTOMER_STATUS_SUCCESS("U0004", "供应商状态修改成功"),
UPDATE_CUSTOMER_STATUS_ERROR("U0505", "供应商状态修改失败")
UPDATE_CUSTOMER_STATUS_SUCCESS("U0004", "客户状态修改成功"),
UPDATE_CUSTOMER_STATUS_ERROR("U0505", "客户状态修改失败")
}
32 changes: 16 additions & 16 deletions web/src/api/basic/common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defHttp} from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
import {ErrorMessageMode, SuccessMessageMode} from '/#/axios';
import {BaseDataResp, BaseResp} from "@/api/model/baseModel";
import {ContentTypeEnum} from "@/enums/httpEnum";

Expand All @@ -15,7 +15,7 @@ export interface UploadFileParams {
file: File;
}

export function uploadXlsx(params: UploadFileParams, mode: ErrorMessageMode = 'notice') {
export function uploadXlsx(params: UploadFileParams, successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.post<BaseResp>(
{
url: Api.UploadXlsx,
Expand All @@ -25,26 +25,26 @@ export function uploadXlsx(params: UploadFileParams, mode: ErrorMessageMode = 'n
// @ts-ignore
ignoreCancelToken: true,
},
},
{
errorMessageMode: mode,
},
},{
successMessageMode: successMode,
errorMessageMode: errorMode,
}
);
}

export function exportXlsx(type: string, mode: ErrorMessageMode = 'notice') {
export function exportXlsx(type: string, successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.get<BaseDataResp<Blob>>(
{
url: `${Api.ExportXlsx}?type=${type}`,
responseType: "blob"
},
{
errorMessageMode: mode,
},
},{
successMessageMode: successMode,
errorMessageMode: errorMode,
}
);
}

export function uploadOss(params: UploadFileParams, mode: ErrorMessageMode = 'notice') {
export function uploadOss(params: UploadFileParams, successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.post<BaseResp>(
{
url: Api.UploadOss,
Expand All @@ -54,10 +54,10 @@ export function uploadOss(params: UploadFileParams, mode: ErrorMessageMode = 'no
// @ts-ignore
ignoreCancelToken: true,
},
},
{
errorMessageMode: mode,
},
},{
successMessageMode: successMode,
errorMessageMode: errorMode,
}
);
}

Expand Down
23 changes: 11 additions & 12 deletions web/src/api/basic/customer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defHttp} from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
import {ErrorMessageMode, SuccessMessageMode} from '/#/axios';
import {BaseDataResp, BaseResp} from "@/api/model/baseModel";
import {
CustomerResp,
Expand All @@ -16,16 +16,12 @@ enum API {
UpdateStatus = '/basic/customer/updateStatus',
}

export function getCustomerPageList(params: QueryCustomerReq, mode: ErrorMessageMode = 'notice') {
export function getCustomerPageList(params: QueryCustomerReq) {
return defHttp.post<BaseDataResp<CustomerResp>>(
{
url: API.PageList,
params,
},
{
errorMessageMode: mode,
successMessageMode: mode,
},
);
}

Expand All @@ -37,36 +33,39 @@ export function getCustomerList() {
);
}

export function addOrUpdateCustomer(params: AddOrUpdateCustomerReq, mode: ErrorMessageMode = 'notice') {
export function addOrUpdateCustomer(params: AddOrUpdateCustomerReq, successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.post<BaseResp>(
{
url: API.AddOrUpdateCustomer,
params,
},
{
errorMessageMode: mode,
successMessageMode: successMode,
errorMessageMode: errorMode,
},
);
}

export function updateCustomerStatus(ids: number[], status: number, mode: ErrorMessageMode = 'notice') {
export function updateCustomerStatus(ids: number[], status: number, successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.post<BaseResp>(
{
url: `${API.UpdateStatus}?ids=${ids}&status=${status}`
},
{
errorMessageMode: mode,
successMessageMode: successMode,
errorMessageMode: errorMode,
},
);
}

export function deleteBatchCustomer(ids: number[], mode: ErrorMessageMode = 'notice') {
export function deleteBatchCustomer(ids: number[], successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.delete<BaseResp>(
{
url: `${API.DeleteBatch}?ids=${ids}`
},
{
errorMessageMode: mode,
successMessageMode: successMode,
errorMessageMode: errorMode,
},
);
}
25 changes: 13 additions & 12 deletions web/src/api/basic/incomeExpense.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defHttp} from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
import {ErrorMessageMode, SuccessMessageMode} from '/#/axios';
import {BaseDataResp, BaseResp} from "@/api/model/baseModel";
import {
QueryIncomeExpenseReq,
Expand All @@ -15,16 +15,12 @@ enum API {
UpdateStatus = '/basic/incomeExpense/updateStatus',
}

export function getIncomeExpensePageList(params: QueryIncomeExpenseReq, mode: ErrorMessageMode = 'notice') {
export function getIncomeExpensePageList(params: QueryIncomeExpenseReq) {
return defHttp.post<BaseDataResp<IncomeExpenseResp>>(
{
url: API.PageList,
params,
},
{
errorMessageMode: mode,
successMessageMode: mode,
},
}
);
}

Expand All @@ -36,33 +32,38 @@ export function getIncomeExpenseList(type: string) {
);
}

export function addOrUpdateIncomeExpense(params: AddOrUpdateIncomeExpenseReq, mode: ErrorMessageMode = 'notice') {
export function addOrUpdateIncomeExpense(params: AddOrUpdateIncomeExpenseReq, successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.post<BaseResp>(
{
url: API.AddOrUpdateIncomeExpense,
params,
},{
successMessageMode: successMode,
errorMessageMode: errorMode,
}
);
}

export function deleteIncomeExpense(ids: number[], mode: ErrorMessageMode = 'notice') {
export function deleteIncomeExpense(ids: number[], successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.delete<BaseResp>(
{
url: `${API.DeleteBatch}?ids=${ids}`
},
{
errorMessageMode: mode,
successMessageMode: successMode,
errorMessageMode: errorMode,
},
);
}

export function updateIncomeExpenseStatus(ids: number[], status: number, mode: ErrorMessageMode = 'notice') {
export function updateIncomeExpenseStatus(ids: number[], status: number, successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.post<BaseResp>(
{
url: `${API.UpdateStatus}?ids=${ids}&status=${status}`
},
{
errorMessageMode: mode,
successMessageMode: successMode,
errorMessageMode: errorMode,
},
);
}
40 changes: 18 additions & 22 deletions web/src/api/basic/member.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defHttp} from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
import {ErrorMessageMode, SuccessMessageMode} from '/#/axios';
import {BaseDataResp, BaseResp} from "@/api/model/baseModel";
import {
MemberResp,
Expand All @@ -16,50 +16,46 @@ enum API {
UpdateStatus = '/basic/member/updateStatus',
}

export function getMemberPageList(params: QueryMemberReq, mode: ErrorMessageMode = 'notice') {
export function getMemberPageList(params: QueryMemberReq) {
return defHttp.post<BaseDataResp<MemberResp>>(
{
url: API.PageList,
params,
},
{
errorMessageMode: mode,
successMessageMode: mode,
},
}
);
}

export function addOrUpdateMember(params: AddOrUpdateMemberReq, mode: ErrorMessageMode = 'notice') {
export function addOrUpdateMember(params: AddOrUpdateMemberReq, successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.post<BaseResp>(
{
url: API.AddOrUpdateMember,
params,
},
{
errorMessageMode: mode,
},
},{
successMessageMode: successMode,
errorMessageMode: errorMode,
}
);
}

export function updateMemberStatus(ids: number[], status: number, mode: ErrorMessageMode = 'notice') {
export function updateMemberStatus(ids: number[], status: number, successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.post<BaseResp>(
{
url: `${API.UpdateStatus}?ids=${ids}&status=${status}`
},
{
errorMessageMode: mode,
},
},{
successMessageMode: successMode,
errorMessageMode: errorMode,
}
);
}

export function deleteBatchMember(ids: number[], mode: ErrorMessageMode = 'notice') {
export function deleteBatchMember(ids: number[], successMode: SuccessMessageMode = 'notice', errorMode: ErrorMessageMode = 'message') {
return defHttp.delete<BaseResp>(
{
url: `${API.DeleteBatch}?ids=${ids}`
},
{
errorMessageMode: mode,
},
},{
successMessageMode: successMode,
errorMessageMode: errorMode,
}
);
}

Expand Down
Loading