Skip to content

Commit

Permalink
Add customer member supplier support english
Browse files Browse the repository at this point in the history
  • Loading branch information
Jzow committed Aug 1, 2024
1 parent 6db4d41 commit 0d556ff
Show file tree
Hide file tree
Showing 30 changed files with 968 additions and 319 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ public Response<String> update(@RequestBody UpdateUserDTO updateUserDTO) {
return userService.updateUser(updateUserDTO);
}

@PostMapping(value = "updateStatus")
public Response<String> updateStatus(@RequestBody UpdateUserDTO updateUserDTO) {
return userService.updateStatus(updateUserDTO);
}

@PostMapping("uploadAvatar")
public Response<String> uploadAvatar(@RequestParam("file") MultipartFile file, @RequestParam("userId") Long userId, @RequestParam("name") String name) {
return userService.uploadAvatar(file, userId, name);
Expand Down
18 changes: 0 additions & 18 deletions core/domain/src/main/kotlin/com/wansenai/vo/basic/CustomerVO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import com.wansenai.NoArg
import com.wansenai.bo.BigDecimalSerializerBO
import com.wansenai.utils.excel.ExcelExport
import java.math.BigDecimal
import java.time.LocalDateTime

Expand All @@ -26,61 +25,44 @@ data class CustomerVO (
@JsonFormat(shape = JsonFormat.Shape.STRING)
var id: Long?,

@ExcelExport(value = "客户", sort = 1)
var customerName: String?,

@ExcelExport(value = "联系人", sort = 2)
var contact: String?,

@ExcelExport(value = "手机号码", sort = 3)
var phoneNumber: String?,

@ExcelExport(value = "电子邮箱", sort = 4)
var email: String?,

@ExcelExport(value = "传真", sort = 5)
var fax: String?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "一季度收款", sort = 8)
var firstQuarterAccountReceivable: BigDecimal?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "二季度收款", sort = 9)
var secondQuarterAccountReceivable: BigDecimal?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "三季度收款", sort = 10)
var thirdQuarterAccountReceivable: BigDecimal?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "四季度收款", sort = 11)
var fourthQuarterAccountReceivable: BigDecimal?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "累计应收账款", sort = 12)
var totalAccountReceivable: BigDecimal?,

@ExcelExport(value = "地址", sort = 6)
var address: String?,

@ExcelExport(value = "纳税人识别号", sort = 13)
var taxNumber: String?,

@ExcelExport(value = "开户行", sort = 15)
var bankName: String?,

@ExcelExport(value = "银行账户", sort = 16)
var accountNumber: String?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "税率(%)", sort = 14)
var taxRate: BigDecimal?,

@ExcelExport(value = "状态", kv="0-启用;1-停用", sort = 7)
var status: Int?,

@ExcelExport(value = "备注", sort = 17)
var remark: String?,

var sort: Int?,
Expand Down
8 changes: 0 additions & 8 deletions core/domain/src/main/kotlin/com/wansenai/vo/basic/MemberVO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import com.wansenai.NoArg
import com.wansenai.bo.BigDecimalSerializerBO
import com.wansenai.utils.excel.ExcelExport
import java.math.BigDecimal
import java.time.LocalDateTime

Expand All @@ -26,26 +25,19 @@ data class MemberVO(
@JsonFormat(shape = JsonFormat.Shape.STRING)
var id: Long?,

@ExcelExport(value = "会原卡号", sort = 1)
var memberNumber: String?,

@ExcelExport(value = "会员名称", sort = 2)
var memberName: String?,

@ExcelExport(value = "手机号码", sort = 3)
var phoneNumber: String?,

@ExcelExport(value = "电子邮箱", sort = 4)
var email: String?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "预付款", sort = 5)
var advancePayment: BigDecimal?,

@ExcelExport(value = "状态", kv="0-启用;1-停用", sort = 6)
var status: Int?,

@ExcelExport(value = "备注", sort = 7)
var remark: String?,

var sort: Int?,
Expand Down
20 changes: 0 additions & 20 deletions core/domain/src/main/kotlin/com/wansenai/vo/basic/SupplierVO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import com.wansenai.NoArg
import com.wansenai.bo.BigDecimalSerializerBO
import com.wansenai.utils.excel.ExcelExport

import java.math.BigDecimal
import java.time.LocalDateTime
Expand All @@ -27,67 +26,48 @@ data class SupplierVO (
@JsonFormat(shape = JsonFormat.Shape.STRING)
var id: Long,

@ExcelExport(value = "供应商名称*", sort = 1)
var supplierName: String,

@ExcelExport(value = "联系人*", sort = 2)
var contact: String?,

@ExcelExport(value = "联系电话", sort = 4)
var contactNumber: String?,

@ExcelExport(value = "手机号码*", sort = 3)
var phoneNumber: String?,

@ExcelExport(value = "", sort = 22)
var address: String?,

@ExcelExport(value = "电子邮箱", sort = 5)
var email: String?,

@ExcelExport(value = "状态", kv="0-启用;1-停用", sort = 7)
var status: Int,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "一季度付款", sort = 12)
var firstQuarterAccountPayment: BigDecimal?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "二季度付款", sort = 13)
var secondQuarterAccountPayment: BigDecimal?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "三季度付款", sort = 14)
var thirdQuarterAccountPayment: BigDecimal?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "四季度付款", sort = 15)
var fourthQuarterAccountPayment: BigDecimal?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "累计应付账款", sort = 16)
var totalAccountPayment: BigDecimal?,

@ExcelExport(value = "传真", sort = 6)
var fax: String?,

@ExcelExport(value = "纳税人识别号", sort = 17)
var taxNumber: String?,

@ExcelExport(value = "开户行", sort = 19)
var bankName: String?,

@ExcelExport(value = "账号", sort = 20)
var accountNumber: String?,

@JsonSerialize(using = BigDecimalSerializerBO::class)
@ExcelExport(value = "税率(%)", sort = 18)
var taxRate: BigDecimal?,

@ExcelExport(value = "排序", sort = 21)
var sort: Int?,

@ExcelExport(value = "备注", sort = 23)
var remark: String?,

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public Response<String> addOrUpdateIncomeExpense(AddOrUpdateIncomeExpenseDTO add
return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL);
}
var operator = userService.getCurrentUserId();

var systemLanguage = userService.getUserSystemLanguage(userService.getCurrentUserId());
if (addOrUpdateIncomeExpenseDTO.getId() == null) {
var incomeExpense = IncomeExpense.builder()
.name(addOrUpdateIncomeExpenseDTO.getName())
Expand All @@ -104,10 +104,16 @@ public Response<String> addOrUpdateIncomeExpense(AddOrUpdateIncomeExpenseDTO add
.build();
var saveResult = save(incomeExpense);
if (!saveResult) {
return Response.responseMsg(IncomeExpenseCodeEnum.ADD_INCOME_EXPENSE_ERROR);
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(IncomeExpenseCodeEnum.ADD_INCOME_EXPENSE_ERROR);
}
return Response.responseMsg(IncomeExpenseCodeEnum.ADD_INCOME_EXPENSE_ERROR_EN);
} else {
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(IncomeExpenseCodeEnum.ADD_INCOME_EXPENSE_SUCCESS);
}
return Response.responseMsg(IncomeExpenseCodeEnum.ADD_INCOME_EXPENSE_SUCCESS_EN);
}
return Response.responseMsg(IncomeExpenseCodeEnum.ADD_INCOME_EXPENSE_SUCCESS);

} else {
var incomeExpense = IncomeExpense.builder()
.id(addOrUpdateIncomeExpenseDTO.getId())
Expand All @@ -121,9 +127,16 @@ public Response<String> addOrUpdateIncomeExpense(AddOrUpdateIncomeExpenseDTO add
.build();
var updateResult = updateById(incomeExpense);
if (!updateResult) {
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_ERROR);
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_ERROR);
}
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_ERROR_EN);
} else {
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_SUCCESS);
}
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_SUCCESS_EN);
}
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_SUCCESS);
}
}

Expand All @@ -132,12 +145,19 @@ public Response<String> deleteBatchIncomeExpense(List<Long> ids) {
if (ids == null || ids.isEmpty()) {
return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL);
}

var deleteResult = incomeExpenseMapper.deleteBatchIds(ids);
var systemLanguage = userService.getUserSystemLanguage(userService.getCurrentUserId());
if (deleteResult <= 0) {
return Response.responseMsg(IncomeExpenseCodeEnum.DELETE_INCOME_EXPENSE_ERROR);
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(IncomeExpenseCodeEnum.DELETE_INCOME_EXPENSE_ERROR);
}
return Response.responseMsg(IncomeExpenseCodeEnum.DELETE_INCOME_EXPENSE_ERROR_EN);
} else {
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(IncomeExpenseCodeEnum.DELETE_INCOME_EXPENSE_SUCCESS);
}
return Response.responseMsg(IncomeExpenseCodeEnum.DELETE_INCOME_EXPENSE_SUCCESS_EN);
}
return Response.responseMsg(IncomeExpenseCodeEnum.DELETE_INCOME_EXPENSE_SUCCESS);
}

@Override
Expand All @@ -149,10 +169,18 @@ public Response<String> updateIncomeExpenseStatus(List<Long> ids, Integer status
.in(IncomeExpense::getId, ids)
.set(IncomeExpense::getStatus, status)
.update();
var systemLanguage = userService.getUserSystemLanguage(userService.getCurrentUserId());
if (!updateResult) {
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_ERROR);
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_ERROR);
}
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_ERROR_EN);
} else {
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_SUCCESS);
}
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_SUCCESS_EN);
}
return Response.responseMsg(IncomeExpenseCodeEnum.UPDATE_INCOME_EXPENSE_SUCCESS);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public Response<Page<OperatorVO>> getOperatorPageList(QueryOperatorDTO queryOper
@Override
public Response<String> addOrUpdateOperator(AddOrUpdateOperatorDTO addOrUpdateOperatorDTO) {
var operateId = baseService.getCurrentUserId();
var systemLanguage = baseService.getCurrentUserSystemLanguage();
if (addOrUpdateOperatorDTO.getId() == null) {
var operator = new Operator();
BeanUtils.copyProperties(addOrUpdateOperatorDTO, operator);
Expand All @@ -85,19 +86,33 @@ public Response<String> addOrUpdateOperator(AddOrUpdateOperatorDTO addOrUpdateOp
operator.setCreateTime(LocalDateTime.now());
var saveResult = operatorMapper.insert(operator);
if(saveResult == 0) {
return Response.responseMsg(OperatorCodeEnum.ADD_OPERATOR_ERROR);
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(OperatorCodeEnum.ADD_OPERATOR_ERROR);
}
return Response.responseMsg(OperatorCodeEnum.ADD_OPERATOR_ERROR_EN);
} else {
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(OperatorCodeEnum.ADD_OPERATOR_SUCCESS);
}
return Response.responseMsg(OperatorCodeEnum.ADD_OPERATOR_SUCCESS_EN);
}
return Response.responseMsg(OperatorCodeEnum.ADD_OPERATOR_SUCCESS);
} else {
var operator = new Operator();
BeanUtils.copyProperties(addOrUpdateOperatorDTO, operator);
operator.setUpdateBy(operateId);
operator.setUpdateTime(LocalDateTime.now());
var updateResult = operatorMapper.updateById(operator);
if(updateResult == 0) {
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_ERROR);
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_ERROR);
}
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_ERROR_EN);
} else {
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_SUCCESS);
}
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_SUCCESS_EN);
}
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_SUCCESS);
}
}

Expand All @@ -108,10 +123,18 @@ public Response<String> deleteBatchOperator(List<Long> ids) {
return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL);
}
var deleteResult = removeBatchByIds(ids);
var systemLanguage = baseService.getCurrentUserSystemLanguage();
if(!deleteResult) {
return Response.responseMsg(OperatorCodeEnum.DELETE_OPERATOR_ERROR);
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(OperatorCodeEnum.DELETE_OPERATOR_ERROR);
}
return Response.responseMsg(OperatorCodeEnum.DELETE_OPERATOR_ERROR_EN);
} else {
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(OperatorCodeEnum.DELETE_OPERATOR_SUCCESS);
}
return Response.responseMsg(OperatorCodeEnum.DELETE_OPERATOR_SUCCESS_EN);
}
return Response.responseMsg(OperatorCodeEnum.DELETE_OPERATOR_SUCCESS);
}

@Override
Expand All @@ -125,11 +148,18 @@ public Response<String> updateOperatorStatus(List<Long> ids, Integer status) {
.set(Operator::getStatus, status)
.update();

var systemLanguage = baseService.getCurrentUserSystemLanguage();
if(!updateStatus) {
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_STATUS_ERROR);
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_STATUS_ERROR);
}
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_STATUS_ERROR_EN);
} else {
if ("zh_CN".equals(systemLanguage)) {
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_STATUS_SUCCESS);
}
return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_STATUS_SUCCESS_EN);
}

return Response.responseMsg(OperatorCodeEnum.UPDATE_OPERATOR_STATUS_SUCCESS);
}

@Override
Expand Down
Loading

0 comments on commit 0d556ff

Please sign in to comment.