forked from sfms3.0/sfms3.0
211 changed files with 13985 additions and 0 deletions
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.businesstype; |
|||
|
|||
import com.win.module.wms.controller.businesstype.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.businesstype.vo.*; |
|||
import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO; |
|||
import com.win.module.wms.convert.businesstype.BusinesstypeConvert; |
|||
import com.win.module.wms.service.businesstype.BusinesstypeService; |
|||
|
|||
@Tag(name = "管理后台 - 业务类型") |
|||
@RestController |
|||
@RequestMapping("/wms/businesstype") |
|||
@Validated |
|||
public class BusinesstypeController { |
|||
|
|||
@Resource |
|||
private BusinesstypeService businesstypeService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建业务类型") |
|||
@PreAuthorize("@ss.hasPermission('wms:businesstype:create')") |
|||
public CommonResult<Long> createBusinesstype(@Valid @RequestBody BusinesstypeCreateReqVO createReqVO) { |
|||
return success(businesstypeService.createBusinesstype(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新业务类型") |
|||
@PreAuthorize("@ss.hasPermission('wms:businesstype:update')") |
|||
public CommonResult<Boolean> updateBusinesstype(@Valid @RequestBody BusinesstypeUpdateReqVO updateReqVO) { |
|||
businesstypeService.updateBusinesstype(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除业务类型") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:businesstype:delete')") |
|||
public CommonResult<Boolean> deleteBusinesstype(@RequestParam("id") Long id) { |
|||
businesstypeService.deleteBusinesstype(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得业务类型") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:businesstype:query')") |
|||
public CommonResult<BusinesstypeRespVO> getBusinesstype(@RequestParam("id") Long id) { |
|||
BusinesstypeDO businesstype = businesstypeService.getBusinesstype(id); |
|||
return success(BusinesstypeConvert.INSTANCE.convert(businesstype)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得业务类型列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:businesstype:query')") |
|||
public CommonResult<List<BusinesstypeRespVO>> getBusinesstypeList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<BusinesstypeDO> list = businesstypeService.getBusinesstypeList(ids); |
|||
return success(BusinesstypeConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得业务类型分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:businesstype:query')") |
|||
public CommonResult<PageResult<BusinesstypeRespVO>> getBusinesstypePage(@Valid BusinesstypePageReqVO pageVO) { |
|||
PageResult<BusinesstypeDO> pageResult = businesstypeService.getBusinesstypePage(pageVO); |
|||
return success(BusinesstypeConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出业务类型 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:businesstype:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportBusinesstypeExcel(@Valid BusinesstypeExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<BusinesstypeDO> list = businesstypeService.getBusinesstypeList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<BusinesstypeExcelVO> datas = BusinesstypeConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "业务类型.xls", "数据", BusinesstypeExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,97 @@ |
|||
package com.win.module.wms.controller.businesstype.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import javax.validation.constraints.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 业务类型 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class BusinesstypeBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
|
|||
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "代码不能为空") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "名称不能为空") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "可用物品类型范围", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "可用物品类型范围不能为空") |
|||
private String itemTypes; |
|||
|
|||
@Schema(description = "可用物品状态范围", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "可用物品状态范围不能为空") |
|||
private String itemStatuses; |
|||
|
|||
@Schema(description = "出库库位类型范围") |
|||
private String outLocationTypes; |
|||
|
|||
@Schema(description = "入库库位类型范围") |
|||
private String inLocationTypes; |
|||
|
|||
@Schema(description = "出库库区范围") |
|||
private String outAreaCodes; |
|||
|
|||
@Schema(description = "入库库区范围") |
|||
private String inAreaCodes; |
|||
|
|||
@Schema(description = "出库库存状态范围") |
|||
private String outInventoryStatuses; |
|||
|
|||
@Schema(description = "入库库存状态范围") |
|||
private String inInventoryStatuses; |
|||
|
|||
@Schema(description = "出库事务类型", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "出库事务类型不能为空") |
|||
private String outTransactionType; |
|||
|
|||
@Schema(description = "入库事务类型", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "入库事务类型不能为空") |
|||
private String inTransactionType; |
|||
|
|||
@Schema(description = "在途库区") |
|||
private String onTheWayArea; |
|||
|
|||
@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 = "是否使用在途库", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否使用在途库不能为空") |
|||
private String useOnTheWay; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.businesstype.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 业务类型创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BusinesstypeCreateReqVO extends BusinesstypeBaseVO { |
|||
|
|||
} |
@ -0,0 +1,97 @@ |
|||
package com.win.module.wms.controller.businesstype.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
|
|||
|
|||
/** |
|||
* 业务类型 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class BusinesstypeExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("名称") |
|||
private String name; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty(value = "可用物品类型范围", converter = DictConvert.class) |
|||
@DictFormat("item_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String itemTypes; |
|||
|
|||
@ExcelProperty(value = "可用物品状态范围", converter = DictConvert.class) |
|||
@DictFormat("item_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String itemStatuses; |
|||
|
|||
@ExcelProperty(value = "出库库位类型范围", converter = DictConvert.class) |
|||
@DictFormat("location_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String outLocationTypes; |
|||
|
|||
@ExcelProperty(value = "入库库位类型范围", converter = DictConvert.class) |
|||
@DictFormat("location_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String inLocationTypes; |
|||
|
|||
@ExcelProperty("出库库区范围") |
|||
private String outAreaCodes; |
|||
|
|||
@ExcelProperty("入库库区范围") |
|||
private String inAreaCodes; |
|||
|
|||
@ExcelProperty(value = "出库库存状态范围", converter = DictConvert.class) |
|||
@DictFormat("inventory_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String outInventoryStatuses; |
|||
|
|||
@ExcelProperty(value = "入库库存状态范围", converter = DictConvert.class) |
|||
@DictFormat("inventory_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String inInventoryStatuses; |
|||
|
|||
@ExcelProperty("出库事务类型") |
|||
private String outTransactionType; |
|||
|
|||
@ExcelProperty("入库事务类型") |
|||
private String inTransactionType; |
|||
|
|||
@ExcelProperty("在途库区") |
|||
private String onTheWayArea; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
@ExcelProperty("是否使用在途库") |
|||
private String useOnTheWay; |
|||
|
|||
@ExcelProperty("是否可用") |
|||
private String available; |
|||
|
|||
@ExcelProperty("是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,85 @@ |
|||
package com.win.module.wms.controller.businesstype.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
import java.time.LocalDateTime; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 业务类型 Excel 导出 Request VO,参数和 BusinesstypePageReqVO 是一致的") |
|||
@Data |
|||
public class BusinesstypeExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "可用物品类型范围") |
|||
private String itemTypes; |
|||
|
|||
@Schema(description = "可用物品状态范围") |
|||
private String itemStatuses; |
|||
|
|||
@Schema(description = "出库库位类型范围") |
|||
private String outLocationTypes; |
|||
|
|||
@Schema(description = "入库库位类型范围") |
|||
private String inLocationTypes; |
|||
|
|||
@Schema(description = "出库库区范围") |
|||
private String outAreaCodes; |
|||
|
|||
@Schema(description = "入库库区范围") |
|||
private String inAreaCodes; |
|||
|
|||
@Schema(description = "出库库存状态范围") |
|||
private String outInventoryStatuses; |
|||
|
|||
@Schema(description = "入库库存状态范围") |
|||
private String inInventoryStatuses; |
|||
|
|||
@Schema(description = "出库事务类型") |
|||
private String outTransactionType; |
|||
|
|||
@Schema(description = "入库事务类型") |
|||
private String inTransactionType; |
|||
|
|||
@Schema(description = "在途库区") |
|||
private String onTheWayArea; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "是否使用在途库") |
|||
private String useOnTheWay; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,87 @@ |
|||
package com.win.module.wms.controller.businesstype.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
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 BusinesstypePageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "可用物品类型范围") |
|||
private String itemTypes; |
|||
|
|||
@Schema(description = "可用物品状态范围") |
|||
private String itemStatuses; |
|||
|
|||
@Schema(description = "出库库位类型范围") |
|||
private String outLocationTypes; |
|||
|
|||
@Schema(description = "入库库位类型范围") |
|||
private String inLocationTypes; |
|||
|
|||
@Schema(description = "出库库区范围") |
|||
private String outAreaCodes; |
|||
|
|||
@Schema(description = "入库库区范围") |
|||
private String inAreaCodes; |
|||
|
|||
@Schema(description = "出库库存状态范围") |
|||
private String outInventoryStatuses; |
|||
|
|||
@Schema(description = "入库库存状态范围") |
|||
private String inInventoryStatuses; |
|||
|
|||
@Schema(description = "出库事务类型") |
|||
private String outTransactionType; |
|||
|
|||
@Schema(description = "入库事务类型") |
|||
private String inTransactionType; |
|||
|
|||
@Schema(description = "在途库区") |
|||
private String onTheWayArea; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "是否使用在途库") |
|||
private String useOnTheWay; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.win.module.wms.controller.businesstype.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 业务类型 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BusinesstypeRespVO extends BusinesstypeBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.businesstype.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 业务类型更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BusinesstypeUpdateReqVO extends BusinesstypeBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.carrier; |
|||
|
|||
import com.win.module.wms.controller.carrier.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.carrier.vo.*; |
|||
import com.win.module.wms.dal.dataobject.carrier.CarrierDO; |
|||
import com.win.module.wms.convert.carrier.CarrierConvert; |
|||
import com.win.module.wms.service.carrier.CarrierService; |
|||
|
|||
@Tag(name = "管理后台 - 承运商") |
|||
@RestController |
|||
@RequestMapping("/wms/carrier") |
|||
@Validated |
|||
public class CarrierController { |
|||
|
|||
@Resource |
|||
private CarrierService carrierService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建承运商") |
|||
@PreAuthorize("@ss.hasPermission('wms:carrier:create')") |
|||
public CommonResult<Long> createCarrier(@Valid @RequestBody CarrierCreateReqVO createReqVO) { |
|||
return success(carrierService.createCarrier(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新承运商") |
|||
@PreAuthorize("@ss.hasPermission('wms:carrier:update')") |
|||
public CommonResult<Boolean> updateCarrier(@Valid @RequestBody CarrierUpdateReqVO updateReqVO) { |
|||
carrierService.updateCarrier(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除承运商") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:carrier:delete')") |
|||
public CommonResult<Boolean> deleteCarrier(@RequestParam("id") Long id) { |
|||
carrierService.deleteCarrier(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得承运商") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:carrier:query')") |
|||
public CommonResult<CarrierRespVO> getCarrier(@RequestParam("id") Long id) { |
|||
CarrierDO carrier = carrierService.getCarrier(id); |
|||
return success(CarrierConvert.INSTANCE.convert(carrier)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得承运商列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:carrier:query')") |
|||
public CommonResult<List<CarrierRespVO>> getCarrierList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<CarrierDO> list = carrierService.getCarrierList(ids); |
|||
return success(CarrierConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得承运商分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:carrier:query')") |
|||
public CommonResult<PageResult<CarrierRespVO>> getCarrierPage(@Valid CarrierPageReqVO pageVO) { |
|||
PageResult<CarrierDO> pageResult = carrierService.getCarrierPage(pageVO); |
|||
return success(CarrierConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出承运商 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:carrier:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportCarrierExcel(@Valid CarrierExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<CarrierDO> list = carrierService.getCarrierList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<CarrierExcelVO> datas = CarrierConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "承运商.xls", "数据", CarrierExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,86 @@ |
|||
package com.win.module.wms.controller.carrier.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import javax.validation.constraints.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 承运商 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class CarrierBaseVO { |
|||
|
|||
@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 = "生效时间") |
|||
@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 = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.carrier.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 承运商创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CarrierCreateReqVO extends CarrierBaseVO { |
|||
|
|||
} |
@ -0,0 +1,88 @@ |
|||
package com.win.module.wms.controller.carrier.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
|
|||
|
|||
/** |
|||
* 承运商 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class CarrierExcelVO { |
|||
|
|||
@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("carrier_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String type; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
@ExcelProperty("是否可用") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.win.module.wms.controller.carrier.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
import java.time.LocalDateTime; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 承运商 Excel 导出 Request VO,参数和 CarrierPageReqVO 是一致的") |
|||
@Data |
|||
public class CarrierExportReqVO { |
|||
|
|||
@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 = "生效时间") |
|||
@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; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,81 @@ |
|||
package com.win.module.wms.controller.carrier.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
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 CarrierPageReqVO 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 = "生效时间") |
|||
@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; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.win.module.wms.controller.carrier.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 承运商 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CarrierRespVO extends CarrierBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.carrier.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 承运商更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class CarrierUpdateReqVO extends CarrierBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.configuration; |
|||
|
|||
import com.win.module.wms.controller.configuration.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.configuration.vo.*; |
|||
import com.win.module.wms.dal.dataobject.configuration.ConfigurationDO; |
|||
import com.win.module.wms.convert.configuration.ConfigurationConvert; |
|||
import com.win.module.wms.service.configuration.ConfigurationService; |
|||
|
|||
@Tag(name = "管理后台 - 配置") |
|||
@RestController |
|||
@RequestMapping("/wms/configuration") |
|||
@Validated |
|||
public class ConfigurationController { |
|||
|
|||
@Resource |
|||
private ConfigurationService configurationService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建配置") |
|||
@PreAuthorize("@ss.hasPermission('wms:configuration:create')") |
|||
public CommonResult<Long> createConfiguration(@Valid @RequestBody ConfigurationCreateReqVO createReqVO) { |
|||
return success(configurationService.createConfiguration(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新配置") |
|||
@PreAuthorize("@ss.hasPermission('wms:configuration:update')") |
|||
public CommonResult<Boolean> updateConfiguration(@Valid @RequestBody ConfigurationUpdateReqVO updateReqVO) { |
|||
configurationService.updateConfiguration(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除配置") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:configuration:delete')") |
|||
public CommonResult<Boolean> deleteConfiguration(@RequestParam("id") Long id) { |
|||
configurationService.deleteConfiguration(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得配置") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:configuration:query')") |
|||
public CommonResult<ConfigurationRespVO> getConfiguration(@RequestParam("id") Long id) { |
|||
ConfigurationDO configuration = configurationService.getConfiguration(id); |
|||
return success(ConfigurationConvert.INSTANCE.convert(configuration)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得配置列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:configuration:query')") |
|||
public CommonResult<List<ConfigurationRespVO>> getConfigurationList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<ConfigurationDO> list = configurationService.getConfigurationList(ids); |
|||
return success(ConfigurationConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得配置分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:configuration:query')") |
|||
public CommonResult<PageResult<ConfigurationRespVO>> getConfigurationPage(@Valid ConfigurationPageReqVO pageVO) { |
|||
PageResult<ConfigurationDO> pageResult = configurationService.getConfigurationPage(pageVO); |
|||
return success(ConfigurationConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出配置 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:configuration:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportConfigurationExcel(@Valid ConfigurationExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<ConfigurationDO> list = configurationService.getConfigurationList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<ConfigurationExcelVO> datas = ConfigurationConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "配置.xls", "数据", ConfigurationExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.win.module.wms.controller.configuration.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import javax.validation.constraints.*; |
|||
|
|||
/** |
|||
* 配置 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class ConfigurationBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "策略代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "策略代码不能为空") |
|||
private String strategyCode; |
|||
|
|||
@Schema(description = "规则代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "规则代码不能为空") |
|||
private String ruleCode; |
|||
|
|||
@Schema(description = "配置名称", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "配置名称不能为空") |
|||
private String configurationCode; |
|||
|
|||
@Schema(description = "配置值", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "配置值不能为空") |
|||
private String configurationValue; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "配置分组") |
|||
private String groupCode; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.configuration.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 配置创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ConfigurationCreateReqVO extends ConfigurationBaseVO { |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.win.module.wms.controller.configuration.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
|
|||
/** |
|||
* 配置 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class ConfigurationExcelVO { |
|||
|
|||
@ExcelProperty("策略代码") |
|||
private String strategyCode; |
|||
|
|||
@ExcelProperty("规则代码") |
|||
private String ruleCode; |
|||
|
|||
@ExcelProperty("配置名称") |
|||
private String configurationCode; |
|||
|
|||
@ExcelProperty("配置值") |
|||
private String configurationValue; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty("配置分组") |
|||
private String groupCode; |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.win.module.wms.controller.configuration.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
|
|||
@Schema(description = "管理后台 - 配置 Excel 导出 Request VO,参数和 ConfigurationPageReqVO 是一致的") |
|||
@Data |
|||
public class ConfigurationExportReqVO { |
|||
|
|||
@Schema(description = "策略代码") |
|||
private String strategyCode; |
|||
|
|||
@Schema(description = "规则代码") |
|||
private String ruleCode; |
|||
|
|||
@Schema(description = "配置名称") |
|||
private String configurationCode; |
|||
|
|||
@Schema(description = "配置值") |
|||
private String configurationValue; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "配置分组") |
|||
private String groupCode; |
|||
|
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.win.module.wms.controller.configuration.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
|
|||
@Schema(description = "管理后台 - 配置分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ConfigurationPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "策略代码") |
|||
private String strategyCode; |
|||
|
|||
@Schema(description = "规则代码") |
|||
private String ruleCode; |
|||
|
|||
@Schema(description = "配置名称") |
|||
private String configurationCode; |
|||
|
|||
@Schema(description = "配置值") |
|||
private String configurationValue; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "配置分组") |
|||
private String groupCode; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.configuration.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 配置 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ConfigurationRespVO extends ConfigurationBaseVO { |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.configuration.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 配置更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ConfigurationUpdateReqVO extends ConfigurationBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.configurationsetting; |
|||
|
|||
import com.win.module.wms.controller.configurationsetting.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.configurationsetting.vo.*; |
|||
import com.win.module.wms.dal.dataobject.configurationsetting.ConfigurationsettingDO; |
|||
import com.win.module.wms.convert.configurationsetting.ConfigurationsettingConvert; |
|||
import com.win.module.wms.service.configurationsetting.ConfigurationsettingService; |
|||
|
|||
@Tag(name = "管理后台 - 配置设置") |
|||
@RestController |
|||
@RequestMapping("/wms/configurationsetting") |
|||
@Validated |
|||
public class ConfigurationsettingController { |
|||
|
|||
@Resource |
|||
private ConfigurationsettingService configurationsettingService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建配置设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:create')") |
|||
public CommonResult<Long> createConfigurationsetting(@Valid @RequestBody ConfigurationsettingCreateReqVO createReqVO) { |
|||
return success(configurationsettingService.createConfigurationsetting(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新配置设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:update')") |
|||
public CommonResult<Boolean> updateConfigurationsetting(@Valid @RequestBody ConfigurationsettingUpdateReqVO updateReqVO) { |
|||
configurationsettingService.updateConfigurationsetting(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除配置设置") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:delete')") |
|||
public CommonResult<Boolean> deleteConfigurationsetting(@RequestParam("id") Long id) { |
|||
configurationsettingService.deleteConfigurationsetting(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得配置设置") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:query')") |
|||
public CommonResult<ConfigurationsettingRespVO> getConfigurationsetting(@RequestParam("id") Long id) { |
|||
ConfigurationsettingDO configurationsetting = configurationsettingService.getConfigurationsetting(id); |
|||
return success(ConfigurationsettingConvert.INSTANCE.convert(configurationsetting)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得配置设置列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:query')") |
|||
public CommonResult<List<ConfigurationsettingRespVO>> getConfigurationsettingList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<ConfigurationsettingDO> list = configurationsettingService.getConfigurationsettingList(ids); |
|||
return success(ConfigurationsettingConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得配置设置分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:query')") |
|||
public CommonResult<PageResult<ConfigurationsettingRespVO>> getConfigurationsettingPage(@Valid ConfigurationsettingPageReqVO pageVO) { |
|||
PageResult<ConfigurationsettingDO> pageResult = configurationsettingService.getConfigurationsettingPage(pageVO); |
|||
return success(ConfigurationsettingConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出配置设置 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportConfigurationsettingExcel(@Valid ConfigurationsettingExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<ConfigurationsettingDO> list = configurationsettingService.getConfigurationsettingList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<ConfigurationsettingExcelVO> datas = ConfigurationsettingConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "配置设置.xls", "数据", ConfigurationsettingExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.win.module.wms.controller.configurationsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import javax.validation.constraints.*; |
|||
|
|||
/** |
|||
* 配置设置 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class ConfigurationsettingBaseVO { |
|||
|
|||
@Schema(description = "策略类型", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "策略类型不能为空") |
|||
private String strategyType; |
|||
|
|||
@Schema(description = "配置代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "配置代码不能为空") |
|||
private String configurationCode; |
|||
|
|||
@Schema(description = "配置名称", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "配置名称不能为空") |
|||
private String configurationName; |
|||
|
|||
@Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "数据类型不能为空") |
|||
private String dataType; |
|||
|
|||
@Schema(description = "值范围", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "值范围不能为空") |
|||
private String valueScope; |
|||
|
|||
@Schema(description = "关联到") |
|||
private String relatedTo; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "必填", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "必填不能为空") |
|||
private String isRequired; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.configurationsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 配置设置创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ConfigurationsettingCreateReqVO extends ConfigurationsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.win.module.wms.controller.configurationsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
|
|||
|
|||
/** |
|||
* 配置设置 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class ConfigurationsettingExcelVO { |
|||
|
|||
@ExcelProperty(value = "策略类型", converter = DictConvert.class) |
|||
@DictFormat("strategy_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String strategyType; |
|||
|
|||
@ExcelProperty("配置代码") |
|||
private String configurationCode; |
|||
|
|||
@ExcelProperty("配置名称") |
|||
private String configurationName; |
|||
|
|||
@ExcelProperty(value = "数据类型", converter = DictConvert.class) |
|||
@DictFormat("data_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String dataType; |
|||
|
|||
@ExcelProperty("值范围") |
|||
private String valueScope; |
|||
|
|||
@ExcelProperty("关联到") |
|||
private String relatedTo; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty("必填") |
|||
private String isRequired; |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.win.module.wms.controller.configurationsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
|
|||
@Schema(description = "管理后台 - 配置设置 Excel 导出 Request VO,参数和 ConfigurationsettingPageReqVO 是一致的") |
|||
@Data |
|||
public class ConfigurationsettingExportReqVO { |
|||
|
|||
@Schema(description = "策略类型") |
|||
private String strategyType; |
|||
|
|||
@Schema(description = "配置代码") |
|||
private String configurationCode; |
|||
|
|||
@Schema(description = "配置名称") |
|||
private String configurationName; |
|||
|
|||
@Schema(description = "数据类型") |
|||
private String dataType; |
|||
|
|||
@Schema(description = "值范围") |
|||
private String valueScope; |
|||
|
|||
@Schema(description = "关联到") |
|||
private String relatedTo; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "必填") |
|||
private String isRequired; |
|||
|
|||
} |
@ -0,0 +1,38 @@ |
|||
package com.win.module.wms.controller.configurationsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
|
|||
@Schema(description = "管理后台 - 配置设置分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ConfigurationsettingPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "策略类型") |
|||
private String strategyType; |
|||
|
|||
@Schema(description = "配置代码") |
|||
private String configurationCode; |
|||
|
|||
@Schema(description = "配置名称") |
|||
private String configurationName; |
|||
|
|||
@Schema(description = "数据类型") |
|||
private String dataType; |
|||
|
|||
@Schema(description = "值范围") |
|||
private String valueScope; |
|||
|
|||
@Schema(description = "关联到") |
|||
private String relatedTo; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "必填") |
|||
private String isRequired; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.configurationsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 配置设置 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ConfigurationsettingRespVO extends ConfigurationsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.configurationsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 配置设置更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ConfigurationsettingUpdateReqVO extends ConfigurationsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.documentsetting; |
|||
|
|||
import com.win.module.wms.controller.documentsetting.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.documentsetting.vo.*; |
|||
import com.win.module.wms.dal.dataobject.documentsetting.DocumentsettingDO; |
|||
import com.win.module.wms.convert.documentsetting.DocumentsettingConvert; |
|||
import com.win.module.wms.service.documentsetting.DocumentsettingService; |
|||
|
|||
@Tag(name = "管理后台 - 单据设置") |
|||
@RestController |
|||
@RequestMapping("/wms/documentsetting") |
|||
@Validated |
|||
public class DocumentsettingController { |
|||
|
|||
@Resource |
|||
private DocumentsettingService documentsettingService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建单据设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:documentsetting:create')") |
|||
public CommonResult<Long> createDocumentsetting(@Valid @RequestBody DocumentsettingCreateReqVO createReqVO) { |
|||
return success(documentsettingService.createDocumentsetting(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新单据设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:documentsetting:update')") |
|||
public CommonResult<Boolean> updateDocumentsetting(@Valid @RequestBody DocumentsettingUpdateReqVO updateReqVO) { |
|||
documentsettingService.updateDocumentsetting(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除单据设置") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:documentsetting:delete')") |
|||
public CommonResult<Boolean> deleteDocumentsetting(@RequestParam("id") Long id) { |
|||
documentsettingService.deleteDocumentsetting(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得单据设置") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:documentsetting:query')") |
|||
public CommonResult<DocumentsettingRespVO> getDocumentsetting(@RequestParam("id") Long id) { |
|||
DocumentsettingDO documentsetting = documentsettingService.getDocumentsetting(id); |
|||
return success(DocumentsettingConvert.INSTANCE.convert(documentsetting)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得单据设置列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:documentsetting:query')") |
|||
public CommonResult<List<DocumentsettingRespVO>> getDocumentsettingList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<DocumentsettingDO> list = documentsettingService.getDocumentsettingList(ids); |
|||
return success(DocumentsettingConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得单据设置分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:documentsetting:query')") |
|||
public CommonResult<PageResult<DocumentsettingRespVO>> getDocumentsettingPage(@Valid DocumentsettingPageReqVO pageVO) { |
|||
PageResult<DocumentsettingDO> pageResult = documentsettingService.getDocumentsettingPage(pageVO); |
|||
return success(DocumentsettingConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出单据设置 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:documentsetting:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportDocumentsettingExcel(@Valid DocumentsettingExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<DocumentsettingDO> list = documentsettingService.getDocumentsettingList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<DocumentsettingExcelVO> datas = DocumentsettingConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "单据设置.xls", "数据", DocumentsettingExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,83 @@ |
|||
package com.win.module.wms.controller.documentsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import javax.validation.constraints.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 单据设置 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class DocumentsettingBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "代码不能为空") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "名称不能为空") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "描述不能为空") |
|||
private String description; |
|||
|
|||
@Schema(description = "单据类型", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "单据类型不能为空") |
|||
private String type; |
|||
|
|||
@Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "业务类型不能为空") |
|||
private String businessType; |
|||
|
|||
@Schema(description = "号码前缀", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "号码前缀不能为空") |
|||
private String numberPrefix; |
|||
|
|||
@Schema(description = "号码时间格式", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "号码时间格式不能为空") |
|||
private String dateFormat; |
|||
|
|||
@Schema(description = "号码流水长度", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "号码流水长度不能为空") |
|||
private Integer serialLength; |
|||
|
|||
@Schema(description = "号码分隔符") |
|||
private String separatorStr; |
|||
|
|||
@Schema(description = "流水重置周期", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "流水重置周期不能为空") |
|||
private String resetPeriod; |
|||
|
|||
@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 = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.documentsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 单据设置创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class DocumentsettingCreateReqVO extends DocumentsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,78 @@ |
|||
package com.win.module.wms.controller.documentsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
|
|||
|
|||
/** |
|||
* 单据设置 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class DocumentsettingExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("名称") |
|||
private String name; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty(value = "单据类型", converter = DictConvert.class) |
|||
@DictFormat("document_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String type; |
|||
|
|||
@ExcelProperty("业务类型") |
|||
private String businessType; |
|||
|
|||
@ExcelProperty("号码前缀") |
|||
private String numberPrefix; |
|||
|
|||
@ExcelProperty("号码时间格式") |
|||
private String dateFormat; |
|||
|
|||
@ExcelProperty("号码流水长度") |
|||
private Integer serialLength; |
|||
|
|||
@ExcelProperty("号码分隔符") |
|||
private String separatorStr; |
|||
|
|||
@ExcelProperty(value = "流水重置周期", converter = DictConvert.class) |
|||
@DictFormat("reset_period") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String resetPeriod; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
@ExcelProperty("是否可用") |
|||
private String available; |
|||
|
|||
@ExcelProperty("是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.win.module.wms.controller.documentsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
import java.time.LocalDateTime; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 单据设置 Excel 导出 Request VO,参数和 DocumentsettingPageReqVO 是一致的") |
|||
@Data |
|||
public class DocumentsettingExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "单据类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "业务类型") |
|||
private String businessType; |
|||
|
|||
@Schema(description = "号码前缀") |
|||
private String numberPrefix; |
|||
|
|||
@Schema(description = "号码时间格式") |
|||
private String dateFormat; |
|||
|
|||
@Schema(description = "号码流水长度") |
|||
private Integer serialLength; |
|||
|
|||
@Schema(description = "号码分隔符") |
|||
private String separatorStr; |
|||
|
|||
@Schema(description = "流水重置周期") |
|||
private String resetPeriod; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,72 @@ |
|||
package com.win.module.wms.controller.documentsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
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 DocumentsettingPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "单据类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "业务类型") |
|||
private String businessType; |
|||
|
|||
@Schema(description = "号码前缀") |
|||
private String numberPrefix; |
|||
|
|||
@Schema(description = "号码时间格式") |
|||
private String dateFormat; |
|||
|
|||
@Schema(description = "号码流水长度") |
|||
private Integer serialLength; |
|||
|
|||
@Schema(description = "号码分隔符") |
|||
private String separatorStr; |
|||
|
|||
@Schema(description = "流水重置周期") |
|||
private String resetPeriod; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.win.module.wms.controller.documentsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 单据设置 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class DocumentsettingRespVO extends DocumentsettingBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.documentsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 单据设置更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class DocumentsettingUpdateReqVO extends DocumentsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.jobsetting; |
|||
|
|||
import com.win.module.wms.controller.jobsetting.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.jobsetting.vo.*; |
|||
import com.win.module.wms.dal.dataobject.jobsetting.JobsettingDO; |
|||
import com.win.module.wms.convert.jobsetting.JobsettingConvert; |
|||
import com.win.module.wms.service.jobsetting.JobsettingService; |
|||
|
|||
@Tag(name = "管理后台 - 任务设置") |
|||
@RestController |
|||
@RequestMapping("/wms/jobsetting") |
|||
@Validated |
|||
public class JobsettingController { |
|||
|
|||
@Resource |
|||
private JobsettingService jobsettingService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建任务设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:jobsetting:create')") |
|||
public CommonResult<Long> createJobsetting(@Valid @RequestBody JobsettingCreateReqVO createReqVO) { |
|||
return success(jobsettingService.createJobsetting(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新任务设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:jobsetting:update')") |
|||
public CommonResult<Boolean> updateJobsetting(@Valid @RequestBody JobsettingUpdateReqVO updateReqVO) { |
|||
jobsettingService.updateJobsetting(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除任务设置") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:jobsetting:delete')") |
|||
public CommonResult<Boolean> deleteJobsetting(@RequestParam("id") Long id) { |
|||
jobsettingService.deleteJobsetting(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得任务设置") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:jobsetting:query')") |
|||
public CommonResult<JobsettingRespVO> getJobsetting(@RequestParam("id") Long id) { |
|||
JobsettingDO jobsetting = jobsettingService.getJobsetting(id); |
|||
return success(JobsettingConvert.INSTANCE.convert(jobsetting)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得任务设置列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:jobsetting:query')") |
|||
public CommonResult<List<JobsettingRespVO>> getJobsettingList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<JobsettingDO> list = jobsettingService.getJobsettingList(ids); |
|||
return success(JobsettingConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得任务设置分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:jobsetting:query')") |
|||
public CommonResult<PageResult<JobsettingRespVO>> getJobsettingPage(@Valid JobsettingPageReqVO pageVO) { |
|||
PageResult<JobsettingDO> pageResult = jobsettingService.getJobsettingPage(pageVO); |
|||
return success(JobsettingConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出任务设置 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:jobsetting:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportJobsettingExcel(@Valid JobsettingExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<JobsettingDO> list = jobsettingService.getJobsettingList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<JobsettingExcelVO> datas = JobsettingConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "任务设置.xls", "数据", JobsettingExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,92 @@ |
|||
package com.win.module.wms.controller.jobsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import javax.validation.constraints.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 任务设置 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class JobsettingBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "代码不能为空") |
|||
private String code; |
|||
|
|||
@Schema(description = "有效分钟", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "有效分钟不能为空") |
|||
private Integer validMinutes; |
|||
|
|||
@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 = "自动完成", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "自动完成不能为空") |
|||
private String autoComplete; |
|||
|
|||
@Schema(description = "允许修改库位", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "允许修改库位不能为空") |
|||
private String allowModifyLocation; |
|||
|
|||
@Schema(description = "允许修改数量", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "允许修改数量不能为空") |
|||
private String allowModifyQty; |
|||
|
|||
@Schema(description = "允许大于推荐数量", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "允许大于推荐数量不能为空") |
|||
private String allowBiggerQty; |
|||
|
|||
@Schema(description = "允许小于推荐数量", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "允许小于推荐数量不能为空") |
|||
private String allowSmallerQty; |
|||
|
|||
@Schema(description = "允许修改库存状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") |
|||
@NotNull(message = "允许修改库存状态不能为空") |
|||
private String allowModifyInventoryStatus; |
|||
|
|||
@Schema(description = "允许连续扫描", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "允许连续扫描不能为空") |
|||
private String allowContinuousScanning; |
|||
|
|||
@Schema(description = "允许部分完成", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "允许部分完成不能为空") |
|||
private String allowPartialComplete; |
|||
|
|||
@Schema(description = "允许修改批次", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "允许修改批次不能为空") |
|||
private String allowModifyBach; |
|||
|
|||
@Schema(description = "允许修改包装号", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "允许修改包装号不能为空") |
|||
private String allowModifyPackingNumber; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.jobsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 任务设置创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class JobsettingCreateReqVO extends JobsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.win.module.wms.controller.jobsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
|
|||
/** |
|||
* 任务设置 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class JobsettingExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("有效分钟") |
|||
private Integer validMinutes; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
@ExcelProperty("自动完成") |
|||
private String autoComplete; |
|||
|
|||
@ExcelProperty("允许修改库位") |
|||
private String allowModifyLocation; |
|||
|
|||
@ExcelProperty("允许修改数量") |
|||
private String allowModifyQty; |
|||
|
|||
@ExcelProperty("允许大于推荐数量") |
|||
private String allowBiggerQty; |
|||
|
|||
@ExcelProperty("允许小于推荐数量") |
|||
private String allowSmallerQty; |
|||
|
|||
@ExcelProperty("允许修改库存状态") |
|||
private String allowModifyInventoryStatus; |
|||
|
|||
@ExcelProperty("允许连续扫描") |
|||
private String allowContinuousScanning; |
|||
|
|||
@ExcelProperty("允许部分完成") |
|||
private String allowPartialComplete; |
|||
|
|||
@ExcelProperty("允许修改批次") |
|||
private String allowModifyBach; |
|||
|
|||
@ExcelProperty("允许修改包装号") |
|||
private String allowModifyPackingNumber; |
|||
|
|||
@ExcelProperty("是否可用") |
|||
private String available; |
|||
|
|||
@ExcelProperty("是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
package com.win.module.wms.controller.jobsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
import java.time.LocalDateTime; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 任务设置 Excel 导出 Request VO,参数和 JobsettingPageReqVO 是一致的") |
|||
@Data |
|||
public class JobsettingExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "有效分钟") |
|||
private Integer validMinutes; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "自动完成") |
|||
private String autoComplete; |
|||
|
|||
@Schema(description = "允许修改库位") |
|||
private String allowModifyLocation; |
|||
|
|||
@Schema(description = "允许修改数量") |
|||
private String allowModifyQty; |
|||
|
|||
@Schema(description = "允许大于推荐数量") |
|||
private String allowBiggerQty; |
|||
|
|||
@Schema(description = "允许小于推荐数量") |
|||
private String allowSmallerQty; |
|||
|
|||
@Schema(description = "允许修改库存状态", example = "2") |
|||
private String allowModifyInventoryStatus; |
|||
|
|||
@Schema(description = "允许连续扫描") |
|||
private String allowContinuousScanning; |
|||
|
|||
@Schema(description = "允许部分完成") |
|||
private String allowPartialComplete; |
|||
|
|||
@Schema(description = "允许修改批次") |
|||
private String allowModifyBach; |
|||
|
|||
@Schema(description = "允许修改包装号") |
|||
private String allowModifyPackingNumber; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,78 @@ |
|||
package com.win.module.wms.controller.jobsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
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 JobsettingPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "有效分钟") |
|||
private Integer validMinutes; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "自动完成") |
|||
private String autoComplete; |
|||
|
|||
@Schema(description = "允许修改库位") |
|||
private String allowModifyLocation; |
|||
|
|||
@Schema(description = "允许修改数量") |
|||
private String allowModifyQty; |
|||
|
|||
@Schema(description = "允许大于推荐数量") |
|||
private String allowBiggerQty; |
|||
|
|||
@Schema(description = "允许小于推荐数量") |
|||
private String allowSmallerQty; |
|||
|
|||
@Schema(description = "允许修改库存状态", example = "2") |
|||
private String allowModifyInventoryStatus; |
|||
|
|||
@Schema(description = "允许连续扫描") |
|||
private String allowContinuousScanning; |
|||
|
|||
@Schema(description = "允许部分完成") |
|||
private String allowPartialComplete; |
|||
|
|||
@Schema(description = "允许修改批次") |
|||
private String allowModifyBach; |
|||
|
|||
@Schema(description = "允许修改包装号") |
|||
private String allowModifyPackingNumber; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.win.module.wms.controller.jobsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 任务设置 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class JobsettingRespVO extends JobsettingBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.jobsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 任务设置更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class JobsettingUpdateReqVO extends JobsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.owner; |
|||
|
|||
import com.win.module.wms.controller.owner.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.owner.vo.*; |
|||
import com.win.module.wms.dal.dataobject.owner.OwnerDO; |
|||
import com.win.module.wms.convert.owner.OwnerConvert; |
|||
import com.win.module.wms.service.owner.OwnerService; |
|||
|
|||
@Tag(name = "管理后台 - 货主") |
|||
@RestController |
|||
@RequestMapping("/wms/owner") |
|||
@Validated |
|||
public class OwnerController { |
|||
|
|||
@Resource |
|||
private OwnerService ownerService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建货主") |
|||
@PreAuthorize("@ss.hasPermission('wms:owner:create')") |
|||
public CommonResult<Long> createOwner(@Valid @RequestBody OwnerCreateReqVO createReqVO) { |
|||
return success(ownerService.createOwner(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新货主") |
|||
@PreAuthorize("@ss.hasPermission('wms:owner:update')") |
|||
public CommonResult<Boolean> updateOwner(@Valid @RequestBody OwnerUpdateReqVO updateReqVO) { |
|||
ownerService.updateOwner(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除货主") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:owner:delete')") |
|||
public CommonResult<Boolean> deleteOwner(@RequestParam("id") Long id) { |
|||
ownerService.deleteOwner(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得货主") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:owner:query')") |
|||
public CommonResult<OwnerRespVO> getOwner(@RequestParam("id") Long id) { |
|||
OwnerDO owner = ownerService.getOwner(id); |
|||
return success(OwnerConvert.INSTANCE.convert(owner)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得货主列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:owner:query')") |
|||
public CommonResult<List<OwnerRespVO>> getOwnerList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<OwnerDO> list = ownerService.getOwnerList(ids); |
|||
return success(OwnerConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得货主分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:owner:query')") |
|||
public CommonResult<PageResult<OwnerRespVO>> getOwnerPage(@Valid OwnerPageReqVO pageVO) { |
|||
PageResult<OwnerDO> pageResult = ownerService.getOwnerPage(pageVO); |
|||
return success(OwnerConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出货主 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:owner:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportOwnerExcel(@Valid OwnerExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<OwnerDO> list = ownerService.getOwnerList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<OwnerExcelVO> datas = OwnerConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "货主.xls", "数据", OwnerExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,86 @@ |
|||
package com.win.module.wms.controller.owner.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import javax.validation.constraints.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 货主 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class OwnerBaseVO { |
|||
|
|||
@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 = "生效时间") |
|||
@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 = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.owner.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 货主创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class OwnerCreateReqVO extends OwnerBaseVO { |
|||
|
|||
} |
@ -0,0 +1,88 @@ |
|||
package com.win.module.wms.controller.owner.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
|
|||
|
|||
/** |
|||
* 货主 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class OwnerExcelVO { |
|||
|
|||
@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("owner_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String type; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
@ExcelProperty("是否可用") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.win.module.wms.controller.owner.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
import java.time.LocalDateTime; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 货主 Excel 导出 Request VO,参数和 OwnerPageReqVO 是一致的") |
|||
@Data |
|||
public class OwnerExportReqVO { |
|||
|
|||
@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 = "生效时间") |
|||
@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; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,81 @@ |
|||
package com.win.module.wms.controller.owner.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
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 OwnerPageReqVO 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 = "生效时间") |
|||
@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; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.win.module.wms.controller.owner.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 货主 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class OwnerRespVO extends OwnerBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.owner.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 货主更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class OwnerUpdateReqVO extends OwnerBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.paramsetting; |
|||
|
|||
import com.win.module.wms.controller.paramsetting.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.paramsetting.vo.*; |
|||
import com.win.module.wms.dal.dataobject.paramsetting.ParamsettingDO; |
|||
import com.win.module.wms.convert.paramsetting.ParamsettingConvert; |
|||
import com.win.module.wms.service.paramsetting.ParamsettingService; |
|||
|
|||
@Tag(name = "管理后台 - 参数设置") |
|||
@RestController |
|||
@RequestMapping("/wms/paramsetting") |
|||
@Validated |
|||
public class ParamsettingController { |
|||
|
|||
@Resource |
|||
private ParamsettingService paramsettingService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建参数设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:paramsetting:create')") |
|||
public CommonResult<Long> createParamsetting(@Valid @RequestBody ParamsettingCreateReqVO createReqVO) { |
|||
return success(paramsettingService.createParamsetting(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新参数设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:paramsetting:update')") |
|||
public CommonResult<Boolean> updateParamsetting(@Valid @RequestBody ParamsettingUpdateReqVO updateReqVO) { |
|||
paramsettingService.updateParamsetting(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除参数设置") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:paramsetting:delete')") |
|||
public CommonResult<Boolean> deleteParamsetting(@RequestParam("id") Long id) { |
|||
paramsettingService.deleteParamsetting(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得参数设置") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:paramsetting:query')") |
|||
public CommonResult<ParamsettingRespVO> getParamsetting(@RequestParam("id") Long id) { |
|||
ParamsettingDO paramsetting = paramsettingService.getParamsetting(id); |
|||
return success(ParamsettingConvert.INSTANCE.convert(paramsetting)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得参数设置列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:paramsetting:query')") |
|||
public CommonResult<List<ParamsettingRespVO>> getParamsettingList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<ParamsettingDO> list = paramsettingService.getParamsettingList(ids); |
|||
return success(ParamsettingConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得参数设置分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:paramsetting:query')") |
|||
public CommonResult<PageResult<ParamsettingRespVO>> getParamsettingPage(@Valid ParamsettingPageReqVO pageVO) { |
|||
PageResult<ParamsettingDO> pageResult = paramsettingService.getParamsettingPage(pageVO); |
|||
return success(ParamsettingConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出参数设置 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:paramsetting:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportParamsettingExcel(@Valid ParamsettingExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<ParamsettingDO> list = paramsettingService.getParamsettingList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<ParamsettingExcelVO> datas = ParamsettingConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "参数设置.xls", "数据", ParamsettingExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.win.module.wms.controller.paramsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import javax.validation.constraints.*; |
|||
|
|||
/** |
|||
* 参数设置 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class ParamsettingBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "策略代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "策略代码不能为空") |
|||
private String strategyType; |
|||
|
|||
@Schema(description = "参数代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "参数代码不能为空") |
|||
private String paramCode; |
|||
|
|||
@Schema(description = "参数名称") |
|||
private String paramName; |
|||
|
|||
@Schema(description = "可用操作符", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "可用操作符不能为空") |
|||
private String usableOpeartors; |
|||
|
|||
@Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "数据类型不能为空") |
|||
private String dataType; |
|||
|
|||
@Schema(description = "值范围", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "值范围不能为空") |
|||
private String valueScope; |
|||
|
|||
@Schema(description = "关联到") |
|||
private String relatedTo; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "必填", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "必填不能为空") |
|||
private String isRequired; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.paramsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 参数设置创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ParamsettingCreateReqVO extends ParamsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.win.module.wms.controller.paramsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
|
|||
|
|||
/** |
|||
* 参数设置 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class ParamsettingExcelVO { |
|||
|
|||
@ExcelProperty(value = "策略代码", converter = DictConvert.class) |
|||
@DictFormat("strategy_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String strategyType; |
|||
|
|||
@ExcelProperty("参数代码") |
|||
private String paramCode; |
|||
|
|||
@ExcelProperty("参数名称") |
|||
private String paramName; |
|||
|
|||
@ExcelProperty(value = "可用操作符", converter = DictConvert.class) |
|||
@DictFormat("strategy_param_opeartor") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String usableOpeartors; |
|||
|
|||
@ExcelProperty(value = "数据类型", converter = DictConvert.class) |
|||
@DictFormat("data_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String dataType; |
|||
|
|||
@ExcelProperty("值范围") |
|||
private String valueScope; |
|||
|
|||
@ExcelProperty("关联到") |
|||
private String relatedTo; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty("必填") |
|||
private String isRequired; |
|||
|
|||
} |
@ -0,0 +1,39 @@ |
|||
package com.win.module.wms.controller.paramsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
|
|||
@Schema(description = "管理后台 - 参数设置 Excel 导出 Request VO,参数和 ParamsettingPageReqVO 是一致的") |
|||
@Data |
|||
public class ParamsettingExportReqVO { |
|||
|
|||
@Schema(description = "策略代码") |
|||
private String strategyType; |
|||
|
|||
@Schema(description = "参数代码") |
|||
private String paramCode; |
|||
|
|||
@Schema(description = "参数名称") |
|||
private String paramName; |
|||
|
|||
@Schema(description = "可用操作符") |
|||
private String usableOpeartors; |
|||
|
|||
@Schema(description = "数据类型") |
|||
private String dataType; |
|||
|
|||
@Schema(description = "值范围") |
|||
private String valueScope; |
|||
|
|||
@Schema(description = "关联到") |
|||
private String relatedTo; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "必填") |
|||
private String isRequired; |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.win.module.wms.controller.paramsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
|
|||
@Schema(description = "管理后台 - 参数设置分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ParamsettingPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "策略代码") |
|||
private String strategyType; |
|||
|
|||
@Schema(description = "参数代码") |
|||
private String paramCode; |
|||
|
|||
@Schema(description = "参数名称") |
|||
private String paramName; |
|||
|
|||
@Schema(description = "可用操作符") |
|||
private String usableOpeartors; |
|||
|
|||
@Schema(description = "数据类型") |
|||
private String dataType; |
|||
|
|||
@Schema(description = "值范围") |
|||
private String valueScope; |
|||
|
|||
@Schema(description = "关联到") |
|||
private String relatedTo; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "必填") |
|||
private String isRequired; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.paramsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 参数设置 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ParamsettingRespVO extends ParamsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.paramsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 参数设置更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ParamsettingUpdateReqVO extends ParamsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.recordsetting; |
|||
|
|||
import com.win.module.wms.controller.recordsetting.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.admin.recordsetting.vo.*; |
|||
import com.win.module.wms.dal.dataobject.recordsetting.RecordsettingDO; |
|||
import com.win.module.wms.convert.recordsetting.RecordsettingConvert; |
|||
import com.win.module.wms.service.recordsetting.RecordsettingService; |
|||
|
|||
@Tag(name = "管理后台 - 记录设置") |
|||
@RestController |
|||
@RequestMapping("/wms/recordsetting") |
|||
@Validated |
|||
public class RecordsettingController { |
|||
|
|||
@Resource |
|||
private RecordsettingService recordsettingService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建记录设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:recordsetting:create')") |
|||
public CommonResult<Long> createRecordsetting(@Valid @RequestBody RecordsettingCreateReqVO createReqVO) { |
|||
return success(recordsettingService.createRecordsetting(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新记录设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:recordsetting:update')") |
|||
public CommonResult<Boolean> updateRecordsetting(@Valid @RequestBody RecordsettingUpdateReqVO updateReqVO) { |
|||
recordsettingService.updateRecordsetting(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除记录设置") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:recordsetting:delete')") |
|||
public CommonResult<Boolean> deleteRecordsetting(@RequestParam("id") Long id) { |
|||
recordsettingService.deleteRecordsetting(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得记录设置") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:recordsetting:query')") |
|||
public CommonResult<RecordsettingRespVO> getRecordsetting(@RequestParam("id") Long id) { |
|||
RecordsettingDO recordsetting = recordsettingService.getRecordsetting(id); |
|||
return success(RecordsettingConvert.INSTANCE.convert(recordsetting)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得记录设置列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:recordsetting:query')") |
|||
public CommonResult<List<RecordsettingRespVO>> getRecordsettingList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<RecordsettingDO> list = recordsettingService.getRecordsettingList(ids); |
|||
return success(RecordsettingConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得记录设置分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:recordsetting:query')") |
|||
public CommonResult<PageResult<RecordsettingRespVO>> getRecordsettingPage(@Valid RecordsettingPageReqVO pageVO) { |
|||
PageResult<RecordsettingDO> pageResult = recordsettingService.getRecordsettingPage(pageVO); |
|||
return success(RecordsettingConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出记录设置 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:recordsetting:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportRecordsettingExcel(@Valid RecordsettingExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<RecordsettingDO> list = recordsettingService.getRecordsettingList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<RecordsettingExcelVO> datas = RecordsettingConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "记录设置.xls", "数据", RecordsettingExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.win.module.wms.controller.recordsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import javax.validation.constraints.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 记录设置 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class RecordsettingBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "代码不能为空") |
|||
private String code; |
|||
|
|||
@Schema(description = "接口类型", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "接口类型不能为空") |
|||
private String interfaceType; |
|||
|
|||
@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 = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.recordsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 记录设置创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RecordsettingCreateReqVO extends RecordsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
package com.win.module.wms.controller.recordsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
|
|||
|
|||
/** |
|||
* 记录设置 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class RecordsettingExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty(value = "接口类型", converter = DictConvert.class) |
|||
@DictFormat("interface_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String interfaceType; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
@ExcelProperty("是否可用") |
|||
private String available; |
|||
|
|||
@ExcelProperty("是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.win.module.wms.controller.recordsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
import java.time.LocalDateTime; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 记录设置 Excel 导出 Request VO,参数和 RecordsettingPageReqVO 是一致的") |
|||
@Data |
|||
public class RecordsettingExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "接口类型") |
|||
private String interfaceType; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.win.module.wms.controller.recordsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
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 RecordsettingPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "接口类型") |
|||
private String interfaceType; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.win.module.wms.controller.recordsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 记录设置 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RecordsettingRespVO extends RecordsettingBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.recordsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 记录设置更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RecordsettingUpdateReqVO extends RecordsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.requestsetting; |
|||
|
|||
import com.win.module.wms.controller.requestsetting.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.requestsetting.vo.*; |
|||
import com.win.module.wms.dal.dataobject.requestsetting.RequestsettingDO; |
|||
import com.win.module.wms.convert.requestsetting.RequestsettingConvert; |
|||
import com.win.module.wms.service.requestsetting.RequestsettingService; |
|||
|
|||
@Tag(name = "管理后台 - 申请设置") |
|||
@RestController |
|||
@RequestMapping("/wms/requestsetting") |
|||
@Validated |
|||
public class RequestsettingController { |
|||
|
|||
@Resource |
|||
private RequestsettingService requestsettingService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建申请设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:requestsetting:create')") |
|||
public CommonResult<Long> createRequestsetting(@Valid @RequestBody RequestsettingCreateReqVO createReqVO) { |
|||
return success(requestsettingService.createRequestsetting(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新申请设置") |
|||
@PreAuthorize("@ss.hasPermission('wms:requestsetting:update')") |
|||
public CommonResult<Boolean> updateRequestsetting(@Valid @RequestBody RequestsettingUpdateReqVO updateReqVO) { |
|||
requestsettingService.updateRequestsetting(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除申请设置") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:requestsetting:delete')") |
|||
public CommonResult<Boolean> deleteRequestsetting(@RequestParam("id") Long id) { |
|||
requestsettingService.deleteRequestsetting(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得申请设置") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:requestsetting:query')") |
|||
public CommonResult<RequestsettingRespVO> getRequestsetting(@RequestParam("id") Long id) { |
|||
RequestsettingDO requestsetting = requestsettingService.getRequestsetting(id); |
|||
return success(RequestsettingConvert.INSTANCE.convert(requestsetting)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得申请设置列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:requestsetting:query')") |
|||
public CommonResult<List<RequestsettingRespVO>> getRequestsettingList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<RequestsettingDO> list = requestsettingService.getRequestsettingList(ids); |
|||
return success(RequestsettingConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得申请设置分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:requestsetting:query')") |
|||
public CommonResult<PageResult<RequestsettingRespVO>> getRequestsettingPage(@Valid RequestsettingPageReqVO pageVO) { |
|||
PageResult<RequestsettingDO> pageResult = requestsettingService.getRequestsettingPage(pageVO); |
|||
return success(RequestsettingConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出申请设置 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:requestsetting:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportRequestsettingExcel(@Valid RequestsettingExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<RequestsettingDO> list = requestsettingService.getRequestsettingList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<RequestsettingExcelVO> datas = RequestsettingConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "申请设置.xls", "数据", RequestsettingExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
package com.win.module.wms.controller.requestsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import javax.validation.constraints.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 申请设置 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class RequestsettingBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "代码不能为空") |
|||
private String code; |
|||
|
|||
@Schema(description = "申请模式", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "申请模式不能为空") |
|||
private String requestMode; |
|||
|
|||
@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 = "自动提交", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "自动提交不能为空") |
|||
private String autoCommit; |
|||
|
|||
@Schema(description = "自动通过", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "自动通过不能为空") |
|||
private String autoAgree; |
|||
|
|||
@Schema(description = "自动执行", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "自动执行不能为空") |
|||
private String autoExecute; |
|||
|
|||
@Schema(description = "跳过任务直接生成记录", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "跳过任务直接生成记录不能为空") |
|||
private String directCreateRecord; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.requestsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 申请设置创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RequestsettingCreateReqVO extends RequestsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,65 @@ |
|||
package com.win.module.wms.controller.requestsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.win.framework.excel.core.annotations.DictFormat; |
|||
import com.win.framework.excel.core.convert.DictConvert; |
|||
|
|||
|
|||
/** |
|||
* 申请设置 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class RequestsettingExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty(value = "申请模式", converter = DictConvert.class) |
|||
@DictFormat("reqeust_mode") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
|||
private String requestMode; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
@ExcelProperty("自动提交") |
|||
private String autoCommit; |
|||
|
|||
@ExcelProperty("自动通过") |
|||
private String autoAgree; |
|||
|
|||
@ExcelProperty("自动执行") |
|||
private String autoExecute; |
|||
|
|||
@ExcelProperty("跳过任务直接生成记录") |
|||
private String directCreateRecord; |
|||
|
|||
@ExcelProperty("是否可用") |
|||
private String available; |
|||
|
|||
@ExcelProperty("是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.win.module.wms.controller.requestsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
import java.time.LocalDateTime; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 申请设置 Excel 导出 Request VO,参数和 RequestsettingPageReqVO 是一致的") |
|||
@Data |
|||
public class RequestsettingExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "申请模式") |
|||
private String requestMode; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "自动提交") |
|||
private String autoCommit; |
|||
|
|||
@Schema(description = "自动通过") |
|||
private String autoAgree; |
|||
|
|||
@Schema(description = "自动执行") |
|||
private String autoExecute; |
|||
|
|||
@Schema(description = "跳过任务直接生成记录") |
|||
private String directCreateRecord; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,60 @@ |
|||
package com.win.module.wms.controller.requestsetting.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
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 RequestsettingPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "申请模式") |
|||
private String requestMode; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "自动提交") |
|||
private String autoCommit; |
|||
|
|||
@Schema(description = "自动通过") |
|||
private String autoAgree; |
|||
|
|||
@Schema(description = "自动执行") |
|||
private String autoExecute; |
|||
|
|||
@Schema(description = "跳过任务直接生成记录") |
|||
private String directCreateRecord; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "是否软删除") |
|||
private String isSoftDeleted; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.win.module.wms.controller.requestsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 申请设置 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RequestsettingRespVO extends RequestsettingBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.requestsetting.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 申请设置更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RequestsettingUpdateReqVO extends RequestsettingBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.rule; |
|||
|
|||
import com.win.module.wms.controller.rule.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.rule.vo.*; |
|||
import com.win.module.wms.dal.dataobject.rule.RuleDO; |
|||
import com.win.module.wms.convert.rule.RuleConvert; |
|||
import com.win.module.wms.service.rule.RuleService; |
|||
|
|||
@Tag(name = "管理后台 - 规则") |
|||
@RestController |
|||
@RequestMapping("/wms/rule") |
|||
@Validated |
|||
public class RuleController { |
|||
|
|||
@Resource |
|||
private RuleService ruleService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建规则") |
|||
@PreAuthorize("@ss.hasPermission('wms:rule:create')") |
|||
public CommonResult<Long> createRule(@Valid @RequestBody RuleCreateReqVO createReqVO) { |
|||
return success(ruleService.createRule(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新规则") |
|||
@PreAuthorize("@ss.hasPermission('wms:rule:update')") |
|||
public CommonResult<Boolean> updateRule(@Valid @RequestBody RuleUpdateReqVO updateReqVO) { |
|||
ruleService.updateRule(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除规则") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:rule:delete')") |
|||
public CommonResult<Boolean> deleteRule(@RequestParam("id") Long id) { |
|||
ruleService.deleteRule(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得规则") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:rule:query')") |
|||
public CommonResult<RuleRespVO> getRule(@RequestParam("id") Long id) { |
|||
RuleDO rule = ruleService.getRule(id); |
|||
return success(RuleConvert.INSTANCE.convert(rule)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得规则列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:rule:query')") |
|||
public CommonResult<List<RuleRespVO>> getRuleList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<RuleDO> list = ruleService.getRuleList(ids); |
|||
return success(RuleConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得规则分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:rule:query')") |
|||
public CommonResult<PageResult<RuleRespVO>> getRulePage(@Valid RulePageReqVO pageVO) { |
|||
PageResult<RuleDO> pageResult = ruleService.getRulePage(pageVO); |
|||
return success(RuleConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出规则 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:rule:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportRuleExcel(@Valid RuleExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<RuleDO> list = ruleService.getRuleList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<RuleExcelVO> datas = RuleConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "规则.xls", "数据", RuleExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.win.module.wms.controller.rule.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import javax.validation.constraints.*; |
|||
|
|||
/** |
|||
* 规则 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class RuleBaseVO { |
|||
|
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "策略代码", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "策略代码不能为空") |
|||
private String strategyCode; |
|||
|
|||
@Schema(description = "优先级", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "优先级不能为空") |
|||
private Integer priority; |
|||
|
|||
@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 condition; |
|||
|
|||
@Schema(description = "配置") |
|||
private String configuration; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.rule.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 规则创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RuleCreateReqVO extends RuleBaseVO { |
|||
|
|||
} |
@ -0,0 +1,38 @@ |
|||
package com.win.module.wms.controller.rule.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
|
|||
/** |
|||
* 规则 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class RuleExcelVO { |
|||
|
|||
@ExcelProperty("策略代码") |
|||
private String strategyCode; |
|||
|
|||
@ExcelProperty("优先级") |
|||
private Integer priority; |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("名称") |
|||
private String name; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty("条件") |
|||
private String condition; |
|||
|
|||
@ExcelProperty("配置") |
|||
private String configuration; |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.win.module.wms.controller.rule.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
|
|||
@Schema(description = "管理后台 - 规则 Excel 导出 Request VO,参数和 RulePageReqVO 是一致的") |
|||
@Data |
|||
public class RuleExportReqVO { |
|||
|
|||
@Schema(description = "策略代码") |
|||
private String strategyCode; |
|||
|
|||
@Schema(description = "优先级") |
|||
private Integer priority; |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "条件") |
|||
private String condition; |
|||
|
|||
@Schema(description = "配置") |
|||
private String configuration; |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.win.module.wms.controller.rule.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
|
|||
@Schema(description = "管理后台 - 规则分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RulePageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "策略代码") |
|||
private String strategyCode; |
|||
|
|||
@Schema(description = "优先级") |
|||
private Integer priority; |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@Schema(description = "条件") |
|||
private String condition; |
|||
|
|||
@Schema(description = "配置") |
|||
private String configuration; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.rule.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 规则 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RuleRespVO extends RuleBaseVO { |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.rule.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 规则更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class RuleUpdateReqVO extends RuleBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.shift; |
|||
|
|||
import com.win.module.wms.controller.shift.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.admin.shift.vo.*; |
|||
import com.win.module.wms.dal.dataobject.shift.ShiftDO; |
|||
import com.win.module.wms.convert.shift.ShiftConvert; |
|||
import com.win.module.wms.service.shift.ShiftService; |
|||
|
|||
@Tag(name = "管理后台 - 班次") |
|||
@RestController |
|||
@RequestMapping("/wms/shift") |
|||
@Validated |
|||
public class ShiftController { |
|||
|
|||
@Resource |
|||
private ShiftService shiftService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建班次") |
|||
@PreAuthorize("@ss.hasPermission('wms:shift:create')") |
|||
public CommonResult<Long> createShift(@Valid @RequestBody ShiftCreateReqVO createReqVO) { |
|||
return success(shiftService.createShift(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新班次") |
|||
@PreAuthorize("@ss.hasPermission('wms:shift:update')") |
|||
public CommonResult<Boolean> updateShift(@Valid @RequestBody ShiftUpdateReqVO updateReqVO) { |
|||
shiftService.updateShift(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除班次") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:shift:delete')") |
|||
public CommonResult<Boolean> deleteShift(@RequestParam("id") Long id) { |
|||
shiftService.deleteShift(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得班次") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:shift:query')") |
|||
public CommonResult<ShiftRespVO> getShift(@RequestParam("id") Long id) { |
|||
ShiftDO shift = shiftService.getShift(id); |
|||
return success(ShiftConvert.INSTANCE.convert(shift)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得班次列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:shift:query')") |
|||
public CommonResult<List<ShiftRespVO>> getShiftList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<ShiftDO> list = shiftService.getShiftList(ids); |
|||
return success(ShiftConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得班次分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:shift:query')") |
|||
public CommonResult<PageResult<ShiftRespVO>> getShiftPage(@Valid ShiftPageReqVO pageVO) { |
|||
PageResult<ShiftDO> pageResult = shiftService.getShiftPage(pageVO); |
|||
return success(ShiftConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出班次 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:shift:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportShiftExcel(@Valid ShiftExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<ShiftDO> list = shiftService.getShiftList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<ShiftExcelVO> datas = ShiftConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "班次.xls", "数据", ShiftExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,67 @@ |
|||
package com.win.module.wms.controller.shift.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import javax.validation.constraints.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 班次 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class ShiftBaseVO { |
|||
|
|||
@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 = "开始时间不能为空") |
|||
@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 entTime; |
|||
|
|||
@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 = "是否跨天", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否跨天不能为空") |
|||
private String endAtNextDay; |
|||
|
|||
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.shift.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 班次创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ShiftCreateReqVO extends ShiftBaseVO { |
|||
|
|||
} |
@ -0,0 +1,60 @@ |
|||
package com.win.module.wms.controller.shift.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
|
|||
/** |
|||
* 班次 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class ShiftExcelVO { |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("名称") |
|||
private String name; |
|||
|
|||
@ExcelProperty("描述") |
|||
private String description; |
|||
|
|||
@ExcelProperty("开始时间") |
|||
private LocalDateTime beginTime; |
|||
|
|||
@ExcelProperty("结束时间") |
|||
private LocalDateTime entTime; |
|||
|
|||
@ExcelProperty("生效时间") |
|||
private LocalDateTime activeTime; |
|||
|
|||
@ExcelProperty("失效时间") |
|||
private LocalDateTime expireTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("创建者ID") |
|||
private String creator; |
|||
|
|||
@ExcelProperty("是否跨天") |
|||
private String endAtNextDay; |
|||
|
|||
@ExcelProperty("是否可用") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.win.module.wms.controller.shift.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
import java.time.LocalDateTime; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 班次 Excel 导出 Request VO,参数和 ShiftPageReqVO 是一致的") |
|||
@Data |
|||
public class ShiftExportReqVO { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@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[] entTime; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "是否跨天") |
|||
private String endAtNextDay; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
package com.win.module.wms.controller.shift.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
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 ShiftPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "名称") |
|||
private String name; |
|||
|
|||
@Schema(description = "描述") |
|||
private String description; |
|||
|
|||
@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[] entTime; |
|||
|
|||
@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; |
|||
|
|||
@Schema(description = "是否跨天") |
|||
private String endAtNextDay; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.win.module.wms.controller.shift.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 班次 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ShiftRespVO extends ShiftBaseVO { |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "创建者ID", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
private String creator; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.shift.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 班次更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ShiftUpdateReqVO extends ShiftBaseVO { |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.win.module.wms.controller.team; |
|||
|
|||
import com.win.module.wms.controller.team.vo.*; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import javax.validation.*; |
|||
import javax.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import com.win.module.wms.controller.team.vo.*; |
|||
import com.win.module.wms.dal.dataobject.team.TeamDO; |
|||
import com.win.module.wms.convert.team.TeamConvert; |
|||
import com.win.module.wms.service.team.TeamService; |
|||
|
|||
@Tag(name = "管理后台 - 班组") |
|||
@RestController |
|||
@RequestMapping("/wms/team") |
|||
@Validated |
|||
public class TeamController { |
|||
|
|||
@Resource |
|||
private TeamService teamService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建班组") |
|||
@PreAuthorize("@ss.hasPermission('wms:team:create')") |
|||
public CommonResult<Long> createTeam(@Valid @RequestBody TeamCreateReqVO createReqVO) { |
|||
return success(teamService.createTeam(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新班组") |
|||
@PreAuthorize("@ss.hasPermission('wms:team:update')") |
|||
public CommonResult<Boolean> updateTeam(@Valid @RequestBody TeamUpdateReqVO updateReqVO) { |
|||
teamService.updateTeam(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除班组") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:team:delete')") |
|||
public CommonResult<Boolean> deleteTeam(@RequestParam("id") Long id) { |
|||
teamService.deleteTeam(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得班组") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:team:query')") |
|||
public CommonResult<TeamRespVO> getTeam(@RequestParam("id") Long id) { |
|||
TeamDO team = teamService.getTeam(id); |
|||
return success(TeamConvert.INSTANCE.convert(team)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得班组列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:team:query')") |
|||
public CommonResult<List<TeamRespVO>> getTeamList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<TeamDO> list = teamService.getTeamList(ids); |
|||
return success(TeamConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得班组分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:team:query')") |
|||
public CommonResult<PageResult<TeamRespVO>> getTeamPage(@Valid TeamPageReqVO pageVO) { |
|||
PageResult<TeamDO> pageResult = teamService.getTeamPage(pageVO); |
|||
return success(TeamConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出班组 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:team:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportTeamExcel(@Valid TeamExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<TeamDO> list = teamService.getTeamList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<TeamExcelVO> datas = TeamConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "班组.xls", "数据", TeamExcelVO.class, datas); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.win.module.wms.controller.team.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import javax.validation.constraints.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 班组 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class TeamBaseVO { |
|||
|
|||
@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 members; |
|||
|
|||
@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 = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "是否可用不能为空") |
|||
private String available; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.team.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 班组创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class TeamCreateReqVO extends TeamBaseVO { |
|||
|
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue