forked from sfms3.0/sfms3.0
370 changed files with 18820 additions and 30 deletions
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.accountcalendar; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode ACCOUNTCALENDAR_NOT_EXISTS = new ErrorCode(1_043_000_000, "账期日历不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.areabasic; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode AREABASIC_NOT_EXISTS = new ErrorCode(1_035_000_000, "库区不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.bom; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode BOM_NOT_EXISTS = new ErrorCode(1_022_000_000, "物料清单不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.currencyexchange; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode CURRENCYEXCHANGE_NOT_EXISTS = new ErrorCode(1_044_000_000, "货币转换不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.customer; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_028_000_000, "客户不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.customerdock; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode CUSTOMERDOCK_NOT_EXISTS = new ErrorCode(1_029_000_000, "客户月台不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.customeritem; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode CUSTOMERITEM_NOT_EXISTS = new ErrorCode(1_030_000_000, "客户物品不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.dock; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode DOCK_NOT_EXISTS = new ErrorCode(1_034_000_000, "月台不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.itempackaging; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode ITEMPACKAGING_NOT_EXISTS = new ErrorCode(1_021_000_000, "物品包装信息 不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.location; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode LOCATION_NOT_EXISTS = new ErrorCode(1_037_000_000, "库位不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.locationgroup; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode LOCATIONGROUP_NOT_EXISTS = new ErrorCode(1_036_000_000, "库位组不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.process; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode PROCESS_NOT_EXISTS = new ErrorCode(1_041_000_000, "工序不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.productionline; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode PRODUCTIONLINE_NOT_EXISTS = new ErrorCode(1_039_000_000, "生产线不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.productionlineitem; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode PRODUCTIONLINEITEM_NOT_EXISTS = new ErrorCode(1_024_000_000, "生产线物料关系不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.project; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode PROJECT_NOT_EXISTS = new ErrorCode(1_031_000_000, "项目不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.purchaseprice; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode PURCHASEPRICE_NOT_EXISTS = new ErrorCode(1_027_000_000, "采购价格单不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.saleprice; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode SALEPRICE_NOT_EXISTS = new ErrorCode(1_032_000_000, "销售价格单不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.stdcostprice; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode STDCOSTPRICE_NOT_EXISTS = new ErrorCode(1_023_000_000, "标准成本价格单不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.supplier; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode SUPPLIER_NOT_EXISTS = new ErrorCode(1_025_000_000, "供应商不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.supplieritem; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode SUPPLIERITEM_NOT_EXISTS = new ErrorCode(1_026_000_000, "供应商物品不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.systemcalendar; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode SYSTEMCALENDAR_NOT_EXISTS = new ErrorCode(1_042_000_000, "系统日历不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.warehouse; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode WAREHOUSE_NOT_EXISTS = new ErrorCode(1_033_000_000, "仓库不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.workshop; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode WORKSHOP_NOT_EXISTS = new ErrorCode(1_038_000_000, "车间不存在"); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.enums.workstation; |
|||
|
|||
import com.win.framework.common.exception.ErrorCode; |
|||
|
|||
/** |
|||
* System 错误码枚举类 |
|||
* |
|||
* system 系统,使用 1-002-000-000 段 |
|||
*/ |
|||
public interface ErrorCodeConstants { |
|||
|
|||
ErrorCode WORKSTATION_NOT_EXISTS = new ErrorCode(1_040_000_000, "工位不存在"); |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.win.module.wms.controller.admin.accountcalendar; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.admin.accountcalendar.vo.*; |
|||
import com.win.module.wms.convert.accountcalendar.AccountcalendarConvert; |
|||
import com.win.module.wms.dal.dataobject.accountcalendar.AccountcalendarDO; |
|||
import com.win.module.wms.service.accountcalendar.AccountcalendarService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 账期日历") |
|||
@RestController |
|||
@RequestMapping("/wms/accountcalendar") |
|||
@Validated |
|||
public class AccountcalendarController { |
|||
|
|||
@Resource |
|||
private AccountcalendarService accountcalendarService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建账期日历") |
|||
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:create')") |
|||
public CommonResult<Long> createAccountcalendar(@Valid @RequestBody AccountcalendarCreateReqVO createReqVO) { |
|||
return success(accountcalendarService.createAccountcalendar(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新账期日历") |
|||
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:update')") |
|||
public CommonResult<Boolean> updateAccountcalendar(@Valid @RequestBody AccountcalendarUpdateReqVO updateReqVO) { |
|||
accountcalendarService.updateAccountcalendar(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除账期日历") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:delete')") |
|||
public CommonResult<Boolean> deleteAccountcalendar(@RequestParam("id") Long id) { |
|||
accountcalendarService.deleteAccountcalendar(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得账期日历") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:query')") |
|||
public CommonResult<AccountcalendarRespVO> getAccountcalendar(@RequestParam("id") Long id) { |
|||
AccountcalendarDO accountcalendar = accountcalendarService.getAccountcalendar(id); |
|||
return success(AccountcalendarConvert.INSTANCE.convert(accountcalendar)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得账期日历列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:query')") |
|||
public CommonResult<List<AccountcalendarRespVO>> getAccountcalendarList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<AccountcalendarDO> list = accountcalendarService.getAccountcalendarList(ids); |
|||
return success(AccountcalendarConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得账期日历分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:query')") |
|||
public CommonResult<PageResult<AccountcalendarRespVO>> getAccountcalendarPage(@Valid AccountcalendarPageReqVO pageVO) { |
|||
PageResult<AccountcalendarDO> pageResult = accountcalendarService.getAccountcalendarPage(pageVO); |
|||
return success(AccountcalendarConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出账期日历 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportAccountcalendarExcel(@Valid AccountcalendarExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<AccountcalendarDO> list = accountcalendarService.getAccountcalendarList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<AccountcalendarExcelVO> datas = AccountcalendarConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "账期日历.xls", "数据", AccountcalendarExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,63 @@ |
|||
package com.win.module.wms.controller.admin.accountcalendar.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 账期日历 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class AccountcalendarBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "年", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "年不能为空") |
|||
private String year; |
|||
|
|||
@Schema(description = "月", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "月不能为空") |
|||
private String month; |
|||
|
|||
@Schema(description = "描述") |
|||
private String descriiption; |
|||
|
|||
@Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "开始时间不能为空") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime beginTime; |
|||
|
|||
@Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "结束时间不能为空") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime endTime; |
|||
|
|||
@Schema(description = "转换生效时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "转换生效时间不能为空") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime converttotime; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.accountcalendar.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 账期日历创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class AccountcalendarCreateReqVO extends AccountcalendarBaseVO { |
|||
|
|||
} |
@ -0,0 +1,56 @@ |
|||
package com.win.module.wms.controller.admin.accountcalendar.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
import lombok.Data; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
|
|||
/** |
|||
* 账期日历 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class AccountcalendarExcelVO { |
|||
|
|||
@ExcelProperty("年") |
|||
private String year; |
|||
|
|||
@ExcelProperty("月") |
|||
private String month; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String descriiption; |
|||
|
|||
@ExcelProperty("开始时间") |
|||
private LocalDateTime beginTime; |
|||
|
|||
@ExcelProperty("结束时间") |
|||
private LocalDateTime endTime; |
|||
|
|||
@ExcelProperty("转换生效时间") |
|||
private LocalDateTime converttotime; |
|||
|
|||
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer available; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creatorId; |
|||
|
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.win.module.wms.controller.admin.accountcalendar.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 账期日历 Excel 导出 Request VO,参数和 AccountcalendarPageReqVO 是一致的") |
|||
@Data |
|||
public class AccountcalendarExportReqVO { |
|||
|
|||
@Schema(description = "年") |
|||
private String year; |
|||
|
|||
@Schema(description = "月") |
|||
private String month; |
|||
|
|||
@Schema(description = "描述") |
|||
private String descriiption; |
|||
|
|||
@Schema(description = "开始时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] beginTime; |
|||
|
|||
@Schema(description = "结束时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] endTime; |
|||
|
|||
@Schema(description = "转换生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] converttotime; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creatorId; |
|||
|
|||
} |
@ -0,0 +1,62 @@ |
|||
package com.win.module.wms.controller.admin.accountcalendar.vo; |
|||
|
|||
import com.win.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 com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 账期日历分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class AccountcalendarPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "年") |
|||
private String year; |
|||
|
|||
@Schema(description = "月") |
|||
private String month; |
|||
|
|||
@Schema(description = "描述") |
|||
private String descriiption; |
|||
|
|||
@Schema(description = "开始时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] beginTime; |
|||
|
|||
@Schema(description = "结束时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] endTime; |
|||
|
|||
@Schema(description = "转换生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] converttotime; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creatorId; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.win.module.wms.controller.admin.accountcalendar.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 账期日历 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class AccountcalendarRespVO extends AccountcalendarBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creatorId; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.accountcalendar.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 账期日历更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class AccountcalendarUpdateReqVO extends AccountcalendarBaseVO { |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.win.module.wms.controller.admin.areabasic; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.admin.areabasic.vo.*; |
|||
import com.win.module.wms.convert.areabasic.AreabasicConvert; |
|||
import com.win.module.wms.dal.dataobject.areabasic.AreabasicDO; |
|||
import com.win.module.wms.service.areabasic.AreabasicService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 库区") |
|||
@RestController |
|||
@RequestMapping("/wms/areabasic") |
|||
@Validated |
|||
public class AreabasicController { |
|||
|
|||
@Resource |
|||
private AreabasicService areabasicService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建库区") |
|||
@PreAuthorize("@ss.hasPermission('wms:areabasic:create')") |
|||
public CommonResult<Long> createAreabasic(@Valid @RequestBody AreabasicCreateReqVO createReqVO) { |
|||
return success(areabasicService.createAreabasic(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新库区") |
|||
@PreAuthorize("@ss.hasPermission('wms:areabasic:update')") |
|||
public CommonResult<Boolean> updateAreabasic(@Valid @RequestBody AreabasicUpdateReqVO updateReqVO) { |
|||
areabasicService.updateAreabasic(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除库区") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:areabasic:delete')") |
|||
public CommonResult<Boolean> deleteAreabasic(@RequestParam("id") Long id) { |
|||
areabasicService.deleteAreabasic(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得库区") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:areabasic:query')") |
|||
public CommonResult<AreabasicRespVO> getAreabasic(@RequestParam("id") Long id) { |
|||
AreabasicDO areabasic = areabasicService.getAreabasic(id); |
|||
return success(AreabasicConvert.INSTANCE.convert(areabasic)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得库区列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:areabasic:query')") |
|||
public CommonResult<List<AreabasicRespVO>> getAreabasicList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<AreabasicDO> list = areabasicService.getAreabasicList(ids); |
|||
return success(AreabasicConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得库区分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:areabasic:query')") |
|||
public CommonResult<PageResult<AreabasicRespVO>> getAreabasicPage(@Valid AreabasicPageReqVO pageVO) { |
|||
PageResult<AreabasicDO> pageResult = areabasicService.getAreabasicPage(pageVO); |
|||
return success(AreabasicConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出库区 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:areabasic:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportAreabasicExcel(@Valid AreabasicExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<AreabasicDO> list = areabasicService.getAreabasicList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<AreabasicExcelVO> datas = AreabasicConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "库区.xls", "数据", AreabasicExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.win.module.wms.controller.admin.areabasic.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 库区 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class AreabasicBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "代码不能为空") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "仓库代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "仓库代码不能为空") |
|||
private String warehouseCode; |
|||
|
|||
@Schema(description = "类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "是否是功能区", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否是功能区不能为空") |
|||
private Integer isFunctional; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.areabasic.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 库区创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class AreabasicCreateReqVO extends AreabasicBaseVO { |
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.win.module.wms.controller.admin.areabasic.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
import lombok.Data; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
|
|||
/** |
|||
* 库区 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class AreabasicExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("名称") |
|||
private String name; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty("仓库代码") |
|||
private String warehouseCode; |
|||
|
|||
@ExcelProperty(value = "类型", converter = DictConvert.class) |
|||
@DictFormat("area_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String type; |
|||
|
|||
@ExcelProperty(value = "是否是功能区", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer isFunctional; |
|||
|
|||
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer available; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.win.module.wms.controller.admin.areabasic.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 库区 Excel 导出 Request VO,参数和 AreabasicPageReqVO 是一致的") |
|||
@Data |
|||
public class AreabasicExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "仓库代码") |
|||
private String warehouseCode; |
|||
|
|||
@Schema(description = "类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "是否是功能区") |
|||
private Integer isFunctional; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
package com.win.module.wms.controller.admin.areabasic.vo; |
|||
|
|||
import com.win.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 com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 库区分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class AreabasicPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "仓库代码") |
|||
private String warehouseCode; |
|||
|
|||
@Schema(description = "类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "是否是功能区") |
|||
private Integer isFunctional; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.win.module.wms.controller.admin.areabasic.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 库区 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class AreabasicRespVO extends AreabasicBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.areabasic.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 库区更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class AreabasicUpdateReqVO extends AreabasicBaseVO { |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.win.module.wms.controller.admin.bom; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.admin.bom.vo.*; |
|||
import com.win.module.wms.convert.bom.BomConvert; |
|||
import com.win.module.wms.dal.dataobject.bom.BomDO; |
|||
import com.win.module.wms.service.bom.BomService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 物料清单") |
|||
@RestController |
|||
@RequestMapping("/wms/bom") |
|||
@Validated |
|||
public class BomController { |
|||
|
|||
@Resource |
|||
private BomService bomService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建物料清单") |
|||
@PreAuthorize("@ss.hasPermission('wms:bom:create')") |
|||
public CommonResult<Long> createBom(@Valid @RequestBody BomCreateReqVO createReqVO) { |
|||
return success(bomService.createBom(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新物料清单") |
|||
@PreAuthorize("@ss.hasPermission('wms:bom:update')") |
|||
public CommonResult<Boolean> updateBom(@Valid @RequestBody BomUpdateReqVO updateReqVO) { |
|||
bomService.updateBom(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除物料清单") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:bom:delete')") |
|||
public CommonResult<Boolean> deleteBom(@RequestParam("id") Long id) { |
|||
bomService.deleteBom(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得物料清单") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:bom:query')") |
|||
public CommonResult<BomRespVO> getBom(@RequestParam("id") Long id) { |
|||
BomDO bom = bomService.getBom(id); |
|||
return success(BomConvert.INSTANCE.convert(bom)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得物料清单列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:bom:query')") |
|||
public CommonResult<List<BomRespVO>> getBomList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<BomDO> list = bomService.getBomList(ids); |
|||
return success(BomConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得物料清单分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:bom:query')") |
|||
public CommonResult<PageResult<BomRespVO>> getBomPage(@Valid BomPageReqVO pageVO) { |
|||
PageResult<BomDO> pageResult = bomService.getBomPage(pageVO); |
|||
return success(BomConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出物料清单 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:bom:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportBomExcel(@Valid BomExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<BomDO> list = bomService.getBomList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<BomExcelVO> datas = BomConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "物料清单.xls", "数据", BomExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
package com.win.module.wms.controller.admin.bom.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 物料清单 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class BomBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "父物料代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "父物料代码不能为空") |
|||
private String productItemCode; |
|||
|
|||
@Schema(description = "子物料代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "子物料代码不能为空") |
|||
private String componentItemCode; |
|||
|
|||
@Schema(description = "子物料计量单位", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "子物料计量单位不能为空") |
|||
private String componentUom; |
|||
|
|||
@Schema(description = "子物料数量", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "子物料数量不能为空") |
|||
private BigDecimal componentQty; |
|||
|
|||
@Schema(description = "工序代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "工序代码不能为空") |
|||
private String processCode; |
|||
|
|||
@Schema(description = "版本") |
|||
private String version; |
|||
|
|||
@Schema(description = "层级") |
|||
private Integer layer; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.bom.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 物料清单创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BomCreateReqVO extends BomBaseVO { |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.win.module.wms.controller.admin.bom.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
|
|||
/** |
|||
* 物料清单 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class BomExcelVO { |
|||
|
|||
@ExcelProperty("父物料代码") |
|||
private String productItemCode; |
|||
|
|||
@ExcelProperty("子物料代码") |
|||
private String componentItemCode; |
|||
|
|||
@ExcelProperty(value = "子物料计量单位", converter = DictConvert.class) |
|||
@DictFormat("uom") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String componentUom; |
|||
|
|||
@ExcelProperty("子物料数量") |
|||
private BigDecimal componentQty; |
|||
|
|||
@ExcelProperty("工序代码") |
|||
private String processCode; |
|||
|
|||
@ExcelProperty("版本") |
|||
private String version; |
|||
|
|||
@ExcelProperty("层级") |
|||
private Integer layer; |
|||
|
|||
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer available; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.win.module.wms.controller.admin.bom.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 物料清单 Excel 导出 Request VO,参数和 BomPageReqVO 是一致的") |
|||
@Data |
|||
public class BomExportReqVO { |
|||
|
|||
@Schema(description = "父物料代码") |
|||
private String productItemCode; |
|||
|
|||
@Schema(description = "子物料代码") |
|||
private String componentItemCode; |
|||
|
|||
@Schema(description = "子物料计量单位") |
|||
private String componentUom; |
|||
|
|||
@Schema(description = "子物料数量") |
|||
private BigDecimal componentQty; |
|||
|
|||
@Schema(description = "工序代码") |
|||
private String processCode; |
|||
|
|||
@Schema(description = "版本") |
|||
private String version; |
|||
|
|||
@Schema(description = "层级") |
|||
private Integer layer; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,63 @@ |
|||
package com.win.module.wms.controller.admin.bom.vo; |
|||
|
|||
import com.win.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.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 物料清单分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BomPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "父物料代码") |
|||
private String productItemCode; |
|||
|
|||
@Schema(description = "子物料代码") |
|||
private String componentItemCode; |
|||
|
|||
@Schema(description = "子物料计量单位") |
|||
private String componentUom; |
|||
|
|||
@Schema(description = "子物料数量") |
|||
private BigDecimal componentQty; |
|||
|
|||
@Schema(description = "工序代码") |
|||
private String processCode; |
|||
|
|||
@Schema(description = "版本") |
|||
private String version; |
|||
|
|||
@Schema(description = "层级") |
|||
private Integer layer; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.win.module.wms.controller.admin.bom.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 物料清单 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BomRespVO extends BomBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.bom.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 物料清单更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BomUpdateReqVO extends BomBaseVO { |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.win.module.wms.controller.admin.currencyexchange; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.admin.currencyexchange.vo.*; |
|||
import com.win.module.wms.convert.currencyexchange.CurrencyexchangeConvert; |
|||
import com.win.module.wms.dal.dataobject.currencyexchange.CurrencyexchangeDO; |
|||
import com.win.module.wms.service.currencyexchange.CurrencyexchangeService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 货币转换") |
|||
@RestController |
|||
@RequestMapping("/wms/currencyexchange") |
|||
@Validated |
|||
public class CurrencyexchangeController { |
|||
|
|||
@Resource |
|||
private CurrencyexchangeService currencyexchangeService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建货币转换") |
|||
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:create')") |
|||
public CommonResult<Long> createCurrencyexchange(@Valid @RequestBody CurrencyexchangeCreateReqVO createReqVO) { |
|||
return success(currencyexchangeService.createCurrencyexchange(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新货币转换") |
|||
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:update')") |
|||
public CommonResult<Boolean> updateCurrencyexchange(@Valid @RequestBody CurrencyexchangeUpdateReqVO updateReqVO) { |
|||
currencyexchangeService.updateCurrencyexchange(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除货币转换") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:delete')") |
|||
public CommonResult<Boolean> deleteCurrencyexchange(@RequestParam("id") Long id) { |
|||
currencyexchangeService.deleteCurrencyexchange(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得货币转换") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:query')") |
|||
public CommonResult<CurrencyexchangeRespVO> getCurrencyexchange(@RequestParam("id") Long id) { |
|||
CurrencyexchangeDO currencyexchange = currencyexchangeService.getCurrencyexchange(id); |
|||
return success(CurrencyexchangeConvert.INSTANCE.convert(currencyexchange)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得货币转换列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:query')") |
|||
public CommonResult<List<CurrencyexchangeRespVO>> getCurrencyexchangeList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<CurrencyexchangeDO> list = currencyexchangeService.getCurrencyexchangeList(ids); |
|||
return success(CurrencyexchangeConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得货币转换分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:query')") |
|||
public CommonResult<PageResult<CurrencyexchangeRespVO>> getCurrencyexchangePage(@Valid CurrencyexchangePageReqVO pageVO) { |
|||
PageResult<CurrencyexchangeDO> pageResult = currencyexchangeService.getCurrencyexchangePage(pageVO); |
|||
return success(CurrencyexchangeConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出货币转换 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportCurrencyexchangeExcel(@Valid CurrencyexchangeExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<CurrencyexchangeDO> list = currencyexchangeService.getCurrencyexchangeList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<CurrencyexchangeExcelVO> datas = CurrencyexchangeConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "货币转换.xls", "数据", CurrencyexchangeExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.win.module.wms.controller.admin.currencyexchange.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 货币转换 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class CurrencyexchangeBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "货币", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "货币不能为空") |
|||
private String currency; |
|||
|
|||
@Schema(description = "基础货币", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "基础货币不能为空") |
|||
private String basiccurrency; |
|||
|
|||
@Schema(description = "比率", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "比率不能为空") |
|||
private BigDecimal rate; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.currencyexchange.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 货币转换创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CurrencyexchangeCreateReqVO extends CurrencyexchangeBaseVO { |
|||
|
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.win.module.wms.controller.admin.currencyexchange.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
|
|||
/** |
|||
* 货币转换 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class CurrencyexchangeExcelVO { |
|||
|
|||
@ExcelProperty("货币") |
|||
private String currency; |
|||
|
|||
@ExcelProperty("基础货币") |
|||
private String basiccurrency; |
|||
|
|||
@ExcelProperty("比率") |
|||
private BigDecimal rate; |
|||
|
|||
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer available; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.win.module.wms.controller.admin.currencyexchange.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 货币转换 Excel 导出 Request VO,参数和 CurrencyexchangePageReqVO 是一致的") |
|||
@Data |
|||
public class CurrencyexchangeExportReqVO { |
|||
|
|||
@Schema(description = "货币") |
|||
private String currency; |
|||
|
|||
@Schema(description = "基础货币") |
|||
private String basiccurrency; |
|||
|
|||
@Schema(description = "比率") |
|||
private BigDecimal rate; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.win.module.wms.controller.admin.currencyexchange.vo; |
|||
|
|||
import com.win.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.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 货币转换分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CurrencyexchangePageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "货币") |
|||
private String currency; |
|||
|
|||
@Schema(description = "基础货币") |
|||
private String basiccurrency; |
|||
|
|||
@Schema(description = "比率") |
|||
private BigDecimal rate; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.win.module.wms.controller.admin.currencyexchange.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 货币转换 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CurrencyexchangeRespVO extends CurrencyexchangeBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.currencyexchange.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 货币转换更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CurrencyexchangeUpdateReqVO extends CurrencyexchangeBaseVO { |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.win.module.wms.controller.admin.customer; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.admin.customer.vo.*; |
|||
import com.win.module.wms.convert.customer.CustomerConvert; |
|||
import com.win.module.wms.dal.dataobject.customer.CustomerDO; |
|||
import com.win.module.wms.service.customer.CustomerService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 客户") |
|||
@RestController |
|||
@RequestMapping("/wms/customer") |
|||
@Validated |
|||
public class CustomerController { |
|||
|
|||
@Resource |
|||
private CustomerService customerService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建客户") |
|||
@PreAuthorize("@ss.hasPermission('wms:customer:create')") |
|||
public CommonResult<Long> createCustomer(@Valid @RequestBody CustomerCreateReqVO createReqVO) { |
|||
return success(customerService.createCustomer(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新客户") |
|||
@PreAuthorize("@ss.hasPermission('wms:customer:update')") |
|||
public CommonResult<Boolean> updateCustomer(@Valid @RequestBody CustomerUpdateReqVO updateReqVO) { |
|||
customerService.updateCustomer(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除客户") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms: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('wms:customer:query')") |
|||
public CommonResult<CustomerRespVO> getCustomer(@RequestParam("id") Long id) { |
|||
CustomerDO customer = customerService.getCustomer(id); |
|||
return success(CustomerConvert.INSTANCE.convert(customer)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得客户列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:customer:query')") |
|||
public CommonResult<List<CustomerRespVO>> getCustomerList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<CustomerDO> list = customerService.getCustomerList(ids); |
|||
return success(CustomerConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得客户分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:customer:query')") |
|||
public CommonResult<PageResult<CustomerRespVO>> getCustomerPage(@Valid CustomerPageReqVO pageVO) { |
|||
PageResult<CustomerDO> pageResult = customerService.getCustomerPage(pageVO); |
|||
return success(CustomerConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出客户 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:customer:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportCustomerExcel(@Valid CustomerExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<CustomerDO> list = customerService.getCustomerList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<CustomerExcelVO> datas = CustomerConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "客户.xls", "数据", CustomerExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.win.module.wms.controller.admin.customer.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 客户 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class CustomerBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "代码不能为空") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "简称", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "简称不能为空") |
|||
private String shortName; |
|||
|
|||
@Schema(description = "地址") |
|||
private String address; |
|||
|
|||
@Schema(description = "国家") |
|||
private String country; |
|||
|
|||
@Schema(description = "城市") |
|||
private String city; |
|||
|
|||
@Schema(description = "电话") |
|||
private String phone; |
|||
|
|||
@Schema(description = "传真") |
|||
private String fax; |
|||
|
|||
@Schema(description = "邮编") |
|||
private String postId; |
|||
|
|||
@Schema(description = "联系人") |
|||
private String contacts; |
|||
|
|||
@Schema(description = "银行") |
|||
private String bank; |
|||
|
|||
@Schema(description = "币种") |
|||
private String currency; |
|||
|
|||
@Schema(description = "税率") |
|||
private BigDecimal taxRate; |
|||
|
|||
@Schema(description = "类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.customer.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 客户创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomerCreateReqVO extends CustomerBaseVO { |
|||
|
|||
} |
@ -0,0 +1,83 @@ |
|||
package com.win.module.wms.controller.admin.customer.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
|
|||
/** |
|||
* 客户 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class CustomerExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("名称") |
|||
private String name; |
|||
|
|||
@ExcelProperty("简称") |
|||
private String shortName; |
|||
|
|||
@ExcelProperty("地址") |
|||
private String address; |
|||
|
|||
@ExcelProperty("国家") |
|||
private String country; |
|||
|
|||
@ExcelProperty("城市") |
|||
private String city; |
|||
|
|||
@ExcelProperty("电话") |
|||
private String phone; |
|||
|
|||
@ExcelProperty("传真") |
|||
private String fax; |
|||
|
|||
@ExcelProperty("邮编") |
|||
private String postId; |
|||
|
|||
@ExcelProperty("联系人") |
|||
private String contacts; |
|||
|
|||
@ExcelProperty("银行") |
|||
private String bank; |
|||
|
|||
@ExcelProperty(value = "币种", converter = DictConvert.class) |
|||
@DictFormat("currency") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String currency; |
|||
|
|||
@ExcelProperty("税率") |
|||
private BigDecimal taxRate; |
|||
|
|||
@ExcelProperty(value = "类型", converter = DictConvert.class) |
|||
@DictFormat("customer_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String type; |
|||
|
|||
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer available; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.win.module.wms.controller.admin.customer.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 客户 Excel 导出 Request VO,参数和 CustomerPageReqVO 是一致的") |
|||
@Data |
|||
public class CustomerExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "简称") |
|||
private String shortName; |
|||
|
|||
@Schema(description = "地址") |
|||
private String address; |
|||
|
|||
@Schema(description = "国家") |
|||
private String country; |
|||
|
|||
@Schema(description = "城市") |
|||
private String city; |
|||
|
|||
@Schema(description = "电话") |
|||
private String phone; |
|||
|
|||
@Schema(description = "传真") |
|||
private String fax; |
|||
|
|||
@Schema(description = "邮编") |
|||
private String postId; |
|||
|
|||
@Schema(description = "联系人") |
|||
private String contacts; |
|||
|
|||
@Schema(description = "银行") |
|||
private String bank; |
|||
|
|||
@Schema(description = "币种") |
|||
private String currency; |
|||
|
|||
@Schema(description = "税率") |
|||
private BigDecimal taxRate; |
|||
|
|||
@Schema(description = "类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,84 @@ |
|||
package com.win.module.wms.controller.admin.customer.vo; |
|||
|
|||
import com.win.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.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 客户分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomerPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "简称") |
|||
private String shortName; |
|||
|
|||
@Schema(description = "地址") |
|||
private String address; |
|||
|
|||
@Schema(description = "国家") |
|||
private String country; |
|||
|
|||
@Schema(description = "城市") |
|||
private String city; |
|||
|
|||
@Schema(description = "电话") |
|||
private String phone; |
|||
|
|||
@Schema(description = "传真") |
|||
private String fax; |
|||
|
|||
@Schema(description = "邮编") |
|||
private String postId; |
|||
|
|||
@Schema(description = "联系人") |
|||
private String contacts; |
|||
|
|||
@Schema(description = "银行") |
|||
private String bank; |
|||
|
|||
@Schema(description = "币种") |
|||
private String currency; |
|||
|
|||
@Schema(description = "税率") |
|||
private BigDecimal taxRate; |
|||
|
|||
@Schema(description = "类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.win.module.wms.controller.admin.customer.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 客户 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomerRespVO extends CustomerBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.customer.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 客户更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomerUpdateReqVO extends CustomerBaseVO { |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.win.module.wms.controller.admin.customerdock; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.admin.customerdock.vo.*; |
|||
import com.win.module.wms.convert.customerdock.CustomerdockConvert; |
|||
import com.win.module.wms.dal.dataobject.customerdock.CustomerdockDO; |
|||
import com.win.module.wms.service.customerdock.CustomerdockService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 客户月台") |
|||
@RestController |
|||
@RequestMapping("/wms/customerdock") |
|||
@Validated |
|||
public class CustomerdockController { |
|||
|
|||
@Resource |
|||
private CustomerdockService customerdockService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建客户月台") |
|||
@PreAuthorize("@ss.hasPermission('wms:customerdock:create')") |
|||
public CommonResult<Long> createCustomerdock(@Valid @RequestBody CustomerdockCreateReqVO createReqVO) { |
|||
return success(customerdockService.createCustomerdock(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新客户月台") |
|||
@PreAuthorize("@ss.hasPermission('wms:customerdock:update')") |
|||
public CommonResult<Boolean> updateCustomerdock(@Valid @RequestBody CustomerdockUpdateReqVO updateReqVO) { |
|||
customerdockService.updateCustomerdock(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除客户月台") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:customerdock:delete')") |
|||
public CommonResult<Boolean> deleteCustomerdock(@RequestParam("id") Long id) { |
|||
customerdockService.deleteCustomerdock(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得客户月台") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:customerdock:query')") |
|||
public CommonResult<CustomerdockRespVO> getCustomerdock(@RequestParam("id") Long id) { |
|||
CustomerdockDO customerdock = customerdockService.getCustomerdock(id); |
|||
return success(CustomerdockConvert.INSTANCE.convert(customerdock)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得客户月台列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:customerdock:query')") |
|||
public CommonResult<List<CustomerdockRespVO>> getCustomerdockList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<CustomerdockDO> list = customerdockService.getCustomerdockList(ids); |
|||
return success(CustomerdockConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得客户月台分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:customerdock:query')") |
|||
public CommonResult<PageResult<CustomerdockRespVO>> getCustomerdockPage(@Valid CustomerdockPageReqVO pageVO) { |
|||
PageResult<CustomerdockDO> pageResult = customerdockService.getCustomerdockPage(pageVO); |
|||
return success(CustomerdockConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出客户月台 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:customerdock:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportCustomerdockExcel(@Valid CustomerdockExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<CustomerdockDO> list = customerdockService.getCustomerdockList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<CustomerdockExcelVO> datas = CustomerdockConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "客户月台.xls", "数据", CustomerdockExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.win.module.wms.controller.admin.customerdock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 客户月台 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class CustomerdockBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "代码不能为空") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "城市") |
|||
private String city; |
|||
|
|||
@Schema(description = "地址") |
|||
private String address; |
|||
|
|||
@Schema(description = "联系人姓名") |
|||
private String contactPerson; |
|||
|
|||
@Schema(description = "联系人电话") |
|||
private String contactPhone; |
|||
|
|||
@Schema(description = "客户代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "客户代码不能为空") |
|||
private String customerCode; |
|||
|
|||
@Schema(description = "仓库") |
|||
private String warehouseCode; |
|||
|
|||
@Schema(description = "默认库位", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "默认库位不能为空") |
|||
private String defaultLocationCode; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.customerdock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 客户月台创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomerdockCreateReqVO extends CustomerdockBaseVO { |
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
package com.win.module.wms.controller.admin.customerdock.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
import lombok.Data; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
|
|||
/** |
|||
* 客户月台 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class CustomerdockExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("名称") |
|||
private String name; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty("城市") |
|||
private String city; |
|||
|
|||
@ExcelProperty("地址") |
|||
private String address; |
|||
|
|||
@ExcelProperty("联系人姓名") |
|||
private String contactPerson; |
|||
|
|||
@ExcelProperty("联系人电话") |
|||
private String contactPhone; |
|||
|
|||
@ExcelProperty("客户代码") |
|||
private String customerCode; |
|||
|
|||
@ExcelProperty("仓库") |
|||
private String warehouseCode; |
|||
|
|||
@ExcelProperty("默认库位") |
|||
private String defaultLocationCode; |
|||
|
|||
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer available; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.win.module.wms.controller.admin.customerdock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 客户月台 Excel 导出 Request VO,参数和 CustomerdockPageReqVO 是一致的") |
|||
@Data |
|||
public class CustomerdockExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "城市") |
|||
private String city; |
|||
|
|||
@Schema(description = "地址") |
|||
private String address; |
|||
|
|||
@Schema(description = "联系人姓名") |
|||
private String contactPerson; |
|||
|
|||
@Schema(description = "联系人电话") |
|||
private String contactPhone; |
|||
|
|||
@Schema(description = "客户代码") |
|||
private String customerCode; |
|||
|
|||
@Schema(description = "仓库") |
|||
private String warehouseCode; |
|||
|
|||
@Schema(description = "默认库位") |
|||
private String defaultLocationCode; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
package com.win.module.wms.controller.admin.customerdock.vo; |
|||
|
|||
import com.win.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 com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 客户月台分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomerdockPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "城市") |
|||
private String city; |
|||
|
|||
@Schema(description = "地址") |
|||
private String address; |
|||
|
|||
@Schema(description = "联系人姓名") |
|||
private String contactPerson; |
|||
|
|||
@Schema(description = "联系人电话") |
|||
private String contactPhone; |
|||
|
|||
@Schema(description = "客户代码") |
|||
private String customerCode; |
|||
|
|||
@Schema(description = "仓库") |
|||
private String warehouseCode; |
|||
|
|||
@Schema(description = "默认库位") |
|||
private String defaultLocationCode; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.win.module.wms.controller.admin.customerdock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 客户月台 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomerdockRespVO extends CustomerdockBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.customerdock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 客户月台更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomerdockUpdateReqVO extends CustomerdockBaseVO { |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.win.module.wms.controller.admin.customeritem; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.admin.customeritem.vo.*; |
|||
import com.win.module.wms.convert.customeritem.CustomeritemConvert; |
|||
import com.win.module.wms.dal.dataobject.customeritem.CustomeritemDO; |
|||
import com.win.module.wms.service.customeritem.CustomeritemService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 客户物品") |
|||
@RestController |
|||
@RequestMapping("/wms/customeritem") |
|||
@Validated |
|||
public class CustomeritemController { |
|||
|
|||
@Resource |
|||
private CustomeritemService customeritemService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建客户物品") |
|||
@PreAuthorize("@ss.hasPermission('wms:customeritem:create')") |
|||
public CommonResult<Long> createCustomeritem(@Valid @RequestBody CustomeritemCreateReqVO createReqVO) { |
|||
return success(customeritemService.createCustomeritem(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新客户物品") |
|||
@PreAuthorize("@ss.hasPermission('wms:customeritem:update')") |
|||
public CommonResult<Boolean> updateCustomeritem(@Valid @RequestBody CustomeritemUpdateReqVO updateReqVO) { |
|||
customeritemService.updateCustomeritem(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除客户物品") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:customeritem:delete')") |
|||
public CommonResult<Boolean> deleteCustomeritem(@RequestParam("id") Long id) { |
|||
customeritemService.deleteCustomeritem(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得客户物品") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:customeritem:query')") |
|||
public CommonResult<CustomeritemRespVO> getCustomeritem(@RequestParam("id") Long id) { |
|||
CustomeritemDO customeritem = customeritemService.getCustomeritem(id); |
|||
return success(CustomeritemConvert.INSTANCE.convert(customeritem)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得客户物品列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:customeritem:query')") |
|||
public CommonResult<List<CustomeritemRespVO>> getCustomeritemList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<CustomeritemDO> list = customeritemService.getCustomeritemList(ids); |
|||
return success(CustomeritemConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得客户物品分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:customeritem:query')") |
|||
public CommonResult<PageResult<CustomeritemRespVO>> getCustomeritemPage(@Valid CustomeritemPageReqVO pageVO) { |
|||
PageResult<CustomeritemDO> pageResult = customeritemService.getCustomeritemPage(pageVO); |
|||
return success(CustomeritemConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出客户物品 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:customeritem:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportCustomeritemExcel(@Valid CustomeritemExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<CustomeritemDO> list = customeritemService.getCustomeritemList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<CustomeritemExcelVO> datas = CustomeritemConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "客户物品.xls", "数据", CustomeritemExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,73 @@ |
|||
package com.win.module.wms.controller.admin.customeritem.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 客户物品 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class CustomeritemBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "客户代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "客户代码不能为空") |
|||
private String customerCode; |
|||
|
|||
@Schema(description = "物料代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "物料代码不能为空") |
|||
private String itemCode; |
|||
|
|||
@Schema(description = "客户物料代码") |
|||
private String customerItemCode; |
|||
|
|||
@Schema(description = "客户计量单位") |
|||
private String cusotmerUom; |
|||
|
|||
@Schema(description = "转换率") |
|||
private BigDecimal convertRate; |
|||
|
|||
@Schema(description = "客户包装单位", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "客户包装单位不能为空") |
|||
private String packUnit; |
|||
|
|||
@Schema(description = "客户包装量", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "客户包装量不能为空") |
|||
private BigDecimal packQty; |
|||
|
|||
@Schema(description = "客户替代包装单位") |
|||
private String altPackUnit; |
|||
|
|||
@Schema(description = "客户替代包装量") |
|||
private BigDecimal altPackQty; |
|||
|
|||
@Schema(description = "每器具包装数", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "每器具包装数不能为空") |
|||
private Integer packQtyOfContainer; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.customeritem.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 客户物品创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomeritemCreateReqVO extends CustomeritemBaseVO { |
|||
|
|||
} |
@ -0,0 +1,72 @@ |
|||
package com.win.module.wms.controller.admin.customeritem.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
|
|||
/** |
|||
* 客户物品 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class CustomeritemExcelVO { |
|||
|
|||
@ExcelProperty("客户代码") |
|||
private String customerCode; |
|||
|
|||
@ExcelProperty("物料代码") |
|||
private String itemCode; |
|||
|
|||
@ExcelProperty("客户物料代码") |
|||
private String customerItemCode; |
|||
|
|||
@ExcelProperty(value = "客户计量单位", converter = DictConvert.class) |
|||
@DictFormat("uom") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String cusotmerUom; |
|||
|
|||
@ExcelProperty("转换率") |
|||
private BigDecimal convertRate; |
|||
|
|||
@ExcelProperty(value = "客户包装单位", converter = DictConvert.class) |
|||
@DictFormat("pack_unit") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String packUnit; |
|||
|
|||
@ExcelProperty("客户包装量") |
|||
private BigDecimal packQty; |
|||
|
|||
@ExcelProperty(value = "客户替代包装单位", converter = DictConvert.class) |
|||
@DictFormat("pack_unit") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String altPackUnit; |
|||
|
|||
@ExcelProperty("客户替代包装量") |
|||
private BigDecimal altPackQty; |
|||
|
|||
@ExcelProperty("每器具包装数") |
|||
private Integer packQtyOfContainer; |
|||
|
|||
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer available; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,67 @@ |
|||
package com.win.module.wms.controller.admin.customeritem.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 客户物品 Excel 导出 Request VO,参数和 CustomeritemPageReqVO 是一致的") |
|||
@Data |
|||
public class CustomeritemExportReqVO { |
|||
|
|||
@Schema(description = "客户代码") |
|||
private String customerCode; |
|||
|
|||
@Schema(description = "物料代码") |
|||
private String itemCode; |
|||
|
|||
@Schema(description = "客户物料代码") |
|||
private String customerItemCode; |
|||
|
|||
@Schema(description = "客户计量单位") |
|||
private String cusotmerUom; |
|||
|
|||
@Schema(description = "转换率") |
|||
private BigDecimal convertRate; |
|||
|
|||
@Schema(description = "客户包装单位") |
|||
private String packUnit; |
|||
|
|||
@Schema(description = "客户包装量") |
|||
private BigDecimal packQty; |
|||
|
|||
@Schema(description = "客户替代包装单位") |
|||
private String altPackUnit; |
|||
|
|||
@Schema(description = "客户替代包装量") |
|||
private BigDecimal altPackQty; |
|||
|
|||
@Schema(description = "每器具包装数") |
|||
private Integer packQtyOfContainer; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,72 @@ |
|||
package com.win.module.wms.controller.admin.customeritem.vo; |
|||
|
|||
import com.win.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.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 客户物品分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomeritemPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "客户代码") |
|||
private String customerCode; |
|||
|
|||
@Schema(description = "物料代码") |
|||
private String itemCode; |
|||
|
|||
@Schema(description = "客户物料代码") |
|||
private String customerItemCode; |
|||
|
|||
@Schema(description = "客户计量单位") |
|||
private String cusotmerUom; |
|||
|
|||
@Schema(description = "转换率") |
|||
private BigDecimal convertRate; |
|||
|
|||
@Schema(description = "客户包装单位") |
|||
private String packUnit; |
|||
|
|||
@Schema(description = "客户包装量") |
|||
private BigDecimal packQty; |
|||
|
|||
@Schema(description = "客户替代包装单位") |
|||
private String altPackUnit; |
|||
|
|||
@Schema(description = "客户替代包装量") |
|||
private BigDecimal altPackQty; |
|||
|
|||
@Schema(description = "每器具包装数") |
|||
private Integer packQtyOfContainer; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.win.module.wms.controller.admin.customeritem.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 客户物品 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomeritemRespVO extends CustomeritemBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.customeritem.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 客户物品更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CustomeritemUpdateReqVO extends CustomeritemBaseVO { |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.win.module.wms.controller.admin.dock; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.admin.dock.vo.*; |
|||
import com.win.module.wms.convert.dock.DockConvert; |
|||
import com.win.module.wms.dal.dataobject.dock.DockDO; |
|||
import com.win.module.wms.service.dock.DockService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 月台") |
|||
@RestController |
|||
@RequestMapping("/wms/dock") |
|||
@Validated |
|||
public class DockController { |
|||
|
|||
@Resource |
|||
private DockService dockService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建月台") |
|||
@PreAuthorize("@ss.hasPermission('wms:dock:create')") |
|||
public CommonResult<Long> createDock(@Valid @RequestBody DockCreateReqVO createReqVO) { |
|||
return success(dockService.createDock(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新月台") |
|||
@PreAuthorize("@ss.hasPermission('wms:dock:update')") |
|||
public CommonResult<Boolean> updateDock(@Valid @RequestBody DockUpdateReqVO updateReqVO) { |
|||
dockService.updateDock(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除月台") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:dock:delete')") |
|||
public CommonResult<Boolean> deleteDock(@RequestParam("id") Long id) { |
|||
dockService.deleteDock(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得月台") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:dock:query')") |
|||
public CommonResult<DockRespVO> getDock(@RequestParam("id") Long id) { |
|||
DockDO dock = dockService.getDock(id); |
|||
return success(DockConvert.INSTANCE.convert(dock)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得月台列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:dock:query')") |
|||
public CommonResult<List<DockRespVO>> getDockList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<DockDO> list = dockService.getDockList(ids); |
|||
return success(DockConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得月台分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:dock:query')") |
|||
public CommonResult<PageResult<DockRespVO>> getDockPage(@Valid DockPageReqVO pageVO) { |
|||
PageResult<DockDO> pageResult = dockService.getDockPage(pageVO); |
|||
return success(DockConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出月台 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:dock:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportDockExcel(@Valid DockExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<DockDO> list = dockService.getDockList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<DockExcelVO> datas = DockConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "月台.xls", "数据", DockExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
package com.win.module.wms.controller.admin.dock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 月台 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class DockBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "代码不能为空") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "城市") |
|||
private String city; |
|||
|
|||
@Schema(description = "地址") |
|||
private String address; |
|||
|
|||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "类型不能为空") |
|||
private String type; |
|||
|
|||
@Schema(description = "仓库代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "仓库代码不能为空") |
|||
private String warehouseCode; |
|||
|
|||
@Schema(description = "默认库位代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "默认库位代码不能为空") |
|||
private String defaultLocationCode; |
|||
|
|||
@Schema(description = "联系人姓名") |
|||
private String contactPerson; |
|||
|
|||
@Schema(description = "联系人电话") |
|||
private String contactPhone; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.dock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 月台创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class DockCreateReqVO extends DockBaseVO { |
|||
|
|||
} |
@ -0,0 +1,69 @@ |
|||
package com.win.module.wms.controller.admin.dock.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
import lombok.Data; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
|
|||
/** |
|||
* 月台 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class DockExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("名称") |
|||
private String name; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty("城市") |
|||
private String city; |
|||
|
|||
@ExcelProperty("地址") |
|||
private String address; |
|||
|
|||
@ExcelProperty(value = "类型", converter = DictConvert.class) |
|||
@DictFormat("dock_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String type; |
|||
|
|||
@ExcelProperty("仓库代码") |
|||
private String warehouseCode; |
|||
|
|||
@ExcelProperty("默认库位代码") |
|||
private String defaultLocationCode; |
|||
|
|||
@ExcelProperty("联系人姓名") |
|||
private String contactPerson; |
|||
|
|||
@ExcelProperty("联系人电话") |
|||
private String contactPhone; |
|||
|
|||
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer available; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.win.module.wms.controller.admin.dock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 月台 Excel 导出 Request VO,参数和 DockPageReqVO 是一致的") |
|||
@Data |
|||
public class DockExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "城市") |
|||
private String city; |
|||
|
|||
@Schema(description = "地址") |
|||
private String address; |
|||
|
|||
@Schema(description = "类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "仓库代码") |
|||
private String warehouseCode; |
|||
|
|||
@Schema(description = "默认库位代码") |
|||
private String defaultLocationCode; |
|||
|
|||
@Schema(description = "联系人姓名") |
|||
private String contactPerson; |
|||
|
|||
@Schema(description = "联系人电话") |
|||
private String contactPhone; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
package com.win.module.wms.controller.admin.dock.vo; |
|||
|
|||
import com.win.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 com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 月台分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class DockPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "城市") |
|||
private String city; |
|||
|
|||
@Schema(description = "地址") |
|||
private String address; |
|||
|
|||
@Schema(description = "类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "仓库代码") |
|||
private String warehouseCode; |
|||
|
|||
@Schema(description = "默认库位代码") |
|||
private String defaultLocationCode; |
|||
|
|||
@Schema(description = "联系人姓名") |
|||
private String contactPerson; |
|||
|
|||
@Schema(description = "联系人电话") |
|||
private String contactPhone; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.win.module.wms.controller.admin.dock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 月台 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class DockRespVO extends DockBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.dock.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 月台更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class DockUpdateReqVO extends DockBaseVO { |
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.win.module.wms.controller.admin.itempackaging; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.admin.itempackaging.vo.*; |
|||
import com.win.module.wms.convert.itempackaging.ItempackagingConvert; |
|||
import com.win.module.wms.dal.dataobject.itempackaging.ItempackagingDO; |
|||
import com.win.module.wms.service.itempackaging.ItempackagingService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 物品包装信息 ") |
|||
@RestController |
|||
@RequestMapping("/wms/itempackaging") |
|||
@Validated |
|||
public class ItempackagingController { |
|||
|
|||
@Resource |
|||
private ItempackagingService itempackagingService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建物品包装信息 ") |
|||
@PreAuthorize("@ss.hasPermission('wms:itempackaging:create')") |
|||
public CommonResult<Long> createItempackaging(@Valid @RequestBody ItempackagingCreateReqVO createReqVO) { |
|||
return success(itempackagingService.createItempackaging(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新物品包装信息 ") |
|||
@PreAuthorize("@ss.hasPermission('wms:itempackaging:update')") |
|||
public CommonResult<Boolean> updateItempackaging(@Valid @RequestBody ItempackagingUpdateReqVO updateReqVO) { |
|||
itempackagingService.updateItempackaging(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除物品包装信息 ") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:itempackaging:delete')") |
|||
public CommonResult<Boolean> deleteItempackaging(@RequestParam("id") Long id) { |
|||
itempackagingService.deleteItempackaging(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得物品包装信息 ") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:itempackaging:query')") |
|||
public CommonResult<ItempackagingRespVO> getItempackaging(@RequestParam("id") Long id) { |
|||
ItempackagingDO itempackaging = itempackagingService.getItempackaging(id); |
|||
return success(ItempackagingConvert.INSTANCE.convert(itempackaging)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得物品包装信息 列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:itempackaging:query')") |
|||
public CommonResult<List<ItempackagingRespVO>> getItempackagingList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<ItempackagingDO> list = itempackagingService.getItempackagingList(ids); |
|||
return success(ItempackagingConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得物品包装信息 分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:itempackaging:query')") |
|||
public CommonResult<PageResult<ItempackagingRespVO>> getItempackagingPage(@Valid ItempackagingPageReqVO pageVO) { |
|||
PageResult<ItempackagingDO> pageResult = itempackagingService.getItempackagingPage(pageVO); |
|||
return success(ItempackagingConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出物品包装信息 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:itempackaging:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportItempackagingExcel(@Valid ItempackagingExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<ItempackagingDO> list = itempackagingService.getItempackagingList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<ItempackagingExcelVO> datas = ItempackagingConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "物品包装信息 .xls", "数据", ItempackagingExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,78 @@ |
|||
package com.win.module.wms.controller.admin.itempackaging.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 物品包装信息 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class ItempackagingBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "物品代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "物品代码不能为空") |
|||
private String itemCode; |
|||
|
|||
@Schema(description = "计量单位", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "计量单位不能为空") |
|||
private String uom; |
|||
|
|||
@Schema(description = "包装单位", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "包装单位不能为空") |
|||
private String stdPackUnit; |
|||
|
|||
@Schema(description = "包装数量", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "包装数量不能为空") |
|||
private BigDecimal stdPackQty; |
|||
|
|||
@Schema(description = "替代包装单位") |
|||
private String altPackUnit1; |
|||
|
|||
@Schema(description = "替代包装量") |
|||
private BigDecimal altPackQty1; |
|||
|
|||
@Schema(description = "替代包装单位") |
|||
private String altPackUnit2; |
|||
|
|||
@Schema(description = "替代包装量") |
|||
private BigDecimal altPackQty2; |
|||
|
|||
@Schema(description = "替代包装单位") |
|||
private String altPackUnit3; |
|||
|
|||
@Schema(description = "替代包装量") |
|||
private BigDecimal altPackQty3; |
|||
|
|||
@Schema(description = "替代包装单位") |
|||
private String altPackUnit4; |
|||
|
|||
@Schema(description = "替代包装量") |
|||
private BigDecimal altPackQty4; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.admin.itempackaging.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 物品包装信息 创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ItempackagingCreateReqVO extends ItempackagingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,81 @@ |
|||
package com.win.module.wms.controller.admin.itempackaging.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
|
|||
/** |
|||
* 物品包装信息 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class ItempackagingExcelVO { |
|||
|
|||
@ExcelProperty("物品代码") |
|||
private String itemCode; |
|||
|
|||
@ExcelProperty(value = "计量单位", converter = DictConvert.class) |
|||
@DictFormat("uom") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String uom; |
|||
|
|||
@ExcelProperty(value = "包装单位", converter = DictConvert.class) |
|||
@DictFormat("pack_unit") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String stdPackUnit; |
|||
|
|||
@ExcelProperty("包装数量") |
|||
private BigDecimal stdPackQty; |
|||
|
|||
@ExcelProperty(value = "替代包装单位", converter = DictConvert.class) |
|||
@DictFormat("pack_unit") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String altPackUnit1; |
|||
|
|||
@ExcelProperty("替代包装量") |
|||
private BigDecimal altPackQty1; |
|||
|
|||
@ExcelProperty(value = "替代包装单位", converter = DictConvert.class) |
|||
@DictFormat("pack_unit") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String altPackUnit2; |
|||
|
|||
@ExcelProperty("替代包装量") |
|||
private BigDecimal altPackQty2; |
|||
|
|||
@ExcelProperty(value = "替代包装单位", converter = DictConvert.class) |
|||
@DictFormat("pack_unit") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String altPackUnit3; |
|||
|
|||
@ExcelProperty("替代包装量") |
|||
private BigDecimal altPackQty3; |
|||
|
|||
@ExcelProperty(value = "替代包装单位", converter = DictConvert.class) |
|||
@DictFormat("pack_unit") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String altPackUnit4; |
|||
|
|||
@ExcelProperty("替代包装量") |
|||
private BigDecimal altPackQty4; |
|||
|
|||
@ExcelProperty(value = "是否可用", converter = DictConvert.class) |
|||
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private Integer available; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,73 @@ |
|||
package com.win.module.wms.controller.admin.itempackaging.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 物品包装信息 Excel 导出 Request VO,参数和 ItempackagingPageReqVO 是一致的") |
|||
@Data |
|||
public class ItempackagingExportReqVO { |
|||
|
|||
@Schema(description = "物品代码") |
|||
private String itemCode; |
|||
|
|||
@Schema(description = "计量单位") |
|||
private String uom; |
|||
|
|||
@Schema(description = "包装单位") |
|||
private String stdPackUnit; |
|||
|
|||
@Schema(description = "包装数量") |
|||
private BigDecimal stdPackQty; |
|||
|
|||
@Schema(description = "替代包装单位") |
|||
private String altPackUnit1; |
|||
|
|||
@Schema(description = "替代包装量") |
|||
private BigDecimal altPackQty1; |
|||
|
|||
@Schema(description = "替代包装单位") |
|||
private String altPackUnit2; |
|||
|
|||
@Schema(description = "替代包装量") |
|||
private BigDecimal altPackQty2; |
|||
|
|||
@Schema(description = "替代包装单位") |
|||
private String altPackUnit3; |
|||
|
|||
@Schema(description = "替代包装量") |
|||
private BigDecimal altPackQty3; |
|||
|
|||
@Schema(description = "替代包装单位") |
|||
private String altPackUnit4; |
|||
|
|||
@Schema(description = "替代包装量") |
|||
private BigDecimal altPackQty4; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private Integer available; |
|||
|
|||
@Schema(description = "生效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] activeTime; |
|||
|
|||
@Schema(description = "失效时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] expireTime; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "创建者ID") |
|||
private String creator; |
|||
|
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue