Merge remote-tracking branch 'upstream/develop' into develop
commit
7936e27ea4
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.erp.enums.common;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* ERP 业务类型枚举
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum ErpBizTypeEnum implements IntArrayValuable {
|
||||
|
||||
PURCHASE_ORDER(10, "采购订单"),
|
||||
PURCHASE_IN(11, "采购入库"),
|
||||
PURCHASE_RETURN(12, "采购退货"),
|
||||
|
||||
SALE_ORDER(20, "销售订单"),
|
||||
SALE_OUT(21, "销售订单"),
|
||||
SALE_RETURN(22, "销售退货"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpBizTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.enums.sale;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* ERP 销售订单的状态枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ErpSaleOrderStatusEnum implements IntArrayValuable {
|
||||
|
||||
AUDIT_NONE(0, "未审核"),
|
||||
AUDIT_PASS(10, "已审核"),
|
||||
SALE_PART(20, "部分销售"),
|
||||
SALE_ALL(21, "完成销售"),
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpSaleOrderStatusEnum::getStatus).toArray();
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.finance;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.account.ErpAccountPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.account.ErpAccountRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.account.ErpAccountSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpAccountDO;
|
||||
import cn.iocoder.yudao.module.erp.service.finance.ErpAccountService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - ERP 结算账户")
|
||||
@RestController
|
||||
@RequestMapping("/erp/account")
|
||||
@Validated
|
||||
public class ErpAccountController {
|
||||
|
||||
@Resource
|
||||
private ErpAccountService accountService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建结算账户")
|
||||
@PreAuthorize("@ss.hasPermission('erp:account:create')")
|
||||
public CommonResult<Long> createAccount(@Valid @RequestBody ErpAccountSaveReqVO createReqVO) {
|
||||
return success(accountService.createAccount(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新结算账户")
|
||||
@PreAuthorize("@ss.hasPermission('erp:account:update')")
|
||||
public CommonResult<Boolean> updateAccount(@Valid @RequestBody ErpAccountSaveReqVO updateReqVO) {
|
||||
accountService.updateAccount(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/update-default-status")
|
||||
@Operation(summary = "更新结算账户默认状态")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "编号", required = true),
|
||||
@Parameter(name = "status", description = "状态", required = true)
|
||||
})
|
||||
public CommonResult<Boolean> updateAccountDefaultStatus(@RequestParam("id") Long id,
|
||||
@RequestParam("defaultStatus") Boolean defaultStatus) {
|
||||
accountService.updateAccountDefaultStatus(id, defaultStatus);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除结算账户")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('erp:account:delete')")
|
||||
public CommonResult<Boolean> deleteAccount(@RequestParam("id") Long id) {
|
||||
accountService.deleteAccount(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得结算账户")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('erp:account:query')")
|
||||
public CommonResult<ErpAccountRespVO> getAccount(@RequestParam("id") Long id) {
|
||||
ErpAccountDO account = accountService.getAccount(id);
|
||||
return success(BeanUtils.toBean(account, ErpAccountRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获得结算账户精简列表", description = "只包含被开启的结算账户,主要用于前端的下拉选项")
|
||||
public CommonResult<List<ErpAccountRespVO>> getWarehouseSimpleList() {
|
||||
List<ErpAccountDO> list = accountService.getAccountListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
return success(convertList(list, account -> new ErpAccountRespVO().setId(account.getId())
|
||||
.setName(account.getName()).setDefaultStatus(account.getDefaultStatus())));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得结算账户分页")
|
||||
@PreAuthorize("@ss.hasPermission('erp:account:query')")
|
||||
public CommonResult<PageResult<ErpAccountRespVO>> getAccountPage(@Valid ErpAccountPageReqVO pageReqVO) {
|
||||
PageResult<ErpAccountDO> pageResult = accountService.getAccountPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpAccountRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出结算账户 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('erp:account:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportAccountExcel(@Valid ErpAccountPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpAccountDO> list = accountService.getAccountPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "结算账户.xls", "数据", ErpAccountRespVO.class,
|
||||
BeanUtils.toBean(list, ErpAccountRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.finance;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment.ErpFinancePaymentPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment.ErpFinancePaymentRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment.ErpFinancePaymentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpAccountDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpFinancePaymentDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpFinancePaymentItemDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpSupplierDO;
|
||||
import cn.iocoder.yudao.module.erp.service.finance.ErpAccountService;
|
||||
import cn.iocoder.yudao.module.erp.service.finance.ErpFinancePaymentService;
|
||||
import cn.iocoder.yudao.module.erp.service.purchase.ErpSupplierService;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - ERP 付款单")
|
||||
@RestController
|
||||
@RequestMapping("/erp/finance-payment")
|
||||
@Validated
|
||||
public class ErpFinancePaymentController {
|
||||
|
||||
@Resource
|
||||
private ErpFinancePaymentService financePaymentService;
|
||||
@Resource
|
||||
private ErpSupplierService supplierService;
|
||||
@Resource
|
||||
private ErpAccountService accountService;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建付款单")
|
||||
@PreAuthorize("@ss.hasPermission('erp:finance-payment:create')")
|
||||
public CommonResult<Long> createFinancePayment(@Valid @RequestBody ErpFinancePaymentSaveReqVO createReqVO) {
|
||||
return success(financePaymentService.createFinancePayment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新付款单")
|
||||
@PreAuthorize("@ss.hasPermission('erp:finance-payment:update')")
|
||||
public CommonResult<Boolean> updateFinancePayment(@Valid @RequestBody ErpFinancePaymentSaveReqVO updateReqVO) {
|
||||
financePaymentService.updateFinancePayment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "更新付款单的状态")
|
||||
@PreAuthorize("@ss.hasPermission('erp:finance-payment:update-status')")
|
||||
public CommonResult<Boolean> updateFinancePaymentStatus(@RequestParam("id") Long id,
|
||||
@RequestParam("status") Integer status) {
|
||||
financePaymentService.updateFinancePaymentStatus(id, status);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除付款单")
|
||||
@Parameter(name = "ids", description = "编号数组", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('erp:finance-payment:delete')")
|
||||
public CommonResult<Boolean> deleteFinancePayment(@RequestParam("ids") List<Long> ids) {
|
||||
financePaymentService.deleteFinancePayment(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得付款单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('erp:finance-payment:query')")
|
||||
public CommonResult<ErpFinancePaymentRespVO> getFinancePayment(@RequestParam("id") Long id) {
|
||||
ErpFinancePaymentDO payment = financePaymentService.getFinancePayment(id);
|
||||
if (payment == null) {
|
||||
return success(null);
|
||||
}
|
||||
List<ErpFinancePaymentItemDO> paymentItemList = financePaymentService.getFinancePaymentItemListByPaymentId(id);
|
||||
return success(BeanUtils.toBean(payment, ErpFinancePaymentRespVO.class, financePaymentVO ->
|
||||
financePaymentVO.setItems(BeanUtils.toBean(paymentItemList, ErpFinancePaymentRespVO.Item.class))));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得付款单分页")
|
||||
@PreAuthorize("@ss.hasPermission('erp:finance-payment:query')")
|
||||
public CommonResult<PageResult<ErpFinancePaymentRespVO>> getFinancePaymentPage(@Valid ErpFinancePaymentPageReqVO pageReqVO) {
|
||||
PageResult<ErpFinancePaymentDO> pageResult = financePaymentService.getFinancePaymentPage(pageReqVO);
|
||||
return success(buildFinancePaymentVOPageResult(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出付款单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('erp:finance-payment:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportFinancePaymentExcel(@Valid ErpFinancePaymentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpFinancePaymentRespVO> list = buildFinancePaymentVOPageResult(financePaymentService.getFinancePaymentPage(pageReqVO)).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "付款单.xls", "数据", ErpFinancePaymentRespVO.class, list);
|
||||
}
|
||||
|
||||
private PageResult<ErpFinancePaymentRespVO> buildFinancePaymentVOPageResult(PageResult<ErpFinancePaymentDO> pageResult) {
|
||||
if (CollUtil.isEmpty(pageResult.getList())) {
|
||||
return PageResult.empty(pageResult.getTotal());
|
||||
}
|
||||
// 1.1 付款项
|
||||
List<ErpFinancePaymentItemDO> paymentItemList = financePaymentService.getFinancePaymentItemListByPaymentIds(
|
||||
convertSet(pageResult.getList(), ErpFinancePaymentDO::getId));
|
||||
Map<Long, List<ErpFinancePaymentItemDO>> financePaymentItemMap = convertMultiMap(paymentItemList, ErpFinancePaymentItemDO::getPaymentId);
|
||||
// 1.2 供应商信息
|
||||
Map<Long, ErpSupplierDO> supplierMap = supplierService.getSupplierMap(
|
||||
convertSet(pageResult.getList(), ErpFinancePaymentDO::getSupplierId));
|
||||
// 1.3 结算账户信息
|
||||
Map<Long, ErpAccountDO> accountMap = accountService.getAccountMap(
|
||||
convertSet(pageResult.getList(), ErpFinancePaymentDO::getAccountId));
|
||||
// 1.4 管理员信息
|
||||
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(convertListByFlatMap(pageResult.getList(),
|
||||
contact -> Stream.of(NumberUtils.parseLong(contact.getCreator()), contact.getFinanceUserId())));
|
||||
// 2. 开始拼接
|
||||
return BeanUtils.toBean(pageResult, ErpFinancePaymentRespVO.class, payment -> {
|
||||
payment.setItems(BeanUtils.toBean(financePaymentItemMap.get(payment.getId()), ErpFinancePaymentRespVO.Item.class));
|
||||
MapUtils.findAndThen(supplierMap, payment.getSupplierId(), supplier -> payment.setSupplierName(supplier.getName()));
|
||||
MapUtils.findAndThen(accountMap, payment.getAccountId(), account -> payment.setAccountName(account.getName()));
|
||||
MapUtils.findAndThen(userMap, Long.parseLong(payment.getCreator()), user -> payment.setCreatorName(user.getNickname()));
|
||||
MapUtils.findAndThen(userMap, payment.getFinanceUserId(), user -> payment.setFinanceUserName(user.getNickname()));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.account;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 结算账户分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpAccountPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "账户编码", example = "A88")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "账户名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.account;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 结算账户 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpAccountRespVO {
|
||||
|
||||
@Schema(description = "结算账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "28684")
|
||||
@ExcelProperty("结算账户编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "账户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("账户名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "账户编码", example = "A88")
|
||||
@ExcelProperty("账户编码")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("开启状态")
|
||||
@DictFormat(DictTypeConstants.COMMON_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "是否默认", example = "1")
|
||||
@ExcelProperty("是否默认")
|
||||
private Boolean defaultStatus;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.account;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 结算账户新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpAccountSaveReqVO {
|
||||
|
||||
@Schema(description = "结算账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "28684")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "账户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "账户名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "账户编码", example = "A88")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "开启状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 付款单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpFinancePaymentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "采购单编号", example = "XS001")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "付款时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] paymentTime;
|
||||
|
||||
@Schema(description = "供应商编号", example = "1724")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "创建者", example = "666")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "财务人员编号", example = "888")
|
||||
private String financeUserId;
|
||||
|
||||
@Schema(description = "结算账户编号", example = "31189")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "付款状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "业务编号", example = "123")
|
||||
private String bizNo;
|
||||
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 付款单 Response VO")
|
||||
@Data
|
||||
public class ErpFinancePaymentRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23752")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "付款单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "FKD888")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "付款状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "付款时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime paymentTime;
|
||||
|
||||
@Schema(description = "财务人员编号", example = "19690")
|
||||
private Long financeUserId;
|
||||
@Schema(description = "财务人员名称", example = "张三")
|
||||
private String financeUserName;
|
||||
|
||||
@Schema(description = "供应商编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "29399")
|
||||
private Long supplierId;
|
||||
@Schema(description = "供应商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小番茄公司")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "付款账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "28989")
|
||||
private Long accountId;
|
||||
@Schema(description = "付款账户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
private String accountName;
|
||||
|
||||
@Schema(description = "合计价格,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "13832")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "优惠金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "11600")
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
@Schema(description = "实际价格,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
|
||||
private BigDecimal paymentPrice;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "创建人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "付款项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "付款项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer bizType;
|
||||
|
||||
@Schema(description = "业务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private Long bizId;
|
||||
|
||||
@Schema(description = "业务单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private String bizNo;
|
||||
|
||||
@Schema(description = "应付欠款,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "已付欠款,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
|
||||
private BigDecimal paidPrice;
|
||||
|
||||
@Schema(description = "本次付款,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
|
||||
@NotNull(message = "本次付款不能为空")
|
||||
private BigDecimal paymentPrice;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 付款单新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpFinancePaymentSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23752")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "付款时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "付款时间不能为空")
|
||||
private LocalDateTime paymentTime;
|
||||
|
||||
@Schema(description = "财务人员编号", example = "19690")
|
||||
private Long financeUserId;
|
||||
|
||||
@Schema(description = "供应商编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "29399")
|
||||
@NotNull(message = "供应商编号不能为空")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "付款账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "28989")
|
||||
@NotNull(message = "付款账户编号不能为空")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "优惠金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "11600")
|
||||
@NotNull(message = "优惠金额不能为空")
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "付款项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "付款项列表不能为空")
|
||||
@Valid
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "付款项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "业务类型不能为空")
|
||||
private Integer bizType;
|
||||
|
||||
@Schema(description = "业务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
@NotNull(message = "业务编号不能为空")
|
||||
private Long bizId;
|
||||
|
||||
@Schema(description = "已付欠款,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
|
||||
@NotNull(message = "已付欠款不能为空")
|
||||
private BigDecimal paidPrice;
|
||||
|
||||
@Schema(description = "本次付款,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
|
||||
@NotNull(message = "本次付款不能为空")
|
||||
private BigDecimal paymentPrice;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.in;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 采购入库分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpPurchaseInPageReqVO extends PageParam {
|
||||
|
||||
public static final Integer PAYMENT_STATUS_NONE = 0;
|
||||
public static final Integer PAYMENT_STATUS_PART = 1;
|
||||
public static final Integer PAYMENT_STATUS_ALL = 2;
|
||||
|
||||
@Schema(description = "采购单编号", example = "XS001")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "供应商编号", example = "1724")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] inTime;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "入库状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "产品编号", example = "1")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "仓库编号", example = "1")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "结算账号编号", example = "1")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "付款状态", example = "1")
|
||||
private Integer paymentStatus;
|
||||
|
||||
@Schema(description = "是否可付款", example = "true")
|
||||
private Boolean paymentEnable; // 对应 paymentStatus = [0, 1]
|
||||
|
||||
@Schema(description = "采购单号", example = "1")
|
||||
private String orderNo;
|
||||
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.in;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 采购入库 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpPurchaseInRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "入库单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||
@ExcelProperty("入库单编号")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "入库状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("入库状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "供应商编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1724")
|
||||
private Long supplierId;
|
||||
@Schema(description = "供应商名称", example = "芋道")
|
||||
@ExcelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "结算账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "311.89")
|
||||
@ExcelProperty("结算账户编号")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "入库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("入库时间")
|
||||
private LocalDateTime inTime;
|
||||
|
||||
@Schema(description = "采购订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
private Long orderId;
|
||||
@Schema(description = "采购订单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "合计数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "15663")
|
||||
@ExcelProperty("合计数量")
|
||||
private BigDecimal totalCount;
|
||||
@Schema(description = "最终合计价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "24906")
|
||||
@ExcelProperty("最终合计价格")
|
||||
private BigDecimal totalPrice;
|
||||
@Schema(description = "已付款金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal paymentPrice;
|
||||
|
||||
@Schema(description = "合计产品价格,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalProductPrice;
|
||||
|
||||
@Schema(description = "合计税额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalTaxPrice;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "优惠金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
@Schema(description = "定金金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal otherPrice;
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("附件地址")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "创建人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "入库项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "产品信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品信息")
|
||||
private String productNames;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "入库项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private Long orderItemId;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "税额,单位:元", example = "100.00")
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
// ========== 关联字段 ==========
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "巧克力")
|
||||
private String productName;
|
||||
@Schema(description = "产品条码", requiredMode = Schema.RequiredMode.REQUIRED, example = "A9985")
|
||||
private String productBarCode;
|
||||
@Schema(description = "产品单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "盒")
|
||||
private String productUnitName;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal stockCount; // 该字段仅仅在“详情”和“编辑”时使用
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.in;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 采购入库新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpPurchaseInSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "结算账户编号", example = "31189")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "入库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "入库时间不能为空")
|
||||
private LocalDateTime inTime;
|
||||
|
||||
@Schema(description = "采购订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
@NotNull(message = "采购订单编号不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "其它金额,单位:元", example = "7127")
|
||||
private BigDecimal otherPrice;
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "入库清单列表")
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "入库项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
@NotNull(message = "采购订单项编号不能为空")
|
||||
private Long orderItemId;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "仓库编号不能为空")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品编号不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品单位单位不能为空")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.order;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 采购订单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpPurchaseOrderPageReqVO extends PageParam {
|
||||
|
||||
/**
|
||||
* 入库状态 - 无
|
||||
*/
|
||||
public static final Integer IN_STATUS_NONE = 0;
|
||||
/**
|
||||
* 入库状态 - 部分
|
||||
*/
|
||||
public static final Integer IN_STATUS_PART = 1;
|
||||
/**
|
||||
* 入库状态 - 全部
|
||||
*/
|
||||
public static final Integer IN_STATUS_ALL = 2;
|
||||
|
||||
/**
|
||||
* 退货状态 - 无
|
||||
*/
|
||||
public static final Integer RETURN_STATUS_NONE = 0;
|
||||
/**
|
||||
* 退货状态 - 部分
|
||||
*/
|
||||
public static final Integer RETURN_STATUS_PART = 1;
|
||||
/**
|
||||
* 退货状态 - 全部
|
||||
*/
|
||||
public static final Integer RETURN_STATUS_ALL = 2;
|
||||
|
||||
@Schema(description = "采购单编号", example = "XS001")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "供应商编号", example = "1724")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "采购时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] orderTime;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "采购状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "产品编号", example = "1")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "入库状态", example = "2")
|
||||
private Integer inStatus;
|
||||
|
||||
@Schema(description = "退货状态", example = "2")
|
||||
private Integer returnStatus;
|
||||
|
||||
@Schema(description = "是否可入库", example = "true")
|
||||
private Boolean inEnable;
|
||||
|
||||
@Schema(description = "是否可退货", example = "true")
|
||||
private Boolean returnEnable;
|
||||
|
||||
}
|
||||
@ -0,0 +1,152 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.order;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 采购订单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpPurchaseOrderRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||
@ExcelProperty("采购单编号")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "采购状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("采购状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "供应商编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1724")
|
||||
private Long supplierId;
|
||||
@Schema(description = "供应商名称", example = "芋道")
|
||||
@ExcelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "结算账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "311.89")
|
||||
@ExcelProperty("结算账户编号")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "采购时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("采购时间")
|
||||
private LocalDateTime orderTime;
|
||||
|
||||
@Schema(description = "合计数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "15663")
|
||||
@ExcelProperty("合计数量")
|
||||
private BigDecimal totalCount;
|
||||
@Schema(description = "最终合计价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "24906")
|
||||
@ExcelProperty("最终合计价格")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "合计产品价格,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalProductPrice;
|
||||
|
||||
@Schema(description = "合计税额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalTaxPrice;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "优惠金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
@Schema(description = "定金金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal depositPrice;
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("附件地址")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "创建人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "订单项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "产品信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品信息")
|
||||
private String productNames;
|
||||
|
||||
// ========== 采购入库 ==========
|
||||
|
||||
@Schema(description = "采购入库数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal inCount;
|
||||
|
||||
// ========== 采购退货(出库)) ==========
|
||||
|
||||
@Schema(description = "采购退货数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal returnCount;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "订单项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "税额,单位:元", example = "100.00")
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
// ========== 采购入库 ==========
|
||||
|
||||
@Schema(description = "采购入库数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal inCount;
|
||||
|
||||
// ========== 采购退货(入库)) ==========
|
||||
|
||||
@Schema(description = "采购退货数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal returnCount;
|
||||
|
||||
// ========== 关联字段 ==========
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "巧克力")
|
||||
private String productName;
|
||||
@Schema(description = "产品条码", requiredMode = Schema.RequiredMode.REQUIRED, example = "A9985")
|
||||
private String productBarCode;
|
||||
@Schema(description = "产品单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "盒")
|
||||
private String productUnitName;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal stockCount; // 该字段仅仅在“详情”和“编辑”时使用
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.order;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 采购订单新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpPurchaseOrderSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "供应商编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1724")
|
||||
@NotNull(message = "供应商编号不能为空")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "结算账户编号", example = "31189")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "采购时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "采购时间不能为空")
|
||||
private LocalDateTime orderTime;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "定金金额,单位:元", example = "7127")
|
||||
private BigDecimal depositPrice;
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "订单清单列表")
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "订单项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品编号不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品单位单位不能为空")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.returns;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 采购退货分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpPurchaseReturnPageReqVO extends PageParam {
|
||||
|
||||
public static final Integer REFUND_STATUS_NONE = 0;
|
||||
public static final Integer REFUND_STATUS_PART = 1;
|
||||
public static final Integer REFUND_STATUS_ALL = 2;
|
||||
|
||||
@Schema(description = "采购单编号", example = "XS001")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "供应商编号", example = "1724")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "退货时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] returnTime;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "退货状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "产品编号", example = "1")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "仓库编号", example = "1")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "结算账号编号", example = "1")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "采购单号", example = "1")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "退款状态", example = "1")
|
||||
private Integer refundStatus;
|
||||
|
||||
@Schema(description = "是否可退款", example = "true")
|
||||
private Boolean refundEnable; // 对应 refundStatus = [0, 1]
|
||||
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.returns;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 采购退货 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpPurchaseReturnRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "退货单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||
@ExcelProperty("退货单编号")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "退货状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("退货状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "供应商编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1724")
|
||||
private Long supplierId;
|
||||
@Schema(description = "供应商名称", example = "芋道")
|
||||
@ExcelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "结算账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "311.89")
|
||||
@ExcelProperty("结算账户编号")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "退货时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("退货时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@Schema(description = "采购订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
private Long orderId;
|
||||
@Schema(description = "采购订单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "合计数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "15663")
|
||||
@ExcelProperty("合计数量")
|
||||
private BigDecimal totalCount;
|
||||
@Schema(description = "最终合计价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "24906")
|
||||
@ExcelProperty("最终合计价格")
|
||||
private BigDecimal totalPrice;
|
||||
@Schema(description = "已退款金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal refundPrice;
|
||||
|
||||
@Schema(description = "合计产品价格,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalProductPrice;
|
||||
|
||||
@Schema(description = "合计税额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalTaxPrice;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "优惠金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
@Schema(description = "定金金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal otherPrice;
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("附件地址")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "创建人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "退货项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "产品信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品信息")
|
||||
private String productNames;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "退货项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private Long orderItemId;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "税额,单位:元", example = "100.00")
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
// ========== 关联字段 ==========
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "巧克力")
|
||||
private String productName;
|
||||
@Schema(description = "产品条码", requiredMode = Schema.RequiredMode.REQUIRED, example = "A9985")
|
||||
private String productBarCode;
|
||||
@Schema(description = "产品单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "盒")
|
||||
private String productUnitName;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal stockCount; // 该字段仅仅在“详情”和“编辑”时使用
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.returns;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 采购退货新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpPurchaseReturnSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "结算账户编号", example = "31189")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "退货时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "退货时间不能为空")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@Schema(description = "采购订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
@NotNull(message = "采购订单编号不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "其它金额,单位:元", example = "7127")
|
||||
private BigDecimal otherPrice;
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "退货清单列表")
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "退货项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "采购订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
@NotNull(message = "采购订单项编号不能为空")
|
||||
private Long orderItemId;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "仓库编号不能为空")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品编号不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品单位单位不能为空")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.sale.vo.customer.ErpCustomerPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.sale.vo.customer.ErpCustomerRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.sale.vo.customer.ErpCustomerSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.sale.ErpCustomerDO;
|
||||
import cn.iocoder.yudao.module.erp.service.sale.ErpCustomerService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - ERP 客户")
|
||||
@RestController
|
||||
@RequestMapping("/erp/customer")
|
||||
@Validated
|
||||
public class ErpCustomerController {
|
||||
|
||||
@Resource
|
||||
private ErpCustomerService customerService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建客户")
|
||||
@PreAuthorize("@ss.hasPermission('erp:customer:create')")
|
||||
public CommonResult<Long> createCustomer(@Valid @RequestBody ErpCustomerSaveReqVO createReqVO) {
|
||||
return success(customerService.createCustomer(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新客户")
|
||||
@PreAuthorize("@ss.hasPermission('erp:customer:update')")
|
||||
public CommonResult<Boolean> updateCustomer(@Valid @RequestBody ErpCustomerSaveReqVO updateReqVO) {
|
||||
customerService.updateCustomer(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除客户")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('erp:customer:delete')")
|
||||
public CommonResult<Boolean> deleteCustomer(@RequestParam("id") Long id) {
|
||||
customerService.deleteCustomer(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得客户")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('erp:customer:query')")
|
||||
public CommonResult<ErpCustomerRespVO> getCustomer(@RequestParam("id") Long id) {
|
||||
ErpCustomerDO customer = customerService.getCustomer(id);
|
||||
return success(BeanUtils.toBean(customer, ErpCustomerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得客户分页")
|
||||
@PreAuthorize("@ss.hasPermission('erp:customer:query')")
|
||||
public CommonResult<PageResult<ErpCustomerRespVO>> getCustomerPage(@Valid ErpCustomerPageReqVO pageReqVO) {
|
||||
PageResult<ErpCustomerDO> pageResult = customerService.getCustomerPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpCustomerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获得客户精简列表", description = "只包含被开启的客户,主要用于前端的下拉选项")
|
||||
public CommonResult<List<ErpCustomerRespVO>> getCustomerSimpleList() {
|
||||
List<ErpCustomerDO> list = customerService.getCustomerListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
return success(convertList(list, customer -> new ErpCustomerRespVO().setId(customer.getId()).setName(customer.getName())));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出客户 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('erp:customer:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportCustomerExcel(@Valid ErpCustomerPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpCustomerDO> list = customerService.getCustomerPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "客户.xls", "数据", ErpCustomerRespVO.class,
|
||||
BeanUtils.toBean(list, ErpCustomerRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
### 请求 /transfer
|
||||
GET {{baseUrl}}/erp/sale-order/demo
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.customer;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 客户分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpCustomerPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "客户名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "手机号码", example = "15601691300")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "联系电话", example = "15601691300")
|
||||
private String telephone;
|
||||
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.customer;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 客户 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpCustomerRespVO {
|
||||
|
||||
@Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "27520")
|
||||
@ExcelProperty("客户编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("客户名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "联系人", example = "老王")
|
||||
@ExcelProperty("联系人")
|
||||
private String contact;
|
||||
|
||||
@Schema(description = "手机号码", example = "15601691300")
|
||||
@ExcelProperty("手机号码")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "联系电话", example = "15601691300")
|
||||
@ExcelProperty("联系电话")
|
||||
private String telephone;
|
||||
|
||||
@Schema(description = "电子邮箱", example = "7685323@qq.com")
|
||||
@ExcelProperty("电子邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "传真", example = "20 7123 4567")
|
||||
@ExcelProperty("传真")
|
||||
private String fax;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty(value = "开启状态", converter = DictConvert.class)
|
||||
@DictFormat("common_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "纳税人识别号", example = "91130803MA098BY05W")
|
||||
@ExcelProperty("纳税人识别号")
|
||||
private String taxNo;
|
||||
|
||||
@Schema(description = "税率", example = "10")
|
||||
@ExcelProperty("税率")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "开户行", example = "芋艿")
|
||||
@ExcelProperty("开户行")
|
||||
private String bankName;
|
||||
|
||||
@Schema(description = "开户账号", example = "622908212277228617")
|
||||
@ExcelProperty("开户账号")
|
||||
private String bankAccount;
|
||||
|
||||
@Schema(description = "开户地址", example = "兴业银行浦东支行")
|
||||
@ExcelProperty("开户地址")
|
||||
private String bankAddress;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.customer;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 客户新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpCustomerSaveReqVO {
|
||||
|
||||
@Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "27520")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "客户名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "联系人", example = "老王")
|
||||
private String contact;
|
||||
|
||||
@Schema(description = "手机号码", example = "15601691300")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "联系电话", example = "15601691300")
|
||||
private String telephone;
|
||||
|
||||
@Schema(description = "电子邮箱", example = "7685323@qq.com")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "传真", example = "20 7123 4567")
|
||||
private String fax;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "开启状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "纳税人识别号", example = "91130803MA098BY05W")
|
||||
private String taxNo;
|
||||
|
||||
@Schema(description = "税率", example = "10")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "开户行", example = "芋艿")
|
||||
private String bankName;
|
||||
|
||||
@Schema(description = "开户账号", example = "622908212277228617")
|
||||
private String bankAccount;
|
||||
|
||||
@Schema(description = "开户地址", example = "兴业银行浦东支行")
|
||||
private String bankAddress;
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.out;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 销售出库分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpSaleOutPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "销售单编号", example = "XS001")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "客户编号", example = "1724")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "出库时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] outTime;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "出库状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "产品编号", example = "1")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "仓库编号", example = "1")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "结算账号编号", example = "1")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "是否欠款", example = "true")
|
||||
private Boolean debtStatus;
|
||||
|
||||
@Schema(description = "销售单号", example = "1")
|
||||
private String orderNo;
|
||||
|
||||
}
|
||||
@ -0,0 +1,152 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.out;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 销售出库 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpSaleOutRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "出库单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||
@ExcelProperty("出库单编号")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "出库状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("出库状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1724")
|
||||
private Long customerId;
|
||||
@Schema(description = "客户名称", example = "芋道")
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "结算账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "311.89")
|
||||
@ExcelProperty("结算账户编号")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "出库员编号", example = "1888")
|
||||
private Long saleUserId;
|
||||
|
||||
@Schema(description = "出库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("出库时间")
|
||||
private LocalDateTime outTime;
|
||||
|
||||
@Schema(description = "销售订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
private Long orderId;
|
||||
@Schema(description = "销售订单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "合计数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "15663")
|
||||
@ExcelProperty("合计数量")
|
||||
private BigDecimal totalCount;
|
||||
@Schema(description = "最终合计价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "24906")
|
||||
@ExcelProperty("最终合计价格")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "合计产品价格,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalProductPrice;
|
||||
|
||||
@Schema(description = "合计税额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalTaxPrice;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "优惠金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
@Schema(description = "定金金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal otherPrice;
|
||||
|
||||
@Schema(description = "本次收款,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal payPrice;
|
||||
@Schema(description = "本次欠款,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "666")
|
||||
private BigDecimal debtPrice;
|
||||
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("附件地址")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "创建人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "出库项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "产品信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品信息")
|
||||
private String productNames;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "出库项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "销售订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private Long orderItemId;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "税额,单位:元", example = "100.00")
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
// ========== 关联字段 ==========
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "巧克力")
|
||||
private String productName;
|
||||
@Schema(description = "产品条码", requiredMode = Schema.RequiredMode.REQUIRED, example = "A9985")
|
||||
private String productBarCode;
|
||||
@Schema(description = "产品单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "盒")
|
||||
private String productUnitName;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal stockCount; // 该字段仅仅在“详情”和“编辑”时使用
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.out;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 销售出库新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpSaleOutSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "结算账户编号", example = "31189")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "销售员编号", example = "1888")
|
||||
private Long saleUserId;
|
||||
|
||||
@Schema(description = "出库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "出库时间不能为空")
|
||||
private LocalDateTime outTime;
|
||||
|
||||
@Schema(description = "销售订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
@NotNull(message = "销售订单编号不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "其它金额,单位:元", example = "7127")
|
||||
private BigDecimal otherPrice;
|
||||
|
||||
@Schema(description = "本次收款,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
@NotNull(message = "本次收款不能为空")
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "出库清单列表")
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "出库项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "销售订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
@NotNull(message = "销售订单项编号不能为空")
|
||||
private Long orderItemId;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "仓库编号不能为空")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品编号不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品单位单位不能为空")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.returns;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 销售退货分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpSaleReturnPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "销售单编号", example = "XS001")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "客户编号", example = "1724")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "退货时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] returnTime;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "退货状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "产品编号", example = "1")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "仓库编号", example = "1")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "结算账号编号", example = "1")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "销售单号", example = "1")
|
||||
private String orderNo;
|
||||
|
||||
}
|
||||
@ -0,0 +1,152 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.returns;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 销售退货 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpSaleReturnRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "退货单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||
@ExcelProperty("退货单编号")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "退货状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("退货状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1724")
|
||||
private Long customerId;
|
||||
@Schema(description = "客户名称", example = "芋道")
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "结算账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "311.89")
|
||||
@ExcelProperty("结算账户编号")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "退货员编号", example = "1888")
|
||||
private Long saleUserId;
|
||||
|
||||
@Schema(description = "退货时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("退货时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@Schema(description = "销售订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
private Long orderId;
|
||||
@Schema(description = "销售订单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "合计数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "15663")
|
||||
@ExcelProperty("合计数量")
|
||||
private BigDecimal totalCount;
|
||||
@Schema(description = "最终合计价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "24906")
|
||||
@ExcelProperty("最终合计价格")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "合计产品价格,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalProductPrice;
|
||||
|
||||
@Schema(description = "合计税额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal totalTaxPrice;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "优惠金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
@Schema(description = "定金金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal otherPrice;
|
||||
|
||||
@Schema(description = "本次退款,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
private BigDecimal refundPrice;
|
||||
@Schema(description = "本次欠款,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "666")
|
||||
private BigDecimal debtPrice;
|
||||
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("附件地址")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "创建人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "退货项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "产品信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品信息")
|
||||
private String productNames;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "退货项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "销售订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private Long orderItemId;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "税额,单位:元", example = "100.00")
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
// ========== 关联字段 ==========
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "巧克力")
|
||||
private String productName;
|
||||
@Schema(description = "产品条码", requiredMode = Schema.RequiredMode.REQUIRED, example = "A9985")
|
||||
private String productBarCode;
|
||||
@Schema(description = "产品单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "盒")
|
||||
private String productUnitName;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal stockCount; // 该字段仅仅在“详情”和“编辑”时使用
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.returns;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 销售退货新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpSaleReturnSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "结算账户编号", example = "31189")
|
||||
private Long accountId;
|
||||
|
||||
@Schema(description = "销售员编号", example = "1888")
|
||||
private Long saleUserId;
|
||||
|
||||
@Schema(description = "退货时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "退货时间不能为空")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@Schema(description = "销售订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||
@NotNull(message = "销售订单编号不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||
private BigDecimal discountPercent;
|
||||
|
||||
@Schema(description = "其它金额,单位:元", example = "7127")
|
||||
private BigDecimal otherPrice;
|
||||
|
||||
@Schema(description = "本次退款,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||
@NotNull(message = "本次退款不能为空")
|
||||
private BigDecimal refundPrice;
|
||||
|
||||
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "退货清单列表")
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "退货项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "销售订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
@NotNull(message = "销售订单项编号不能为空")
|
||||
private Long orderItemId;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "仓库编号不能为空")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品编号不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单位单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品单位单位不能为空")
|
||||
private Long productUnitId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.check;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 库存盘点单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpStockCheckPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "盘点单号", example = "S123")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "仓库编号", example = "3113")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "盘点时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] checkTime;
|
||||
|
||||
@Schema(description = "状态", example = "10")
|
||||
@InEnum(ErpAuditStatus.class)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "产品编号", example = "1")
|
||||
private Long productId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,111 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.check;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.module.erp.enums.DictTypeConstants.AUDIT_STATUS;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 库存盘点单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpStockCheckRespVO {
|
||||
|
||||
@Schema(description = "盘点编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
@ExcelProperty("盘点编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "盘点单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "S123")
|
||||
@ExcelProperty("盘点单号")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "盘点时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("盘点时间")
|
||||
private LocalDateTime checkTime;
|
||||
|
||||
@Schema(description = "合计数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "15663")
|
||||
@ExcelProperty("合计数量")
|
||||
private BigDecimal totalCount;
|
||||
|
||||
@Schema(description = "合计金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "24906")
|
||||
@ExcelProperty("合计金额")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(AUDIT_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "附件 URL", example = "https://www.iocoder.cn/1.doc")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "创建人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "创建人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "盘点项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "产品信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品信息")
|
||||
private String productNames;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "盘点项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "账面数量(当前库存)", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "账面数量不能为空")
|
||||
private BigDecimal stockCount;
|
||||
|
||||
@Schema(description = "实际数量(实际库存)", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "实际数量不能为空")
|
||||
private BigDecimal actualCount;
|
||||
|
||||
@Schema(description = "盈亏数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "盈亏数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
// ========== 关联字段 ==========
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "巧克力")
|
||||
private String productName;
|
||||
@Schema(description = "产品条码", requiredMode = Schema.RequiredMode.REQUIRED, example = "A9985")
|
||||
private String productBarCode;
|
||||
@Schema(description = "产品单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "盒")
|
||||
private String productUnitName;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.check;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 其它出库单新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpStockCheckSaveReqVO {
|
||||
|
||||
@Schema(description = "出库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "出库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "出库时间不能为空")
|
||||
private LocalDateTime checkTime;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "附件 URL", example = "https://www.iocoder.cn/1.doc")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "出库项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "出库项列表不能为空")
|
||||
@Valid
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "出库项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "仓库编号不能为空")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品编号不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "账面数量(当前库存)", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "账面数量不能为空")
|
||||
private BigDecimal stockCount;
|
||||
|
||||
@Schema(description = "实际数量(实际库存)", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "实际数量不能为空")
|
||||
private BigDecimal actualCount;
|
||||
|
||||
@Schema(description = "盈亏数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "盈亏数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.move;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 库存调拨单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpStockMovePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "调拨单号", example = "S123")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "调拨时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] moveTime;
|
||||
|
||||
@Schema(description = "状态", example = "10")
|
||||
@InEnum(ErpAuditStatus.class)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "产品编号", example = "1")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "调出仓库编号", example = "1")
|
||||
private Long fromWarehouseId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.move;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.module.erp.enums.DictTypeConstants.AUDIT_STATUS;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 库存调拨单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpStockMoveRespVO {
|
||||
|
||||
@Schema(description = "调拨编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
@ExcelProperty("调拨编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "调拨单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "S123")
|
||||
@ExcelProperty("调拨单号")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "调拨时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("调拨时间")
|
||||
private LocalDateTime moveTime;
|
||||
|
||||
@Schema(description = "合计数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "15663")
|
||||
@ExcelProperty("合计数量")
|
||||
private BigDecimal totalCount;
|
||||
|
||||
@Schema(description = "合计金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "24906")
|
||||
@ExcelProperty("合计金额")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(AUDIT_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "附件 URL", example = "https://www.iocoder.cn/1.doc")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "创建人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "创建人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "调拨项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "产品信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品信息")
|
||||
private String productNames;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "调拨项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "调出仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long fromWarehouseId;
|
||||
|
||||
@Schema(description = "调入仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "888")
|
||||
private Long toWarehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
// ========== 关联字段 ==========
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "巧克力")
|
||||
private String productName;
|
||||
@Schema(description = "产品条码", requiredMode = Schema.RequiredMode.REQUIRED, example = "A9985")
|
||||
private String productBarCode;
|
||||
@Schema(description = "产品单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "盒")
|
||||
private String productUnitName;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal stockCount; // 该字段仅仅在“详情”和“编辑”时使用
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.move;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.AssertTrue;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 库存调拨单新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpStockMoveSaveReqVO {
|
||||
|
||||
@Schema(description = "调拨编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "客户编号", example = "3113")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "调拨时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "调拨时间不能为空")
|
||||
private LocalDateTime moveTime;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "附件 URL", example = "https://www.iocoder.cn/1.doc")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "调拨项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "调拨项列表不能为空")
|
||||
@Valid
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "调拨项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "调出仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "调出仓库编号不能为空")
|
||||
private Long fromWarehouseId;
|
||||
|
||||
@Schema(description = "调入仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "888")
|
||||
@NotNull(message = "调入仓库编号不能为空")
|
||||
private Long toWarehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品编号不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@AssertTrue(message = "调出、调仓仓库不能相同")
|
||||
@JsonIgnore
|
||||
public boolean isWarehouseValid() {
|
||||
return ObjectUtil.notEqual(fromWarehouseId, toWarehouseId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 其它出库单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpStockOutPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "出库单号", example = "S123")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "客户编号", example = "3113")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "出库时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] outTime;
|
||||
|
||||
@Schema(description = "状态", example = "10")
|
||||
@InEnum(ErpAuditStatus.class)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "产品编号", example = "1")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "仓库编号", example = "1")
|
||||
private Long warehouseId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,110 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.module.erp.enums.DictTypeConstants.AUDIT_STATUS;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 其它出库单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpStockOutRespVO {
|
||||
|
||||
@Schema(description = "出库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
@ExcelProperty("出库编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "出库单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "S123")
|
||||
@ExcelProperty("出库单号")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "客户编号", example = "3113")
|
||||
private Long customerId;
|
||||
@Schema(description = "客户名称", example = "芋道")
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "出库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("出库时间")
|
||||
private LocalDateTime outTime;
|
||||
|
||||
@Schema(description = "合计数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "15663")
|
||||
@ExcelProperty("合计数量")
|
||||
private BigDecimal totalCount;
|
||||
|
||||
@Schema(description = "合计金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "24906")
|
||||
@ExcelProperty("合计金额")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(AUDIT_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "附件 URL", example = "https://www.iocoder.cn/1.doc")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "创建人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "创建人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "出库项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "产品信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品信息")
|
||||
private String productNames;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "出库项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
// ========== 关联字段 ==========
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "巧克力")
|
||||
private String productName;
|
||||
@Schema(description = "产品条码", requiredMode = Schema.RequiredMode.REQUIRED, example = "A9985")
|
||||
private String productBarCode;
|
||||
@Schema(description = "产品单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "盒")
|
||||
private String productUnitName;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal stockCount; // 该字段仅仅在“详情”和“编辑”时使用
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 其它出库单新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpStockOutSaveReqVO {
|
||||
|
||||
@Schema(description = "出库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "客户编号", example = "3113")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "出库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "出库时间不能为空")
|
||||
private LocalDateTime outTime;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "附件 URL", example = "https://www.iocoder.cn/1.doc")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "出库项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "出库项列表不能为空")
|
||||
@Valid
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "出库项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "仓库编号不能为空")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品编号不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单价", example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.finance;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* ERP 结算账户 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("erp_account")
|
||||
@KeySequence("erp_account_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ErpAccountDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 结算账户编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 账户编码
|
||||
*/
|
||||
private String no;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 开启状态
|
||||
*
|
||||
* 枚举 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum}
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 是否默认
|
||||
*/
|
||||
private Boolean defaultStatus;
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.supplier;
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.purchase;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
@ -0,0 +1,90 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.sale;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* ERP 客户 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("erp_customer")
|
||||
@KeySequence("erp_customer_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ErpCustomerDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 客户编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contact;
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
private String fax;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 开启状态
|
||||
*
|
||||
* 枚举 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum}
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
private String taxNo;
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
private BigDecimal taxPercent;
|
||||
/**
|
||||
* 开户行
|
||||
*/
|
||||
private String bankName;
|
||||
/**
|
||||
* 开户账号
|
||||
*/
|
||||
private String bankAccount;
|
||||
/**
|
||||
* 开户地址
|
||||
*/
|
||||
private String bankAddress;
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.finance;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.account.ErpAccountPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpAccountDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP 结算账户 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpAccountMapper extends BaseMapperX<ErpAccountDO> {
|
||||
|
||||
default PageResult<ErpAccountDO> selectPage(ErpAccountPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpAccountDO>()
|
||||
.likeIfPresent(ErpAccountDO::getName, reqVO.getName())
|
||||
.likeIfPresent(ErpAccountDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(ErpAccountDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(ErpAccountDO::getId));
|
||||
}
|
||||
|
||||
default ErpAccountDO selectByDefaultStatus() {
|
||||
return selectOne(ErpAccountDO::getDefaultStatus, true);
|
||||
}
|
||||
|
||||
default List<ErpAccountDO> selectListByStatus(Integer status) {
|
||||
return selectList(ErpAccountDO::getStatus, status);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.finance;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpFinancePaymentItemDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ERP 付款单项 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpFinancePaymentItemMapper extends BaseMapperX<ErpFinancePaymentItemDO> {
|
||||
|
||||
default List<ErpFinancePaymentItemDO> selectListByPaymentId(Long paymentId) {
|
||||
return selectList(ErpFinancePaymentItemDO::getPaymentId, paymentId);
|
||||
}
|
||||
|
||||
default List<ErpFinancePaymentItemDO> selectListByPaymentIds(Collection<Long> paymentIds) {
|
||||
return selectList(ErpFinancePaymentItemDO::getPaymentId, paymentIds);
|
||||
}
|
||||
|
||||
default BigDecimal selectPaymentPriceSumByBizIdAndBizType(Long bizId, Integer bizType) {
|
||||
// SQL sum 查询
|
||||
List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpFinancePaymentItemDO>()
|
||||
.select("SUM(payment_price) AS paymentPriceSum")
|
||||
.eq("biz_id", bizId)
|
||||
.eq("biz_type", bizType));
|
||||
// 获得数量
|
||||
if (CollUtil.isEmpty(result)) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return BigDecimal.valueOf(MapUtil.getDouble(result.get(0), "paymentPriceSum", 0D));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.finance;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment.ErpFinancePaymentPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpFinancePaymentDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpFinancePaymentItemDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP 付款单 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpFinancePaymentMapper extends BaseMapperX<ErpFinancePaymentDO> {
|
||||
|
||||
default PageResult<ErpFinancePaymentDO> selectPage(ErpFinancePaymentPageReqVO reqVO) {
|
||||
MPJLambdaWrapperX<ErpFinancePaymentDO> query = new MPJLambdaWrapperX<ErpFinancePaymentDO>()
|
||||
.likeIfPresent(ErpFinancePaymentDO::getNo, reqVO.getNo())
|
||||
.betweenIfPresent(ErpFinancePaymentDO::getPaymentTime, reqVO.getPaymentTime())
|
||||
.eqIfPresent(ErpFinancePaymentDO::getSupplierId, reqVO.getSupplierId())
|
||||
.eqIfPresent(ErpFinancePaymentDO::getCreator, reqVO.getCreator())
|
||||
.eqIfPresent(ErpFinancePaymentDO::getFinanceUserId, reqVO.getFinanceUserId())
|
||||
.eqIfPresent(ErpFinancePaymentDO::getAccountId, reqVO.getAccountId())
|
||||
.eqIfPresent(ErpFinancePaymentDO::getStatus, reqVO.getStatus())
|
||||
.likeIfPresent(ErpFinancePaymentDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(ErpFinancePaymentDO::getId);
|
||||
if (reqVO.getBizNo() != null) {
|
||||
query.leftJoin(ErpFinancePaymentItemDO.class, ErpFinancePaymentItemDO::getPaymentId, ErpFinancePaymentDO::getId)
|
||||
.eq(reqVO.getBizNo() != null, ErpFinancePaymentItemDO::getBizNo, reqVO.getBizNo())
|
||||
.groupBy(ErpFinancePaymentDO::getId); // 避免 1 对多查询,产生相同的 1
|
||||
}
|
||||
return selectJoinPage(reqVO, ErpFinancePaymentDO.class, query);
|
||||
}
|
||||
|
||||
default int updateByIdAndStatus(Long id, Integer status, ErpFinancePaymentDO updateObj) {
|
||||
return update(updateObj, new LambdaUpdateWrapper<ErpFinancePaymentDO>()
|
||||
.eq(ErpFinancePaymentDO::getId, id).eq(ErpFinancePaymentDO::getStatus, status));
|
||||
}
|
||||
|
||||
default ErpFinancePaymentDO selectByNo(String no) {
|
||||
return selectOne(ErpFinancePaymentDO::getNo, no);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.purchase;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.in.ErpPurchaseInPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseInDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseInItemDO;
|
||||
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* ERP 采购入库 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpPurchaseInMapper extends BaseMapperX<ErpPurchaseInDO> {
|
||||
|
||||
default PageResult<ErpPurchaseInDO> selectPage(ErpPurchaseInPageReqVO reqVO) {
|
||||
MPJLambdaWrapperX<ErpPurchaseInDO> query = new MPJLambdaWrapperX<ErpPurchaseInDO>()
|
||||
.likeIfPresent(ErpPurchaseInDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(ErpPurchaseInDO::getSupplierId, reqVO.getSupplierId())
|
||||
.betweenIfPresent(ErpPurchaseInDO::getInTime, reqVO.getInTime())
|
||||
.eqIfPresent(ErpPurchaseInDO::getStatus, reqVO.getStatus())
|
||||
.likeIfPresent(ErpPurchaseInDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ErpPurchaseInDO::getCreator, reqVO.getCreator())
|
||||
.eqIfPresent(ErpPurchaseInDO::getAccountId, reqVO.getAccountId())
|
||||
.likeIfPresent(ErpPurchaseInDO::getOrderNo, reqVO.getOrderNo())
|
||||
.orderByDesc(ErpPurchaseInDO::getId);
|
||||
// 付款状态。为什么需要 t. 的原因,是因为联表查询时,需要指定表名,不然会报字段不存在的错误
|
||||
if (Objects.equals(reqVO.getPaymentStatus(), ErpPurchaseInPageReqVO.PAYMENT_STATUS_NONE)) {
|
||||
query.eq(ErpPurchaseInDO::getPaymentPrice, 0);
|
||||
} else if (Objects.equals(reqVO.getPaymentStatus(), ErpPurchaseInPageReqVO.PAYMENT_STATUS_PART)) {
|
||||
query.gt(ErpPurchaseInDO::getPaymentPrice, 0).apply("t.payment_price < t.total_price");
|
||||
} else if (Objects.equals(reqVO.getPaymentStatus(), ErpPurchaseInPageReqVO.PAYMENT_STATUS_ALL)) {
|
||||
query.apply("t.payment_price = t.total_price");
|
||||
}
|
||||
if (Boolean.TRUE.equals(reqVO.getPaymentEnable())) {
|
||||
query.eq(ErpPurchaseInDO::getStatus, ErpAuditStatus.APPROVE.getStatus())
|
||||
.apply("t.payment_price < t.total_price");
|
||||
}
|
||||
if (reqVO.getWarehouseId() != null || reqVO.getProductId() != null) {
|
||||
query.leftJoin(ErpPurchaseInItemDO.class, ErpPurchaseInItemDO::getInId, ErpPurchaseInDO::getId)
|
||||
.eq(reqVO.getWarehouseId() != null, ErpPurchaseInItemDO::getWarehouseId, reqVO.getWarehouseId())
|
||||
.eq(reqVO.getProductId() != null, ErpPurchaseInItemDO::getProductId, reqVO.getProductId())
|
||||
.groupBy(ErpPurchaseInDO::getId); // 避免 1 对多查询,产生相同的 1
|
||||
}
|
||||
return selectJoinPage(reqVO, ErpPurchaseInDO.class, query);
|
||||
}
|
||||
|
||||
default int updateByIdAndStatus(Long id, Integer status, ErpPurchaseInDO updateObj) {
|
||||
return update(updateObj, new LambdaUpdateWrapper<ErpPurchaseInDO>()
|
||||
.eq(ErpPurchaseInDO::getId, id).eq(ErpPurchaseInDO::getStatus, status));
|
||||
}
|
||||
|
||||
default ErpPurchaseInDO selectByNo(String no) {
|
||||
return selectOne(ErpPurchaseInDO::getNo, no);
|
||||
}
|
||||
|
||||
default List<ErpPurchaseInDO> selectListByOrderId(Long orderId) {
|
||||
return selectList(ErpPurchaseInDO::getOrderId, orderId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.purchase;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseOrderItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP 采购订单明项目 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpPurchaseOrderItemMapper extends BaseMapperX<ErpPurchaseOrderItemDO> {
|
||||
|
||||
default List<ErpPurchaseOrderItemDO> selectListByOrderId(Long orderId) {
|
||||
return selectList(ErpPurchaseOrderItemDO::getOrderId, orderId);
|
||||
}
|
||||
|
||||
default List<ErpPurchaseOrderItemDO> selectListByOrderIds(Collection<Long> orderIds) {
|
||||
return selectList(ErpPurchaseOrderItemDO::getOrderId, orderIds);
|
||||
}
|
||||
|
||||
default int deleteByOrderId(Long orderId) {
|
||||
return delete(ErpPurchaseOrderItemDO::getOrderId, orderId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.purchase;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseOrderDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseOrderItemDO;
|
||||
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* ERP 采购订单 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO> {
|
||||
|
||||
default PageResult<ErpPurchaseOrderDO> selectPage(ErpPurchaseOrderPageReqVO reqVO) {
|
||||
MPJLambdaWrapperX<ErpPurchaseOrderDO> query = new MPJLambdaWrapperX<ErpPurchaseOrderDO>()
|
||||
.likeIfPresent(ErpPurchaseOrderDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(ErpPurchaseOrderDO::getSupplierId, reqVO.getSupplierId())
|
||||
.betweenIfPresent(ErpPurchaseOrderDO::getOrderTime, reqVO.getOrderTime())
|
||||
.eqIfPresent(ErpPurchaseOrderDO::getStatus, reqVO.getStatus())
|
||||
.likeIfPresent(ErpPurchaseOrderDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ErpPurchaseOrderDO::getCreator, reqVO.getCreator())
|
||||
.orderByDesc(ErpPurchaseOrderDO::getId);
|
||||
// 入库状态。为什么需要 t. 的原因,是因为联表查询时,需要指定表名,不然会报 in_count 错误
|
||||
if (Objects.equals(reqVO.getInStatus(), ErpPurchaseOrderPageReqVO.IN_STATUS_NONE)) {
|
||||
query.eq(ErpPurchaseOrderDO::getInCount, 0);
|
||||
} else if (Objects.equals(reqVO.getInStatus(), ErpPurchaseOrderPageReqVO.IN_STATUS_PART)) {
|
||||
query.gt(ErpPurchaseOrderDO::getInCount, 0).apply("t.in_count < t.total_count");
|
||||
} else if (Objects.equals(reqVO.getInStatus(), ErpPurchaseOrderPageReqVO.IN_STATUS_ALL)) {
|
||||
query.apply("t.in_count = t.total_count");
|
||||
}
|
||||
// 退货状态
|
||||
if (Objects.equals(reqVO.getReturnStatus(), ErpPurchaseOrderPageReqVO.RETURN_STATUS_NONE)) {
|
||||
query.eq(ErpPurchaseOrderDO::getReturnCount, 0);
|
||||
} else if (Objects.equals(reqVO.getReturnStatus(), ErpPurchaseOrderPageReqVO.RETURN_STATUS_PART)) {
|
||||
query.gt(ErpPurchaseOrderDO::getReturnCount, 0).apply("t.return_count < t.total_count");
|
||||
} else if (Objects.equals(reqVO.getReturnStatus(), ErpPurchaseOrderPageReqVO.RETURN_STATUS_ALL)) {
|
||||
query.apply("t.return_count = t.total_count");
|
||||
}
|
||||
// 可采购入库
|
||||
if (Boolean.TRUE.equals(reqVO.getInEnable())) {
|
||||
query.eq(ErpPurchaseOrderDO::getStatus, ErpAuditStatus.APPROVE.getStatus())
|
||||
.apply("t.in_count < t.total_count");
|
||||
}
|
||||
// 可采购退货
|
||||
if (Boolean.TRUE.equals(reqVO.getReturnEnable())) {
|
||||
query.eq(ErpPurchaseOrderDO::getStatus, ErpAuditStatus.APPROVE.getStatus())
|
||||
.apply("t.return_count < t.in_count");
|
||||
}
|
||||
if (reqVO.getProductId() != null) {
|
||||
query.leftJoin(ErpPurchaseOrderItemDO.class, ErpPurchaseOrderItemDO::getOrderId, ErpPurchaseOrderDO::getId)
|
||||
.eq(reqVO.getProductId() != null, ErpPurchaseOrderItemDO::getProductId, reqVO.getProductId())
|
||||
.groupBy(ErpPurchaseOrderDO::getId); // 避免 1 对多查询,产生相同的 1
|
||||
}
|
||||
return selectJoinPage(reqVO, ErpPurchaseOrderDO.class, query);
|
||||
}
|
||||
|
||||
default int updateByIdAndStatus(Long id, Integer status, ErpPurchaseOrderDO updateObj) {
|
||||
return update(updateObj, new LambdaUpdateWrapper<ErpPurchaseOrderDO>()
|
||||
.eq(ErpPurchaseOrderDO::getId, id).eq(ErpPurchaseOrderDO::getStatus, status));
|
||||
}
|
||||
|
||||
default ErpPurchaseOrderDO selectByNo(String no) {
|
||||
return selectOne(ErpPurchaseOrderDO::getNo, no);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.purchase;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.returns.ErpPurchaseReturnPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseInDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseReturnDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseReturnItemDO;
|
||||
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* ERP 采购退货 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpPurchaseReturnMapper extends BaseMapperX<ErpPurchaseReturnDO> {
|
||||
|
||||
default PageResult<ErpPurchaseReturnDO> selectPage(ErpPurchaseReturnPageReqVO reqVO) {
|
||||
MPJLambdaWrapperX<ErpPurchaseReturnDO> query = new MPJLambdaWrapperX<ErpPurchaseReturnDO>()
|
||||
.likeIfPresent(ErpPurchaseReturnDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(ErpPurchaseReturnDO::getSupplierId, reqVO.getSupplierId())
|
||||
.betweenIfPresent(ErpPurchaseReturnDO::getReturnTime, reqVO.getReturnTime())
|
||||
.eqIfPresent(ErpPurchaseReturnDO::getStatus, reqVO.getStatus())
|
||||
.likeIfPresent(ErpPurchaseReturnDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ErpPurchaseReturnDO::getCreator, reqVO.getCreator())
|
||||
.eqIfPresent(ErpPurchaseReturnDO::getAccountId, reqVO.getAccountId())
|
||||
.likeIfPresent(ErpPurchaseReturnDO::getOrderNo, reqVO.getOrderNo())
|
||||
.orderByDesc(ErpPurchaseReturnDO::getId);
|
||||
// 退款状态。为什么需要 t. 的原因,是因为联表查询时,需要指定表名,不然会报字段不存在的错误
|
||||
if (Objects.equals(reqVO.getRefundStatus(), ErpPurchaseReturnPageReqVO.REFUND_STATUS_NONE)) {
|
||||
query.eq(ErpPurchaseReturnDO::getRefundPrice, 0);
|
||||
} else if (Objects.equals(reqVO.getRefundStatus(), ErpPurchaseReturnPageReqVO.REFUND_STATUS_PART)) {
|
||||
query.gt(ErpPurchaseReturnDO::getRefundPrice, 0).apply("t.refund_price < t.total_price");
|
||||
} else if (Objects.equals(reqVO.getRefundStatus(), ErpPurchaseReturnPageReqVO.REFUND_STATUS_ALL)) {
|
||||
query.apply("t.refund_price = t.total_price");
|
||||
}
|
||||
if (Boolean.TRUE.equals(reqVO.getRefundEnable())) {
|
||||
query.eq(ErpPurchaseInDO::getStatus, ErpAuditStatus.APPROVE.getStatus())
|
||||
.apply("t.refund_price < t.total_price");
|
||||
}
|
||||
if (reqVO.getWarehouseId() != null || reqVO.getProductId() != null) {
|
||||
query.leftJoin(ErpPurchaseReturnItemDO.class, ErpPurchaseReturnItemDO::getReturnId, ErpPurchaseReturnDO::getId)
|
||||
.eq(reqVO.getWarehouseId() != null, ErpPurchaseReturnItemDO::getWarehouseId, reqVO.getWarehouseId())
|
||||
.eq(reqVO.getProductId() != null, ErpPurchaseReturnItemDO::getProductId, reqVO.getProductId())
|
||||
.groupBy(ErpPurchaseReturnDO::getId); // 避免 1 对多查询,产生相同的 1
|
||||
}
|
||||
return selectJoinPage(reqVO, ErpPurchaseReturnDO.class, query);
|
||||
}
|
||||
|
||||
default int updateByIdAndStatus(Long id, Integer status, ErpPurchaseReturnDO updateObj) {
|
||||
return update(updateObj, new LambdaUpdateWrapper<ErpPurchaseReturnDO>()
|
||||
.eq(ErpPurchaseReturnDO::getId, id).eq(ErpPurchaseReturnDO::getStatus, status));
|
||||
}
|
||||
|
||||
default ErpPurchaseReturnDO selectByNo(String no) {
|
||||
return selectOne(ErpPurchaseReturnDO::getNo, no);
|
||||
}
|
||||
|
||||
default List<ErpPurchaseReturnDO> selectListByOrderId(Long orderId) {
|
||||
return selectList(ErpPurchaseReturnDO::getOrderId, orderId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.sale;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.sale.vo.customer.ErpCustomerPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.sale.ErpCustomerDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP 客户 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpCustomerMapper extends BaseMapperX<ErpCustomerDO> {
|
||||
|
||||
default PageResult<ErpCustomerDO> selectPage(ErpCustomerPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCustomerDO>()
|
||||
.likeIfPresent(ErpCustomerDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ErpCustomerDO::getMobile, reqVO.getMobile())
|
||||
.eqIfPresent(ErpCustomerDO::getTelephone, reqVO.getTelephone())
|
||||
.orderByDesc(ErpCustomerDO::getId));
|
||||
}
|
||||
|
||||
default List<ErpCustomerDO> selectListByStatus(Integer status) {
|
||||
return selectList(ErpCustomerDO::getStatus, status);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue