feat(module): 入库管理
添加入库管理模块,实现批量导入功能
This commit is contained in:
parent
2083325e40
commit
6fb4762af9
@ -0,0 +1,106 @@
|
||||
package com.zhyc.module.stock.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.stock.domain.WzMaterialsManagement;
|
||||
import com.zhyc.module.stock.service.IWzMaterialsManagementService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资管理Controller
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/stock/management")
|
||||
public class WzMaterialsManagementController extends BaseController
|
||||
{
|
||||
private final IWzMaterialsManagementService wzMaterialsManagementService;
|
||||
|
||||
public WzMaterialsManagementController(IWzMaterialsManagementService wzMaterialsManagementService) {
|
||||
this.wzMaterialsManagementService = wzMaterialsManagementService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物资管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:management:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WzMaterialsManagement wzMaterialsManagement)
|
||||
{
|
||||
startPage();
|
||||
List<WzMaterialsManagement> list = wzMaterialsManagementService.selectWzMaterialsManagementList(wzMaterialsManagement);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:management:export')")
|
||||
@Log(title = "物资管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WzMaterialsManagement wzMaterialsManagement)
|
||||
{
|
||||
List<WzMaterialsManagement> list = wzMaterialsManagementService.selectWzMaterialsManagementList(wzMaterialsManagement);
|
||||
ExcelUtil<WzMaterialsManagement> util = new ExcelUtil<>(WzMaterialsManagement.class);
|
||||
util.exportExcel(response, list, "物资管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:management:query')")
|
||||
@GetMapping(value = "/{materialManagementCode}")
|
||||
public AjaxResult getInfo(@PathVariable("materialManagementCode") Long materialManagementCode)
|
||||
{
|
||||
return success(wzMaterialsManagementService.selectWzMaterialsManagementByMaterialManagementCode(materialManagementCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:management:add')")
|
||||
@Log(title = "物资管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WzMaterialsManagement wzMaterialsManagement)
|
||||
{
|
||||
return toAjax(wzMaterialsManagementService.insertWzMaterialsManagement(wzMaterialsManagement));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:management:edit')")
|
||||
@Log(title = "物资管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WzMaterialsManagement wzMaterialsManagement)
|
||||
{
|
||||
return toAjax(wzMaterialsManagementService.updateWzMaterialsManagement(wzMaterialsManagement));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物资管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:management:remove')")
|
||||
@Log(title = "物资管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{materialManagementCodes}")
|
||||
public AjaxResult remove(@PathVariable Long[] materialManagementCodes)
|
||||
{
|
||||
return toAjax(wzMaterialsManagementService.deleteWzMaterialsManagementByMaterialManagementCodes(materialManagementCodes));
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package com.zhyc.module.stock.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.common.core.domain.entity.SysUser;
|
||||
import com.zhyc.module.stock.service.impl.WzStockInServiceImpl;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.stock.domain.WzStockIn;
|
||||
import com.zhyc.module.stock.service.IWzStockInService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 入库记录Controller
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/stock/in")
|
||||
public class WzStockInController extends BaseController
|
||||
{
|
||||
private final IWzStockInService wzStockInService;
|
||||
|
||||
public WzStockInController(IWzStockInService wzStockInService) {
|
||||
this.wzStockInService = wzStockInService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询入库记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:in:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WzStockIn wzStockIn)
|
||||
{
|
||||
startPage();
|
||||
List<WzStockIn> list = wzStockInService.selectWzStockInList(wzStockIn);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入库记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:in:export')")
|
||||
@Log(title = "入库记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WzStockIn wzStockIn)
|
||||
{
|
||||
List<WzStockIn> list = wzStockInService.selectWzStockInList(wzStockIn);
|
||||
ExcelUtil<WzStockIn> util = new ExcelUtil<>(WzStockIn.class);
|
||||
util.exportExcel(response, list, "入库记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入库记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:in:query')")
|
||||
@GetMapping(value = "/{stockInCode}")
|
||||
public AjaxResult getInfo(@PathVariable("stockInCode") Long stockInCode)
|
||||
{
|
||||
return success(wzStockInService.selectWzStockInByStockInCode(stockInCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:in:add')")
|
||||
@Log(title = "入库记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WzStockIn wzStockIn)
|
||||
{
|
||||
return toAjax(wzStockInService.insertWzStockIn(wzStockIn));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改入库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:in:edit')")
|
||||
@Log(title = "入库记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WzStockIn wzStockIn)
|
||||
{
|
||||
return toAjax(wzStockInService.updateWzStockIn(wzStockIn));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除入库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:in:remove')")
|
||||
@Log(title = "入库记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{stockInCodes}")
|
||||
public AjaxResult remove(@PathVariable Long[] stockInCodes)
|
||||
{
|
||||
return toAjax(wzStockInService.deleteWzStockInByStockInCodes(stockInCodes));
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('stock:in:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
ExcelUtil<WzStockIn> util = new ExcelUtil<WzStockIn>(WzStockIn.class);
|
||||
List<WzStockIn> stockInList = util.importExcel(file.getInputStream());
|
||||
stockInList.removeIf(wzStockIn -> wzStockIn.getDocDate() == null);
|
||||
String operName = getUsername();
|
||||
String message = wzStockInService.importUser(stockInList, updateSupport, operName);
|
||||
// String message = "OK We are testing";
|
||||
return success(message);
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package com.zhyc.module.stock.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.zhyc.common.annotation.Log;
|
||||
import com.zhyc.common.core.controller.BaseController;
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.common.enums.BusinessType;
|
||||
import com.zhyc.module.stock.domain.WzStockOut;
|
||||
import com.zhyc.module.stock.service.IWzStockOutService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 出库记录Controller
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/stock/out")
|
||||
public class WzStockOutController extends BaseController
|
||||
{
|
||||
private final IWzStockOutService wzStockOutService;
|
||||
|
||||
public WzStockOutController(IWzStockOutService wzStockOutService) {
|
||||
this.wzStockOutService = wzStockOutService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:out:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WzStockOut wzStockOut)
|
||||
{
|
||||
startPage();
|
||||
List<WzStockOut> list = wzStockOutService.selectWzStockOutList(wzStockOut);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出库记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:out:export')")
|
||||
@Log(title = "出库记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WzStockOut wzStockOut)
|
||||
{
|
||||
List<WzStockOut> list = wzStockOutService.selectWzStockOutList(wzStockOut);
|
||||
ExcelUtil<WzStockOut> util = new ExcelUtil<>(WzStockOut.class);
|
||||
util.exportExcel(response, list, "出库记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出库记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:out:query')")
|
||||
@GetMapping(value = "/{stockOutCode}")
|
||||
public AjaxResult getInfo(@PathVariable("stockOutCode") Long stockOutCode)
|
||||
{
|
||||
return success(wzStockOutService.selectWzStockOutByStockOutCode(stockOutCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:out:add')")
|
||||
@Log(title = "出库记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WzStockOut wzStockOut)
|
||||
{
|
||||
return toAjax(wzStockOutService.insertWzStockOut(wzStockOut));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:out:edit')")
|
||||
@Log(title = "出库记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WzStockOut wzStockOut)
|
||||
{
|
||||
return toAjax(wzStockOutService.updateWzStockOut(wzStockOut));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('stock:out:remove')")
|
||||
@Log(title = "出库记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{stockOutCodes}")
|
||||
public AjaxResult remove(@PathVariable Long[] stockOutCodes)
|
||||
{
|
||||
return toAjax(wzStockOutService.deleteWzStockOutByStockOutCodes(stockOutCodes));
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.zhyc.module.stock.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 物资管理对象 wz_materials_management
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class WzMaterialsManagement extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 序号 */
|
||||
@Excel(name = "序号")
|
||||
private Long materialManagementCode;
|
||||
|
||||
/** 存货编码 */
|
||||
@Excel(name = "存货编码")
|
||||
private String materialId;
|
||||
|
||||
/** 存货 */
|
||||
@Excel(name = "存货")
|
||||
private String materialName;
|
||||
|
||||
/** 批号 */
|
||||
@Excel(name = "批号")
|
||||
private String batchId;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String materialSpecification;
|
||||
|
||||
/** 主计量 */
|
||||
@Excel(name = "主计量")
|
||||
private String materialUnit;
|
||||
|
||||
/** 现存量(主) */
|
||||
@Excel(name = "现存量(主)")
|
||||
private BigDecimal currentStock;
|
||||
|
||||
/** 库存预警 */
|
||||
@Excel(name = "库存预警")
|
||||
private String stockAlarm;
|
||||
|
||||
/** 生产日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date productionDate;
|
||||
|
||||
/** 失效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "失效日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expirationDate;
|
||||
|
||||
/** 失效预警 */
|
||||
@Excel(name = "失效预警")
|
||||
private String expirationAlarm;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("materialManagementCode", getMaterialManagementCode())
|
||||
.append("materialId", getMaterialId())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("batchId", getBatchId())
|
||||
.append("materialSpecification", getMaterialSpecification())
|
||||
.append("materialUnit", getMaterialUnit())
|
||||
.append("currentStock", getCurrentStock())
|
||||
.append("stockAlarm", getStockAlarm())
|
||||
.append("productionDate", getProductionDate())
|
||||
.append("expirationDate", getExpirationDate())
|
||||
.append("expirationAlarm", getExpirationAlarm())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,142 @@
|
||||
package com.zhyc.module.stock.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 入库记录对象 wz_stock_in
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class WzStockIn extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 序号 */
|
||||
private Long stockInCode;
|
||||
|
||||
/** 单据日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date docDate;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createDate;
|
||||
|
||||
/** 单据编号 */
|
||||
@Excel(name = "单据编号")
|
||||
private String docId;
|
||||
|
||||
/** 业务类型 */
|
||||
@Excel(name = "业务类型")
|
||||
private String businessType;
|
||||
|
||||
/** 仓库编码 */
|
||||
@Excel(name = "仓库编码")
|
||||
private String repositoryId;
|
||||
|
||||
/** 仓库 */
|
||||
@Excel(name = "仓库")
|
||||
private String repositoryName;
|
||||
|
||||
/** 入库类别 */
|
||||
@Excel(name = "入库类别")
|
||||
private String stockInType;
|
||||
|
||||
/** 供应商编码 */
|
||||
@Excel(name = "供应商编码")
|
||||
private String supplierId;
|
||||
|
||||
/** 供应商 */
|
||||
@Excel(name = "供应商")
|
||||
private String supplierName;
|
||||
|
||||
/** 部门编码 */
|
||||
@Excel(name = "部门编码")
|
||||
private String departmentId;
|
||||
|
||||
/** 部门 */
|
||||
@Excel(name = "部门")
|
||||
private String departmentName;
|
||||
|
||||
/** 经手人编码 */
|
||||
@Excel(name = "经手人编码")
|
||||
private String operatorId;
|
||||
|
||||
/** 经手人 */
|
||||
@Excel(name = "经手人")
|
||||
private String operatorName;
|
||||
|
||||
/** 制单人 */
|
||||
@Excel(name = "制单人")
|
||||
private String single;
|
||||
|
||||
/** 审核人 */
|
||||
@Excel(name = "审核人")
|
||||
private String reviewer;
|
||||
|
||||
/** 存货编码 */
|
||||
@Excel(name = "存货编码")
|
||||
private String materialId;
|
||||
|
||||
/** 存货 */
|
||||
@Excel(name = "存货")
|
||||
private String materialName;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String materialSpecification;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
private String materialUnit;
|
||||
|
||||
/** 实收数量 */
|
||||
@Excel(name = "实收数量")
|
||||
private BigDecimal count;
|
||||
|
||||
/** 入库调整 */
|
||||
@Excel(name = "入库调整")
|
||||
private String stockInAdjustRemark;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("stockInCode", getStockInCode())
|
||||
.append("docDate", getDocDate())
|
||||
.append("createDate", getCreateDate())
|
||||
.append("docId", getDocId())
|
||||
.append("businessType", getBusinessType())
|
||||
.append("repositoryId", getRepositoryId())
|
||||
.append("repositoryName", getRepositoryName())
|
||||
.append("stockInType", getStockInType())
|
||||
.append("supplierId", getSupplierId())
|
||||
.append("supplierName", getSupplierName())
|
||||
.append("departmentId", getDepartmentId())
|
||||
.append("departmentName", getDepartmentName())
|
||||
.append("operatorId", getOperatorId())
|
||||
.append("operatorName", getOperatorName())
|
||||
.append("remark", getRemark())
|
||||
.append("single", getSingle())
|
||||
.append("reviewer", getReviewer())
|
||||
.append("materialId", getMaterialId())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("materialSpecification", getMaterialSpecification())
|
||||
.append("materialUnit", getMaterialUnit())
|
||||
.append("count", getCount())
|
||||
.append("stockInAdjustRemark", getStockInAdjustRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,179 @@
|
||||
package com.zhyc.module.stock.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 出库记录对象 wz_stock_out
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class WzStockOut extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 序号 */
|
||||
private Long stockOutCode;
|
||||
|
||||
/** 单据日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date docDate;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createDate;
|
||||
|
||||
/** 单据编号 */
|
||||
@Excel(name = "单据编号")
|
||||
private String docId;
|
||||
|
||||
/** 业务类型 */
|
||||
@Excel(name = "业务类型")
|
||||
private String businessType;
|
||||
|
||||
/** 仓库编码 */
|
||||
@Excel(name = "仓库编码")
|
||||
private String repositoryId;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String repositoryName;
|
||||
|
||||
/** 项目分类 */
|
||||
@Excel(name = "项目分类")
|
||||
private String projectClassification;
|
||||
|
||||
/** 项目编码 */
|
||||
@Excel(name = "项目编码")
|
||||
private String projectId;
|
||||
|
||||
/** 项目 */
|
||||
@Excel(name = "项目")
|
||||
private String projectName;
|
||||
|
||||
/** 生产车间编码 */
|
||||
@Excel(name = "生产车间编码")
|
||||
private String departmentId;
|
||||
|
||||
/** 生产车间 */
|
||||
@Excel(name = "生产车间")
|
||||
private String departmentName;
|
||||
|
||||
/** 领用人 */
|
||||
@Excel(name = "领用人")
|
||||
private String receiver;
|
||||
|
||||
/** 制单人 */
|
||||
@Excel(name = "制单人")
|
||||
private String single;
|
||||
|
||||
/** 审核人 */
|
||||
@Excel(name = "审核人")
|
||||
private String reviewer;
|
||||
|
||||
/** 审核时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date reviewDate;
|
||||
|
||||
/** 修改人 */
|
||||
@Excel(name = "修改人")
|
||||
private String modifier;
|
||||
|
||||
/** 材料分类编码 */
|
||||
@Excel(name = "材料分类编码")
|
||||
private String materialClassId;
|
||||
|
||||
/** 材料分类 */
|
||||
@Excel(name = "材料分类")
|
||||
private String materialClassName;
|
||||
|
||||
/** 材料名称 */
|
||||
@Excel(name = "材料名称")
|
||||
private String materialName;
|
||||
|
||||
/** 材料规格 */
|
||||
@Excel(name = "材料规格")
|
||||
private String materialSpecification;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
private String materialUnit;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private BigDecimal count;
|
||||
|
||||
/** 批号 */
|
||||
@Excel(name = "批号")
|
||||
private Long batchId;
|
||||
|
||||
/** 生产日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date productionDate;
|
||||
|
||||
/** 保质期 */
|
||||
@Excel(name = "保质期")
|
||||
private Long shelfLife;
|
||||
|
||||
/** 保质期单位 */
|
||||
@Excel(name = "保质期单位")
|
||||
private String shelfLifeUnit;
|
||||
|
||||
/** 失效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "失效日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expirationDate;
|
||||
|
||||
/** 代理人 */
|
||||
@Excel(name = "代理人")
|
||||
private String agent;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("stockOutCode", getStockOutCode())
|
||||
.append("docDate", getDocDate())
|
||||
.append("createDate", getCreateDate())
|
||||
.append("docId", getDocId())
|
||||
.append("businessType", getBusinessType())
|
||||
.append("repositoryId", getRepositoryId())
|
||||
.append("repositoryName", getRepositoryName())
|
||||
.append("projectClassification", getProjectClassification())
|
||||
.append("projectId", getProjectId())
|
||||
.append("projectName", getProjectName())
|
||||
.append("departmentId", getDepartmentId())
|
||||
.append("departmentName", getDepartmentName())
|
||||
.append("receiver", getReceiver())
|
||||
.append("single", getSingle())
|
||||
.append("reviewer", getReviewer())
|
||||
.append("reviewDate", getReviewDate())
|
||||
.append("modifier", getModifier())
|
||||
.append("materialClassId", getMaterialClassId())
|
||||
.append("materialClassName", getMaterialClassName())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("materialSpecification", getMaterialSpecification())
|
||||
.append("materialUnit", getMaterialUnit())
|
||||
.append("count", getCount())
|
||||
.append("batchId", getBatchId())
|
||||
.append("productionDate", getProductionDate())
|
||||
.append("shelfLife", getShelfLife())
|
||||
.append("shelfLifeUnit", getShelfLifeUnit())
|
||||
.append("expirationDate", getExpirationDate())
|
||||
.append("agent", getAgent())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.zhyc.module.stock.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.stock.domain.WzMaterialsManagement;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 物资管理Mapper接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface WzMaterialsManagementMapper
|
||||
{
|
||||
/**
|
||||
* 查询物资管理
|
||||
*
|
||||
* @param materialManagementCode 物资管理主键
|
||||
* @return 物资管理
|
||||
*/
|
||||
WzMaterialsManagement selectWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode);
|
||||
|
||||
/**
|
||||
* 查询物资管理列表
|
||||
*
|
||||
* @param wzMaterialsManagement 物资管理
|
||||
* @return 物资管理集合
|
||||
*/
|
||||
List<WzMaterialsManagement> selectWzMaterialsManagementList(WzMaterialsManagement wzMaterialsManagement);
|
||||
|
||||
/**
|
||||
* 新增物资管理
|
||||
*
|
||||
* @param wzMaterialsManagement 物资管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement);
|
||||
|
||||
/**
|
||||
* 修改物资管理
|
||||
*
|
||||
* @param wzMaterialsManagement 物资管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement);
|
||||
|
||||
/**
|
||||
* 删除物资管理
|
||||
*
|
||||
* @param materialManagementCode 物资管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode);
|
||||
|
||||
/**
|
||||
* 批量删除物资管理
|
||||
*
|
||||
* @param materialManagementCodes 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzMaterialsManagementByMaterialManagementCodes(Long[] materialManagementCodes);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.zhyc.module.stock.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.stock.domain.WzStockIn;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 入库记录Mapper接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface WzStockInMapper
|
||||
{
|
||||
/**
|
||||
* 查询入库记录
|
||||
*
|
||||
* @param stockInCode 入库记录主键
|
||||
* @return 入库记录
|
||||
*/
|
||||
WzStockIn selectWzStockInByStockInCode(Long stockInCode);
|
||||
|
||||
/**
|
||||
* 查询入库记录列表
|
||||
*
|
||||
* @param wzStockIn 入库记录
|
||||
* @return 入库记录集合
|
||||
*/
|
||||
List<WzStockIn> selectWzStockInList(WzStockIn wzStockIn);
|
||||
|
||||
/**
|
||||
* 新增入库记录
|
||||
*
|
||||
* @param wzStockIn 入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWzStockIn(WzStockIn wzStockIn);
|
||||
|
||||
/**
|
||||
* 修改入库记录
|
||||
*
|
||||
* @param wzStockIn 入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWzStockIn(WzStockIn wzStockIn);
|
||||
|
||||
/**
|
||||
* 删除入库记录
|
||||
*
|
||||
* @param stockInCode 入库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzStockInByStockInCode(Long stockInCode);
|
||||
|
||||
/**
|
||||
* 批量删除入库记录
|
||||
*
|
||||
* @param stockInCodes 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzStockInByStockInCodes(Long[] stockInCodes);
|
||||
|
||||
/**
|
||||
* 查询最近的入库记录
|
||||
*
|
||||
* @return 数据库中最近的入库记录
|
||||
*/
|
||||
WzStockIn getEarliestStockIn();
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.zhyc.module.stock.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.stock.domain.WzStockOut;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 出库记录Mapper接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface WzStockOutMapper
|
||||
{
|
||||
/**
|
||||
* 查询出库记录
|
||||
*
|
||||
* @param stockOutCode 出库记录主键
|
||||
* @return 出库记录
|
||||
*/
|
||||
WzStockOut selectWzStockOutByStockOutCode(Long stockOutCode);
|
||||
|
||||
/**
|
||||
* 查询出库记录列表
|
||||
*
|
||||
* @param wzStockOut 出库记录
|
||||
* @return 出库记录集合
|
||||
*/
|
||||
List<WzStockOut> selectWzStockOutList(WzStockOut wzStockOut);
|
||||
|
||||
/**
|
||||
* 新增出库记录
|
||||
*
|
||||
* @param wzStockOut 出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWzStockOut(WzStockOut wzStockOut);
|
||||
|
||||
/**
|
||||
* 修改出库记录
|
||||
*
|
||||
* @param wzStockOut 出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWzStockOut(WzStockOut wzStockOut);
|
||||
|
||||
/**
|
||||
* 删除出库记录
|
||||
*
|
||||
* @param stockOutCode 出库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzStockOutByStockOutCode(Long stockOutCode);
|
||||
|
||||
/**
|
||||
* 批量删除出库记录
|
||||
*
|
||||
* @param stockOutCodes 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzStockOutByStockOutCodes(Long[] stockOutCodes);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.stock.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.stock.domain.WzMaterialsManagement;
|
||||
|
||||
/**
|
||||
* 物资管理Service接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
public interface IWzMaterialsManagementService
|
||||
{
|
||||
/**
|
||||
* 查询物资管理
|
||||
*
|
||||
* @param materialManagementCode 物资管理主键
|
||||
* @return 物资管理
|
||||
*/
|
||||
WzMaterialsManagement selectWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode);
|
||||
|
||||
/**
|
||||
* 查询物资管理列表
|
||||
*
|
||||
* @param wzMaterialsManagement 物资管理
|
||||
* @return 物资管理集合
|
||||
*/
|
||||
List<WzMaterialsManagement> selectWzMaterialsManagementList(WzMaterialsManagement wzMaterialsManagement);
|
||||
|
||||
/**
|
||||
* 新增物资管理
|
||||
*
|
||||
* @param wzMaterialsManagement 物资管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement);
|
||||
|
||||
/**
|
||||
* 修改物资管理
|
||||
*
|
||||
* @param wzMaterialsManagement 物资管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement);
|
||||
|
||||
/**
|
||||
* 批量删除物资管理
|
||||
*
|
||||
* @param materialManagementCodes 需要删除的物资管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzMaterialsManagementByMaterialManagementCodes(Long[] materialManagementCodes);
|
||||
|
||||
/**
|
||||
* 删除物资管理信息
|
||||
*
|
||||
* @param materialManagementCode 物资管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode);
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.zhyc.module.stock.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zhyc.common.core.domain.entity.SysUser;
|
||||
import com.zhyc.module.stock.domain.WzStockIn;
|
||||
|
||||
/**
|
||||
* 入库记录Service接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
public interface IWzStockInService
|
||||
{
|
||||
/**
|
||||
* 查询入库记录
|
||||
*
|
||||
* @param stockInCode 入库记录主键
|
||||
* @return 入库记录
|
||||
*/
|
||||
WzStockIn selectWzStockInByStockInCode(Long stockInCode);
|
||||
|
||||
/**
|
||||
* 查询入库记录列表
|
||||
*
|
||||
* @param wzStockIn 入库记录
|
||||
* @return 入库记录集合
|
||||
*/
|
||||
List<WzStockIn> selectWzStockInList(WzStockIn wzStockIn);
|
||||
|
||||
/**
|
||||
* 新增入库记录
|
||||
*
|
||||
* @param wzStockIn 入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWzStockIn(WzStockIn wzStockIn);
|
||||
|
||||
/**
|
||||
* 修改入库记录
|
||||
*
|
||||
* @param wzStockIn 入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWzStockIn(WzStockIn wzStockIn);
|
||||
|
||||
/**
|
||||
* 批量删除入库记录
|
||||
*
|
||||
* @param stockInCodes 需要删除的入库记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzStockInByStockInCodes(Long[] stockInCodes);
|
||||
|
||||
/**
|
||||
* 删除入库记录信息
|
||||
*
|
||||
* @param stockInCode 入库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzStockInByStockInCode(Long stockInCode);
|
||||
|
||||
/**
|
||||
* 导入入库数据
|
||||
*
|
||||
* @param StockInList 入库数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
public String importUser(List<WzStockIn> StockInList, Boolean isUpdateSupport, String operName);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.zhyc.module.stock.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.stock.domain.WzStockOut;
|
||||
|
||||
/**
|
||||
* 出库记录Service接口
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
public interface IWzStockOutService
|
||||
{
|
||||
/**
|
||||
* 查询出库记录
|
||||
*
|
||||
* @param stockOutCode 出库记录主键
|
||||
* @return 出库记录
|
||||
*/
|
||||
WzStockOut selectWzStockOutByStockOutCode(Long stockOutCode);
|
||||
|
||||
/**
|
||||
* 查询出库记录列表
|
||||
*
|
||||
* @param wzStockOut 出库记录
|
||||
* @return 出库记录集合
|
||||
*/
|
||||
List<WzStockOut> selectWzStockOutList(WzStockOut wzStockOut);
|
||||
|
||||
/**
|
||||
* 新增出库记录
|
||||
*
|
||||
* @param wzStockOut 出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWzStockOut(WzStockOut wzStockOut);
|
||||
|
||||
/**
|
||||
* 修改出库记录
|
||||
*
|
||||
* @param wzStockOut 出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWzStockOut(WzStockOut wzStockOut);
|
||||
|
||||
/**
|
||||
* 批量删除出库记录
|
||||
*
|
||||
* @param stockOutCodes 需要删除的出库记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzStockOutByStockOutCodes(Long[] stockOutCodes);
|
||||
|
||||
/**
|
||||
* 删除出库记录信息
|
||||
*
|
||||
* @param stockOutCode 出库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWzStockOutByStockOutCode(Long stockOutCode);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.zhyc.module.stock.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.stock.mapper.WzMaterialsManagementMapper;
|
||||
import com.zhyc.module.stock.domain.WzMaterialsManagement;
|
||||
import com.zhyc.module.stock.service.IWzMaterialsManagementService;
|
||||
|
||||
/**
|
||||
* 物资管理Service业务层处理
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Service
|
||||
public class WzMaterialsManagementServiceImpl implements IWzMaterialsManagementService
|
||||
{
|
||||
private final WzMaterialsManagementMapper wzMaterialsManagementMapper;
|
||||
|
||||
public WzMaterialsManagementServiceImpl(WzMaterialsManagementMapper wzMaterialsManagementMapper) {
|
||||
this.wzMaterialsManagementMapper = wzMaterialsManagementMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物资管理
|
||||
*
|
||||
* @param materialManagementCode 物资管理主键
|
||||
* @return 物资管理
|
||||
*/
|
||||
@Override
|
||||
public WzMaterialsManagement selectWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode)
|
||||
{
|
||||
return wzMaterialsManagementMapper.selectWzMaterialsManagementByMaterialManagementCode(materialManagementCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物资管理列表
|
||||
*
|
||||
* @param wzMaterialsManagement 物资管理
|
||||
* @return 物资管理
|
||||
*/
|
||||
@Override
|
||||
public List<WzMaterialsManagement> selectWzMaterialsManagementList(WzMaterialsManagement wzMaterialsManagement)
|
||||
{
|
||||
return wzMaterialsManagementMapper.selectWzMaterialsManagementList(wzMaterialsManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资管理
|
||||
*
|
||||
* @param wzMaterialsManagement 物资管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement)
|
||||
{
|
||||
return wzMaterialsManagementMapper.insertWzMaterialsManagement(wzMaterialsManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资管理
|
||||
*
|
||||
* @param wzMaterialsManagement 物资管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWzMaterialsManagement(WzMaterialsManagement wzMaterialsManagement)
|
||||
{
|
||||
return wzMaterialsManagementMapper.updateWzMaterialsManagement(wzMaterialsManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物资管理
|
||||
*
|
||||
* @param materialManagementCodes 需要删除的物资管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWzMaterialsManagementByMaterialManagementCodes(Long[] materialManagementCodes)
|
||||
{
|
||||
return wzMaterialsManagementMapper.deleteWzMaterialsManagementByMaterialManagementCodes(materialManagementCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物资管理信息
|
||||
*
|
||||
* @param materialManagementCode 物资管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWzMaterialsManagementByMaterialManagementCode(Long materialManagementCode)
|
||||
{
|
||||
return wzMaterialsManagementMapper.deleteWzMaterialsManagementByMaterialManagementCode(materialManagementCode);
|
||||
}
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
package com.zhyc.module.stock.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zhyc.common.exception.ServiceException;
|
||||
import com.zhyc.common.utils.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.stock.mapper.WzStockInMapper;
|
||||
import com.zhyc.module.stock.domain.WzStockIn;
|
||||
import com.zhyc.module.stock.service.IWzStockInService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 入库记录Service业务层处理
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Service
|
||||
public class WzStockInServiceImpl implements IWzStockInService {
|
||||
private final WzStockInMapper wzStockInMapper;
|
||||
|
||||
public WzStockInServiceImpl(WzStockInMapper wzStockInMapper) {
|
||||
this.wzStockInMapper = wzStockInMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询入库记录
|
||||
*
|
||||
* @param stockInCode 入库记录主键
|
||||
* @return 入库记录
|
||||
*/
|
||||
@Override
|
||||
public WzStockIn selectWzStockInByStockInCode(Long stockInCode) {
|
||||
return wzStockInMapper.selectWzStockInByStockInCode(stockInCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询入库记录列表
|
||||
*
|
||||
* @param wzStockIn 入库记录
|
||||
* @return 入库记录
|
||||
*/
|
||||
@Override
|
||||
public List<WzStockIn> selectWzStockInList(WzStockIn wzStockIn) {
|
||||
return wzStockInMapper.selectWzStockInList(wzStockIn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库记录
|
||||
*
|
||||
* @param wzStockIn 入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWzStockIn(WzStockIn wzStockIn) {
|
||||
return wzStockInMapper.insertWzStockIn(wzStockIn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改入库记录
|
||||
*
|
||||
* @param wzStockIn 入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWzStockIn(WzStockIn wzStockIn) {
|
||||
return wzStockInMapper.updateWzStockIn(wzStockIn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除入库记录
|
||||
*
|
||||
* @param stockInCodes 需要删除的入库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWzStockInByStockInCodes(Long[] stockInCodes) {
|
||||
return wzStockInMapper.deleteWzStockInByStockInCodes(stockInCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除入库记录信息
|
||||
*
|
||||
* @param stockInCode 入库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWzStockInByStockInCode(Long stockInCode) {
|
||||
return wzStockInMapper.deleteWzStockInByStockInCode(stockInCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户数据
|
||||
*
|
||||
* @param StockInList 用户数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String importUser(List<WzStockIn> StockInList, Boolean isUpdateSupport, String operName) {
|
||||
if (StringUtils.isNull(StockInList) || StockInList.isEmpty()) {
|
||||
throw new ServiceException("导入用户数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
int sameNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
try {
|
||||
WzStockIn earliestStockIn = wzStockInMapper.getEarliestStockIn();
|
||||
System.out.println(earliestStockIn);
|
||||
for (WzStockIn wzStockIn : StockInList) {
|
||||
if (earliestStockIn.getDocDate().getTime() >= wzStockIn.getDocDate().getTime()) {
|
||||
sameNum++;
|
||||
continue;
|
||||
}
|
||||
int result = wzStockInMapper.insertWzStockIn(wzStockIn);
|
||||
if (result == 0) {
|
||||
failureNum++;
|
||||
failureMsg.append("失败的项:").append(wzStockIn.getDocId()).append("\n");
|
||||
}
|
||||
else successNum++;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
}
|
||||
if (failureNum > 0) {
|
||||
return failureMsg.toString();
|
||||
}
|
||||
successMsg.append("导入完成 : 导入 ").append(successNum).append(" 条\n跳过 ").append(sameNum).append(" 条(重复记录)");
|
||||
return successMsg.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.zhyc.module.stock.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhyc.module.stock.mapper.WzStockOutMapper;
|
||||
import com.zhyc.module.stock.domain.WzStockOut;
|
||||
import com.zhyc.module.stock.service.IWzStockOutService;
|
||||
|
||||
/**
|
||||
* 出库记录Service业务层处理
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Service
|
||||
public class WzStockOutServiceImpl implements IWzStockOutService
|
||||
{
|
||||
private final WzStockOutMapper wzStockOutMapper;
|
||||
|
||||
public WzStockOutServiceImpl(WzStockOutMapper wzStockOutMapper) {
|
||||
this.wzStockOutMapper = wzStockOutMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库记录
|
||||
*
|
||||
* @param stockOutCode 出库记录主键
|
||||
* @return 出库记录
|
||||
*/
|
||||
@Override
|
||||
public WzStockOut selectWzStockOutByStockOutCode(Long stockOutCode)
|
||||
{
|
||||
return wzStockOutMapper.selectWzStockOutByStockOutCode(stockOutCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库记录列表
|
||||
*
|
||||
* @param wzStockOut 出库记录
|
||||
* @return 出库记录
|
||||
*/
|
||||
@Override
|
||||
public List<WzStockOut> selectWzStockOutList(WzStockOut wzStockOut)
|
||||
{
|
||||
return wzStockOutMapper.selectWzStockOutList(wzStockOut);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库记录
|
||||
*
|
||||
* @param wzStockOut 出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWzStockOut(WzStockOut wzStockOut)
|
||||
{
|
||||
return wzStockOutMapper.insertWzStockOut(wzStockOut);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库记录
|
||||
*
|
||||
* @param wzStockOut 出库记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWzStockOut(WzStockOut wzStockOut)
|
||||
{
|
||||
return wzStockOutMapper.updateWzStockOut(wzStockOut);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除出库记录
|
||||
*
|
||||
* @param stockOutCodes 需要删除的出库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWzStockOutByStockOutCodes(Long[] stockOutCodes)
|
||||
{
|
||||
return wzStockOutMapper.deleteWzStockOutByStockOutCodes(stockOutCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库记录信息
|
||||
*
|
||||
* @param stockOutCode 出库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWzStockOutByStockOutCode(Long stockOutCode)
|
||||
{
|
||||
return wzStockOutMapper.deleteWzStockOutByStockOutCode(stockOutCode);
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.stock.mapper.WzMaterialsManagementMapper">
|
||||
|
||||
<resultMap type="WzMaterialsManagement" id="WzMaterialsManagementResult">
|
||||
<result property="materialManagementCode" column="material_management_code" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="batchId" column="batch_id" />
|
||||
<result property="materialSpecification" column="material_specification" />
|
||||
<result property="materialUnit" column="material_unit" />
|
||||
<result property="currentStock" column="current_stock" />
|
||||
<result property="stockAlarm" column="stock_alarm" />
|
||||
<result property="productionDate" column="production_date" />
|
||||
<result property="expirationDate" column="expiration_date" />
|
||||
<result property="expirationAlarm" column="expiration_alarm" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWzMaterialsManagementVo">
|
||||
select material_management_code, material_id, material_name, batch_id, material_specification, material_unit, current_stock, stock_alarm, production_date, expiration_date, expiration_alarm from wz_materials_management
|
||||
</sql>
|
||||
|
||||
<select id="selectWzMaterialsManagementList" parameterType="WzMaterialsManagement" resultMap="WzMaterialsManagementResult">
|
||||
<include refid="selectWzMaterialsManagementVo"/>
|
||||
<where>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="params.beginProductionDate != null and params.beginProductionDate != '' and params.endProductionDate != null and params.endProductionDate != ''"> and production_date between #{params.beginProductionDate} and #{params.endProductionDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWzMaterialsManagementByMaterialManagementCode" parameterType="Long" resultMap="WzMaterialsManagementResult">
|
||||
<include refid="selectWzMaterialsManagementVo"/>
|
||||
where material_management_code = #{materialManagementCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertWzMaterialsManagement" parameterType="WzMaterialsManagement" useGeneratedKeys="true" keyProperty="materialManagementCode">
|
||||
insert into wz_materials_management
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="materialId != null and materialId != ''">material_id,</if>
|
||||
<if test="materialName != null and materialName != ''">material_name,</if>
|
||||
<if test="batchId != null">batch_id,</if>
|
||||
<if test="materialSpecification != null">material_specification,</if>
|
||||
<if test="materialUnit != null">material_unit,</if>
|
||||
<if test="currentStock != null">current_stock,</if>
|
||||
<if test="stockAlarm != null">stock_alarm,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="expirationDate != null">expiration_date,</if>
|
||||
<if test="expirationAlarm != null">expiration_alarm,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="materialId != null and materialId != ''">#{materialId},</if>
|
||||
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
||||
<if test="batchId != null">#{batchId},</if>
|
||||
<if test="materialSpecification != null">#{materialSpecification},</if>
|
||||
<if test="materialUnit != null">#{materialUnit},</if>
|
||||
<if test="currentStock != null">#{currentStock},</if>
|
||||
<if test="stockAlarm != null">#{stockAlarm},</if>
|
||||
<if test="productionDate != null">#{productionDate},</if>
|
||||
<if test="expirationDate != null">#{expirationDate},</if>
|
||||
<if test="expirationAlarm != null">#{expirationAlarm},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWzMaterialsManagement" parameterType="WzMaterialsManagement">
|
||||
update wz_materials_management
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="materialId != null and materialId != ''">material_id = #{materialId},</if>
|
||||
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
|
||||
<if test="batchId != null">batch_id = #{batchId},</if>
|
||||
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
|
||||
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
|
||||
<if test="currentStock != null">current_stock = #{currentStock},</if>
|
||||
<if test="stockAlarm != null">stock_alarm = #{stockAlarm},</if>
|
||||
<if test="productionDate != null">production_date = #{productionDate},</if>
|
||||
<if test="expirationDate != null">expiration_date = #{expirationDate},</if>
|
||||
<if test="expirationAlarm != null">expiration_alarm = #{expirationAlarm},</if>
|
||||
</trim>
|
||||
where material_management_code = #{materialManagementCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWzMaterialsManagementByMaterialManagementCode" parameterType="Long">
|
||||
delete from wz_materials_management where material_management_code = #{materialManagementCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWzMaterialsManagementByMaterialManagementCodes" parameterType="String">
|
||||
delete from wz_materials_management where material_management_code in
|
||||
<foreach item="materialManagementCode" collection="array" open="(" separator="," close=")">
|
||||
#{materialManagementCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
147
zhyc-module/src/main/resources/mapper/stock/WzStockInMapper.xml
Normal file
147
zhyc-module/src/main/resources/mapper/stock/WzStockInMapper.xml
Normal file
@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.stock.mapper.WzStockInMapper">
|
||||
|
||||
<resultMap type="WzStockIn" id="WzStockInResult">
|
||||
<result property="stockInCode" column="stock_in_code" />
|
||||
<result property="docDate" column="doc_date" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="docId" column="doc_id" />
|
||||
<result property="businessType" column="business_type" />
|
||||
<result property="repositoryId" column="repository_id" />
|
||||
<result property="repositoryName" column="repository_name" />
|
||||
<result property="stockInType" column="stock_in_type" />
|
||||
<result property="supplierId" column="supplier_id" />
|
||||
<result property="supplierName" column="supplier_name" />
|
||||
<result property="departmentId" column="department_id" />
|
||||
<result property="departmentName" column="department_name" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="operatorName" column="operator_name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="single" column="single" />
|
||||
<result property="reviewer" column="reviewer" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialSpecification" column="material_specification" />
|
||||
<result property="materialUnit" column="material_unit" />
|
||||
<result property="count" column="count" />
|
||||
<result property="stockInAdjustRemark" column="stock_in_adjust_remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWzStockInVo">
|
||||
select stock_in_code, doc_date, create_date, doc_id, business_type, repository_id, repository_name, stock_in_type, supplier_id, supplier_name, department_id, department_name, operator_id, operator_name, remark, single, reviewer, material_id, material_name, material_specification, material_unit, count, stock_in_adjust_remark from wz_stock_in
|
||||
</sql>
|
||||
|
||||
<select id="selectWzStockInList" parameterType="WzStockIn" resultMap="WzStockInResult">
|
||||
<include refid="selectWzStockInVo"/>
|
||||
<where>
|
||||
<if test="params.beginDocDate != null and params.beginDocDate != '' and params.endDocDate != null and params.endDocDate != ''"> and doc_date between #{params.beginDocDate} and #{params.endDocDate}</if>
|
||||
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
|
||||
<if test="repositoryName != null and repositoryName != ''"> and repository_name like concat('%', #{repositoryName}, '%')</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWzStockInByStockInCode" parameterType="Long" resultMap="WzStockInResult">
|
||||
<include refid="selectWzStockInVo"/>
|
||||
where stock_in_code = #{stockInCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertWzStockIn" parameterType="WzStockIn" useGeneratedKeys="true" keyProperty="stockInCode">
|
||||
insert into wz_stock_in
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="docDate != null">doc_date,</if>
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="docId != null">doc_id,</if>
|
||||
<if test="businessType != null">business_type,</if>
|
||||
<if test="repositoryId != null">repository_id,</if>
|
||||
<if test="repositoryName != null">repository_name,</if>
|
||||
<if test="stockInType != null">stock_in_type,</if>
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
<if test="supplierName != null">supplier_name,</if>
|
||||
<if test="departmentId != null">department_id,</if>
|
||||
<if test="departmentName != null">department_name,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="operatorName != null">operator_name,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="single != null">single,</if>
|
||||
<if test="reviewer != null">reviewer,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialSpecification != null">material_specification,</if>
|
||||
<if test="materialUnit != null">material_unit,</if>
|
||||
<if test="count != null">count,</if>
|
||||
<if test="stockInAdjustRemark != null">stock_in_adjust_remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="docDate != null">#{docDate},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="docId != null">#{docId},</if>
|
||||
<if test="businessType != null">#{businessType},</if>
|
||||
<if test="repositoryId != null">#{repositoryId},</if>
|
||||
<if test="repositoryName != null">#{repositoryName},</if>
|
||||
<if test="stockInType != null">#{stockInType},</if>
|
||||
<if test="supplierId != null">#{supplierId},</if>
|
||||
<if test="supplierName != null">#{supplierName},</if>
|
||||
<if test="departmentId != null">#{departmentId},</if>
|
||||
<if test="departmentName != null">#{departmentName},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="operatorName != null">#{operatorName},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="single != null">#{single},</if>
|
||||
<if test="reviewer != null">#{reviewer},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialSpecification != null">#{materialSpecification},</if>
|
||||
<if test="materialUnit != null">#{materialUnit},</if>
|
||||
<if test="count != null">#{count},</if>
|
||||
<if test="stockInAdjustRemark != null">#{stockInAdjustRemark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWzStockIn" parameterType="WzStockIn">
|
||||
update wz_stock_in
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="docDate != null">doc_date = #{docDate},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="docId != null">doc_id = #{docId},</if>
|
||||
<if test="businessType != null">business_type = #{businessType},</if>
|
||||
<if test="repositoryId != null">repository_id = #{repositoryId},</if>
|
||||
<if test="repositoryName != null">repository_name = #{repositoryName},</if>
|
||||
<if test="stockInType != null">stock_in_type = #{stockInType},</if>
|
||||
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
||||
<if test="supplierName != null">supplier_name = #{supplierName},</if>
|
||||
<if test="departmentId != null">department_id = #{departmentId},</if>
|
||||
<if test="departmentName != null">department_name = #{departmentName},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="operatorName != null">operator_name = #{operatorName},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="single != null">single = #{single},</if>
|
||||
<if test="reviewer != null">reviewer = #{reviewer},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
|
||||
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
|
||||
<if test="count != null">count = #{count},</if>
|
||||
<if test="stockInAdjustRemark != null">stock_in_adjust_remark = #{stockInAdjustRemark},</if>
|
||||
</trim>
|
||||
where stock_in_code = #{stockInCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWzStockInByStockInCode" parameterType="Long">
|
||||
delete from wz_stock_in where stock_in_code = #{stockInCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWzStockInByStockInCodes" parameterType="String">
|
||||
delete from wz_stock_in where stock_in_code in
|
||||
<foreach item="stockInCode" collection="array" open="(" separator="," close=")">
|
||||
#{stockInCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getEarliestStockIn" resultMap="WzStockInResult">
|
||||
SELECT * FROM wz_stock_in ORDER BY doc_date DESC LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
168
zhyc-module/src/main/resources/mapper/stock/WzStockOutMapper.xml
Normal file
168
zhyc-module/src/main/resources/mapper/stock/WzStockOutMapper.xml
Normal file
@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.stock.mapper.WzStockOutMapper">
|
||||
|
||||
<resultMap type="WzStockOut" id="WzStockOutResult">
|
||||
<result property="stockOutCode" column="stock_out_code" />
|
||||
<result property="docDate" column="doc_date" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="docId" column="doc_id" />
|
||||
<result property="businessType" column="business_type" />
|
||||
<result property="repositoryId" column="repository_id" />
|
||||
<result property="repositoryName" column="repository_name" />
|
||||
<result property="projectClassification" column="project_classification" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="departmentId" column="department_id" />
|
||||
<result property="departmentName" column="department_name" />
|
||||
<result property="receiver" column="receiver" />
|
||||
<result property="single" column="single" />
|
||||
<result property="reviewer" column="reviewer" />
|
||||
<result property="reviewDate" column="review_date" />
|
||||
<result property="modifier" column="modifier" />
|
||||
<result property="materialClassId" column="material_class_id" />
|
||||
<result property="materialClassName" column="material_class_name" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialSpecification" column="material_specification" />
|
||||
<result property="materialUnit" column="material_unit" />
|
||||
<result property="count" column="count" />
|
||||
<result property="batchId" column="batch_id" />
|
||||
<result property="productionDate" column="production_date" />
|
||||
<result property="shelfLife" column="shelf_life" />
|
||||
<result property="shelfLifeUnit" column="shelf_life_unit" />
|
||||
<result property="expirationDate" column="expiration_date" />
|
||||
<result property="agent" column="agent" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWzStockOutVo">
|
||||
select stock_out_code, doc_date, create_date, doc_id, business_type, repository_id, repository_name, project_classification, project_id, project_name, department_id, department_name, receiver, single, reviewer, review_date, modifier, material_class_id, material_class_name, material_name, material_specification, material_unit, count, batch_id, production_date, shelf_life, shelf_life_unit, expiration_date, agent from wz_stock_out
|
||||
</sql>
|
||||
|
||||
<select id="selectWzStockOutList" parameterType="WzStockOut" resultMap="WzStockOutResult">
|
||||
<include refid="selectWzStockOutVo"/>
|
||||
<where>
|
||||
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
|
||||
<if test="repositoryName != null and repositoryName != ''"> and repository_name like concat('%', #{repositoryName}, '%')</if>
|
||||
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="departmentName != null and departmentName != ''"> and department_name like concat('%', #{departmentName}, '%')</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWzStockOutByStockOutCode" parameterType="Long" resultMap="WzStockOutResult">
|
||||
<include refid="selectWzStockOutVo"/>
|
||||
where stock_out_code = #{stockOutCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertWzStockOut" parameterType="WzStockOut" useGeneratedKeys="true" keyProperty="stockOutCode">
|
||||
insert into wz_stock_out
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="docDate != null">doc_date,</if>
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="docId != null">doc_id,</if>
|
||||
<if test="businessType != null">business_type,</if>
|
||||
<if test="repositoryId != null">repository_id,</if>
|
||||
<if test="repositoryName != null">repository_name,</if>
|
||||
<if test="projectClassification != null">project_classification,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="projectName != null">project_name,</if>
|
||||
<if test="departmentId != null">department_id,</if>
|
||||
<if test="departmentName != null">department_name,</if>
|
||||
<if test="receiver != null">receiver,</if>
|
||||
<if test="single != null">single,</if>
|
||||
<if test="reviewer != null">reviewer,</if>
|
||||
<if test="reviewDate != null">review_date,</if>
|
||||
<if test="modifier != null">modifier,</if>
|
||||
<if test="materialClassId != null">material_class_id,</if>
|
||||
<if test="materialClassName != null">material_class_name,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialSpecification != null">material_specification,</if>
|
||||
<if test="materialUnit != null">material_unit,</if>
|
||||
<if test="count != null">count,</if>
|
||||
<if test="batchId != null">batch_id,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="shelfLife != null">shelf_life,</if>
|
||||
<if test="shelfLifeUnit != null">shelf_life_unit,</if>
|
||||
<if test="expirationDate != null">expiration_date,</if>
|
||||
<if test="agent != null">agent,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="docDate != null">#{docDate},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="docId != null">#{docId},</if>
|
||||
<if test="businessType != null">#{businessType},</if>
|
||||
<if test="repositoryId != null">#{repositoryId},</if>
|
||||
<if test="repositoryName != null">#{repositoryName},</if>
|
||||
<if test="projectClassification != null">#{projectClassification},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="projectName != null">#{projectName},</if>
|
||||
<if test="departmentId != null">#{departmentId},</if>
|
||||
<if test="departmentName != null">#{departmentName},</if>
|
||||
<if test="receiver != null">#{receiver},</if>
|
||||
<if test="single != null">#{single},</if>
|
||||
<if test="reviewer != null">#{reviewer},</if>
|
||||
<if test="reviewDate != null">#{reviewDate},</if>
|
||||
<if test="modifier != null">#{modifier},</if>
|
||||
<if test="materialClassId != null">#{materialClassId},</if>
|
||||
<if test="materialClassName != null">#{materialClassName},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialSpecification != null">#{materialSpecification},</if>
|
||||
<if test="materialUnit != null">#{materialUnit},</if>
|
||||
<if test="count != null">#{count},</if>
|
||||
<if test="batchId != null">#{batchId},</if>
|
||||
<if test="productionDate != null">#{productionDate},</if>
|
||||
<if test="shelfLife != null">#{shelfLife},</if>
|
||||
<if test="shelfLifeUnit != null">#{shelfLifeUnit},</if>
|
||||
<if test="expirationDate != null">#{expirationDate},</if>
|
||||
<if test="agent != null">#{agent},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWzStockOut" parameterType="WzStockOut">
|
||||
update wz_stock_out
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="docDate != null">doc_date = #{docDate},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="docId != null">doc_id = #{docId},</if>
|
||||
<if test="businessType != null">business_type = #{businessType},</if>
|
||||
<if test="repositoryId != null">repository_id = #{repositoryId},</if>
|
||||
<if test="repositoryName != null">repository_name = #{repositoryName},</if>
|
||||
<if test="projectClassification != null">project_classification = #{projectClassification},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="projectName != null">project_name = #{projectName},</if>
|
||||
<if test="departmentId != null">department_id = #{departmentId},</if>
|
||||
<if test="departmentName != null">department_name = #{departmentName},</if>
|
||||
<if test="receiver != null">receiver = #{receiver},</if>
|
||||
<if test="single != null">single = #{single},</if>
|
||||
<if test="reviewer != null">reviewer = #{reviewer},</if>
|
||||
<if test="reviewDate != null">review_date = #{reviewDate},</if>
|
||||
<if test="modifier != null">modifier = #{modifier},</if>
|
||||
<if test="materialClassId != null">material_class_id = #{materialClassId},</if>
|
||||
<if test="materialClassName != null">material_class_name = #{materialClassName},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
|
||||
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
|
||||
<if test="count != null">count = #{count},</if>
|
||||
<if test="batchId != null">batch_id = #{batchId},</if>
|
||||
<if test="productionDate != null">production_date = #{productionDate},</if>
|
||||
<if test="shelfLife != null">shelf_life = #{shelfLife},</if>
|
||||
<if test="shelfLifeUnit != null">shelf_life_unit = #{shelfLifeUnit},</if>
|
||||
<if test="expirationDate != null">expiration_date = #{expirationDate},</if>
|
||||
<if test="agent != null">agent = #{agent},</if>
|
||||
</trim>
|
||||
where stock_out_code = #{stockOutCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWzStockOutByStockOutCode" parameterType="Long">
|
||||
delete from wz_stock_out where stock_out_code = #{stockOutCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWzStockOutByStockOutCodes" parameterType="String">
|
||||
delete from wz_stock_out where stock_out_code in
|
||||
<foreach item="stockOutCode" collection="array" open="(" separator="," close=")">
|
||||
#{stockOutCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user