master
wanghao 2 weeks ago
parent 3f3c0ffbd4
commit 6de83a8c98

@ -0,0 +1,117 @@
package org.dromara.wms.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.wms.domain.vo.WmsBaseLocationVo;
import org.dromara.wms.domain.bo.WmsBaseLocationBo;
import org.dromara.wms.service.IWmsBaseLocationService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/wms/baseLocation
*
* @author Yinq
* @date 2025-01-08
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/baseLocation")
public class WmsBaseLocationController extends BaseController {
private final IWmsBaseLocationService wmsBaseLocationService;
/**
*
*/
@SaCheckPermission("wms:baseLocation:list")
@GetMapping("/list")
public TableDataInfo<WmsBaseLocationVo> list(WmsBaseLocationBo bo, PageQuery pageQuery) {
return wmsBaseLocationService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("wms:baseLocation:export")
@Log(title = "库位基础信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsBaseLocationBo bo, HttpServletResponse response) {
List<WmsBaseLocationVo> list = wmsBaseLocationService.queryList(bo);
ExcelUtil.exportExcel(list, "库位基础信息", WmsBaseLocationVo.class, response);
}
/**
*
*
* @param locationId
*/
@SaCheckPermission("wms:baseLocation:query")
@GetMapping("/{locationId}")
public R<WmsBaseLocationVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long locationId) {
return R.ok(wmsBaseLocationService.queryById(locationId));
}
/**
*
*/
@SaCheckPermission("wms:baseLocation:add")
@Log(title = "库位基础信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsBaseLocationBo bo) {
return toAjax(wmsBaseLocationService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("wms:baseLocation:edit")
@Log(title = "库位基础信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsBaseLocationBo bo) {
return toAjax(wmsBaseLocationService.updateByBo(bo));
}
/**
*
*
* @param locationIds
*/
@SaCheckPermission("wms:baseLocation:remove")
@Log(title = "库位基础信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{locationIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] locationIds) {
return toAjax(wmsBaseLocationService.deleteWithValidByIds(List.of(locationIds), true));
}
/**
*
*/
@GetMapping("getWmsBaseLocationList")
public R<List<WmsBaseLocationVo>> getWmsBaseLocationlist(WmsBaseLocationBo bo) {
List<WmsBaseLocationVo> list = wmsBaseLocationService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,118 @@
package org.dromara.wms.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.wms.domain.vo.WmsBaseWarehouseVo;
import org.dromara.wms.domain.bo.WmsBaseWarehouseBo;
import org.dromara.wms.service.IWmsBaseWarehouseService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/wms/baseWarehouse
*
* @author Yinq
* @date 2025-01-07
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/baseWarehouse")
public class WmsBaseWarehouseController extends BaseController {
private final IWmsBaseWarehouseService wmsBaseWarehouseService;
/**
*
*/
@SaCheckPermission("wms:baseWarehouse:list")
@GetMapping("/list")
public TableDataInfo<WmsBaseWarehouseVo> list(WmsBaseWarehouseBo bo, PageQuery pageQuery) {
return wmsBaseWarehouseService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("wms:baseWarehouse:export")
@Log(title = "仓库基础信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsBaseWarehouseBo bo, HttpServletResponse response) {
List<WmsBaseWarehouseVo> list = wmsBaseWarehouseService.queryList(bo);
// System.out.println(list.get(0).getWorkshopName());
ExcelUtil.exportExcel(list, "仓库基础信息", WmsBaseWarehouseVo.class, response);
}
/**
*
*
* @param warehouseId
*/
@SaCheckPermission("wms:baseWarehouse:query")
@GetMapping("/{warehouseId}")
public R<WmsBaseWarehouseVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long warehouseId) {
return R.ok(wmsBaseWarehouseService.queryById(warehouseId));
}
/**
*
*/
@SaCheckPermission("wms:baseWarehouse:add")
@Log(title = "仓库基础信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsBaseWarehouseBo bo) {
return toAjax(wmsBaseWarehouseService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("wms:baseWarehouse:edit")
@Log(title = "仓库基础信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsBaseWarehouseBo bo) {
return toAjax(wmsBaseWarehouseService.updateByBo(bo));
}
/**
*
*
* @param warehouseIds
*/
@SaCheckPermission("wms:baseWarehouse:remove")
@Log(title = "仓库基础信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{warehouseIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] warehouseIds) {
return toAjax(wmsBaseWarehouseService.deleteWithValidByIds(List.of(warehouseIds), true));
}
/**
*
*/
@GetMapping("getWmsBaseWarehouseList")
public R<List<WmsBaseWarehouseVo>> getWmsBaseWarehouselist(WmsBaseWarehouseBo bo) {
List<WmsBaseWarehouseVo> list = wmsBaseWarehouseService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,106 @@
package org.dromara.wms.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.wms.domain.vo.WmsInstockRecordVo;
import org.dromara.wms.domain.bo.WmsInstockRecordBo;
import org.dromara.wms.service.IWmsInstockRecordService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/wms/instockRecord
*
* @author Yinq
* @date 2025-01-07
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/instockRecord")
public class WmsInstockRecordController extends BaseController {
private final IWmsInstockRecordService wmsInstockRecordService;
/**
*
*/
@SaCheckPermission("wms:instockRecord:list")
@GetMapping("/list")
public TableDataInfo<WmsInstockRecordVo> list(WmsInstockRecordBo bo, PageQuery pageQuery) {
return wmsInstockRecordService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("wms:instockRecord:export")
@Log(title = "入库记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsInstockRecordBo bo, HttpServletResponse response) {
List<WmsInstockRecordVo> list = wmsInstockRecordService.queryList(bo);
ExcelUtil.exportExcel(list, "入库记录", WmsInstockRecordVo.class, response);
}
/**
*
*
* @param instockRecordId
*/
@SaCheckPermission("wms:instockRecord:query")
@GetMapping("/{instockRecordId}")
public R<WmsInstockRecordVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long instockRecordId) {
return R.ok(wmsInstockRecordService.queryById(instockRecordId));
}
/**
*
*/
@SaCheckPermission("wms:instockRecord:add")
@Log(title = "入库记录", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsInstockRecordBo bo) {
return toAjax(wmsInstockRecordService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("wms:instockRecord:edit")
@Log(title = "入库记录", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsInstockRecordBo bo) {
return toAjax(wmsInstockRecordService.updateByBo(bo));
}
/**
*
*
* @param instockRecordIds
*/
@SaCheckPermission("wms:instockRecord:remove")
@Log(title = "入库记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{instockRecordIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] instockRecordIds) {
return toAjax(wmsInstockRecordService.deleteWithValidByIds(List.of(instockRecordIds), true));
}
}

@ -0,0 +1,61 @@
package org.dromara.wms.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.tenant.core.TenantEntity;
import java.io.Serial;
/**
* prod_base_workshop_info
*
* @author Yinq
* @date 2025-01-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("prod_base_workshop_info")
public class ProdBaseWorkshopInfo1 extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@TableId(value = "workshop_id", type = IdType.AUTO)
private Long workshopId;
/**
*
*/
private String workshopCode;
/**
*
*/
private String workshopName;
/**
*
*/
private Long factoryId;
/**
* (1 0)
*/
private String activeFlag;
/**
*
*/
private String remark;
@TableField(exist = false)
private String factoryName;//字段映射
}

@ -0,0 +1,61 @@
package org.dromara.wms.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* wms_base_location
*
* @author Yinq
* @date 2025-01-08
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_base_location")
public class WmsBaseLocation extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.AUTO,value = "location_id")
private Long locationId;
/**
*
*/
private Long warehouseId;
/**
*
*/
private String locationCode;
/**
*
*/
private Long lineNum;
/**
*
*/
private Long layerNum;
/**
*
*/
private Long locationNum;
@TableField(exist = false)
private String warehouseCode;
/**
*
*/
@TableField(exist = false)
private String warehouseName;
}

@ -0,0 +1,62 @@
package org.dromara.wms.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* wms_base_warehouse
*
* @author Yinq
* @date 2025-01-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_base_warehouse")
public class WmsBaseWarehouse extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "warehouse_id", type = IdType.AUTO)
private Long warehouseId;
/**
*
*/
private String warehouseCode;
/**
*
*/
private String warehouseName;
/**
*
*/
private String materialCategories;
/**
*
*/
private String warehouseLocation;
/**
*
*/
private Long workshopId;
/**
*
*/
private String warehouseType;
@TableField(exist = false)
private String workshopName;//字段映射
}

@ -24,6 +24,7 @@ public class WmsDeliveryNote extends TenantEntity {
/** /**
* *
*/ */
@TableId(value = "delivery_note_id", type = IdType.AUTO)
private Long deliveryNoteId; private Long deliveryNoteId;
/** /**

@ -0,0 +1,91 @@
package org.dromara.wms.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* wms_instock_record
*
* @author Yinq
* @date 2025-01-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_instock_record")
public class WmsInstockRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "instock_record_id", type = IdType.AUTO)
private Long instockRecordId;
/**
*
*/
// private Long instockId;
/**
*
*/
private String instockCode;
/**
*
*/
private String batchCode;
/**
* id
*/
private Long materialId;
/**
* ID
*/
private Long warehouseId;
/**
*
*/
private String locationCode;
/**
*
*/
private String materialCode;
/**
*
*/
private String materialName;
/**
*
*/
private Double instockQty;
/**
*
*/
private String materialCategories;
/**
* erp
*/
private String erpSynchronousStatus;
/**
* erp
*/
private Double erpSynchronousQty;
}

@ -0,0 +1,49 @@
package org.dromara.wms.domain.bo;
import org.dromara.wms.domain.WmsBaseLocation;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
/**
* wms_base_location
*
* @author Yinq
* @date 2025-01-08
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsBaseLocation.class, reverseConvertGenerate = false)
public class WmsBaseLocationBo extends BaseEntity {
private Long locationId;
/**
*
*/
private Long warehouseId;
/**
*
*/
private String locationCode;
/**
*
*/
private Long lineNum;
/**
*
*/
private Long layerNum;
/**
*
*/
private Long locationNum;
}

@ -0,0 +1,66 @@
package org.dromara.wms.domain.bo;
import org.dromara.wms.domain.WmsBaseWarehouse;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
/**
* wms_base_warehouse
*
* @author Yinq
* @date 2025-01-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsBaseWarehouse.class, reverseConvertGenerate = false)
public class WmsBaseWarehouseBo extends BaseEntity {
/**
*
*/
// @NotNull(message = "表主键不能为空", groups = { AddGroup.class })
private Long warehouseId;
/**
*
*/
@NotBlank(message = "仓库编码不能为空", groups = { AddGroup.class, EditGroup.class })
private String warehouseCode;
/**
*
*/
@NotBlank(message = "仓库名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String warehouseName;
/**
*
*/
@NotBlank(message = "物料大类不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCategories;
/**
*
*/
// @NotBlank(message = "仓库位置不能为空", groups = { AddGroup.class, EditGroup.class })
private String warehouseLocation;
/**
*
*/
@NotNull(message = "关联车间不能为空", groups = { AddGroup.class, EditGroup.class })
private Long workshopId;
/**
*
*/
@NotBlank(message = "仓库类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String warehouseType;
}

@ -1,5 +1,7 @@
package org.dromara.wms.domain.bo; package org.dromara.wms.domain.bo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import org.dromara.wms.domain.WmsDeliveryNote; import org.dromara.wms.domain.WmsDeliveryNote;
import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.AddGroup;
@ -24,6 +26,8 @@ public class WmsDeliveryNoteBo extends BaseEntity {
* *
*/ */
// @NotNull(message = "送货单表主键不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotNull(message = "送货单表主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long deliveryNoteId; private Long deliveryNoteId;
/** /**
@ -41,19 +45,19 @@ public class WmsDeliveryNoteBo extends BaseEntity {
/** /**
* *
*/ */
@NotBlank(message = "客户名称(默认值)不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "客户名称(默认值)不能为空", groups = {AddGroup.class, EditGroup.class})
private String customerName; private String customerName;
/** /**
* *
*/ */
@NotBlank(message = "联系人不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "联系人不能为空", groups = {AddGroup.class, EditGroup.class})
private String contacts; private String contacts;
/** /**
* *
*/ */
@NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "联系电话不能为空", groups = {AddGroup.class, EditGroup.class})
private String contactsIpone; private String contactsIpone;
/** /**
@ -71,7 +75,7 @@ public class WmsDeliveryNoteBo extends BaseEntity {
/** /**
* *
*/ */
@NotBlank(message = "车牌号不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "车牌号不能为空", groups = {AddGroup.class, EditGroup.class})
private String licensePlate; private String licensePlate;
private String tenantId; private String tenantId;

@ -0,0 +1,81 @@
package org.dromara.wms.domain.bo;
import org.dromara.wms.domain.WmsInstockRecord;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
/**
* wms_instock_record
*
* @author Yinq
* @date 2025-01-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsInstockRecord.class, reverseConvertGenerate = false)
public class WmsInstockRecordBo extends BaseEntity {
/**
*
*/
private String instockCode;
/**
*
*/
private String batchCode;
/**
* id
*/
private Long materialId;
/**
* ID
*/
private Long warehouseId;
/**
*
*/
private String locationCode;
/**
*
*/
private String materialCode;
/**
*
*/
private String materialName;
/**
*
*/
private Double instockQty;
/**
*
*/
private String materialCategories;
/**
* erp
*/
@NotBlank(message = "erp同步状态不能为空", groups = { AddGroup.class, EditGroup.class })
private String erpSynchronousStatus;
/**
* erp
*/
@NotNull(message = "erp同步数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Double erpSynchronousQty;
}

@ -0,0 +1,107 @@
package org.dromara.wms.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.wms.domain.ProdBaseWorkshopInfo1;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* prod_base_workshop_info
*
* @author Yinq
* @date 2025-01-02
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ProdBaseWorkshopInfo1.class)
public class ProdBaseWorkshopInfoVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ExcelProperty(value = "车间ID")
private Long workshopId;
/**
*
*/
@ExcelProperty(value = "租户编号")
private String tenantId;
/**
*
*/
@ExcelProperty(value = "车间编号")
private String workshopCode;
/**
*
*/
@ExcelProperty(value = "车间名称")
private String workshopName;
/**
* ID
*/
@ExcelProperty(value = "所属工厂ID")
private Long factoryId;
/**
*
*/
@ExcelProperty(value = "所属工厂名称")
private String factoryName;
/**
* (1 0)
*/
@ExcelProperty(value = "激活标识")
private String activeFlag;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
/**
*
*/
@ExcelProperty(value = "创建部门")
private Long createDept;
/**
*
*/
@ExcelProperty(value = "创建人")
private Long createBy;
/**
*
*/
@ExcelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@ExcelProperty(value = "更新人")
private Long updateBy;
/**
*
*/
@ExcelProperty(value = "更新时间")
private Date updateTime;
}

@ -0,0 +1,85 @@
package org.dromara.wms.domain.vo;
import org.dromara.wms.domain.WmsBaseLocation;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* wms_base_location
*
* @author Yinq
* @date 2025-01-08
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsBaseLocation.class)
public class WmsBaseLocationVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "表主键")
private Long locationId;
/**
*
*/
@ExcelProperty(value = "所属仓库")
private Long warehouseId;
/**
*
*/
@ExcelProperty(value = "库位编码")
private String locationCode;
/**
*
*/
@ExcelProperty(value = "排")
private Long lineNum;
/**
*
*/
@ExcelProperty(value = "层")
private Long layerNum;
/**
*
*/
@ExcelProperty(value = "位")
private Long locationNum;
/**
*
*/
@ExcelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@ExcelProperty(value = "更新时间")
private Date updateTime;
private String warehouseCode;
/**
*
*/
private String warehouseName;
}

@ -0,0 +1,100 @@
package org.dromara.wms.domain.vo;
import org.dromara.wms.domain.WmsBaseWarehouse;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* wms_base_warehouse
*
* @author Yinq
* @date 2025-01-07
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsBaseWarehouse.class)
public class WmsBaseWarehouseVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "表主键")
private Long warehouseId;
/**
*
*/
@ExcelProperty(value = "仓库编码")
private String warehouseCode;
/**
*
*/
@ExcelProperty(value = "仓库名称")
private String warehouseName;
/**
*
*/
@ExcelProperty(value = "物料大类", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "material_mategories")
private String materialCategories;
/**
*
*/
@ExcelProperty(value = "仓库位置")
private String warehouseLocation;
/**
*
*/
@ExcelProperty(value = "关联车间")
private Long workshopId;
/**
*
*/
@ExcelProperty(value = "仓库类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "wms_wharehouse_type")
private String warehouseType;
/**
*
*/
@ExcelProperty(value = "创建人")
private Long createBy;
/**
*
*/
@ExcelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@ExcelProperty(value = "更新人")
private Long updateBy;
/**
*
*/
@ExcelProperty(value = "更新时间")
private Date updateTime;
private String workshopName;//字段映射
}

@ -0,0 +1,117 @@
package org.dromara.wms.domain.vo;
import org.dromara.wms.domain.WmsInstockRecord;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* wms_instock_record
*
* @author Yinq
* @date 2025-01-07
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsInstockRecord.class)
public class WmsInstockRecordVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "入库单号")
private String instockCode;
/**
*
*/
@ExcelProperty(value = "批次码")
private String batchCode;
/**
* id
*/
@ExcelProperty(value = "物料id")
private Long materialId;
/**
* ID
*/
@ExcelProperty(value = "仓库ID")
private Long warehouseId;
/**
*
*/
@ExcelProperty(value = "库位编码")
private String locationCode;
/**
*
*/
@ExcelProperty(value = "物料编码")
private String materialCode;
/**
*
*/
@ExcelProperty(value = "物料名称")
private String materialName;
/**
*
*/
@ExcelProperty(value = "入库数量")
private Double instockQty;
/**
*
*/
@ExcelProperty(value = "物料大类")
private String materialCategories;
/**
*
*/
@ExcelProperty(value = "入库人")
private Long createBy;
/**
*
*/
@ExcelProperty(value = "入库时间")
private Date createTime;
/**
* erp
*/
@ExcelProperty(value = "erp同步状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "sys_common_status")
private String erpSynchronousStatus;
/**
* erp
*/
@ExcelProperty(value = "erp同步数量")
private Double erpSynchronousQty;
/**
*
*/
@ExcelProperty(value = "同步时间")
private Date updateTime;
}

@ -0,0 +1,17 @@
package org.dromara.wms.mapper;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.ProdBaseWorkshopInfo1;
import org.dromara.wms.domain.vo.ProdBaseWorkshopInfoVo;
/**
* Mapper
*
* @author Yinq
* @date 2025-01-02
*/
public interface ProdBaseWorkshopInfoMapper extends BaseMapperPlus<ProdBaseWorkshopInfo1, ProdBaseWorkshopInfoVo> {
}

@ -0,0 +1,15 @@
package org.dromara.wms.mapper;
import org.dromara.wms.domain.WmsBaseLocation;
import org.dromara.wms.domain.vo.WmsBaseLocationVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author Yinq
* @date 2025-01-08
*/
public interface WmsBaseLocationMapper extends BaseMapperPlus<WmsBaseLocation, WmsBaseLocationVo> {
}

@ -0,0 +1,15 @@
package org.dromara.wms.mapper;
import org.dromara.wms.domain.WmsBaseWarehouse;
import org.dromara.wms.domain.vo.WmsBaseWarehouseVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author Yinq
* @date 2025-01-07
*/
public interface WmsBaseWarehouseMapper extends BaseMapperPlus<WmsBaseWarehouse, WmsBaseWarehouseVo> {
}

@ -0,0 +1,16 @@
package org.dromara.wms.mapper;
import org.dromara.wms.domain.WmsInstockRecord;
import org.dromara.wms.domain.vo.WmsInstockRecordVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* Mapper
*
* @author Yinq
* @date 2025-01-07
*/
public interface WmsInstockRecordMapper extends BaseMapperPlus<WmsInstockRecord, WmsInstockRecordVo> {
}

@ -0,0 +1,69 @@
package org.dromara.wms.service;
import org.dromara.wms.domain.WmsBaseLocation;
import org.dromara.wms.domain.vo.WmsBaseLocationVo;
import org.dromara.wms.domain.bo.WmsBaseLocationBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-01-08
*/
public interface IWmsBaseLocationService {
/**
*
*
* @param locationId
* @return
*/
WmsBaseLocationVo queryById(Long locationId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<WmsBaseLocationVo> queryPageList(WmsBaseLocationBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsBaseLocationVo> queryList(WmsBaseLocationBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(WmsBaseLocationBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(WmsBaseLocationBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,69 @@
package org.dromara.wms.service;
import org.dromara.wms.domain.WmsBaseWarehouse;
import org.dromara.wms.domain.vo.WmsBaseWarehouseVo;
import org.dromara.wms.domain.bo.WmsBaseWarehouseBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-01-07
*/
public interface IWmsBaseWarehouseService {
/**
*
*
* @param warehouseId
* @return
*/
WmsBaseWarehouseVo queryById(Long warehouseId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<WmsBaseWarehouseVo> queryPageList(WmsBaseWarehouseBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsBaseWarehouseVo> queryList(WmsBaseWarehouseBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(WmsBaseWarehouseBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(WmsBaseWarehouseBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,69 @@
package org.dromara.wms.service;
import org.dromara.wms.domain.WmsInstockRecord;
import org.dromara.wms.domain.vo.WmsInstockRecordVo;
import org.dromara.wms.domain.bo.WmsInstockRecordBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-01-07
*/
public interface IWmsInstockRecordService {
/**
*
*
* @param instockRecordId
* @return
*/
WmsInstockRecordVo queryById(Long instockRecordId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<WmsInstockRecordVo> queryPageList(WmsInstockRecordBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsInstockRecordVo> queryList(WmsInstockRecordBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(WmsInstockRecordBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(WmsInstockRecordBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,139 @@
package org.dromara.wms.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.wms.domain.WmsBaseWarehouse;
import org.springframework.stereotype.Service;
import org.dromara.wms.domain.bo.WmsBaseLocationBo;
import org.dromara.wms.domain.vo.WmsBaseLocationVo;
import org.dromara.wms.domain.WmsBaseLocation;
import org.dromara.wms.mapper.WmsBaseLocationMapper;
import org.dromara.wms.service.IWmsBaseLocationService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-01-08
*/
@RequiredArgsConstructor
@Service
public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
private final WmsBaseLocationMapper baseMapper;
/**
*
*
* @param locationId
* @return
*/
@Override
public WmsBaseLocationVo queryById(Long locationId){
return baseMapper.selectVoById(locationId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<WmsBaseLocationVo> queryPageList(WmsBaseLocationBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<WmsBaseLocation> lqw = buildQueryWrapper(bo);
Page<WmsBaseLocationVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsBaseLocationVo> queryList(WmsBaseLocationBo bo) {
MPJLambdaWrapper<WmsBaseLocation> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsBaseLocation> buildQueryWrapper(WmsBaseLocationBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsBaseLocation> lqw = JoinWrappers.lambda(WmsBaseLocation.class)
.selectAll(WmsBaseLocation.class)
.select(WmsBaseWarehouse::getWarehouseName,WmsBaseWarehouse::getWarehouseCode)
.leftJoin(WmsBaseWarehouse.class,WmsBaseWarehouse::getWarehouseId,WmsBaseLocation::getWarehouseId)
.eq(bo.getWarehouseId() != null, WmsBaseLocation::getWarehouseId, bo.getWarehouseId())
.like(StringUtils.isNotBlank(bo.getLocationCode()), WmsBaseLocation::getLocationCode, bo.getLocationCode())
.eq(bo.getLineNum() != null, WmsBaseLocation::getLineNum, bo.getLineNum())
.eq(bo.getLayerNum() != null, WmsBaseLocation::getLayerNum, bo.getLayerNum())
.orderByDesc(WmsBaseLocation::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(WmsBaseLocationBo bo) {
WmsBaseLocation add = MapstructUtils.convert(bo, WmsBaseLocation.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setLocationId(add.getLocationId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(WmsBaseLocationBo bo) {
WmsBaseLocation update = MapstructUtils.convert(bo, WmsBaseLocation.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsBaseLocation entity){
//TODO 做一些数据校验,如唯一约束
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -0,0 +1,142 @@
package org.dromara.wms.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.wms.domain.ProdBaseWorkshopInfo1;
import org.springframework.stereotype.Service;
import org.dromara.wms.domain.bo.WmsBaseWarehouseBo;
import org.dromara.wms.domain.vo.WmsBaseWarehouseVo;
import org.dromara.wms.domain.WmsBaseWarehouse;
import org.dromara.wms.mapper.WmsBaseWarehouseMapper;
import org.dromara.wms.service.IWmsBaseWarehouseService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-01-07
*/
@RequiredArgsConstructor
@Service
public class WmsBaseWarehouseServiceImpl implements IWmsBaseWarehouseService {
private final WmsBaseWarehouseMapper baseMapper;
/**
*
*
* @param warehouseId
* @return
*/
@Override
public WmsBaseWarehouseVo queryById(Long warehouseId) {
return baseMapper.selectVoById(warehouseId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<WmsBaseWarehouseVo> queryPageList(WmsBaseWarehouseBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<WmsBaseWarehouse> lqw = buildQueryWrapper(bo);
Page<WmsBaseWarehouseVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsBaseWarehouseVo> queryList(WmsBaseWarehouseBo bo) {
MPJLambdaWrapper<WmsBaseWarehouse> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsBaseWarehouse> buildQueryWrapper(WmsBaseWarehouseBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsBaseWarehouse> lqw = JoinWrappers.lambda(WmsBaseWarehouse.class)
.selectAll(WmsBaseWarehouse.class)
.select(ProdBaseWorkshopInfo1::getWorkshopName)
.leftJoin(ProdBaseWorkshopInfo1.class, ProdBaseWorkshopInfo1::getWorkshopId, WmsBaseWarehouse::getWorkshopId)
.eq(StringUtils.isNotBlank(bo.getWarehouseCode()), WmsBaseWarehouse::getWarehouseCode, bo.getWarehouseCode())
.like(StringUtils.isNotBlank(bo.getWarehouseName()), WmsBaseWarehouse::getWarehouseName, bo.getWarehouseName())
.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsBaseWarehouse::getMaterialCategories, bo.getMaterialCategories())
.eq(bo.getWorkshopId() != null, WmsBaseWarehouse::getWorkshopId, bo.getWorkshopId())
.eq(StringUtils.isNotBlank(bo.getWarehouseType()), WmsBaseWarehouse::getWarehouseType, bo.getWarehouseType())
.orderByDesc(WmsBaseWarehouse::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(WmsBaseWarehouseBo bo) {
WmsBaseWarehouse add = MapstructUtils.convert(bo, WmsBaseWarehouse.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setWarehouseId(add.getWarehouseId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(WmsBaseWarehouseBo bo) {
WmsBaseWarehouse update = MapstructUtils.convert(bo, WmsBaseWarehouse.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsBaseWarehouse entity) {
//TODO 做一些数据校验,如唯一约束
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -2,6 +2,7 @@ package org.dromara.wms.service.impl;
import com.alibaba.nacos.shaded.com.google.common.collect.Maps; import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -10,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.dromara.common.satoken.utils.LoginHelper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.dromara.wms.domain.bo.WmsDeliveryNoteBo; import org.dromara.wms.domain.bo.WmsDeliveryNoteBo;
import org.dromara.wms.domain.vo.WmsDeliveryNoteVo; import org.dromara.wms.domain.vo.WmsDeliveryNoteVo;
@ -42,7 +44,8 @@ public class WmsDeliveryNoteServiceImpl implements IWmsDeliveryNoteService {
@Override @Override
public WmsDeliveryNoteVo queryById(Long deliveryNoteId){ public WmsDeliveryNoteVo queryById(Long deliveryNoteId){
return baseMapper.selectVoOne(new LambdaQueryWrapper<WmsDeliveryNote>().eq(WmsDeliveryNote::getDeliveryNoteId, deliveryNoteId)); // return baseMapper.selectVoOne(new LambdaQueryWrapper<WmsDeliveryNote>().eq(WmsDeliveryNote::getDeliveryNoteId, deliveryNoteId));
return baseMapper.selectVoById(deliveryNoteId);
} }
/** /**
@ -93,8 +96,12 @@ public class WmsDeliveryNoteServiceImpl implements IWmsDeliveryNoteService {
*/ */
@Override @Override
public Boolean insertByBo(WmsDeliveryNoteBo bo) { public Boolean insertByBo(WmsDeliveryNoteBo bo) {
bo.setDeliveryNoteCode("SH"+DateUtils.dateTimeNow());
// bo.setCreateBy(LoginHelper.getUsername());
WmsDeliveryNote add = MapstructUtils.convert(bo, WmsDeliveryNote.class); WmsDeliveryNote add = MapstructUtils.convert(bo, WmsDeliveryNote.class);
// add.setCreateBy("12312"); // add.setCreateBy("12312");
validEntityBeforeSave(add); validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0; boolean flag = baseMapper.insert(add) > 0;
if (flag) { if (flag) {

@ -0,0 +1,142 @@
package org.dromara.wms.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.dromara.wms.domain.bo.WmsInstockRecordBo;
import org.dromara.wms.domain.vo.WmsInstockRecordVo;
import org.dromara.wms.domain.WmsInstockRecord;
import org.dromara.wms.mapper.WmsInstockRecordMapper;
import org.dromara.wms.service.IWmsInstockRecordService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-01-07
*/
@RequiredArgsConstructor
@Service
public class WmsInstockRecordServiceImpl implements IWmsInstockRecordService {
private final WmsInstockRecordMapper baseMapper;
/**
*
*
* @param instockRecordId
* @return
*/
@Override
public WmsInstockRecordVo queryById(Long instockRecordId){
return baseMapper.selectVoById(instockRecordId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<WmsInstockRecordVo> queryPageList(WmsInstockRecordBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<WmsInstockRecord> lqw = buildQueryWrapper(bo);
Page<WmsInstockRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsInstockRecordVo> queryList(WmsInstockRecordBo bo) {
MPJLambdaWrapper<WmsInstockRecord> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsInstockRecord> buildQueryWrapper(WmsInstockRecordBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsInstockRecord> lqw = JoinWrappers.lambda(WmsInstockRecord.class)
.selectAll(WmsInstockRecord.class)
.eq(StringUtils.isNotBlank(bo.getInstockCode()), WmsInstockRecord::getInstockCode, bo.getInstockCode())
.eq(StringUtils.isNotBlank(bo.getBatchCode()), WmsInstockRecord::getBatchCode, bo.getBatchCode())
.eq(bo.getWarehouseId() != null, WmsInstockRecord::getWarehouseId, bo.getWarehouseId())
.like(StringUtils.isNotBlank(bo.getLocationCode()), WmsInstockRecord::getLocationCode, bo.getLocationCode())
.like(StringUtils.isNotBlank(bo.getMaterialCode()), WmsInstockRecord::getMaterialCode, bo.getMaterialCode())
.like(StringUtils.isNotBlank(bo.getMaterialName()), WmsInstockRecord::getMaterialName, bo.getMaterialName())
.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsInstockRecord::getMaterialCategories, bo.getMaterialCategories())
.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
WmsInstockRecord::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime"))
.eq(StringUtils.isNotBlank(bo.getErpSynchronousStatus()), WmsInstockRecord::getErpSynchronousStatus, bo.getErpSynchronousStatus())
.eq(bo.getErpSynchronousQty() != null, WmsInstockRecord::getErpSynchronousQty, bo.getErpSynchronousQty())
.orderByDesc(WmsInstockRecord::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(WmsInstockRecordBo bo) {
WmsInstockRecord add = MapstructUtils.convert(bo, WmsInstockRecord.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
// if (flag) {
// bo.setInstockRecordId(add.getInstockRecordId());
// }
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(WmsInstockRecordBo bo) {
WmsInstockRecord update = MapstructUtils.convert(bo, WmsInstockRecord.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsInstockRecord entity){
//TODO 做一些数据校验,如唯一约束
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -0,0 +1,7 @@
<?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="org.dromara.wms.mapper.ProdBaseWorkshopInfoMapper">
</mapper>

@ -0,0 +1,7 @@
<?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="org.dromara.wms.mapper.WmsBaseLocationMapper">
</mapper>

@ -0,0 +1,7 @@
<?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="org.dromara.wms.mapper.WmsBaseWarehouseMapper">
</mapper>

@ -0,0 +1,7 @@
<?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="org.dromara.wms.mapper.WmsInstockRecordMapper">
</mapper>
Loading…
Cancel
Save