入库相关接口开发

This commit is contained in:
2025-05-30 16:13:27 +08:00
parent 8694b17db4
commit 68f96b9872
60 changed files with 3568 additions and 194 deletions

View File

@@ -120,6 +120,10 @@ public class SecurityConfig
"/ws/**",
"/information/device/**",
"/MatchScan/**",
// "/wisdom/stock/**",
// "/information/materialtype/**",
// "/information/warehousingtype/**",
// "/information/warehouseinfo/**",
"/Visual/**",
"/HdInventory/**").permitAll()
// 静态资源,可匿名访问

View File

@@ -1,4 +1,4 @@
package com.zg.project.Information.controller;
package com.zg.project.information.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zg.framework.aspectj.lang.annotation.Log;
import com.zg.framework.aspectj.lang.enums.BusinessType;
import com.zg.project.Information.domain.DeviceInfo;
import com.zg.project.Information.service.IDeviceInfoService;
import com.zg.project.information.domain.DeviceInfo;
import com.zg.project.information.service.IDeviceInfoService;
import com.zg.framework.web.controller.BaseController;
import com.zg.framework.web.domain.AjaxResult;
import com.zg.common.utils.poi.ExcelUtil;

View File

@@ -0,0 +1,112 @@
package com.zg.project.information.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zg.framework.aspectj.lang.annotation.Log;
import com.zg.framework.aspectj.lang.enums.BusinessType;
import com.zg.project.information.domain.MaterialType;
import com.zg.project.information.service.IMaterialTypeService;
import com.zg.framework.web.controller.BaseController;
import com.zg.framework.web.domain.AjaxResult;
import com.zg.common.utils.poi.ExcelUtil;
import com.zg.framework.web.page.TableDataInfo;
/**
* 物资类型Controller
*
* @author zg
* @date 2025-05-27
*/
@RestController
@RequestMapping("/information/materialtype")
public class MaterialTypeController extends BaseController
{
@Autowired
private IMaterialTypeService materialTypeService;
/**
* 查询物资类型列表
*/
@PreAuthorize("@ss.hasPermi('information:materialtype:list')")
@GetMapping("/list")
public TableDataInfo list(MaterialType materialType)
{
startPage();
List<MaterialType> list = materialTypeService.selectMaterialTypeList(materialType);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('information:materialtype:list')")
@GetMapping("/getAll")
public AjaxResult getAll()
{
List<MaterialType> list = materialTypeService.selectMaterialTypeList(new MaterialType());
return success(list);
}
/**
* 导出物资类型列表
*/
@PreAuthorize("@ss.hasPermi('information:materialtype:export')")
@Log(title = "物资类型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MaterialType materialType)
{
List<MaterialType> list = materialTypeService.selectMaterialTypeList(materialType);
ExcelUtil<MaterialType> util = new ExcelUtil<MaterialType>(MaterialType.class);
util.exportExcel(response, list, "物资类型数据");
}
/**
* 获取物资类型详细信息
*/
@PreAuthorize("@ss.hasPermi('information:materialtype:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(materialTypeService.selectMaterialTypeById(id));
}
/**
* 新增物资类型
*/
@PreAuthorize("@ss.hasPermi('information:materialtype:add')")
@Log(title = "物资类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MaterialType materialType)
{
return toAjax(materialTypeService.insertMaterialType(materialType));
}
/**
* 修改物资类型
*/
@PreAuthorize("@ss.hasPermi('information:materialtype:edit')")
@Log(title = "物资类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MaterialType materialType)
{
return toAjax(materialTypeService.updateMaterialType(materialType));
}
/**
* 删除物资类型
*/
@PreAuthorize("@ss.hasPermi('information:materialtype:remove')")
@Log(title = "物资类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(materialTypeService.deleteMaterialTypeByIds(ids));
}
}

View File

@@ -0,0 +1,115 @@
package com.zg.project.information.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zg.project.wisdom.domain.GysJh;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.zg.framework.aspectj.lang.annotation.Log;
import com.zg.framework.aspectj.lang.enums.BusinessType;
import com.zg.project.information.domain.PcdeDetail;
import com.zg.project.information.service.IPcdeDetailService;
import com.zg.framework.web.controller.BaseController;
import com.zg.framework.web.domain.AjaxResult;
import com.zg.common.utils.poi.ExcelUtil;
import com.zg.framework.web.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 库位明细Controller
*
* @author zg
* @date 2025-05-29
*/
@RestController
@RequestMapping("/information/pcdedetail")
public class PcdeDetailController extends BaseController
{
@Autowired
private IPcdeDetailService pcdeDetailService;
/**
* 查询库位明细列表
*/
@PreAuthorize("@ss.hasPermi('information:pcdedetail:list')")
@GetMapping("/list")
public TableDataInfo list(PcdeDetail pcdeDetail)
{
startPage();
List<PcdeDetail> list = pcdeDetailService.selectPcdeDetailList(pcdeDetail);
return getDataTable(list);
}
/**
* 导出库位明细列表
*/
@PreAuthorize("@ss.hasPermi('information:pcdedetail:export')")
@Log(title = "库位明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, PcdeDetail pcdeDetail)
{
List<PcdeDetail> list = pcdeDetailService.selectPcdeDetailList(pcdeDetail);
ExcelUtil<PcdeDetail> util = new ExcelUtil<PcdeDetail>(PcdeDetail.class);
util.exportExcel(response, list, "库位明细数据");
}
/**
* 导入供应计划数据(全部新增,不校验重复)
*/
@PreAuthorize("@ss.hasPermi('information:pcdedetail:import')")
@Log(title = "库位明细", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(@RequestParam("file") MultipartFile file) throws Exception {
ExcelUtil<PcdeDetail> util = new ExcelUtil<>(PcdeDetail.class);
List<PcdeDetail> list = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = pcdeDetailService.importPcdeDetail(list, operName);
return AjaxResult.success(message);
}
/**
* 获取库位明细详细信息
*/
@PreAuthorize("@ss.hasPermi('information:pcdedetail:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(pcdeDetailService.selectPcdeDetailById(id));
}
/**
* 新增库位明细
*/
@PreAuthorize("@ss.hasPermi('information:pcdedetail:add')")
@Log(title = "库位明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody PcdeDetail pcdeDetail)
{
return toAjax(pcdeDetailService.insertPcdeDetail(pcdeDetail));
}
/**
* 修改库位明细
*/
@PreAuthorize("@ss.hasPermi('information:pcdedetail:edit')")
@Log(title = "库位明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody PcdeDetail pcdeDetail)
{
return toAjax(pcdeDetailService.updatePcdeDetail(pcdeDetail));
}
/**
* 删除库位明细
*/
@PreAuthorize("@ss.hasPermi('information:pcdedetail:remove')")
@Log(title = "库位明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(pcdeDetailService.deletePcdeDetailByIds(ids));
}
}

View File

@@ -1,10 +1,10 @@
package com.zg.project.Information.controller;
package com.zg.project.information.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zg.project.Information.domain.SceneMapping;
import com.zg.project.Information.service.ISceneMappingService;
import com.zg.project.information.domain.SceneMapping;
import com.zg.project.information.service.ISceneMappingService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -47,6 +47,18 @@ public class SceneMappingController extends BaseController
return getDataTable(list);
}
/**
* 查询场景编号列表
* @return
*/
@PreAuthorize("@ss.hasPermi('information:scene:list')")
@GetMapping("/getAll")
public AjaxResult getAll()
{
List<SceneMapping> list = sceneMappingService.selectSceneMappingList(new SceneMapping());
return success(list);
}
/**
* 导出场景编号列表
*/

View File

@@ -0,0 +1,115 @@
package com.zg.project.information.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zg.framework.aspectj.lang.annotation.Log;
import com.zg.framework.aspectj.lang.enums.BusinessType;
import com.zg.project.information.domain.StockInType;
import com.zg.project.information.service.IStockInTypeService;
import com.zg.framework.web.controller.BaseController;
import com.zg.framework.web.domain.AjaxResult;
import com.zg.common.utils.poi.ExcelUtil;
import com.zg.framework.web.page.TableDataInfo;
/**
* 入库类型Controller
*
* @author zg
* @date 2025-05-27
*/
@RestController
@RequestMapping("/information/warehousingtype")
public class StockInTypeController extends BaseController
{
@Autowired
private IStockInTypeService stockInTypeService;
/**
* 查询入库类型列表
*/
@PreAuthorize("@ss.hasPermi('information:warehousingtype:list')")
@GetMapping("/list")
public TableDataInfo list(StockInType stockInType)
{
startPage();
List<StockInType> list = stockInTypeService.selectStockInTypeList(stockInType);
return getDataTable(list);
}
/**
* 查询所有入库类型列表
* @return
*/
@PreAuthorize("@ss.hasPermi('information:warehousingtype:list')")
@GetMapping("/getAll")
public AjaxResult getAll()
{
List<StockInType> list = stockInTypeService.selectStockInTypeList(new StockInType());
return AjaxResult.success(list);
}
/**
* 导出入库类型列表
*/
@PreAuthorize("@ss.hasPermi('information:warehousingtype:export')")
@Log(title = "入库类型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StockInType stockInType)
{
List<StockInType> list = stockInTypeService.selectStockInTypeList(stockInType);
ExcelUtil<StockInType> util = new ExcelUtil<StockInType>(StockInType.class);
util.exportExcel(response, list, "入库类型数据");
}
/**
* 获取入库类型详细信息
*/
@PreAuthorize("@ss.hasPermi('information:warehousingtype:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(stockInTypeService.selectStockInTypeById(id));
}
/**
* 新增入库类型
*/
@PreAuthorize("@ss.hasPermi('information:warehousingtype:add')")
@Log(title = "入库类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody StockInType stockInType)
{
return toAjax(stockInTypeService.insertStockInType(stockInType));
}
/**
* 修改入库类型
*/
@PreAuthorize("@ss.hasPermi('information:warehousingtype:edit')")
@Log(title = "入库类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody StockInType stockInType)
{
return toAjax(stockInTypeService.updateStockInType(stockInType));
}
/**
* 删除入库类型
*/
@PreAuthorize("@ss.hasPermi('information:warehousingtype:remove')")
@Log(title = "入库类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(stockInTypeService.deleteStockInTypeByIds(ids));
}
}

View File

@@ -0,0 +1,34 @@
package com.zg.project.information.controller;
import com.zg.framework.web.controller.BaseController;
import com.zg.framework.web.domain.AjaxResult;
import com.zg.project.system.domain.SysUser;
import com.zg.project.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 用户信息
*
* @author zg
*/
@RestController
@RequestMapping("/information/user")
public class UserController extends BaseController {
@Autowired
private ISysUserService userService;
/**
* 获取用户列表
*/
@GetMapping("/getAll")
public AjaxResult getAll() {
List<SysUser> list = userService.getAll();
return AjaxResult.success(list);
}
}

View File

@@ -0,0 +1,116 @@
package com.zg.project.information.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zg.framework.aspectj.lang.annotation.Log;
import com.zg.framework.aspectj.lang.enums.BusinessType;
import com.zg.project.information.domain.WarehouseInfo;
import com.zg.project.information.service.IWarehouseInfoService;
import com.zg.framework.web.controller.BaseController;
import com.zg.framework.web.domain.AjaxResult;
import com.zg.common.utils.poi.ExcelUtil;
import com.zg.framework.web.page.TableDataInfo;
/**
* 仓库信息Controller
*
* @author zg
* @date 2025-05-27
*/
@RestController
@RequestMapping("/information/warehouseinfo")
public class WarehouseInfoController extends BaseController
{
@Autowired
private IWarehouseInfoService warehouseInfoService;
/**
* 查询仓库信息列表
*/
@PreAuthorize("@ss.hasPermi('information:warehouseinfo:list')")
@GetMapping("/list")
public TableDataInfo list(WarehouseInfo warehouseInfo)
{
startPage();
List<WarehouseInfo> list = warehouseInfoService.selectWarehouseInfoList(warehouseInfo);
return getDataTable(list);
}
/**
* 查询仓库信息列表
* @return
*/
@PreAuthorize("@ss.hasPermi('information:warehouseinfo:list')")
@GetMapping("/getAll")
public AjaxResult getAll()
{
List<WarehouseInfo> list = warehouseInfoService.selectWarehouseInfoList(new WarehouseInfo());
return success(list);
}
/**
* 导出仓库信息列表
*/
@PreAuthorize("@ss.hasPermi('information:warehouseinfo:export')")
@Log(title = "仓库信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WarehouseInfo warehouseInfo)
{
List<WarehouseInfo> list = warehouseInfoService.selectWarehouseInfoList(warehouseInfo);
ExcelUtil<WarehouseInfo> util = new ExcelUtil<WarehouseInfo>(WarehouseInfo.class);
util.exportExcel(response, list, "仓库信息数据");
}
/**
* 获取仓库信息详细信息
*/
@PreAuthorize("@ss.hasPermi('information:warehouseinfo:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(warehouseInfoService.selectWarehouseInfoById(id));
}
/**
* 新增仓库信息
*/
@PreAuthorize("@ss.hasPermi('information:warehouseinfo:add')")
@Log(title = "仓库信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WarehouseInfo warehouseInfo)
{
return toAjax(warehouseInfoService.insertWarehouseInfo(warehouseInfo));
}
/**
* 修改仓库信息
*/
@PreAuthorize("@ss.hasPermi('information:warehouseinfo:edit')")
@Log(title = "仓库信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WarehouseInfo warehouseInfo)
{
return toAjax(warehouseInfoService.updateWarehouseInfo(warehouseInfo));
}
/**
* 删除仓库信息
*/
@PreAuthorize("@ss.hasPermi('information:warehouseinfo:remove')")
@Log(title = "仓库信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(warehouseInfoService.deleteWarehouseInfoByIds(ids));
}
}

View File

@@ -1,4 +1,4 @@
package com.zg.project.Information.domain;
package com.zg.project.information.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

View File

@@ -0,0 +1,132 @@
package com.zg.project.information.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zg.framework.aspectj.lang.annotation.Excel;
import com.zg.framework.web.domain.BaseEntity;
/**
* 物资类型对象 material_type
*
* @author zg
* @date 2025-05-27
*/
public class MaterialType extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 物资类型编码 */
@Excel(name = "物资类型编码")
private String typeCode;
/** 物资类型名称 */
@Excel(name = "物资类型名称")
private String typeName;
/** 状态1=启用0=禁用) */
@Excel(name = "状态", readConverterExp = "1==启用0=禁用")
private Long status;
/** 排序值 */
@Excel(name = "排序值")
private Long sort;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdAt;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTypeCode(String typeCode)
{
this.typeCode = typeCode;
}
public String getTypeCode()
{
return typeCode;
}
public void setTypeName(String typeName)
{
this.typeName = typeName;
}
public String getTypeName()
{
return typeName;
}
public void setStatus(Long status)
{
this.status = status;
}
public Long getStatus()
{
return status;
}
public void setSort(Long sort)
{
this.sort = sort;
}
public Long getSort()
{
return sort;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("typeCode", getTypeCode())
.append("typeName", getTypeName())
.append("status", getStatus())
.append("sort", getSort())
.append("remark", getRemark())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.toString();
}
}

View File

@@ -0,0 +1,215 @@
package com.zg.project.information.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zg.framework.aspectj.lang.annotation.Excel;
import com.zg.framework.web.domain.BaseEntity;
/**
* 库位明细对象 pcde_detail
*
* @author zg
* @date 2025-05-29
*/
public class PcdeDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 库位编号 */
@Excel(name = "库位编号")
private String locationCode;
/** 所属场景 */
private String scene;
/** 所属场景名称 */
@Excel(name = "所属场景名称")
private String sceneName;
/** 所属仓库 */
@Excel(name = "所属仓库")
private String warehouse;
/** 编码后ID */
@Excel(name = "编码后ID")
private String encodedId;
/** 标签 */
@Excel(name = "标签")
private String tag;
/** 备注 */
@Excel(name = "备注")
private String remark;
/** 是否删除0 正常1 删除) */
private String isDelete;
/** 创建人 */
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date createdAt;
/** 修改人 */
private String updatedBy;
/** 修改时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date updatedAt;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setLocationCode(String locationCode)
{
this.locationCode = locationCode;
}
public String getLocationCode()
{
return locationCode;
}
public void setScene(String scene)
{
this.scene = scene;
}
public String getScene()
{
return scene;
}
public void setSceneName(String sceneName)
{
this.sceneName = sceneName;
}
public String getSceneName()
{
return sceneName;
}
public void setWarehouse(String warehouse)
{
this.warehouse = warehouse;
}
public String getWarehouse()
{
return warehouse;
}
public void setEncodedId(String encodedId)
{
this.encodedId = encodedId;
}
public String getEncodedId()
{
return encodedId;
}
public void setTag(String tag)
{
this.tag = tag;
}
public String getTag()
{
return tag;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public String getRemark()
{
return remark;
}
public void setIsDelete(String isDelete)
{
this.isDelete = isDelete;
}
public String getIsDelete()
{
return isDelete;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedBy(String updatedBy)
{
this.updatedBy = updatedBy;
}
public String getUpdatedBy()
{
return updatedBy;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("locationCode", getLocationCode())
.append("scene", getScene())
.append("sceneName", getSceneName())
.append("warehouse", getWarehouse())
.append("encodedId", getEncodedId())
.append("tag", getTag())
.append("remark", getRemark())
.append("isDelete", getIsDelete())
.append("createdBy", getCreatedBy())
.append("createdAt", getCreatedAt())
.append("updatedBy", getUpdatedBy())
.append("updatedAt", getUpdatedAt())
.toString();
}
}

View File

@@ -1,4 +1,4 @@
package com.zg.project.Information.domain;
package com.zg.project.information.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

View File

@@ -1,4 +1,4 @@
package com.zg.project.Information.domain;
package com.zg.project.information.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

View File

@@ -1,4 +1,4 @@
package com.zg.project.Information.domain;
package com.zg.project.information.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

View File

@@ -1,7 +1,7 @@
package com.zg.project.Information.mapper;
package com.zg.project.information.mapper;
import java.util.List;
import com.zg.project.Information.domain.DeviceInfo;
import com.zg.project.information.domain.DeviceInfo;
/**
* 设备信息Mapper接口

View File

@@ -0,0 +1,61 @@
package com.zg.project.information.mapper;
import java.util.List;
import com.zg.project.information.domain.MaterialType;
/**
* 物资类型Mapper接口
*
* @author zg
* @date 2025-05-27
*/
public interface MaterialTypeMapper
{
/**
* 查询物资类型
*
* @param id 物资类型主键
* @return 物资类型
*/
public MaterialType selectMaterialTypeById(Long id);
/**
* 查询物资类型列表
*
* @param materialType 物资类型
* @return 物资类型集合
*/
public List<MaterialType> selectMaterialTypeList(MaterialType materialType);
/**
* 新增物资类型
*
* @param materialType 物资类型
* @return 结果
*/
public int insertMaterialType(MaterialType materialType);
/**
* 修改物资类型
*
* @param materialType 物资类型
* @return 结果
*/
public int updateMaterialType(MaterialType materialType);
/**
* 删除物资类型
*
* @param id 物资类型主键
* @return 结果
*/
public int deleteMaterialTypeById(Long id);
/**
* 批量删除物资类型
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMaterialTypeByIds(Long[] ids);
}

View File

@@ -0,0 +1,69 @@
package com.zg.project.information.mapper;
import java.util.List;
import com.zg.project.information.domain.PcdeDetail;
/**
* 库位明细Mapper接口
*
* @author zg
* @date 2025-05-29
*/
public interface PcdeDetailMapper
{
/**
* 查询库位明细
*
* @param id 库位明细主键
* @return 库位明细
*/
public PcdeDetail selectPcdeDetailById(Long id);
/**
* 查询库位明细列表
*
* @param pcdeDetail 库位明细
* @return 库位明细集合
*/
public List<PcdeDetail> selectPcdeDetailList(PcdeDetail pcdeDetail);
/**
* 新增库位明细
*
* @param pcdeDetail 库位明细
* @return 结果
*/
public int insertPcdeDetail(PcdeDetail pcdeDetail);
/**
* 修改库位明细
*
* @param pcdeDetail 库位明细
* @return 结果
*/
public int updatePcdeDetail(PcdeDetail pcdeDetail);
/**
* 删除库位明细
*
* @param id 库位明细主键
* @return 结果
*/
public int deletePcdeDetailById(Long id);
/**
* 批量删除库位明细
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deletePcdeDetailByIds(Long[] ids);
/**
* 根据库位编码查询库位信息
* @param locationCode
* @return
*/
PcdeDetail selectByLocationCode(String locationCode);
}

View File

@@ -1,6 +1,6 @@
package com.zg.project.Information.mapper;
package com.zg.project.information.mapper;
import com.zg.project.Information.domain.SceneMapping;
import com.zg.project.information.domain.SceneMapping;
import java.util.List;

View File

@@ -0,0 +1,61 @@
package com.zg.project.information.mapper;
import java.util.List;
import com.zg.project.information.domain.StockInType;
/**
* 入库类型Mapper接口
*
* @author zg
* @date 2025-05-27
*/
public interface StockInTypeMapper
{
/**
* 查询入库类型
*
* @param id 入库类型主键
* @return 入库类型
*/
public StockInType selectStockInTypeById(Long id);
/**
* 查询入库类型列表
*
* @param stockInType 入库类型
* @return 入库类型集合
*/
public List<StockInType> selectStockInTypeList(StockInType stockInType);
/**
* 新增入库类型
*
* @param stockInType 入库类型
* @return 结果
*/
public int insertStockInType(StockInType stockInType);
/**
* 修改入库类型
*
* @param stockInType 入库类型
* @return 结果
*/
public int updateStockInType(StockInType stockInType);
/**
* 删除入库类型
*
* @param id 入库类型主键
* @return 结果
*/
public int deleteStockInTypeById(Long id);
/**
* 批量删除入库类型
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteStockInTypeByIds(Long[] ids);
}

View File

@@ -0,0 +1,62 @@
package com.zg.project.information.mapper;
import com.zg.project.information.domain.WarehouseInfo;
import java.util.List;
/**
* 仓库信息Mapper接口
*
* @author zg
* @date 2025-05-27
*/
public interface WarehouseInfoMapper
{
/**
* 查询仓库信息
*
* @param id 仓库信息主键
* @return 仓库信息
*/
public WarehouseInfo selectWarehouseInfoById(Long id);
/**
* 查询仓库信息列表
*
* @param warehouseInfo 仓库信息
* @return 仓库信息集合
*/
public List<WarehouseInfo> selectWarehouseInfoList(WarehouseInfo warehouseInfo);
/**
* 新增仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
public int insertWarehouseInfo(WarehouseInfo warehouseInfo);
/**
* 修改仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
public int updateWarehouseInfo(WarehouseInfo warehouseInfo);
/**
* 删除仓库信息
*
* @param id 仓库信息主键
* @return 结果
*/
public int deleteWarehouseInfoById(Long id);
/**
* 批量删除仓库信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWarehouseInfoByIds(Long[] ids);
}

View File

@@ -1,7 +1,7 @@
package com.zg.project.Information.service;
package com.zg.project.information.service;
import java.util.List;
import com.zg.project.Information.domain.DeviceInfo;
import com.zg.project.information.domain.DeviceInfo;
/**
* 设备信息Service接口

View File

@@ -0,0 +1,61 @@
package com.zg.project.information.service;
import java.util.List;
import com.zg.project.information.domain.MaterialType;
/**
* 物资类型Service接口
*
* @author zg
* @date 2025-05-27
*/
public interface IMaterialTypeService
{
/**
* 查询物资类型
*
* @param id 物资类型主键
* @return 物资类型
*/
public MaterialType selectMaterialTypeById(Long id);
/**
* 查询物资类型列表
*
* @param materialType 物资类型
* @return 物资类型集合
*/
public List<MaterialType> selectMaterialTypeList(MaterialType materialType);
/**
* 新增物资类型
*
* @param materialType 物资类型
* @return 结果
*/
public int insertMaterialType(MaterialType materialType);
/**
* 修改物资类型
*
* @param materialType 物资类型
* @return 结果
*/
public int updateMaterialType(MaterialType materialType);
/**
* 批量删除物资类型
*
* @param ids 需要删除的物资类型主键集合
* @return 结果
*/
public int deleteMaterialTypeByIds(Long[] ids);
/**
* 删除物资类型信息
*
* @param id 物资类型主键
* @return 结果
*/
public int deleteMaterialTypeById(Long id);
}

View File

@@ -0,0 +1,69 @@
package com.zg.project.information.service;
import java.util.List;
import com.zg.project.information.domain.PcdeDetail;
/**
* 库位明细Service接口
*
* @author zg
* @date 2025-05-29
*/
public interface IPcdeDetailService
{
/**
* 查询库位明细
*
* @param id 库位明细主键
* @return 库位明细
*/
public PcdeDetail selectPcdeDetailById(Long id);
/**
* 查询库位明细列表
*
* @param pcdeDetail 库位明细
* @return 库位明细集合
*/
public List<PcdeDetail> selectPcdeDetailList(PcdeDetail pcdeDetail);
/**
* 新增库位明细
*
* @param pcdeDetail 库位明细
* @return 结果
*/
public int insertPcdeDetail(PcdeDetail pcdeDetail);
/**
* 修改库位明细
*
* @param pcdeDetail 库位明细
* @return 结果
*/
public int updatePcdeDetail(PcdeDetail pcdeDetail);
/**
* 批量删除库位明细
*
* @param ids 需要删除的库位明细主键集合
* @return 结果
*/
public int deletePcdeDetailByIds(Long[] ids);
/**
* 删除库位明细信息
*
* @param id 库位明细主键
* @return 结果
*/
public int deletePcdeDetailById(Long id);
/**
* 导入数据
* @param list
* @param operName
* @return
*/
String importPcdeDetail(List<PcdeDetail> list, String operName);
}

View File

@@ -1,6 +1,6 @@
package com.zg.project.Information.service;
package com.zg.project.information.service;
import com.zg.project.Information.domain.SceneMapping;
import com.zg.project.information.domain.SceneMapping;
import java.util.List;

View File

@@ -0,0 +1,61 @@
package com.zg.project.information.service;
import java.util.List;
import com.zg.project.information.domain.StockInType;
/**
* 入库类型Service接口
*
* @author zg
* @date 2025-05-27
*/
public interface IStockInTypeService
{
/**
* 查询入库类型
*
* @param id 入库类型主键
* @return 入库类型
*/
public StockInType selectStockInTypeById(Long id);
/**
* 查询入库类型列表
*
* @param stockInType 入库类型
* @return 入库类型集合
*/
public List<StockInType> selectStockInTypeList(StockInType stockInType);
/**
* 新增入库类型
*
* @param stockInType 入库类型
* @return 结果
*/
public int insertStockInType(StockInType stockInType);
/**
* 修改入库类型
*
* @param stockInType 入库类型
* @return 结果
*/
public int updateStockInType(StockInType stockInType);
/**
* 批量删除入库类型
*
* @param ids 需要删除的入库类型主键集合
* @return 结果
*/
public int deleteStockInTypeByIds(Long[] ids);
/**
* 删除入库类型信息
*
* @param id 入库类型主键
* @return 结果
*/
public int deleteStockInTypeById(Long id);
}

View File

@@ -0,0 +1,62 @@
package com.zg.project.information.service;
import com.zg.project.information.domain.WarehouseInfo;
import java.util.List;
/**
* 仓库信息Service接口
*
* @author zg
* @date 2025-05-27
*/
public interface IWarehouseInfoService
{
/**
* 查询仓库信息
*
* @param id 仓库信息主键
* @return 仓库信息
*/
public WarehouseInfo selectWarehouseInfoById(Long id);
/**
* 查询仓库信息列表
*
* @param warehouseInfo 仓库信息
* @return 仓库信息集合
*/
public List<WarehouseInfo> selectWarehouseInfoList(WarehouseInfo warehouseInfo);
/**
* 新增仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
public int insertWarehouseInfo(WarehouseInfo warehouseInfo);
/**
* 修改仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
public int updateWarehouseInfo(WarehouseInfo warehouseInfo);
/**
* 批量删除仓库信息
*
* @param ids 需要删除的仓库信息主键集合
* @return 结果
*/
public int deleteWarehouseInfoByIds(Long[] ids);
/**
* 删除仓库信息信息
*
* @param id 仓库信息主键
* @return 结果
*/
public int deleteWarehouseInfoById(Long id);
}

View File

@@ -1,12 +1,12 @@
package com.zg.project.Information.service.impl;
package com.zg.project.information.service.impl;
import java.util.List;
import com.zg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zg.project.Information.mapper.DeviceInfoMapper;
import com.zg.project.Information.domain.DeviceInfo;
import com.zg.project.Information.service.IDeviceInfoService;
import com.zg.project.information.mapper.DeviceInfoMapper;
import com.zg.project.information.domain.DeviceInfo;
import com.zg.project.information.service.IDeviceInfoService;
/**
* 设备信息Service业务层处理

View File

@@ -0,0 +1,93 @@
package com.zg.project.information.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zg.project.information.mapper.MaterialTypeMapper;
import com.zg.project.information.domain.MaterialType;
import com.zg.project.information.service.IMaterialTypeService;
/**
* 物资类型Service业务层处理
*
* @author zg
* @date 2025-05-27
*/
@Service
public class MaterialTypeServiceImpl implements IMaterialTypeService
{
@Autowired
private MaterialTypeMapper materialTypeMapper;
/**
* 查询物资类型
*
* @param id 物资类型主键
* @return 物资类型
*/
@Override
public MaterialType selectMaterialTypeById(Long id)
{
return materialTypeMapper.selectMaterialTypeById(id);
}
/**
* 查询物资类型列表
*
* @param materialType 物资类型
* @return 物资类型
*/
@Override
public List<MaterialType> selectMaterialTypeList(MaterialType materialType)
{
return materialTypeMapper.selectMaterialTypeList(materialType);
}
/**
* 新增物资类型
*
* @param materialType 物资类型
* @return 结果
*/
@Override
public int insertMaterialType(MaterialType materialType)
{
return materialTypeMapper.insertMaterialType(materialType);
}
/**
* 修改物资类型
*
* @param materialType 物资类型
* @return 结果
*/
@Override
public int updateMaterialType(MaterialType materialType)
{
return materialTypeMapper.updateMaterialType(materialType);
}
/**
* 批量删除物资类型
*
* @param ids 需要删除的物资类型主键
* @return 结果
*/
@Override
public int deleteMaterialTypeByIds(Long[] ids)
{
return materialTypeMapper.deleteMaterialTypeByIds(ids);
}
/**
* 删除物资类型信息
*
* @param id 物资类型主键
* @return 结果
*/
@Override
public int deleteMaterialTypeById(Long id)
{
return materialTypeMapper.deleteMaterialTypeById(id);
}
}

View File

@@ -0,0 +1,146 @@
package com.zg.project.information.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.zg.common.exception.ServiceException;
import com.zg.common.utils.DateUtils;
import com.zg.project.wisdom.domain.GysJh;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zg.project.information.mapper.PcdeDetailMapper;
import com.zg.project.information.domain.PcdeDetail;
import com.zg.project.information.service.IPcdeDetailService;
/**
* 库位明细Service业务层处理
*
* @author zg
* @date 2025-05-29
*/
@Service
public class PcdeDetailServiceImpl implements IPcdeDetailService
{
@Autowired
private PcdeDetailMapper pcdeDetailMapper;
/**
* 查询库位明细
*
* @param id 库位明细主键
* @return 库位明细
*/
@Override
public PcdeDetail selectPcdeDetailById(Long id)
{
return pcdeDetailMapper.selectPcdeDetailById(id);
}
/**
* 查询库位明细列表
*
* @param pcdeDetail 库位明细
* @return 库位明细
*/
@Override
public List<PcdeDetail> selectPcdeDetailList(PcdeDetail pcdeDetail)
{
return pcdeDetailMapper.selectPcdeDetailList(pcdeDetail);
}
/**
* 新增库位明细
*
* @param pcdeDetail 库位明细
* @return 结果
*/
@Override
public int insertPcdeDetail(PcdeDetail pcdeDetail) {
// 原始 locationCode
String locationCode = pcdeDetail.getLocationCode();
// 将 locationCode 转换为十六进制字符串
StringBuilder hex = new StringBuilder();
for (int i = 0; i < locationCode.length(); i++) {
char c = locationCode.charAt(i);
String hexPart = Integer.toHexString(c).toUpperCase();
hex.append(hexPart);
}
pcdeDetail.setEncodedId( hex.toString());
// 继续插入操作
return pcdeDetailMapper.insertPcdeDetail(pcdeDetail);
}
/**
* 修改库位明细
*
* @param pcdeDetail 库位明细
* @return 结果
*/
@Override
public int updatePcdeDetail(PcdeDetail pcdeDetail)
{
return pcdeDetailMapper.updatePcdeDetail(pcdeDetail);
}
/**
* 批量删除库位明细
*
* @param ids 需要删除的库位明细主键
* @return 结果
*/
@Override
public int deletePcdeDetailByIds(Long[] ids)
{
return pcdeDetailMapper.deletePcdeDetailByIds(ids);
}
/**
* 删除库位明细信息
*
* @param id 库位明细主键
* @return 结果
*/
@Override
public int deletePcdeDetailById(Long id)
{
return pcdeDetailMapper.deletePcdeDetailById(id);
}
@Override
public String importPcdeDetail(List<PcdeDetail> pcdeList, String operName) {
if (CollectionUtils.isEmpty(pcdeList)) {
throw new ServiceException("导入数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder failureMsg = new StringBuilder();
for (PcdeDetail detail : pcdeList) {
try {
PcdeDetail exist = pcdeDetailMapper.selectByLocationCode(detail.getLocationCode());
if (exist == null) {
detail.setCreateBy(operName);
detail.setCreateTime(DateUtils.getNowDate());
pcdeDetailMapper.insertPcdeDetail(detail);
successNum++;
} else {
failureNum++;
failureMsg.append("<br/>库位编号 ").append(detail.getLocationCode()).append(" 已存在");
}
} catch (Exception e) {
failureNum++;
failureMsg.append("<br/>库位编号 ").append(detail.getLocationCode()).append(" 导入失败:").append(e.getMessage());
}
}
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据有误,错误如下:");
throw new ServiceException(failureMsg.toString());
} else {
return "恭喜您,数据已全部导入成功!共 " + successNum + " 条。";
}
}
}

View File

@@ -1,10 +1,10 @@
package com.zg.project.Information.service.impl;
package com.zg.project.information.service.impl;
import java.util.List;
import com.zg.project.Information.domain.SceneMapping;
import com.zg.project.Information.mapper.SceneMappingMapper;
import com.zg.project.Information.service.ISceneMappingService;
import com.zg.project.information.domain.SceneMapping;
import com.zg.project.information.mapper.SceneMappingMapper;
import com.zg.project.information.service.ISceneMappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

View File

@@ -0,0 +1,93 @@
package com.zg.project.information.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zg.project.information.mapper.StockInTypeMapper;
import com.zg.project.information.domain.StockInType;
import com.zg.project.information.service.IStockInTypeService;
/**
* 入库类型Service业务层处理
*
* @author zg
* @date 2025-05-27
*/
@Service
public class StockInTypeServiceImpl implements IStockInTypeService
{
@Autowired
private StockInTypeMapper stockInTypeMapper;
/**
* 查询入库类型
*
* @param id 入库类型主键
* @return 入库类型
*/
@Override
public StockInType selectStockInTypeById(Long id)
{
return stockInTypeMapper.selectStockInTypeById(id);
}
/**
* 查询入库类型列表
*
* @param stockInType 入库类型
* @return 入库类型
*/
@Override
public List<StockInType> selectStockInTypeList(StockInType stockInType)
{
return stockInTypeMapper.selectStockInTypeList(stockInType);
}
/**
* 新增入库类型
*
* @param stockInType 入库类型
* @return 结果
*/
@Override
public int insertStockInType(StockInType stockInType)
{
return stockInTypeMapper.insertStockInType(stockInType);
}
/**
* 修改入库类型
*
* @param stockInType 入库类型
* @return 结果
*/
@Override
public int updateStockInType(StockInType stockInType)
{
return stockInTypeMapper.updateStockInType(stockInType);
}
/**
* 批量删除入库类型
*
* @param ids 需要删除的入库类型主键
* @return 结果
*/
@Override
public int deleteStockInTypeByIds(Long[] ids)
{
return stockInTypeMapper.deleteStockInTypeByIds(ids);
}
/**
* 删除入库类型信息
*
* @param id 入库类型主键
* @return 结果
*/
@Override
public int deleteStockInTypeById(Long id)
{
return stockInTypeMapper.deleteStockInTypeById(id);
}
}

View File

@@ -0,0 +1,93 @@
package com.zg.project.information.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zg.project.information.mapper.WarehouseInfoMapper;
import com.zg.project.information.domain.WarehouseInfo;
import com.zg.project.information.service.IWarehouseInfoService;
/**
* 仓库信息Service业务层处理
*
* @author zg
* @date 2025-05-27
*/
@Service
public class WarehouseInfoServiceImpl implements IWarehouseInfoService
{
@Autowired
private WarehouseInfoMapper warehouseInfoMapper;
/**
* 查询仓库信息
*
* @param id 仓库信息主键
* @return 仓库信息
*/
@Override
public WarehouseInfo selectWarehouseInfoById(Long id)
{
return warehouseInfoMapper.selectWarehouseInfoById(id);
}
/**
* 查询仓库信息列表
*
* @param warehouseInfo 仓库信息
* @return 仓库信息
*/
@Override
public List<WarehouseInfo> selectWarehouseInfoList(WarehouseInfo warehouseInfo)
{
return warehouseInfoMapper.selectWarehouseInfoList(warehouseInfo);
}
/**
* 新增仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
@Override
public int insertWarehouseInfo(WarehouseInfo warehouseInfo)
{
return warehouseInfoMapper.insertWarehouseInfo(warehouseInfo);
}
/**
* 修改仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
@Override
public int updateWarehouseInfo(WarehouseInfo warehouseInfo)
{
return warehouseInfoMapper.updateWarehouseInfo(warehouseInfo);
}
/**
* 批量删除仓库信息
*
* @param ids 需要删除的仓库信息主键
* @return 结果
*/
@Override
public int deleteWarehouseInfoByIds(Long[] ids)
{
return warehouseInfoMapper.deleteWarehouseInfoByIds(ids);
}
/**
* 删除仓库信息信息
*
* @param id 仓库信息主键
* @return 结果
*/
@Override
public int deleteWarehouseInfoById(Long id)
{
return warehouseInfoMapper.deleteWarehouseInfoById(id);
}
}

View File

@@ -126,4 +126,11 @@ public interface SysUserMapper
* @return 结果
*/
public SysUser checkEmailUnique(String email);
/**
* 获取所有用户
* @return
*/
List<SysUser> getAll();
}

View File

@@ -203,4 +203,12 @@ public interface ISysUserService
* @return 结果
*/
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
/**
* 获取所有用户
* @return
*/
List<SysUser> getAll();
}

View File

@@ -547,4 +547,9 @@ public class SysUserServiceImpl implements ISysUserService
}
return successMsg.toString();
}
@Override
public List<SysUser> getAll() {
return userMapper.getAll();
}
}

View File

@@ -1,17 +1,14 @@
package com.zg.project.wisdom.plan.controller;
package com.zg.project.wisdom.controller;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.zg.framework.aspectj.lang.annotation.Log;
import com.zg.framework.aspectj.lang.enums.BusinessType;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.zg.project.wisdom.plan.domain.GysJh;
import com.zg.project.wisdom.plan.service.IGysJhService;
import com.zg.project.wisdom.domain.GysJh;
import com.zg.project.wisdom.service.IGysJhService;
import com.zg.framework.web.controller.BaseController;
import com.zg.framework.web.domain.AjaxResult;
import com.zg.common.utils.poi.ExcelUtil;
@@ -22,103 +19,108 @@ import org.springframework.web.multipart.MultipartFile;
* 供应计划Controller
*
* @author zg
* @date 2025-05-12
* @date 2025-05-28
*/
@RestController
@RequestMapping("/plan/jh")
public class GysJhController extends BaseController {
public class GysJhController extends BaseController
{
@Autowired
private IGysJhService gysJhService;
/**
* 查询供应计划列表
*/
@PreAuthorize("@ss.hasPermi('query:jh:list')")
@PreAuthorize("@ss.hasPermi('plan:jh:list')")
@GetMapping("/list")
public TableDataInfo list(GysJh gysJh) {
public TableDataInfo list(GysJh gysJh)
{
startPage();
List<GysJh> list = gysJhService.selectGysJhList(gysJh);
return getDataTable(list);
}
/**
* 根据sapNo查询供应计划列表
* @param sapNo
* @return
*/
@PreAuthorize("@ss.hasPermi('plan:jh:list')")
@GetMapping("/getBySapNo")
public AjaxResult getBySapNo(String sapNo)
{
List<GysJh> list = gysJhService.getBySapNo(sapNo);
return success(list);
}
/**
* 导出供应计划列表
*/
@PreAuthorize("@ss.hasPermi('query:jh:export')")
@PreAuthorize("@ss.hasPermi('plan:jh:export')")
@Log(title = "供应计划", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, GysJh gysJh) {
public void export(HttpServletResponse response, GysJh gysJh)
{
List<GysJh> list = gysJhService.selectGysJhList(gysJh);
ExcelUtil<GysJh> util = new ExcelUtil<GysJh>(GysJh.class);
util.exportExcel(response, list, "供应计划数据");
}
/**
* 导入供应计划数据全部新增不校验重复
*/
@PreAuthorize("@ss.hasPermi('wisdom:jh:import')")
@Log(title = "供应计划", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(@RequestParam("file") MultipartFile file) throws Exception {
ExcelUtil<GysJh> util = new ExcelUtil<>(GysJh.class);
List<GysJh> jhList = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = gysJhService.importGysJhList(jhList, operName);
return AjaxResult.success(message);
}
/**
* 获取供应计划详细信息
*/
@PreAuthorize("@ss.hasPermi('query:jh:query')")
@PreAuthorize("@ss.hasPermi('plan:jh:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(gysJhService.selectGysJhById(id));
}
/**
* 新增供应计划
*/
@PreAuthorize("@ss.hasPermi('query:jh:add')")
@PreAuthorize("@ss.hasPermi('plan:jh:add')")
@Log(title = "供应计划", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody GysJh gysJh) {
@PostMapping
public AjaxResult add(@RequestBody GysJh gysJh)
{
return toAjax(gysJhService.insertGysJh(gysJh));
}
/**
* 供应计划导入
*/
@PreAuthorize("@ss.hasPermi('query:jh:import')")
@Log(title = "供应计划", businessType = BusinessType.IMPORT)
@PostMapping("/import")
public AjaxResult importData(@RequestParam("file") MultipartFile file, boolean updateSupport) throws IOException {
ExcelUtil<GysJh> util = new ExcelUtil<>(GysJh.class);
List<GysJh> list = util.importExcel(file.getInputStream());
String operator = getUsername();
String message = gysJhService.importGysJh(list, updateSupport, "zhangsan");
return AjaxResult.success(message);
}
/**
* 修改供应计划
*/
@PreAuthorize("@ss.hasPermi('query:jh:edit')")
@PreAuthorize("@ss.hasPermi('plan:jh:edit')")
@Log(title = "供应计划", businessType = BusinessType.UPDATE)
@PutMapping("/update")
public AjaxResult edit(@RequestBody GysJh gysJh) {
@PutMapping
public AjaxResult edit(@RequestBody GysJh gysJh)
{
return toAjax(gysJhService.updateGysJh(gysJh));
}
/**
* 删除供应计划
*/
@PreAuthorize("@ss.hasPermi('query:jh:remove')")
@PreAuthorize("@ss.hasPermi('plan:jh:remove')")
@Log(title = "供应计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(gysJhService.deleteGysJhByIds(ids));
}
}

View File

@@ -1,4 +1,4 @@
package com.zg.project.wisdom.login;
package com.zg.project.wisdom.controller;
import com.zg.common.constant.Constants;
import com.zg.framework.security.LoginBody;

View File

@@ -0,0 +1,106 @@
package com.zg.project.wisdom.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zg.project.wisdom.domain.dto.RkInfoBatchDTO;
import com.zg.project.wisdom.service.IGysJhService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zg.framework.aspectj.lang.annotation.Log;
import com.zg.framework.aspectj.lang.enums.BusinessType;
import com.zg.project.wisdom.domain.RkInfo;
import com.zg.project.wisdom.service.IRkInfoService;
import com.zg.framework.web.controller.BaseController;
import com.zg.framework.web.domain.AjaxResult;
import com.zg.common.utils.poi.ExcelUtil;
import com.zg.framework.web.page.TableDataInfo;
/**
* 库存单据主Controller
*
* @author zg
* @date 2025-05-28
*/
@RestController
@RequestMapping("/wisdom/stock")
public class RkInfoController extends BaseController
{
@Autowired
private IRkInfoService rkInfoService;
/**
* 查询库存单据主列表
*/
@PreAuthorize("@ss.hasPermi('wisdom:stock:list')")
@GetMapping("/list")
public TableDataInfo list(RkInfo rkInfo)
{
startPage();
List<RkInfo> list = rkInfoService.selectRkInfoList(rkInfo);
return getDataTable(list);
}
/**
* 导出库存单据主列表
*/
@PreAuthorize("@ss.hasPermi('wisdom:stock:export')")
@Log(title = "库存单据主", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RkInfo rkInfo)
{
List<RkInfo> list = rkInfoService.selectRkInfoList(rkInfo);
ExcelUtil<RkInfo> util = new ExcelUtil<RkInfo>(RkInfo.class);
util.exportExcel(response, list, "库存单据主数据");
}
/**
* 获取库存单据主详细信息
*/
@PreAuthorize("@ss.hasPermi('wisdom:stock:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(rkInfoService.selectRkInfoById(id));
}
/**
* 新增库存单据主
*/
@PreAuthorize("@ss.hasPermi('wisdom:stock:add')")
@Log(title = "库存单据主", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult batchAdd(@RequestBody RkInfoBatchDTO dto) {
return toAjax(rkInfoService.batchInsert(dto));
}
/**
* 修改库存单据主
*/
@PreAuthorize("@ss.hasPermi('wisdom:stock:edit')")
@Log(title = "库存单据主", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RkInfo rkInfo)
{
return toAjax(rkInfoService.updateRkInfo(rkInfo));
}
/**
* 删除库存单据主
*/
@PreAuthorize("@ss.hasPermi('wisdom:stock:remove')")
@Log(title = "库存单据主", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(rkInfoService.deleteRkInfoByIds(ids));
}
}

View File

@@ -1,4 +1,4 @@
package com.zg.project.wisdom.plan.domain;
package com.zg.project.wisdom.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -10,7 +10,7 @@ import com.zg.framework.web.domain.BaseEntity;
* 供应计划对象 gys_jh
*
* @author zg
* @date 2025-05-12
* @date 2025-05-28
*/
public class GysJh extends BaseEntity
{
@@ -19,6 +19,10 @@ public class GysJh extends BaseEntity
/** 主键ID */
private Long id;
/** 序号 */
@Excel(name = "序号")
private Long indexNo;
/** 县局 */
@Excel(name = "县局")
private String xj;
@@ -75,12 +79,8 @@ public class GysJh extends BaseEntity
@Excel(name = "计量单位")
private String dw;
/** 备注 */
@Excel(name = "备注")
private String remark;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0未到货1已入库")
/** 0未到货1已入库 */
@Excel(name = "0未到货1已入库")
private String status;
/** 是否删除0正常 1删除 */
@@ -97,6 +97,16 @@ public class GysJh extends BaseEntity
return id;
}
public void setIndexNo(Long indexNo)
{
this.indexNo = indexNo;
}
public Long getIndexNo()
{
return indexNo;
}
public void setXj(String xj)
{
this.xj = xj;
@@ -237,20 +247,12 @@ public class GysJh extends BaseEntity
return dw;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public void setStatus(String status)
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
public String getStatus()
{
return status;
}
@@ -269,6 +271,7 @@ public class GysJh extends BaseEntity
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("indexNo", getIndexNo())
.append("xj", getXj())
.append("xmNo", getXmNo())
.append("xmMs", getXmMs())
@@ -283,13 +286,13 @@ public class GysJh extends BaseEntity
.append("jhQty", getJhQty())
.append("htQty", getHtQty())
.append("dw", getDw())
.append("status", getStatus())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDelete", getIsDelete())
.append("status", getStatus())
.toString();
}
}

View File

@@ -0,0 +1,453 @@
package com.zg.project.wisdom.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zg.framework.aspectj.lang.annotation.Excel;
import com.zg.framework.web.domain.BaseEntity;
/**
* 库存单据主对象 rk_info
*
* @author zg
* @date 2025-05-28
*/
public class RkInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 入库类型 */
// @Excel(name = "入库类型")
private String rkType;
/** 物资类型 */
// @Excel(name = "物资类型")
private String wlType;
/** 所属仓库 */
// @Excel(name = "所属仓库")
private String cangku;
/** 入库类型名称(联查显示用,导出专用) */
@Excel(name = "入库类型名称")
private String rkTypeName;
/** 物资类型名称(联查显示用,导出专用) */
@Excel(name = "物资类型名称")
private String wlTypeName;
/** 所属仓库名称(联查显示用,导出专用) */
@Excel(name = "所属仓库名称")
private String cangkuName;
/** 入库时间(用户操作入库的日期) */
@Excel(name = "入库时间", readConverterExp = "用=户操作入库的日期")
private Date rkTime;
/** 理货员 */
@Excel(name = "理货员")
private String lihuoY;
/** 是否已出库0未出库1已出库 */
@Excel(name = "是否已出库", readConverterExp = "0=已入库1已出库")
private String isChuku;
/** 县局 */
@Excel(name = "县局")
private String xj;
/** 项目号 */
@Excel(name = "项目号")
private String xmNo;
/** 项目描述 */
@Excel(name = "项目描述")
private String xmMs;
/** 物料号 */
@Excel(name = "物料号")
private String wlNo;
/** 物料描述 */
@Excel(name = "物料描述")
private String wlMs;
/** 供应商编码 */
@Excel(name = "供应商编码")
private String gysNo;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String gysMc;
/** 计划交货金额 */
@Excel(name = "计划交货金额")
private BigDecimal jhAmt;
/** 合同单价 */
@Excel(name = "合同单价")
private BigDecimal htDj;
/** SAP订单编号 */
@Excel(name = "SAP订单编号")
private String sapNo;
/** 行号 */
@Excel(name = "行号")
private String xh;
/** 计划交货数量 */
@Excel(name = "计划交货数量")
private Long jhQty;
/** 合同数量 */
@Excel(name = "合同数量")
private Long htQty;
/** 计量单位 */
@Excel(name = "计量单位")
private String dw;
/** 实际入库数量 */
@Excel(name = "实际入库数量")
private Long realQty;
/** 库位码 */
@Excel(name = "库位码")
private String pcode;
/** 托盘码 */
@Excel(name = "托盘码")
private String trayCode;
/** 实物ID */
@Excel(name = "实物ID")
private String entityId;
/** 是否删除0 表示正常1 表示已删除) */
@Excel(name = "是否删除", readConverterExp = "0=,表=示正常1,表=示已删除")
private String isDelete;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setRkType(String rkType)
{
this.rkType = rkType;
}
public String getRkType()
{
return rkType;
}
public void setWlType(String wlType)
{
this.wlType = wlType;
}
public String getWlType()
{
return wlType;
}
public void setCangku(String cangku)
{
this.cangku = cangku;
}
public String getCangku()
{
return cangku;
}
public String getRkTypeName() {
return rkTypeName;
}
public void setRkTypeName(String rkTypeName) {
this.rkTypeName = rkTypeName;
}
public String getWlTypeName() {
return wlTypeName;
}
public void setWlTypeName(String wlTypeName) {
this.wlTypeName = wlTypeName;
}
public String getCangkuName() {
return cangkuName;
}
public void setCangkuName(String cangkuName) {
this.cangkuName = cangkuName;
}
public void setRkTime(Date rkTime)
{
this.rkTime = rkTime;
}
public Date getRkTime()
{
return rkTime;
}
public void setLihuoY(String lihuoY)
{
this.lihuoY = lihuoY;
}
public String getLihuoY()
{
return lihuoY;
}
public void setIsChuku(String isChuku)
{
this.isChuku = isChuku;
}
public String getIsChuku()
{
return isChuku;
}
public void setXj(String xj)
{
this.xj = xj;
}
public String getXj()
{
return xj;
}
public void setXmNo(String xmNo)
{
this.xmNo = xmNo;
}
public String getXmNo()
{
return xmNo;
}
public void setXmMs(String xmMs)
{
this.xmMs = xmMs;
}
public String getXmMs()
{
return xmMs;
}
public void setWlNo(String wlNo)
{
this.wlNo = wlNo;
}
public String getWlNo()
{
return wlNo;
}
public void setWlMs(String wlMs)
{
this.wlMs = wlMs;
}
public String getWlMs()
{
return wlMs;
}
public void setGysNo(String gysNo)
{
this.gysNo = gysNo;
}
public String getGysNo()
{
return gysNo;
}
public void setGysMc(String gysMc)
{
this.gysMc = gysMc;
}
public String getGysMc()
{
return gysMc;
}
public void setJhAmt(BigDecimal jhAmt)
{
this.jhAmt = jhAmt;
}
public BigDecimal getJhAmt()
{
return jhAmt;
}
public void setHtDj(BigDecimal htDj)
{
this.htDj = htDj;
}
public BigDecimal getHtDj()
{
return htDj;
}
public void setSapNo(String sapNo)
{
this.sapNo = sapNo;
}
public String getSapNo()
{
return sapNo;
}
public void setXh(String xh)
{
this.xh = xh;
}
public String getXh()
{
return xh;
}
public void setJhQty(Long jhQty)
{
this.jhQty = jhQty;
}
public Long getJhQty()
{
return jhQty;
}
public void setHtQty(Long htQty)
{
this.htQty = htQty;
}
public Long getHtQty()
{
return htQty;
}
public void setDw(String dw)
{
this.dw = dw;
}
public String getDw()
{
return dw;
}
public void setRealQty(Long realQty)
{
this.realQty = realQty;
}
public Long getRealQty()
{
return realQty;
}
public void setPcode(String pcode)
{
this.pcode = pcode;
}
public String getPcode()
{
return pcode;
}
public void setTrayCode(String trayCode)
{
this.trayCode = trayCode;
}
public String getTrayCode()
{
return trayCode;
}
public void setEntityId(String entityId)
{
this.entityId = entityId;
}
public String getEntityId()
{
return entityId;
}
public void setIsDelete(String isDelete)
{
this.isDelete = isDelete;
}
public String getIsDelete()
{
return isDelete;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("rkType", getRkType())
.append("wlType", getWlType())
.append("cangku", getCangku())
.append("rkTime", getRkTime())
.append("lihuoY", getLihuoY())
.append("isChuku", getIsChuku())
.append("remark", getRemark())
.append("xj", getXj())
.append("xmNo", getXmNo())
.append("xmMs", getXmMs())
.append("wlNo", getWlNo())
.append("wlMs", getWlMs())
.append("gysNo", getGysNo())
.append("gysMc", getGysMc())
.append("jhAmt", getJhAmt())
.append("htDj", getHtDj())
.append("sapNo", getSapNo())
.append("xh", getXh())
.append("jhQty", getJhQty())
.append("htQty", getHtQty())
.append("dw", getDw())
.append("realQty", getRealQty())
.append("pcode", getPcode())
.append("trayCode", getTrayCode())
.append("entityId", getEntityId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDelete", getIsDelete())
.toString();
}
}

View File

@@ -0,0 +1,62 @@
package com.zg.project.wisdom.domain.dto;
import java.util.List;
public class RkInfoBatchDTO {
/** 入库类型 */
private String rkType;
/** 物资类型 */
private String wlType;
/** 理货员 */
private String lihuoY;
/** 所属仓库 */
private String cangku;
/** 入库物料列表 */
private List<RkInfoItemDTO> rkList;
// Getters and Setters
public String getRkType() {
return rkType;
}
public void setRkType(String rkType) {
this.rkType = rkType;
}
public String getWlType() {
return wlType;
}
public void setWlType(String wlType) {
this.wlType = wlType;
}
public String getLihuoY() {
return lihuoY;
}
public void setLihuoY(String lihuoY) {
this.lihuoY = lihuoY;
}
public String getCangku() {
return cangku;
}
public void setCangku(String cangku) {
this.cangku = cangku;
}
public List<RkInfoItemDTO> getRkList() {
return rkList;
}
public void setRkList(List<RkInfoItemDTO> rkList) {
this.rkList = rkList;
}
}

View File

@@ -0,0 +1,40 @@
package com.zg.project.wisdom.domain.dto;
import java.util.List;
public class RkInfoItemDTO {
/** 物料号 */
private String wlNo;
/** 项目描述 */
private String xmMs;
/** 扫码记录列表 */
private List<RkInfoScanDTO> scanList;
// Getters and Setters
public String getWlNo() {
return wlNo;
}
public void setWlNo(String wlNo) {
this.wlNo = wlNo;
}
public String getXmMs() {
return xmMs;
}
public void setXmMs(String xmMs) {
this.xmMs = xmMs;
}
public List<RkInfoScanDTO> getScanList() {
return scanList;
}
public void setScanList(List<RkInfoScanDTO> scanList) {
this.scanList = scanList;
}
}

View File

@@ -0,0 +1,60 @@
package com.zg.project.wisdom.domain.dto;
public class RkInfoScanDTO {
/** 库位码 */
private String pcode;
/** 托盘码 */
private String trayCode;
/** 实际入库数量 */
private Long realQty;
/** 实物ID */
private String entityId;
/** 备注 */
private String remark;
// Getters and Setters
public String getPcode() {
return pcode;
}
public void setPcode(String pcode) {
this.pcode = pcode;
}
public String getTrayCode() {
return trayCode;
}
public void setTrayCode(String trayCode) {
this.trayCode = trayCode;
}
public Long getRealQty() {
return realQty;
}
public void setRealQty(Long realQty) {
this.realQty = realQty;
}
public String getEntityId() {
return entityId;
}
public void setEntityId(String entityId) {
this.entityId = entityId;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@@ -1,13 +1,13 @@
package com.zg.project.wisdom.plan.mapper;
package com.zg.project.wisdom.mapper;
import java.util.List;
import com.zg.project.wisdom.plan.domain.GysJh;
import com.zg.project.wisdom.domain.GysJh;
/**
* 供应计划Mapper接口
*
* @author zg
* @date 2025-05-12
* @date 2025-05-28
*/
public interface GysJhMapper
{
@@ -60,10 +60,9 @@ public interface GysJhMapper
public int deleteGysJhByIds(Long[] ids);
/**
* 根据订单号查询是否已存在
* 根据sapNo查询
* @param sapNo
* @param xh
* @return
*/
GysJh selectExistByKey(String sapNo, String xh);
List<GysJh> getBySapNo(String sapNo);
}

View File

@@ -0,0 +1,61 @@
package com.zg.project.wisdom.mapper;
import java.util.List;
import com.zg.project.wisdom.domain.RkInfo;
/**
* 库存单据主Mapper接口
*
* @author zg
* @date 2025-05-28
*/
public interface RkInfoMapper
{
/**
* 查询库存单据主
*
* @param id 库存单据主主键
* @return 库存单据主
*/
public RkInfo selectRkInfoById(Long id);
/**
* 查询库存单据主列表
*
* @param rkInfo 库存单据主
* @return 库存单据主集合
*/
public List<RkInfo> selectRkInfoList(RkInfo rkInfo);
/**
* 修改库存单据主
*
* @param rkInfo 库存单据主
* @return 结果
*/
public int updateRkInfo(RkInfo rkInfo);
/**
* 删除库存单据主
*
* @param id 库存单据主主键
* @return 结果
*/
public int deleteRkInfoById(Long id);
/**
* 批量删除库存单据主
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRkInfoByIds(Long[] ids);
/**
* 新增入库单据
* @param saveList
* @return
*/
int batchInsertRkInfo(List<RkInfo> saveList);
}

View File

@@ -1,14 +1,13 @@
package com.zg.project.wisdom.plan.service;
package com.zg.project.wisdom.service;
import java.rmi.ServerException;
import java.util.List;
import com.zg.project.wisdom.plan.domain.GysJh;
import com.zg.project.wisdom.domain.GysJh;
/**
* 供应计划Service接口
*
* @author zg
* @date 2025-05-12
* @date 2025-05-28
*/
public interface IGysJhService
{
@@ -62,10 +61,16 @@ public interface IGysJhService
/**
* 供应计划导入
* @param list
* @param updateSupport
* @param operator
* @param jhList
* @param operName
* @return
*/
String importGysJh(List<GysJh> list, boolean updateSupport, String operator) throws ServerException;
String importGysJhList(List<GysJh> jhList, String operName);
/**
* 根据sapNo查询
* @param sapNo
* @return
*/
List<GysJh> getBySapNo(String sapNo);
}

View File

@@ -0,0 +1,62 @@
package com.zg.project.wisdom.service;
import java.util.List;
import com.zg.project.wisdom.domain.RkInfo;
import com.zg.project.wisdom.domain.dto.RkInfoBatchDTO;
/**
* 库存单据主Service接口
*
* @author zg
* @date 2025-05-28
*/
public interface IRkInfoService
{
/**
* 查询库存单据主
*
* @param id 库存单据主主键
* @return 库存单据主
*/
public RkInfo selectRkInfoById(Long id);
/**
* 查询库存单据主列表
*
* @param rkInfo 库存单据主
* @return 库存单据主集合
*/
public List<RkInfo> selectRkInfoList(RkInfo rkInfo);
/**
* 修改库存单据主
*
* @param rkInfo 库存单据主
* @return 结果
*/
public int updateRkInfo(RkInfo rkInfo);
/**
* 批量删除库存单据主
*
* @param ids 需要删除的库存单据主主键集合
* @return 结果
*/
public int deleteRkInfoByIds(Long[] ids);
/**
* 删除库存单据主信息
*
* @param id 库存单据主主键
* @return 结果
*/
public int deleteRkInfoById(Long id);
/**
* 新增入库单据
* @param dto
* @return
*/
int batchInsert(RkInfoBatchDTO dto);
}

View File

@@ -1,19 +1,20 @@
package com.zg.project.wisdom.plan.service.impl;
package com.zg.project.wisdom.service.impl;
import java.rmi.ServerException;
import java.util.List;
import com.zg.common.exception.ServiceException;
import com.zg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zg.project.wisdom.plan.mapper.GysJhMapper;
import com.zg.project.wisdom.plan.domain.GysJh;
import com.zg.project.wisdom.plan.service.IGysJhService;
import com.zg.project.wisdom.mapper.GysJhMapper;
import com.zg.project.wisdom.domain.GysJh;
import com.zg.project.wisdom.service.IGysJhService;
/**
* 供应计划Service业务层处理
*
* @author zg
* @date 2025-05-12
* @date 2025-05-28
*/
@Service
public class GysJhServiceImpl implements IGysJhService
@@ -54,13 +55,7 @@ public class GysJhServiceImpl implements IGysJhService
@Override
public int insertGysJh(GysJh gysJh)
{
if (gysJh.getStatus() == null) {
gysJh.setStatus("0");
}
gysJh.setCreateTime(DateUtils.getNowDate());
// String operator = getUsername();
gysJh.setCreateBy("张三");
return gysJhMapper.insertGysJh(gysJh);
}
@@ -74,8 +69,6 @@ public class GysJhServiceImpl implements IGysJhService
public int updateGysJh(GysJh gysJh)
{
gysJh.setUpdateTime(DateUtils.getNowDate());
// String operator = getUsername();
gysJh.setUpdateBy("张三");
return gysJhMapper.updateGysJh(gysJh);
}
@@ -103,33 +96,52 @@ public class GysJhServiceImpl implements IGysJhService
return gysJhMapper.deleteGysJhById(id);
}
/**
* 供应计划导入
* @param jhList
* @param operName
* @return
*/
@Override
public String importGysJh(List<GysJh> list, boolean updateSupport, String operator) throws ServerException {
if (list == null || list.isEmpty()){
throw new ServerException("导入数据不能为空");
public String importGysJhList(List<GysJh> jhList, String operName) {
if (jhList == null || jhList.isEmpty()) {
throw new ServiceException("导入数据不能为空!");
}
int insertCount = 0 , updateCount = 0;
for (GysJh jh : list) {
if (jh.getStatus() == null) {
int successNum = 0;
int failureNum = 0;
StringBuilder failureMsg = new StringBuilder();
for (GysJh jh : jhList) {
try {
jh.setCreateBy(operName);
jh.setStatus("0");
}
GysJh exist = gysJhMapper.selectExistByKey(jh.getSapNo(), jh.getXh());
if (exist == null){
jh.setCreateBy(operator);
jh.setCreateTime(DateUtils.getNowDate());
gysJhMapper.insertGysJh(jh);
insertCount++;
}else if (updateSupport){
jh.setId(exist.getId());
jh.setUpdateBy(operator);
jh.setUpdateTime(DateUtils.getNowDate());
gysJhMapper.updateGysJh(jh);
updateCount++;
jh.setIsDelete("0");
insertGysJh(jh);
successNum++;
} catch (Exception e) {
failureNum++;
failureMsg.append("<br/>项目号:").append(jh.getXmNo())
.append(",物料号:").append(jh.getWlNo())
.append(" 导入失败:").append(e.getMessage());
}
}
return String.format("导入成功:新增 %d 条,更新 %d 条。", insertCount, updateCount);
if (failureNum > 0) {
failureMsg.insert(0, "导入完成,但有 " + failureNum + " 条记录失败:");
throw new ServiceException(failureMsg.toString());
}
return "导入成功,共 " + successNum + " 条数据";
}
/**
* 根据SAP编号查询
* @param sapNo
* @return
*/
@Override
public List<GysJh> getBySapNo(String sapNo) {
return gysJhMapper.getBySapNo(sapNo);
}
}

View File

@@ -0,0 +1,144 @@
package com.zg.project.wisdom.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.zg.common.utils.DateUtils;
import com.zg.common.utils.SecurityUtils;
import com.zg.project.wisdom.domain.GysJh;
import com.zg.project.wisdom.domain.dto.RkInfoBatchDTO;
import com.zg.project.wisdom.domain.dto.RkInfoItemDTO;
import com.zg.project.wisdom.domain.dto.RkInfoScanDTO;
import com.zg.project.wisdom.service.IGysJhService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zg.project.wisdom.mapper.RkInfoMapper;
import com.zg.project.wisdom.domain.RkInfo;
import com.zg.project.wisdom.service.IRkInfoService;
/**
* 库存单据主Service业务层处理
*
* @author zg
* @date 2025-05-28
*/
@Service
public class RkInfoServiceImpl implements IRkInfoService
{
@Autowired
private IGysJhService gysJhService;
@Autowired
private RkInfoMapper rkInfoMapper;
/**
* 查询库存单据主
*
* @param id 库存单据主主键
* @return 库存单据主
*/
@Override
public RkInfo selectRkInfoById(Long id)
{
return rkInfoMapper.selectRkInfoById(id);
}
/**
* 查询库存单据主列表
*
* @param rkInfo 库存单据主
* @return 库存单据主
*/
@Override
public List<RkInfo> selectRkInfoList(RkInfo rkInfo)
{
return rkInfoMapper.selectRkInfoList(rkInfo);
}
/**
* 修改库存单据主
*
* @param rkInfo 库存单据主
* @return 结果
*/
@Override
public int updateRkInfo(RkInfo rkInfo)
{
rkInfo.setUpdateTime(DateUtils.getNowDate());
return rkInfoMapper.updateRkInfo(rkInfo);
}
/**
* 批量删除库存单据主
*
* @param ids 需要删除的库存单据主主键
* @return 结果
*/
@Override
public int deleteRkInfoByIds(Long[] ids)
{
return rkInfoMapper.deleteRkInfoByIds(ids);
}
/**
* 删除库存单据主信息
*
* @param id 库存单据主主键
* @return 结果
*/
@Override
public int deleteRkInfoById(Long id)
{
return rkInfoMapper.deleteRkInfoById(id);
}
/**
* 新增入库单据
* @param dto
* @return
*/
@Override
public int batchInsert(RkInfoBatchDTO dto) {
List<RkInfo> saveList = new ArrayList<>();
String username = SecurityUtils.getUsername(); // 获取当前登录用户
Date now = DateUtils.getNowDate(); // 当前时间
for (RkInfoItemDTO item : dto.getRkList()) {
for (RkInfoScanDTO scan : item.getScanList()) {
RkInfo entity = new RkInfo();
// ======= 来自最外层 DTO =======
entity.setRkType(dto.getRkType());
entity.setWlType(dto.getWlType());
entity.setCangku(dto.getCangku());
entity.setLihuoY(dto.getLihuoY());
// ======= 中层 DTO =======
entity.setWlNo(item.getWlNo());
entity.setXmMs(item.getXmMs());
// ======= 最内层 DTO =======
entity.setPcode(scan.getPcode());
entity.setTrayCode(scan.getTrayCode());
entity.setRealQty(scan.getRealQty());
entity.setEntityId(scan.getEntityId());
entity.setRemark(scan.getRemark());
// ======= 系统默认字段 =======
entity.setIsChuku("0");
entity.setIsDelete("0");
entity.setRkTime(now);
entity.setCreateBy(username);
entity.setCreateTime(now);
saveList.add(entity);
}
}
// 批量插入到数据库
return rkInfoMapper.batchInsertRkInfo(saveList);
}
}