forked from sfms3.0/sfms3.0
31 changed files with 821 additions and 123 deletions
@ -0,0 +1,106 @@ |
|||
package com.win.module.wms.controller.labelBarbasic; |
|||
|
|||
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.labelBarbasic.vo.*; |
|||
import com.win.module.wms.dal.dataobject.labelBarbasic.BarbasicDO; |
|||
import com.win.module.wms.convert.labelBarbasic.BarbasicConvert; |
|||
import com.win.module.wms.service.labelBarbasic.BarbasicService; |
|||
|
|||
|
|||
@Tag(name = "管理后台 - 条码实体基类") |
|||
@RestController |
|||
@RequestMapping("/wms/barbasic") |
|||
@Validated |
|||
public class BarbasicController { |
|||
|
|||
@Resource |
|||
private BarbasicService barbasicService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建条码实体基类") |
|||
@PreAuthorize("@ss.hasPermission('wms:barbasic:create')") |
|||
public CommonResult<Long> createBarbasic(@Valid @RequestBody BarbasicCreateReqVO createReqVO) { |
|||
return success(barbasicService.createBarbasic(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新条码实体基类") |
|||
@PreAuthorize("@ss.hasPermission('wms:barbasic:update')") |
|||
public CommonResult<Boolean> updateBarbasic(@Valid @RequestBody BarbasicUpdateReqVO updateReqVO) { |
|||
int result = barbasicService.updateBarbasic(updateReqVO); |
|||
return success(result > 0); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除条码实体基类") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('wms:barbasic:delete')") |
|||
public CommonResult<Boolean> deleteBarbasic(@RequestParam("id") Long id) { |
|||
int result = barbasicService.deleteBarbasic(id); |
|||
return success(result > 0); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得条码实体基类") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('wms:barbasic:query')") |
|||
public CommonResult<BarbasicRespVO> getBarbasic(@RequestParam("id") Long id) { |
|||
BarbasicDO barbasic = barbasicService.getBarbasic(id); |
|||
return success(BarbasicConvert.INSTANCE.convert(barbasic)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "获得条码实体基类列表") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:barbasic:query')") |
|||
public CommonResult<List<BarbasicRespVO>> getBarbasicList(@RequestParam("ids") Collection<Long> ids) { |
|||
List<BarbasicDO> list = barbasicService.getBarbasicList(ids); |
|||
return success(BarbasicConvert.INSTANCE.convertList(list)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得条码实体基类分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:barbasic:query')") |
|||
public CommonResult<PageResult<BarbasicRespVO>> getBarbasicPage(@Valid BarbasicPageReqVO pageVO) { |
|||
PageResult<BarbasicDO> pageResult = barbasicService.getBarbasicPage(pageVO); |
|||
return success(BarbasicConvert.INSTANCE.convertPage(pageResult)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出条码实体基类 Excel") |
|||
@PreAuthorize("@ss.hasPermission('wms:barbasic:export')") |
|||
@OperateLog(type = EXPORT) |
|||
public void exportBarbasicExcel(@Valid BarbasicExportReqVO exportReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
List<BarbasicDO> list = barbasicService.getBarbasicList(exportReqVO); |
|||
// 导出 Excel
|
|||
List<BarbasicExcelVO> datas = BarbasicConvert.INSTANCE.convertList02(list); |
|||
ExcelUtils.write(response, "条码实体基类.xls", "数据", BarbasicExcelVO.class, datas); |
|||
} |
|||
|
|||
@GetMapping("/get-import-template") |
|||
@Operation(summary = "获得导入条码实体基类模板") |
|||
public void importTemplate(HttpServletResponse response) throws IOException { |
|||
List<BarbasicExcelVO> list = Arrays.asList(); |
|||
// 输出
|
|||
ExcelUtils.write(response, "条码实体基类基本信息导入模板.xls", "条码实体基类基本信息列表", BarbasicExcelVO.class, list); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.win.module.wms.controller.labelBarbasic.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 BarbasicBaseVO { |
|||
|
|||
@Schema(description = "id", example = "id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "标签号", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "标签号不能为空") |
|||
private String number; |
|||
|
|||
@Schema(description = "标签类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
|||
@NotNull(message = "标签类型不能为空") |
|||
private String type; |
|||
|
|||
@Schema(description = "标签模板", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "标签模板不能为空") |
|||
private String template; |
|||
|
|||
@Schema(description = "标签状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") |
|||
@NotNull(message = "标签状态不能为空") |
|||
private String status; |
|||
|
|||
@Schema(description = "关联号") |
|||
private String relateNumber; |
|||
|
|||
@Schema(description = "标签条码字符串", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "标签条码字符串不能为空") |
|||
private String barcodeString; |
|||
|
|||
@Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@NotNull(message = "打印次数不能为空") |
|||
private Integer printTimes; |
|||
|
|||
@Schema(description = "最后打印时间") |
|||
private String lastPrintTime; |
|||
|
|||
@Schema(description = "最后打印人ID", example = "8732") |
|||
private String lastPrintUserId; |
|||
|
|||
@Schema(description = "最后打印人用户名", example = "王五") |
|||
private String lastPrintUserName; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.win.module.wms.controller.labelBarbasic.vo; |
|||
|
|||
import lombok.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
@Schema(description = "管理后台 - 条码实体基类创建 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BarbasicCreateReqVO extends BarbasicBaseVO { |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.win.module.wms.controller.labelBarbasic.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 BarbasicExcelVO { |
|||
|
|||
@ExcelProperty("id") |
|||
private Long id; |
|||
|
|||
@ExcelProperty("标签号") |
|||
private String number; |
|||
|
|||
@ExcelProperty("标签类型") |
|||
private String type; |
|||
|
|||
@ExcelProperty("标签模板") |
|||
private String template; |
|||
|
|||
@ExcelProperty("标签状态") |
|||
private String status; |
|||
|
|||
@ExcelProperty("关联号") |
|||
private String relateNumber; |
|||
|
|||
@ExcelProperty("标签条码字符串") |
|||
private String barcodeString; |
|||
|
|||
@ExcelProperty("打印次数") |
|||
private Integer printTimes; |
|||
|
|||
@ExcelProperty("最后打印时间") |
|||
private String lastPrintTime; |
|||
|
|||
@ExcelProperty("最后打印人ID") |
|||
private String lastPrintUserId; |
|||
|
|||
@ExcelProperty("最后打印人用户名") |
|||
private String lastPrintUserName; |
|||
|
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.win.module.wms.controller.labelBarbasic.vo; |
|||
|
|||
import com.alibaba.excel.annotation.format.DateTimeFormat; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import com.win.framework.common.pojo.PageParam; |
|||
|
|||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 条码实体基类 Excel 导出 Request VO,参数和 BarbasicPageReqVO 是一致的") |
|||
@Data |
|||
public class BarbasicExportReqVO { |
|||
|
|||
@Schema(description = "标签号") |
|||
private String number; |
|||
|
|||
@Schema(description = "标签类型", example = "1") |
|||
private String type; |
|||
|
|||
@Schema(description = "标签模板") |
|||
private String template; |
|||
|
|||
@Schema(description = "标签状态", example = "2") |
|||
private String status; |
|||
|
|||
@Schema(description = "关联号") |
|||
private String relateNumber; |
|||
|
|||
@Schema(description = "标签条码字符串") |
|||
private String barcodeString; |
|||
|
|||
@Schema(description = "打印次数") |
|||
private Integer printTimes; |
|||
|
|||
@Schema(description = "最后打印时间") |
|||
private String[] lastPrintTime; |
|||
|
|||
@Schema(description = "最后打印人ID", example = "8732") |
|||
private String lastPrintUserId; |
|||
|
|||
@Schema(description = "最后打印人用户名", example = "王五") |
|||
private String lastPrintUserName; |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.win.module.wms.controller.labelBarbasic.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 BarbasicPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "标签号") |
|||
private String number; |
|||
|
|||
@Schema(description = "标签类型", example = "1") |
|||
private String type; |
|||
|
|||
@Schema(description = "标签模板") |
|||
private String template; |
|||
|
|||
@Schema(description = "标签状态", example = "2") |
|||
private String status; |
|||
|
|||
@Schema(description = "关联号") |
|||
private String relateNumber; |
|||
|
|||
@Schema(description = "标签条码字符串") |
|||
private String barcodeString; |
|||
|
|||
@Schema(description = "打印次数") |
|||
private Integer printTimes; |
|||
|
|||
@Schema(description = "最后打印时间") |
|||
private String[] lastPrintTime; |
|||
|
|||
@Schema(description = "最后打印人ID", example = "8732") |
|||
private String lastPrintUserId; |
|||
|
|||
@Schema(description = "最后打印人用户名", example = "王五") |
|||
private String lastPrintUserName; |
|||
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.win.module.wms.controller.labelBarbasic.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
@Schema(description = "管理后台 - 条码实体基类 Response VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BarbasicRespVO extends BarbasicBaseVO { |
|||
|
|||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29175") |
|||
private Long id; |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.win.module.wms.controller.labelBarbasic.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
|
|||
import javax.validation.constraints.*; |
|||
|
|||
@Schema(description = "管理后台 - 条码实体基类更新 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
public class BarbasicUpdateReqVO extends BarbasicBaseVO { |
|||
|
|||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29175") |
|||
@NotNull(message = "id不能为空") |
|||
private Long id; |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.win.module.wms.convert.labelBarbasic; |
|||
|
|||
import java.util.*; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
|
|||
import com.win.module.wms.controller.labelBarbasic.vo.BarbasicCreateReqVO; |
|||
import com.win.module.wms.controller.labelBarbasic.vo.BarbasicExcelVO; |
|||
import com.win.module.wms.controller.labelBarbasic.vo.BarbasicRespVO; |
|||
import com.win.module.wms.controller.labelBarbasic.vo.BarbasicUpdateReqVO; |
|||
import org.mapstruct.Mapper; |
|||
import org.mapstruct.factory.Mappers; |
|||
import com.win.module.wms.dal.dataobject.labelBarbasic.BarbasicDO; |
|||
|
|||
/** |
|||
* 条码实体基类 Convert |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Mapper |
|||
public interface BarbasicConvert { |
|||
|
|||
BarbasicConvert INSTANCE = Mappers.getMapper(BarbasicConvert.class); |
|||
|
|||
BarbasicDO convert(BarbasicCreateReqVO bean); |
|||
|
|||
BarbasicDO convert(BarbasicUpdateReqVO bean); |
|||
|
|||
BarbasicRespVO convert(BarbasicDO bean); |
|||
|
|||
List<BarbasicRespVO> convertList(List<BarbasicDO> list); |
|||
|
|||
PageResult<BarbasicRespVO> convertPage(PageResult<BarbasicDO> page); |
|||
|
|||
List<BarbasicExcelVO> convertList02(List<BarbasicDO> list); |
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
package com.win.module.wms.dal.dataobject.labelBarbasic; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.win.framework.mybatis.core.dataobject.BaseDO; |
|||
|
|||
/** |
|||
* 条码实体基类 DO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@TableName("label_barbasic") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
@Builder |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class BarbasicDO extends BaseDO { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId |
|||
private Long id; |
|||
/** |
|||
* 标签号 |
|||
*/ |
|||
private String number; |
|||
/** |
|||
* 标签类型 |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 标签模板 |
|||
*/ |
|||
private String template; |
|||
/** |
|||
* 标签状态 |
|||
*/ |
|||
private String status; |
|||
/** |
|||
* 关联号 |
|||
*/ |
|||
private String relateNumber; |
|||
/** |
|||
* 标签条码字符串 |
|||
*/ |
|||
private String barcodeString; |
|||
/** |
|||
* 打印次数 |
|||
*/ |
|||
private Integer printTimes; |
|||
/** |
|||
* 最后打印时间 |
|||
*/ |
|||
private String lastPrintTime; |
|||
/** |
|||
* 最后打印人ID |
|||
*/ |
|||
private String lastPrintUserId; |
|||
/** |
|||
* 最后打印人用户名 |
|||
*/ |
|||
private String lastPrintUserName; |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.win.module.wms.dal.mysql.labelBarbasic; |
|||
|
|||
import java.util.*; |
|||
|
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX; |
|||
import com.win.framework.mybatis.core.mapper.BaseMapperX; |
|||
import com.win.module.wms.controller.labelBarbasic.vo.BarbasicExportReqVO; |
|||
import com.win.module.wms.controller.labelBarbasic.vo.BarbasicPageReqVO; |
|||
import com.win.module.wms.dal.dataobject.labelBarbasic.BarbasicDO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 条码实体基类 Mapper |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Mapper |
|||
public interface BarbasicMapper extends BaseMapperX<BarbasicDO> { |
|||
|
|||
default PageResult<BarbasicDO> selectPage(BarbasicPageReqVO reqVO) { |
|||
return selectPage(reqVO, new LambdaQueryWrapperX<BarbasicDO>() |
|||
.eqIfPresent(BarbasicDO::getNumber, reqVO.getNumber()) |
|||
.eqIfPresent(BarbasicDO::getType, reqVO.getType()) |
|||
.eqIfPresent(BarbasicDO::getTemplate, reqVO.getTemplate()) |
|||
.eqIfPresent(BarbasicDO::getStatus, reqVO.getStatus()) |
|||
.eqIfPresent(BarbasicDO::getRelateNumber, reqVO.getRelateNumber()) |
|||
.eqIfPresent(BarbasicDO::getBarcodeString, reqVO.getBarcodeString()) |
|||
.eqIfPresent(BarbasicDO::getPrintTimes, reqVO.getPrintTimes()) |
|||
.betweenIfPresent(BarbasicDO::getLastPrintTime, reqVO.getLastPrintTime()) |
|||
.eqIfPresent(BarbasicDO::getLastPrintUserId, reqVO.getLastPrintUserId()) |
|||
.likeIfPresent(BarbasicDO::getLastPrintUserName, reqVO.getLastPrintUserName()) |
|||
.orderByDesc(BarbasicDO::getId)); |
|||
} |
|||
|
|||
default List<BarbasicDO> selectList(BarbasicExportReqVO reqVO) { |
|||
return selectList(new LambdaQueryWrapperX<BarbasicDO>() |
|||
.eqIfPresent(BarbasicDO::getNumber, reqVO.getNumber()) |
|||
.eqIfPresent(BarbasicDO::getType, reqVO.getType()) |
|||
.eqIfPresent(BarbasicDO::getTemplate, reqVO.getTemplate()) |
|||
.eqIfPresent(BarbasicDO::getStatus, reqVO.getStatus()) |
|||
.eqIfPresent(BarbasicDO::getRelateNumber, reqVO.getRelateNumber()) |
|||
.eqIfPresent(BarbasicDO::getBarcodeString, reqVO.getBarcodeString()) |
|||
.eqIfPresent(BarbasicDO::getPrintTimes, reqVO.getPrintTimes()) |
|||
.betweenIfPresent(BarbasicDO::getLastPrintTime, reqVO.getLastPrintTime()) |
|||
.eqIfPresent(BarbasicDO::getLastPrintUserId, reqVO.getLastPrintUserId()) |
|||
.likeIfPresent(BarbasicDO::getLastPrintUserName, reqVO.getLastPrintUserName()) |
|||
.orderByDesc(BarbasicDO::getId)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
package com.win.module.wms.service.labelBarbasic; |
|||
|
|||
import java.util.*; |
|||
import javax.validation.*; |
|||
import com.win.module.wms.controller.labelBarbasic.vo.*; |
|||
import com.win.module.wms.dal.dataobject.labelBarbasic.BarbasicDO; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
|
|||
/** |
|||
* 条码实体基类 Service 接口 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
public interface BarbasicService { |
|||
|
|||
/** |
|||
* 创建条码实体基类 |
|||
* |
|||
* @param createReqVO 创建信息 |
|||
* @return 编号 |
|||
*/ |
|||
Long createBarbasic(@Valid BarbasicCreateReqVO createReqVO); |
|||
|
|||
/** |
|||
* 更新条码实体基类 |
|||
* |
|||
* @param updateReqVO 更新信息 |
|||
*/ |
|||
Integer updateBarbasic(@Valid BarbasicUpdateReqVO updateReqVO); |
|||
|
|||
/** |
|||
* 删除条码实体基类 |
|||
* |
|||
* @param id 编号 |
|||
*/ |
|||
Integer deleteBarbasic(Long id); |
|||
|
|||
/** |
|||
* 获得条码实体基类 |
|||
* |
|||
* @param id 编号 |
|||
* @return 条码实体基类 |
|||
*/ |
|||
BarbasicDO getBarbasic(Long id); |
|||
|
|||
/** |
|||
* 获得条码实体基类列表 |
|||
* |
|||
* @param ids 编号 |
|||
* @return 条码实体基类列表 |
|||
*/ |
|||
List<BarbasicDO> getBarbasicList(Collection<Long> ids); |
|||
|
|||
/** |
|||
* 获得条码实体基类分页 |
|||
* |
|||
* @param pageReqVO 分页查询 |
|||
* @return 条码实体基类分页 |
|||
*/ |
|||
PageResult<BarbasicDO> getBarbasicPage(BarbasicPageReqVO pageReqVO); |
|||
|
|||
/** |
|||
* 获得条码实体基类列表, 用于 Excel 导出 |
|||
* |
|||
* @param exportReqVO 查询条件 |
|||
* @return 条码实体基类列表 |
|||
*/ |
|||
List<BarbasicDO> getBarbasicList(BarbasicExportReqVO exportReqVO); |
|||
|
|||
|
|||
} |
@ -0,0 +1,84 @@ |
|||
package com.win.module.wms.service.labelBarbasic; |
|||
|
|||
|
|||
import org.springframework.stereotype.Service; |
|||
import javax.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import java.util.*; |
|||
import com.win.module.wms.controller.labelBarbasic.vo.*; |
|||
import com.win.module.wms.dal.dataobject.labelBarbasic.BarbasicDO; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
|
|||
import com.win.module.wms.convert.labelBarbasic.BarbasicConvert; |
|||
import com.win.module.wms.dal.mysql.labelBarbasic.BarbasicMapper; |
|||
|
|||
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; |
|||
import static com.win.module.wms.enums.ErrorCodeConstants.*; |
|||
|
|||
/** |
|||
* 条码实体基类 Service 实现类 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Service |
|||
@Validated |
|||
public class BarbasicServiceImpl implements BarbasicService { |
|||
|
|||
@Resource |
|||
private BarbasicMapper barbasicMapper; |
|||
|
|||
@Override |
|||
public Long createBarbasic(BarbasicCreateReqVO createReqVO) { |
|||
// 插入
|
|||
BarbasicDO barbasic = BarbasicConvert.INSTANCE.convert(createReqVO); |
|||
barbasicMapper.insert(barbasic); |
|||
// 返回
|
|||
return barbasic.getId(); |
|||
} |
|||
|
|||
@Override |
|||
public Integer updateBarbasic(BarbasicUpdateReqVO updateReqVO) { |
|||
// 校验存在
|
|||
validateBarbasicExists(updateReqVO.getId()); |
|||
// 更新
|
|||
BarbasicDO updateObj = BarbasicConvert.INSTANCE.convert(updateReqVO); |
|||
return barbasicMapper.updateById(updateObj); |
|||
} |
|||
|
|||
@Override |
|||
public Integer deleteBarbasic(Long id) { |
|||
// 校验存在
|
|||
validateBarbasicExists(id); |
|||
// 删除
|
|||
return barbasicMapper.deleteById(id); |
|||
} |
|||
|
|||
private void validateBarbasicExists(Long id) { |
|||
if (barbasicMapper.selectById(id) == null) { |
|||
throw exception(BARBASIC_NOT_EXISTS); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public BarbasicDO getBarbasic(Long id) { |
|||
return barbasicMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<BarbasicDO> getBarbasicList(Collection<Long> ids) { |
|||
return barbasicMapper.selectBatchIds(ids); |
|||
} |
|||
|
|||
@Override |
|||
public PageResult<BarbasicDO> getBarbasicPage(BarbasicPageReqVO pageReqVO) { |
|||
return barbasicMapper.selectPage(pageReqVO); |
|||
} |
|||
|
|||
@Override |
|||
public List<BarbasicDO> getBarbasicList(BarbasicExportReqVO exportReqVO) { |
|||
return barbasicMapper.selectList(exportReqVO); |
|||
} |
|||
|
|||
|
|||
} |
Loading…
Reference in new issue