forked from sfms3.0/sfms3.0
37 changed files with 1867 additions and 14 deletions
@ -0,0 +1,135 @@ |
|||
package com.win.module.wms.controller.containerBind; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.containerBind.vo.*; |
|||
import com.win.module.wms.convert.containerBind.ContainerBindRecordDetailConvert; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordDetailDO; |
|||
import com.win.module.wms.service.containerBind.ContainerBindRecordDetailService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.time.LocalDateTime; |
|||
import java.time.ZoneOffset; |
|||
import java.util.*; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 器具绑定记录子") |
|||
@RestController |
|||
@RequestMapping("/wms/container-bind-record-detail") |
|||
@Validated |
|||
public class ContainerBindRecordDetailController { |
|||
|
|||
@Resource |
|||
private ContainerBindRecordDetailService containerBindRecordDetailService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建器具绑定记录子") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-detail:create')") |
|||
public CommonResult<Long> createContainerBindRecordDetail(@Valid @RequestBody ContainerBindRecordDetailCreateReqVO createReqVO) { |
|||
return success(containerBindRecordDetailService.createContainerBindRecordDetail(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新器具绑定记录子") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-detail:update')") |
|||
public CommonResult<Boolean> updateContainerBindRecordDetail(@Valid @RequestBody ContainerBindRecordDetailUpdateReqVO updateReqVO) { |
|||
int result = containerBindRecordDetailService.updateContainerBindRecordDetail(updateReqVO); |
|||
return success(result > 0); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除器具绑定记录子") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-detail:delete')") |
|||
public CommonResult<Boolean> deleteContainerBindRecordDetail(@RequestParam("id") Long id) { |
|||
int result = containerBindRecordDetailService.deleteContainerBindRecordDetail(id); |
|||
return success(result > 0); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得器具绑定记录子") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-detail:query')") |
|||
public CommonResult<ContainerBindRecordDetailRespVO> getContainerBindRecordDetail(@RequestParam("id") Long id) { |
|||
ContainerBindRecordDetailDO containerBindRecordDetail = containerBindRecordDetailService.getContainerBindRecordDetail(id); |
|||
return success(ContainerBindRecordDetailConvert.INSTANCE.convert(containerBindRecordDetail)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得器具绑定记录子列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-detail:query')") |
|||
public CommonResult<List<ContainerBindRecordDetailRespVO>> getContainerBindRecordDetailList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<ContainerBindRecordDetailDO> list = containerBindRecordDetailService.getContainerBindRecordDetailList(ids); |
|||
return success(ContainerBindRecordDetailConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得器具绑定记录子分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-detail:query')") |
|||
public CommonResult<PageResult<ContainerBindRecordDetailRespVO>> getContainerBindRecordDetailPage(@Valid ContainerBindRecordDetailPageReqVO pageVO) { |
|||
PageResult<ContainerBindRecordDetailDO> pageResult = containerBindRecordDetailService.getContainerBindRecordDetailPage(pageVO); |
|||
return success(ContainerBindRecordDetailConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出器具绑定记录子 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-detail:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportContainerBindRecordDetailExcel(@Valid ContainerBindRecordDetailExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<ContainerBindRecordDetailDO> list = containerBindRecordDetailService.getContainerBindRecordDetailList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<ContainerBindRecordDetailExcelVO> datas = ContainerBindRecordDetailConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "器具绑定记录子.xls", "数据", ContainerBindRecordDetailExcelVO.class, datas); |
|||
} |
|||
|
|||
@GetMapping("/get-import-template") |
|||
@Operation(summary = "获得导入器具绑定记录子模板") |
|||
public void importTemplate(HttpServletResponse response) throws IOException { |
|||
List<ContainerBindRecordDetailExcelVO> list = Arrays.asList(); |
|||
// 输出
|
|||
ExcelUtils.write(response, "器具绑定记录子基本信息导入模板.xls", "器具绑定记录子基本信息列表", ContainerBindRecordDetailExcelVO.class, list); |
|||
} |
|||
|
|||
@PostMapping("/import") |
|||
@Operation(summary = "导入器具绑定记录子基本信息") |
|||
@Parameters({ |
|||
@Parameter(name = "file", description = "Excel 文件", required = true), |
|||
@Parameter(name = "mode", description = "导入模式1更新2追加3覆盖", example = "1"), |
|||
@Parameter(name = "updatePart", description = "部分更新,默认为 true", example = "true") |
|||
}) |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-detail:import')") |
|||
public CommonResult<Map<String, Object>> importExcel(HttpServletResponse response, |
|||
@RequestParam("file") MultipartFile file, |
|||
@RequestParam(value = "mode") Integer mode, |
|||
@RequestParam(value = "updatePart", required = false, defaultValue = "false") Boolean updatePart) throws Exception { |
|||
|
|||
List<ContainerBindRecordDetailExcelVO> list = ExcelUtils.read(file, ContainerBindRecordDetailExcelVO.class); |
|||
List<ContainerBindRecordDetailExcelVO> errorList = containerBindRecordDetailService.importContainerBindRecordDetailList(list, mode, updatePart); |
|||
|
|||
Map<String, Object> returnMap = new HashMap<>(); |
|||
returnMap.put("errorCount", errorList.size()); |
|||
if(!errorList.isEmpty()) { |
|||
String url = ExcelUtils.writeLocalFile("器具绑定记录子基本信息导入错误数据" + LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")) + ".xlsx", "错误列表", errorList); |
|||
returnMap.put("errorFile", url); |
|||
} |
|||
|
|||
return success(returnMap); |
|||
} |
|||
} |
@ -0,0 +1,135 @@ |
|||
package com.win.module.wms.controller.containerBind; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.excel.core.util.ExcelUtils; |
|||
import com.win.framework.operatelog.core.annotations.OperateLog; |
|||
import com.win.module.wms.controller.containerBind.vo.*; |
|||
import com.win.module.wms.convert.containerBind.ContainerBindRecordMainConvert; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordMainDO; |
|||
import com.win.module.wms.service.containerBind.ContainerBindRecordMainService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import java.io.IOException; |
|||
import java.time.LocalDateTime; |
|||
import java.time.ZoneOffset; |
|||
import java.util.*; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|||
|
|||
@Tag(name = "管理后台 - 器具绑定记录主") |
|||
@RestController |
|||
@RequestMapping("/wms/container-bind-record-main") |
|||
@Validated |
|||
public class ContainerBindRecordMainController { |
|||
|
|||
@Resource |
|||
private ContainerBindRecordMainService containerBindRecordMainService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建器具绑定记录主") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-main:create')") |
|||
public CommonResult<Long> createContainerBindRecordMain(@Valid @RequestBody ContainerBindRecordMainCreateReqVO createReqVO) { |
|||
return success(containerBindRecordMainService.createContainerBindRecordMain(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新器具绑定记录主") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-main:update')") |
|||
public CommonResult<Boolean> updateContainerBindRecordMain(@Valid @RequestBody ContainerBindRecordMainUpdateReqVO updateReqVO) { |
|||
int result = containerBindRecordMainService.updateContainerBindRecordMain(updateReqVO); |
|||
return success(result > 0); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除器具绑定记录主") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-main:delete')") |
|||
public CommonResult<Boolean> deleteContainerBindRecordMain(@RequestParam("id") Long id) { |
|||
int result = containerBindRecordMainService.deleteContainerBindRecordMain(id); |
|||
return success(result > 0); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得器具绑定记录主") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-main:query')") |
|||
public CommonResult<ContainerBindRecordMainRespVO> getContainerBindRecordMain(@RequestParam("id") Long id) { |
|||
ContainerBindRecordMainDO containerBindRecordMain = containerBindRecordMainService.getContainerBindRecordMain(id); |
|||
return success(ContainerBindRecordMainConvert.INSTANCE.convert(containerBindRecordMain)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得器具绑定记录主列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-main:query')") |
|||
public CommonResult<List<ContainerBindRecordMainRespVO>> getContainerBindRecordMainList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<ContainerBindRecordMainDO> list = containerBindRecordMainService.getContainerBindRecordMainList(ids); |
|||
return success(ContainerBindRecordMainConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得器具绑定记录主分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-main:query')") |
|||
public CommonResult<PageResult<ContainerBindRecordMainRespVO>> getContainerBindRecordMainPage(@Valid ContainerBindRecordMainPageReqVO pageVO) { |
|||
PageResult<ContainerBindRecordMainDO> pageResult = containerBindRecordMainService.getContainerBindRecordMainPage(pageVO); |
|||
return success(ContainerBindRecordMainConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出器具绑定记录主 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-main:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportContainerBindRecordMainExcel(@Valid ContainerBindRecordMainExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<ContainerBindRecordMainDO> list = containerBindRecordMainService.getContainerBindRecordMainList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<ContainerBindRecordMainExcelVO> datas = ContainerBindRecordMainConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "器具绑定记录主.xls", "数据", ContainerBindRecordMainExcelVO.class, datas); |
|||
} |
|||
|
|||
@GetMapping("/get-import-template") |
|||
@Operation(summary = "获得导入器具绑定记录主模板") |
|||
public void importTemplate(HttpServletResponse response) throws IOException { |
|||
List<ContainerBindRecordMainExcelVO> list = Arrays.asList(); |
|||
// 输出
|
|||
ExcelUtils.write(response, "器具绑定记录主基本信息导入模板.xls", "器具绑定记录主基本信息列表", ContainerBindRecordMainExcelVO.class, list); |
|||
} |
|||
|
|||
@PostMapping("/import") |
|||
@Operation(summary = "导入器具绑定记录主基本信息") |
|||
@Parameters({ |
|||
@Parameter(name = "file", description = "Excel 文件", required = true), |
|||
@Parameter(name = "mode", description = "导入模式1更新2追加3覆盖", example = "1"), |
|||
@Parameter(name = "updatePart", description = "部分更新,默认为 true", example = "true") |
|||
}) |
|||
@PreAuthorize("@ss.hasPermission('wms:container-bind-record-main:import')") |
|||
public CommonResult<Map<String, Object>> importExcel(HttpServletResponse response, |
|||
@RequestParam("file") MultipartFile file, |
|||
@RequestParam(value = "mode") Integer mode, |
|||
@RequestParam(value = "updatePart", required = false, defaultValue = "false") Boolean updatePart) throws Exception { |
|||
|
|||
List<ContainerBindRecordMainExcelVO> list = ExcelUtils.read(file, ContainerBindRecordMainExcelVO.class); |
|||
List<ContainerBindRecordMainExcelVO> errorList = containerBindRecordMainService.importContainerBindRecordMainList(list, mode, updatePart); |
|||
|
|||
Map<String, Object> returnMap = new HashMap<>(); |
|||
returnMap.put("errorCount", errorList.size()); |
|||
if(!errorList.isEmpty()) { |
|||
String url = ExcelUtils.writeLocalFile("器具绑定记录主基本信息导入错误数据" + LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")) + ".xlsx", "错误列表", errorList); |
|||
returnMap.put("errorFile", url); |
|||
} |
|||
|
|||
return success(returnMap); |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 器具绑定记录子 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class ContainerBindRecordDetailBaseVO { |
|||
|
|||
@Schema(description = "内容物类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
|||
@NotNull(message = "内容物类型不能为空") |
|||
private String containerContentType; |
|||
|
|||
@Schema(description = "内容物号") |
|||
private String contentNumber; |
|||
|
|||
@Schema(description = "物料代码") |
|||
private String itemCode; |
|||
|
|||
@Schema(description = "批次") |
|||
private String batch; |
|||
|
|||
@Schema(description = "库存状态", example = "2") |
|||
private String inventoryStatus; |
|||
|
|||
@Schema(description = "计量单位") |
|||
private String uom; |
|||
|
|||
@Schema(description = "数量") |
|||
private BigDecimal qty; |
|||
|
|||
@Schema(description = "主表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21761") |
|||
@NotNull(message = "主表ID不能为空") |
|||
private Long masterId; |
|||
|
|||
@Schema(description = "单据号", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "单据号不能为空") |
|||
private String number; |
|||
|
|||
@Schema(description = "地点ID", example = "15969") |
|||
private String siteId; |
|||
|
|||
@Schema(description = "备注", example = "你猜") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录子创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ContainerBindRecordDetailCreateReqVO extends ContainerBindRecordDetailBaseVO { |
|||
|
|||
} |
@ -0,0 +1,56 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
/** |
|||
* 器具绑定记录子 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class ContainerBindRecordDetailExcelVO { |
|||
|
|||
@ExcelProperty("id") |
|||
private Long id; |
|||
|
|||
@ExcelProperty("内容物类型") |
|||
private String containerContentType; |
|||
|
|||
@ExcelProperty("内容物号") |
|||
private String contentNumber; |
|||
|
|||
@ExcelProperty("物料代码") |
|||
private String itemCode; |
|||
|
|||
@ExcelProperty("批次") |
|||
private String batch; |
|||
|
|||
@ExcelProperty("库存状态") |
|||
private String inventoryStatus; |
|||
|
|||
@ExcelProperty("计量单位") |
|||
private String uom; |
|||
|
|||
@ExcelProperty("数量") |
|||
private BigDecimal qty; |
|||
|
|||
@ExcelProperty("主表ID") |
|||
private Long masterId; |
|||
|
|||
@ExcelProperty("单据号") |
|||
private String number; |
|||
|
|||
@ExcelProperty("地点ID") |
|||
private String siteId; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录子 Excel 导出 Request VO,参数和 ContainerBindRecordDetailPageReqVO 是一致的") |
|||
@Data |
|||
public class ContainerBindRecordDetailExportReqVO { |
|||
|
|||
@Schema(description = "内容物类型", example = "1") |
|||
private String containerContentType; |
|||
|
|||
@Schema(description = "内容物号") |
|||
private String contentNumber; |
|||
|
|||
@Schema(description = "物料代码") |
|||
private String itemCode; |
|||
|
|||
@Schema(description = "批次") |
|||
private String batch; |
|||
|
|||
@Schema(description = "库存状态", example = "2") |
|||
private String inventoryStatus; |
|||
|
|||
@Schema(description = "计量单位") |
|||
private String uom; |
|||
|
|||
@Schema(description = "数量") |
|||
private BigDecimal qty; |
|||
|
|||
@Schema(description = "主表ID", example = "21761") |
|||
private Long masterId; |
|||
|
|||
@Schema(description = "单据号") |
|||
private String number; |
|||
|
|||
@Schema(description = "地点ID", example = "15969") |
|||
private String siteId; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "备注", example = "你猜") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import com.win.framework.common.pojo.PageParam; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录子分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ContainerBindRecordDetailPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "内容物类型", example = "1") |
|||
private String containerContentType; |
|||
|
|||
@Schema(description = "内容物号") |
|||
private String contentNumber; |
|||
|
|||
@Schema(description = "物料代码") |
|||
private String itemCode; |
|||
|
|||
@Schema(description = "批次") |
|||
private String batch; |
|||
|
|||
@Schema(description = "库存状态", example = "2") |
|||
private String inventoryStatus; |
|||
|
|||
@Schema(description = "计量单位") |
|||
private String uom; |
|||
|
|||
@Schema(description = "数量") |
|||
private BigDecimal qty; |
|||
|
|||
@Schema(description = "主表ID", example = "21761") |
|||
private Long masterId; |
|||
|
|||
@Schema(description = "单据号") |
|||
private String number; |
|||
|
|||
@Schema(description = "地点ID", example = "15969") |
|||
private String siteId; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "备注", example = "你猜") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录子 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ContainerBindRecordDetailRespVO extends ContainerBindRecordDetailBaseVO { |
|||
|
|||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "50") |
|||
private Long id; |
|||
|
|||
@Schema(description = "创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录子更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ContainerBindRecordDetailUpdateReqVO extends ContainerBindRecordDetailBaseVO { |
|||
|
|||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "50") |
|||
@NotNull(message = "id不能为空") |
|||
private Long id; |
|||
|
|||
} |
@ -0,0 +1,91 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
/** |
|||
* 器具绑定记录主 Base VO,提供给添加、修改、详细的子 VO 使用 |
|||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
|||
*/ |
|||
@Data |
|||
public class ContainerBindRecordMainBaseVO { |
|||
|
|||
@Schema(description = "单据号") |
|||
private String number; |
|||
|
|||
@Schema(description = "器具号") |
|||
private String containerNumber; |
|||
|
|||
@Schema(description = "从仓库代码") |
|||
private String fromWarehouseCode; |
|||
|
|||
@Schema(description = "到仓库代码") |
|||
private String toWarehouseCode; |
|||
|
|||
@Schema(description = "出库事务类型", example = "1") |
|||
private String outTransactionType; |
|||
|
|||
@Schema(description = "入库事务类型", example = "2") |
|||
private String inTransactionType; |
|||
|
|||
@Schema(description = "执行时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime executeTime; |
|||
|
|||
@Schema(description = "生效日期") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime activeDate; |
|||
|
|||
@Schema(description = "是否可用") |
|||
private String available; |
|||
|
|||
@Schema(description = "申请时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime requestTime; |
|||
|
|||
@Schema(description = "截止时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime dueTime; |
|||
|
|||
@Schema(description = "部门") |
|||
private String departmentCode; |
|||
|
|||
@Schema(description = "用户组") |
|||
private String userGroupCode; |
|||
|
|||
@Schema(description = "接口类型", example = "2") |
|||
private String interfaceType; |
|||
|
|||
@Schema(description = "业务类型", example = "1") |
|||
private String businessType; |
|||
|
|||
@Schema(description = "备注", example = "随便") |
|||
private String remark; |
|||
|
|||
@Schema(description = "扩展属性") |
|||
private String extraProperties; |
|||
|
|||
@Schema(description = "地点ID", example = "9596") |
|||
private String siteId; |
|||
|
|||
@Schema(description = "代码") |
|||
private String code; |
|||
|
|||
@Schema(description = "从库位类型范围") |
|||
private String fromLocationTypes; |
|||
|
|||
@Schema(description = "到库位类型范围") |
|||
private String toLocationTypes; |
|||
|
|||
@Schema(description = "从库区代码范围") |
|||
private String fromAreaCodes; |
|||
|
|||
@Schema(description = "到库区代码范围") |
|||
private String toAreaCodes; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录主创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ContainerBindRecordMainCreateReqVO extends ContainerBindRecordMainBaseVO { |
|||
|
|||
} |
@ -0,0 +1,88 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
/** |
|||
* 器具绑定记录主 Excel VO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Data |
|||
public class ContainerBindRecordMainExcelVO { |
|||
|
|||
@ExcelProperty("单据号") |
|||
private String number; |
|||
|
|||
@ExcelProperty("器具号") |
|||
private String containerNumber; |
|||
|
|||
@ExcelProperty("从仓库代码") |
|||
private String fromWarehouseCode; |
|||
|
|||
@ExcelProperty("到仓库代码") |
|||
private String toWarehouseCode; |
|||
|
|||
@ExcelProperty("出库事务类型") |
|||
private String outTransactionType; |
|||
|
|||
@ExcelProperty("入库事务类型") |
|||
private String inTransactionType; |
|||
|
|||
@ExcelProperty("执行时间") |
|||
private LocalDateTime executeTime; |
|||
|
|||
@ExcelProperty("生效日期") |
|||
private LocalDateTime activeDate; |
|||
|
|||
@ExcelProperty("是否可用") |
|||
private String available; |
|||
|
|||
@ExcelProperty("申请时间") |
|||
private LocalDateTime requestTime; |
|||
|
|||
@ExcelProperty("截止时间") |
|||
private LocalDateTime dueTime; |
|||
|
|||
@ExcelProperty("部门") |
|||
private String departmentCode; |
|||
|
|||
@ExcelProperty("用户组") |
|||
private String userGroupCode; |
|||
|
|||
@ExcelProperty("接口类型") |
|||
private String interfaceType; |
|||
|
|||
@ExcelProperty("业务类型") |
|||
private String businessType; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@ExcelProperty("扩展属性") |
|||
private String extraProperties; |
|||
|
|||
@ExcelProperty("地点ID") |
|||
private String siteId; |
|||
|
|||
@ExcelProperty("代码") |
|||
private String code; |
|||
|
|||
@ExcelProperty("从库位类型范围") |
|||
private String fromLocationTypes; |
|||
|
|||
@ExcelProperty("到库位类型范围") |
|||
private String toLocationTypes; |
|||
|
|||
@ExcelProperty("从库区代码范围") |
|||
private String fromAreaCodes; |
|||
|
|||
@ExcelProperty("到库区代码范围") |
|||
private String toAreaCodes; |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录主 Excel 导出 Request VO,参数和 ContainerBindRecordMainPageReqVO 是一致的") |
|||
@Data |
|||
public class ContainerBindRecordMainExportReqVO { |
|||
|
|||
@Schema(description = "单据号") |
|||
private String number; |
|||
|
|||
@Schema(description = "器具号") |
|||
private String containerNumber; |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import com.win.framework.common.pojo.PageParam; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录主分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ContainerBindRecordMainPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "单据号") |
|||
private String number; |
|||
|
|||
@Schema(description = "器具号") |
|||
private String containerNumber; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录主 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ContainerBindRecordMainRespVO extends ContainerBindRecordMainBaseVO { |
|||
|
|||
@Schema(description = "创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.win.module.wms.controller.containerBind.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.ToString; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
|
|||
@Schema(description = "管理后台 - 器具绑定记录主更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class ContainerBindRecordMainUpdateReqVO extends ContainerBindRecordMainBaseVO { |
|||
|
|||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9992") |
|||
@NotNull(message = "id不能为空") |
|||
private Long id; |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.win.module.wms.convert.containerBind; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordDetailCreateReqVO; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordDetailExcelVO; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordDetailRespVO; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordDetailUpdateReqVO; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordDetailDO; |
|||
import org.mapstruct.Mapper; |
|||
import org.mapstruct.factory.Mappers; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 器具绑定记录子 Convert |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Mapper |
|||
public interface ContainerBindRecordDetailConvert { |
|||
|
|||
ContainerBindRecordDetailConvert INSTANCE = Mappers.getMapper(ContainerBindRecordDetailConvert.class); |
|||
|
|||
ContainerBindRecordDetailDO convert(ContainerBindRecordDetailCreateReqVO bean); |
|||
|
|||
ContainerBindRecordDetailDO convert(ContainerBindRecordDetailUpdateReqVO bean); |
|||
|
|||
ContainerBindRecordDetailRespVO convert(ContainerBindRecordDetailDO bean); |
|||
|
|||
List<ContainerBindRecordDetailRespVO> convertList(List<ContainerBindRecordDetailDO> list); |
|||
|
|||
PageResult<ContainerBindRecordDetailRespVO> convertPage(PageResult<ContainerBindRecordDetailDO> page); |
|||
|
|||
List<ContainerBindRecordDetailExcelVO> convertList02(List<ContainerBindRecordDetailDO> list); |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.win.module.wms.convert.containerBind; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordMainCreateReqVO; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordMainExcelVO; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordMainRespVO; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordMainUpdateReqVO; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordMainDO; |
|||
import org.mapstruct.Mapper; |
|||
import org.mapstruct.factory.Mappers; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 器具绑定记录主 Convert |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Mapper |
|||
public interface ContainerBindRecordMainConvert { |
|||
|
|||
ContainerBindRecordMainConvert INSTANCE = Mappers.getMapper(ContainerBindRecordMainConvert.class); |
|||
|
|||
ContainerBindRecordMainDO convert(ContainerBindRecordMainCreateReqVO bean); |
|||
|
|||
ContainerBindRecordMainDO convert(ContainerBindRecordMainUpdateReqVO bean); |
|||
|
|||
ContainerBindRecordMainRespVO convert(ContainerBindRecordMainDO bean); |
|||
|
|||
List<ContainerBindRecordMainRespVO> convertList(List<ContainerBindRecordMainDO> list); |
|||
|
|||
PageResult<ContainerBindRecordMainRespVO> convertPage(PageResult<ContainerBindRecordMainDO> page); |
|||
|
|||
List<ContainerBindRecordMainExcelVO> convertList02(List<ContainerBindRecordMainDO> list); |
|||
|
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.win.module.wms.dal.dataobject.containerBind; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.win.framework.mybatis.core.dataobject.BaseDO; |
|||
import lombok.*; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 器具绑定记录子 DO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@TableName("record_container_bind_detail") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
@Builder |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class ContainerBindRecordDetailDO extends BaseDO { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId |
|||
private Long id; |
|||
/** |
|||
* 内容物类型 |
|||
*/ |
|||
private String containerContentType; |
|||
/** |
|||
* 内容物号 |
|||
*/ |
|||
private String contentNumber; |
|||
/** |
|||
* 物料代码 |
|||
*/ |
|||
private String itemCode; |
|||
/** |
|||
* 批次 |
|||
*/ |
|||
private String batch; |
|||
/** |
|||
* 库存状态 |
|||
*/ |
|||
private String inventoryStatus; |
|||
/** |
|||
* 计量单位 |
|||
*/ |
|||
private String uom; |
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private BigDecimal qty; |
|||
/** |
|||
* 主表ID |
|||
*/ |
|||
private Long masterId; |
|||
/** |
|||
* 单据号 |
|||
*/ |
|||
private String number; |
|||
/** |
|||
* 地点ID |
|||
*/ |
|||
private String siteId; |
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,122 @@ |
|||
package com.win.module.wms.dal.dataobject.containerBind; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.win.framework.mybatis.core.dataobject.BaseDO; |
|||
import lombok.*; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
/** |
|||
* 器具绑定记录主 DO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@TableName("record_container_bind_main") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
@Builder |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class ContainerBindRecordMainDO extends BaseDO { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId |
|||
private Long id; |
|||
/** |
|||
* 单据号 |
|||
*/ |
|||
private String number; |
|||
/** |
|||
* 器具号 |
|||
*/ |
|||
private String containerNumber; |
|||
/** |
|||
* 从仓库代码 |
|||
*/ |
|||
private String fromWarehouseCode; |
|||
/** |
|||
* 到仓库代码 |
|||
*/ |
|||
private String toWarehouseCode; |
|||
/** |
|||
* 出库事务类型 |
|||
*/ |
|||
private String outTransactionType; |
|||
/** |
|||
* 入库事务类型 |
|||
*/ |
|||
private String inTransactionType; |
|||
/** |
|||
* 执行时间 |
|||
*/ |
|||
private LocalDateTime executeTime; |
|||
/** |
|||
* 生效日期 |
|||
*/ |
|||
private LocalDateTime activeDate; |
|||
/** |
|||
* 是否可用 |
|||
*/ |
|||
private String available; |
|||
/** |
|||
* 申请时间 |
|||
*/ |
|||
private LocalDateTime requestTime; |
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private LocalDateTime dueTime; |
|||
/** |
|||
* 部门 |
|||
*/ |
|||
private String departmentCode; |
|||
/** |
|||
* 用户组 |
|||
*/ |
|||
private String userGroupCode; |
|||
/** |
|||
* 接口类型 |
|||
*/ |
|||
private String interfaceType; |
|||
/** |
|||
* 业务类型 |
|||
*/ |
|||
private String businessType; |
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
/** |
|||
* 扩展属性 |
|||
*/ |
|||
private String extraProperties; |
|||
/** |
|||
* 地点ID |
|||
*/ |
|||
private String siteId; |
|||
/** |
|||
* 代码 |
|||
*/ |
|||
private String code; |
|||
/** |
|||
* 从库位类型范围 |
|||
*/ |
|||
private String fromLocationTypes; |
|||
/** |
|||
* 到库位类型范围 |
|||
*/ |
|||
private String toLocationTypes; |
|||
/** |
|||
* 从库区代码范围 |
|||
*/ |
|||
private String fromAreaCodes; |
|||
/** |
|||
* 到库区代码范围 |
|||
*/ |
|||
private String toAreaCodes; |
|||
|
|||
} |
@ -0,0 +1,55 @@ |
|||
package com.win.module.wms.dal.mysql.containerBind; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.mybatis.core.mapper.BaseMapperX; |
|||
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordDetailExportReqVO; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordDetailPageReqVO; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordDetailDO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 器具绑定记录子 Mapper |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Mapper |
|||
public interface ContainerBindRecordDetailMapper extends BaseMapperX<ContainerBindRecordDetailDO> { |
|||
|
|||
default PageResult<ContainerBindRecordDetailDO> selectPage(ContainerBindRecordDetailPageReqVO reqVO) { |
|||
return selectPage(reqVO, new LambdaQueryWrapperX<ContainerBindRecordDetailDO>() |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getContainerContentType, reqVO.getContainerContentType()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getContentNumber, reqVO.getContentNumber()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getItemCode, reqVO.getItemCode()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getBatch, reqVO.getBatch()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getInventoryStatus, reqVO.getInventoryStatus()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getUom, reqVO.getUom()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getQty, reqVO.getQty()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getMasterId, reqVO.getMasterId()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getNumber, reqVO.getNumber()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getSiteId, reqVO.getSiteId()) |
|||
.betweenIfPresent(ContainerBindRecordDetailDO::getCreateTime, reqVO.getCreateTime()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getRemark, reqVO.getRemark()) |
|||
.orderByDesc(ContainerBindRecordDetailDO::getId)); |
|||
} |
|||
|
|||
default List<ContainerBindRecordDetailDO> selectList(ContainerBindRecordDetailExportReqVO reqVO) { |
|||
return selectList(new LambdaQueryWrapperX<ContainerBindRecordDetailDO>() |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getContainerContentType, reqVO.getContainerContentType()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getContentNumber, reqVO.getContentNumber()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getItemCode, reqVO.getItemCode()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getBatch, reqVO.getBatch()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getInventoryStatus, reqVO.getInventoryStatus()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getUom, reqVO.getUom()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getQty, reqVO.getQty()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getMasterId, reqVO.getMasterId()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getNumber, reqVO.getNumber()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getSiteId, reqVO.getSiteId()) |
|||
.betweenIfPresent(ContainerBindRecordDetailDO::getCreateTime, reqVO.getCreateTime()) |
|||
.eqIfPresent(ContainerBindRecordDetailDO::getRemark, reqVO.getRemark()) |
|||
.orderByDesc(ContainerBindRecordDetailDO::getId)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.win.module.wms.dal.mysql.containerBind; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.mybatis.core.mapper.BaseMapperX; |
|||
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordMainExportReqVO; |
|||
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordMainPageReqVO; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordMainDO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 器具绑定记录主 Mapper |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Mapper |
|||
public interface ContainerBindRecordMainMapper extends BaseMapperX<ContainerBindRecordMainDO> { |
|||
|
|||
default PageResult<ContainerBindRecordMainDO> selectPage(ContainerBindRecordMainPageReqVO reqVO) { |
|||
return selectPage(reqVO, new LambdaQueryWrapperX<ContainerBindRecordMainDO>() |
|||
.eqIfPresent(ContainerBindRecordMainDO::getNumber, reqVO.getNumber()) |
|||
.eqIfPresent(ContainerBindRecordMainDO::getContainerNumber, reqVO.getContainerNumber()) |
|||
.orderByDesc(ContainerBindRecordMainDO::getId)); |
|||
} |
|||
|
|||
default List<ContainerBindRecordMainDO> selectList(ContainerBindRecordMainExportReqVO reqVO) { |
|||
return selectList(new LambdaQueryWrapperX<ContainerBindRecordMainDO>() |
|||
.eqIfPresent(ContainerBindRecordMainDO::getNumber, reqVO.getNumber()) |
|||
.eqIfPresent(ContainerBindRecordMainDO::getContainerNumber, reqVO.getContainerNumber()) |
|||
.orderByDesc(ContainerBindRecordMainDO::getId)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,81 @@ |
|||
package com.win.module.wms.service.containerBind; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.module.wms.controller.containerBind.vo.*; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordDetailDO; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 器具绑定记录子 Service 接口 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
public interface ContainerBindRecordDetailService { |
|||
|
|||
/** |
|||
* 创建器具绑定记录子 |
|||
* |
|||
* @param createReqVO 创建信息 |
|||
* @return 编号 |
|||
*/ |
|||
Long createContainerBindRecordDetail(@Valid ContainerBindRecordDetailCreateReqVO createReqVO); |
|||
|
|||
/** |
|||
* 更新器具绑定记录子 |
|||
* |
|||
* @param updateReqVO 更新信息 |
|||
*/ |
|||
Integer updateContainerBindRecordDetail(@Valid ContainerBindRecordDetailUpdateReqVO updateReqVO); |
|||
|
|||
/** |
|||
* 删除器具绑定记录子 |
|||
* |
|||
* @param id 编号 |
|||
*/ |
|||
Integer deleteContainerBindRecordDetail(Long id); |
|||
|
|||
/** |
|||
* 获得器具绑定记录子 |
|||
* |
|||
* @param id 编号 |
|||
* @return 器具绑定记录子 |
|||
*/ |
|||
ContainerBindRecordDetailDO getContainerBindRecordDetail(Long id); |
|||
|
|||
/** |
|||
* 获得器具绑定记录子列表 |
|||
* |
|||
* @param ids 编号 |
|||
* @return 器具绑定记录子列表 |
|||
*/ |
|||
List<ContainerBindRecordDetailDO> getContainerBindRecordDetailList(Collection<Long> ids); |
|||
|
|||
/** |
|||
* 获得器具绑定记录子分页 |
|||
* |
|||
* @param pageReqVO 分页查询 |
|||
* @return 器具绑定记录子分页 |
|||
*/ |
|||
PageResult<ContainerBindRecordDetailDO> getContainerBindRecordDetailPage(ContainerBindRecordDetailPageReqVO pageReqVO); |
|||
|
|||
/** |
|||
* 获得器具绑定记录子列表, 用于 Excel 导出 |
|||
* |
|||
* @param exportReqVO 查询条件 |
|||
* @return 器具绑定记录子列表 |
|||
*/ |
|||
List<ContainerBindRecordDetailDO> getContainerBindRecordDetailList(ContainerBindRecordDetailExportReqVO exportReqVO); |
|||
|
|||
/** |
|||
* 导入器具绑定记录子主信息 |
|||
* |
|||
* @param datas 导入器具绑定记录子主信息列表 |
|||
* @param mode 导入模式1更新2追加3覆盖 |
|||
* @param updatePart 是否支持更新 |
|||
* @return 导入结果 |
|||
*/ |
|||
public List<ContainerBindRecordDetailExcelVO> importContainerBindRecordDetailList(List<ContainerBindRecordDetailExcelVO> datas, Integer mode, boolean updatePart); |
|||
} |
@ -0,0 +1,109 @@ |
|||
package com.win.module.wms.service.containerBind; |
|||
|
|||
import cn.hutool.core.collection.CollUtil; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.module.wms.controller.containerBind.vo.*; |
|||
import com.win.module.wms.convert.containerBind.ContainerBindRecordDetailConvert; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordDetailDO; |
|||
import com.win.module.wms.dal.mysql.containerBind.ContainerBindRecordDetailMapper; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.ArrayList; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; |
|||
import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_BIND_RECORD_DETAIL_IMPORT_LIST_IS_EMPTY; |
|||
import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_BIND_RECORD_DETAIL_NOT_EXISTS; |
|||
|
|||
/** |
|||
* 器具绑定记录子 Service 实现类 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Service |
|||
@Validated |
|||
public class ContainerBindRecordDetailServiceImpl implements ContainerBindRecordDetailService { |
|||
|
|||
@Resource |
|||
private ContainerBindRecordDetailMapper containerBindRecordDetailMapper; |
|||
|
|||
@Override |
|||
public Long createContainerBindRecordDetail(ContainerBindRecordDetailCreateReqVO createReqVO) { |
|||
// 插入
|
|||
ContainerBindRecordDetailDO containerBindRecordDetail = ContainerBindRecordDetailConvert.INSTANCE.convert(createReqVO); |
|||
containerBindRecordDetailMapper.insert(containerBindRecordDetail); |
|||
// 返回
|
|||
return containerBindRecordDetail.getId(); |
|||
} |
|||
|
|||
@Override |
|||
public Integer updateContainerBindRecordDetail(ContainerBindRecordDetailUpdateReqVO updateReqVO) { |
|||
// 校验存在
|
|||
validateContainerBindRecordDetailExists(updateReqVO.getId()); |
|||
// 更新
|
|||
ContainerBindRecordDetailDO updateObj = ContainerBindRecordDetailConvert.INSTANCE.convert(updateReqVO); |
|||
return containerBindRecordDetailMapper.updateById(updateObj); |
|||
} |
|||
|
|||
@Override |
|||
public Integer deleteContainerBindRecordDetail(Long id) { |
|||
// 校验存在
|
|||
validateContainerBindRecordDetailExists(id); |
|||
// 删除
|
|||
return containerBindRecordDetailMapper.deleteById(id); |
|||
} |
|||
|
|||
private void validateContainerBindRecordDetailExists(Long id) { |
|||
if (containerBindRecordDetailMapper.selectById(id) == null) { |
|||
throw exception(CONTAINER_BIND_RECORD_DETAIL_NOT_EXISTS); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public ContainerBindRecordDetailDO getContainerBindRecordDetail(Long id) { |
|||
return containerBindRecordDetailMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<ContainerBindRecordDetailDO> getContainerBindRecordDetailList(Collection<Long> ids) { |
|||
return containerBindRecordDetailMapper.selectBatchIds(ids); |
|||
} |
|||
|
|||
@Override |
|||
public PageResult<ContainerBindRecordDetailDO> getContainerBindRecordDetailPage(ContainerBindRecordDetailPageReqVO pageReqVO) { |
|||
return containerBindRecordDetailMapper.selectPage(pageReqVO); |
|||
} |
|||
|
|||
@Override |
|||
public List<ContainerBindRecordDetailDO> getContainerBindRecordDetailList(ContainerBindRecordDetailExportReqVO exportReqVO) { |
|||
return containerBindRecordDetailMapper.selectList(exportReqVO); |
|||
} |
|||
|
|||
@Override |
|||
public List<ContainerBindRecordDetailExcelVO> importContainerBindRecordDetailList(List<ContainerBindRecordDetailExcelVO> datas, Integer mode, boolean updatePart) { |
|||
if (CollUtil.isEmpty(datas)) { |
|||
throw exception(CONTAINER_BIND_RECORD_DETAIL_IMPORT_LIST_IS_EMPTY); |
|||
} |
|||
|
|||
List<ContainerBindRecordDetailExcelVO> errorList = new ArrayList<>(); |
|||
// datas.forEach(item -> {
|
|||
// if(errorList == null){
|
|||
// // 判断如果不存在,在进行插入
|
|||
// ContainerBindRecordDetailDO obj = containerBindRecordDetailMapper.selectByCode(item.getCode());
|
|||
// if (obj == null&& mode != 3) {
|
|||
// containerBindRecordDetailMapper.insert(ContainerBindRecordDetailConvert.INSTANCE.convert(item));
|
|||
// }
|
|||
// else if (obj != null && mode != 2) {// 如果存在,判断是否允许更新
|
|||
// ContainerBindRecordDetailDO containerBindRecordDetailDO = ContainerBindRecordDetailConvert.INSTANCE.convert(item);
|
|||
// containerBindRecordDetailDO.setId(obj.getId());
|
|||
// containerBindRecordDetailMapper.updateById(obj);
|
|||
// }
|
|||
// }
|
|||
// });
|
|||
|
|||
return errorList; |
|||
} |
|||
} |
@ -0,0 +1,81 @@ |
|||
package com.win.module.wms.service.containerBind; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.module.wms.controller.containerBind.vo.*; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordMainDO; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 器具绑定记录主 Service 接口 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
public interface ContainerBindRecordMainService { |
|||
|
|||
/** |
|||
* 创建器具绑定记录主 |
|||
* |
|||
* @param createReqVO 创建信息 |
|||
* @return 编号 |
|||
*/ |
|||
Long createContainerBindRecordMain(@Valid ContainerBindRecordMainCreateReqVO createReqVO); |
|||
|
|||
/** |
|||
* 更新器具绑定记录主 |
|||
* |
|||
* @param updateReqVO 更新信息 |
|||
*/ |
|||
Integer updateContainerBindRecordMain(@Valid ContainerBindRecordMainUpdateReqVO updateReqVO); |
|||
|
|||
/** |
|||
* 删除器具绑定记录主 |
|||
* |
|||
* @param id 编号 |
|||
*/ |
|||
Integer deleteContainerBindRecordMain(Long id); |
|||
|
|||
/** |
|||
* 获得器具绑定记录主 |
|||
* |
|||
* @param id 编号 |
|||
* @return 器具绑定记录主 |
|||
*/ |
|||
ContainerBindRecordMainDO getContainerBindRecordMain(Long id); |
|||
|
|||
/** |
|||
* 获得器具绑定记录主列表 |
|||
* |
|||
* @param ids 编号 |
|||
* @return 器具绑定记录主列表 |
|||
*/ |
|||
List<ContainerBindRecordMainDO> getContainerBindRecordMainList(Collection<Long> ids); |
|||
|
|||
/** |
|||
* 获得器具绑定记录主分页 |
|||
* |
|||
* @param pageReqVO 分页查询 |
|||
* @return 器具绑定记录主分页 |
|||
*/ |
|||
PageResult<ContainerBindRecordMainDO> getContainerBindRecordMainPage(ContainerBindRecordMainPageReqVO pageReqVO); |
|||
|
|||
/** |
|||
* 获得器具绑定记录主列表, 用于 Excel 导出 |
|||
* |
|||
* @param exportReqVO 查询条件 |
|||
* @return 器具绑定记录主列表 |
|||
*/ |
|||
List<ContainerBindRecordMainDO> getContainerBindRecordMainList(ContainerBindRecordMainExportReqVO exportReqVO); |
|||
|
|||
/** |
|||
* 导入器具绑定记录主主信息 |
|||
* |
|||
* @param datas 导入器具绑定记录主主信息列表 |
|||
* @param mode 导入模式1更新2追加3覆盖 |
|||
* @param updatePart 是否支持更新 |
|||
* @return 导入结果 |
|||
*/ |
|||
public List<ContainerBindRecordMainExcelVO> importContainerBindRecordMainList(List<ContainerBindRecordMainExcelVO> datas, Integer mode, boolean updatePart); |
|||
} |
@ -0,0 +1,109 @@ |
|||
package com.win.module.wms.service.containerBind; |
|||
|
|||
import cn.hutool.core.collection.CollUtil; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.module.wms.controller.containerBind.vo.*; |
|||
import com.win.module.wms.convert.containerBind.ContainerBindRecordMainConvert; |
|||
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordMainDO; |
|||
import com.win.module.wms.dal.mysql.containerBind.ContainerBindRecordMainMapper; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.ArrayList; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; |
|||
import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_BIND_RECORD_MAIN_IMPORT_LIST_IS_EMPTY; |
|||
import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_BIND_RECORD_MAIN_NOT_EXISTS; |
|||
|
|||
/** |
|||
* 器具绑定记录主 Service 实现类 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Service |
|||
@Validated |
|||
public class ContainerBindRecordMainServiceImpl implements ContainerBindRecordMainService { |
|||
|
|||
@Resource |
|||
private ContainerBindRecordMainMapper containerBindRecordMainMapper; |
|||
|
|||
@Override |
|||
public Long createContainerBindRecordMain(ContainerBindRecordMainCreateReqVO createReqVO) { |
|||
// 插入
|
|||
ContainerBindRecordMainDO containerBindRecordMain = ContainerBindRecordMainConvert.INSTANCE.convert(createReqVO); |
|||
containerBindRecordMainMapper.insert(containerBindRecordMain); |
|||
// 返回
|
|||
return containerBindRecordMain.getId(); |
|||
} |
|||
|
|||
@Override |
|||
public Integer updateContainerBindRecordMain(ContainerBindRecordMainUpdateReqVO updateReqVO) { |
|||
// 校验存在
|
|||
validateContainerBindRecordMainExists(updateReqVO.getId()); |
|||
// 更新
|
|||
ContainerBindRecordMainDO updateObj = ContainerBindRecordMainConvert.INSTANCE.convert(updateReqVO); |
|||
return containerBindRecordMainMapper.updateById(updateObj); |
|||
} |
|||
|
|||
@Override |
|||
public Integer deleteContainerBindRecordMain(Long id) { |
|||
// 校验存在
|
|||
validateContainerBindRecordMainExists(id); |
|||
// 删除
|
|||
return containerBindRecordMainMapper.deleteById(id); |
|||
} |
|||
|
|||
private void validateContainerBindRecordMainExists(Long id) { |
|||
if (containerBindRecordMainMapper.selectById(id) == null) { |
|||
throw exception(CONTAINER_BIND_RECORD_MAIN_NOT_EXISTS); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public ContainerBindRecordMainDO getContainerBindRecordMain(Long id) { |
|||
return containerBindRecordMainMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<ContainerBindRecordMainDO> getContainerBindRecordMainList(Collection<Long> ids) { |
|||
return containerBindRecordMainMapper.selectBatchIds(ids); |
|||
} |
|||
|
|||
@Override |
|||
public PageResult<ContainerBindRecordMainDO> getContainerBindRecordMainPage(ContainerBindRecordMainPageReqVO pageReqVO) { |
|||
return containerBindRecordMainMapper.selectPage(pageReqVO); |
|||
} |
|||
|
|||
@Override |
|||
public List<ContainerBindRecordMainDO> getContainerBindRecordMainList(ContainerBindRecordMainExportReqVO exportReqVO) { |
|||
return containerBindRecordMainMapper.selectList(exportReqVO); |
|||
} |
|||
|
|||
@Override |
|||
public List<ContainerBindRecordMainExcelVO> importContainerBindRecordMainList(List<ContainerBindRecordMainExcelVO> datas, Integer mode, boolean updatePart) { |
|||
if (CollUtil.isEmpty(datas)) { |
|||
throw exception(CONTAINER_BIND_RECORD_MAIN_IMPORT_LIST_IS_EMPTY); |
|||
} |
|||
|
|||
List<ContainerBindRecordMainExcelVO> errorList = new ArrayList<>(); |
|||
// datas.forEach(item -> {
|
|||
// if(errorList == null){
|
|||
// // 判断如果不存在,在进行插入
|
|||
// ContainerBindRecordMainDO obj = containerBindRecordMainMapper.selectByCode(item.getCode());
|
|||
// if (obj == null&& mode != 3) {
|
|||
// containerBindRecordMainMapper.insert(ContainerBindRecordMainConvert.INSTANCE.convert(item));
|
|||
// }
|
|||
// else if (obj != null && mode != 2) {// 如果存在,判断是否允许更新
|
|||
// ContainerBindRecordMainDO containerBindRecordMainDO = ContainerBindRecordMainConvert.INSTANCE.convert(item);
|
|||
// containerBindRecordMainDO.setId(obj.getId());
|
|||
// containerBindRecordMainMapper.updateById(obj);
|
|||
// }
|
|||
// }
|
|||
// });
|
|||
|
|||
return errorList; |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.win.module.wms.dal.mysql.containerBind.ContainerBindRecordDetailMapper"> |
|||
|
|||
<!-- |
|||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 |
|||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 |
|||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 |
|||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ |
|||
--> |
|||
|
|||
</mapper> |
@ -0,0 +1,12 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.win.module.wms.dal.mysql.containerBind.ContainerBindRecordMainMapper"> |
|||
|
|||
<!-- |
|||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 |
|||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 |
|||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 |
|||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ |
|||
--> |
|||
|
|||
</mapper> |
@ -0,0 +1,206 @@ |
|||
server: |
|||
port: 12080 |
|||
|
|||
--- #################### 数据库相关配置 #################### |
|||
|
|||
spring: |
|||
# 数据源配置项 |
|||
autoconfigure: |
|||
exclude: |
|||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 |
|||
- org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration # 排除积木报表带来的 MongoDB 的自动配置 |
|||
shardingsphere: |
|||
mode: |
|||
type: Memory |
|||
# 属性配置 |
|||
props: |
|||
sql.show: true |
|||
## 数据源配置 |
|||
datasource: |
|||
names: master,slave0,slave1 |
|||
# 主数据源 |
|||
master: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
# url: jdbc:mysql://dev.ccwin-in.com:23113/sfms_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
|||
# username: learun |
|||
# password: Microdoft@2021 |
|||
url: jdbc:mysql://localhost:3306/sfms1218?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
|||
username: root |
|||
password: 123456 |
|||
# 读数据源 |
|||
slave0: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
# url: jdbc:mysql://dev.ccwin-in.com:23113/sfms_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
|||
# username: learun |
|||
# password: Microdoft@2021 |
|||
url: jdbc:mysql://localhost:3306/sfms1218?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
|||
username: root |
|||
password: 123456 |
|||
# 读数据源 |
|||
slave1: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
# url: jdbc:mysql://dev.ccwin-in.com:23113/sfms_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
|||
# username: learun |
|||
# password: Microdoft@2021 |
|||
url: jdbc:mysql://localhost:3306/sfms1218?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
|||
username: root |
|||
password: 123456 |
|||
# 读写分离类型,如: Static,Dynamic |
|||
rules: |
|||
readwrite-splitting: |
|||
data-sources: |
|||
myds: |
|||
type: Static |
|||
props: |
|||
write-data-source-name: master |
|||
read-data-source-names: slave0,slave1 |
|||
load-balancer-name: alg_round |
|||
load-balancers: |
|||
alg_round: |
|||
type: ROUND_ROBIN |
|||
sharding: |
|||
# 表策略配置 |
|||
tables: |
|||
# t_user 是逻辑表 |
|||
infra_trends: |
|||
# 配置数据节点,这里是按月分表 |
|||
actualDataNodes: master.infra_trends_$->{2023}${(10..12).collect{t->t.toString().padLeft(2,'0')}},master.infra_trends_$->{2024..2030}${(1..12).collect{t->t.toString().padLeft(2,'0')}} |
|||
tableStrategy: |
|||
# 使用标准分片策略 |
|||
standard: |
|||
# 配置分片字段 |
|||
shardingColumn: create_time |
|||
# 分片算法名称,不支持大写字母和下划线,否则启动就会报错 |
|||
shardingAlgorithmName: time-sharding-altorithm |
|||
# 分片算法配置 |
|||
shardingAlgorithms: |
|||
# 分片算法名称,不支持大写字母和下划线,否则启动就会报错 |
|||
time-sharding-altorithm: |
|||
# 类型:自定义策略 |
|||
type: CLASS_BASED |
|||
props: |
|||
# 分片策略 |
|||
strategy: standard |
|||
# 分片算法类 |
|||
algorithmClassName: com.win.framework.datasource.sharding.TimeShardingAlgorithm |
|||
# 不创建此数据源,用于生成代码 |
|||
datasource: |
|||
dynamic: |
|||
strict: true |
|||
primary: master |
|||
datasource: |
|||
master: |
|||
type: ${spring.shardingsphere.datasource.master.type} |
|||
driver-class-name: ${spring.shardingsphere.datasource.master.driverClassName} |
|||
url: ${spring.shardingsphere.datasource.master.url} |
|||
username: ${spring.shardingsphere.datasource.master.username} |
|||
password: ${spring.shardingsphere.datasource.master.password} |
|||
|
|||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 |
|||
redis: |
|||
# host: dev.ccwin-in.com # 地址 |
|||
# port: 23114 # 端口 |
|||
# database: 6 # 数据库索引 |
|||
host: localhost # 地址 |
|||
port: 6379 # 端口 |
|||
database: 6 # 数据库索引 |
|||
# password: dev # 密码,建议生产环境开启 |
|||
|
|||
--- #################### 定时任务相关配置 #################### |
|||
|
|||
# Quartz 配置项,对应 QuartzProperties 配置类 |
|||
spring: |
|||
quartz: |
|||
auto-startup: true # 测试环境,需要开启 Job |
|||
scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName |
|||
job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。 |
|||
wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true |
|||
properties: # 添加 Quartz Scheduler 附加属性,更多可以看 http://www.quartz-scheduler.org/documentation/2.4.0-SNAPSHOT/configuration.html 文档 |
|||
org: |
|||
quartz: |
|||
# Scheduler 相关配置 |
|||
scheduler: |
|||
instanceName: schedulerName |
|||
instanceId: AUTO # 自动生成 instance ID |
|||
# JobStore 相关配置 |
|||
jobStore: |
|||
# JobStore 实现类。可见博客:https://blog.csdn.net/weixin_42458219/article/details/122247162 |
|||
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore |
|||
isClustered: true # 是集群模式 |
|||
clusterCheckinInterval: 15000 # 集群检查频率,单位:毫秒。默认为 15000,即 15 秒 |
|||
misfireThreshold: 60000 # misfire 阀值,单位:毫秒。 |
|||
# 线程池相关配置 |
|||
threadPool: |
|||
threadCount: 25 # 线程池大小。默认为 10 。 |
|||
threadPriority: 5 # 线程优先级 |
|||
class: org.quartz.simpl.SimpleThreadPool # 线程池类型 |
|||
jdbc: # 使用 JDBC 的 JobStore 的时候,JDBC 的配置 |
|||
initialize-schema: NEVER # 是否自动使用 SQL 初始化 Quartz 表结构。这里设置成 never ,我们手动创建表结构。 |
|||
|
|||
--- #################### 服务保障相关配置 #################### |
|||
|
|||
# Lock4j 配置项 |
|||
lock4j: |
|||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒 |
|||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒 |
|||
|
|||
# Resilience4j 配置项 |
|||
resilience4j: |
|||
ratelimiter: |
|||
instances: |
|||
backendA: |
|||
limit-for-period: 1 # 每个周期内,允许的请求数。默认为 50 |
|||
limit-refresh-period: 60s # 每个周期的时长,单位:微秒。默认为 500 |
|||
timeout-duration: 1s # 被限流时,阻塞等待的时长,单位:微秒。默认为 5s |
|||
register-health-indicator: true # 是否注册到健康监测 |
|||
|
|||
--- #################### 监控相关配置 #################### |
|||
|
|||
# Actuator 监控端点的配置项 |
|||
management: |
|||
endpoint: |
|||
health: |
|||
show-details: ALWAYS |
|||
endpoints: |
|||
enable-by-default: true |
|||
web: |
|||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator |
|||
exposure: |
|||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。 |
|||
|
|||
# Spring Boot Admin 配置项 |
|||
spring: |
|||
boot: |
|||
admin: |
|||
# Spring Boot Admin Client 客户端的相关配置 |
|||
client: |
|||
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址 |
|||
instance: |
|||
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME] |
|||
# Spring Boot Admin Server 服务端的相关配置 |
|||
context-path: /admin # 配置 Spring |
|||
|
|||
# 日志文件配置 |
|||
logging: |
|||
file: |
|||
path: logs |
|||
level: |
|||
com.win: debug |
|||
org.springframework: warn |
|||
|
|||
--- #################### 闻荫相关配置 #################### |
|||
|
|||
# 闻荫配置项,设置当前项目所有自定义的配置 |
|||
win: |
|||
xss: |
|||
enable: false |
|||
exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系 |
|||
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求 |
|||
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 |
|||
demo: false # 开启演示模式 |
|||
security: |
|||
mock-enable: true # 是否开启 Token 的模拟机制 |
|||
mock-secret: test # Token 模拟机制的 Token 前缀 |
Loading…
Reference in new issue