parent
0fb9042920
commit
13deb8d814
@ -0,0 +1,105 @@
|
||||
package com.hw.mes.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.common.security.annotation.RequiresPermissions;
|
||||
import com.hw.mes.domain.MesAlarmInfo;
|
||||
import com.hw.mes.service.IMesAlarmInfoService;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产告警信息Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/alarmInfo")
|
||||
public class MesAlarmInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMesAlarmInfoService mesAlarmInfoService;
|
||||
|
||||
/**
|
||||
* 查询生产告警信息列表
|
||||
*/
|
||||
@RequiresPermissions("mes:alarmInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesAlarmInfo mesAlarmInfo)
|
||||
{
|
||||
startPage();
|
||||
List<MesAlarmInfo> list = mesAlarmInfoService.selectMesAlarmInfoList(mesAlarmInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产告警信息列表
|
||||
*/
|
||||
@RequiresPermissions("mes:alarmInfo:export")
|
||||
@Log(title = "生产告警信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesAlarmInfo mesAlarmInfo)
|
||||
{
|
||||
List<MesAlarmInfo> list = mesAlarmInfoService.selectMesAlarmInfoList(mesAlarmInfo);
|
||||
ExcelUtil<MesAlarmInfo> util = new ExcelUtil<MesAlarmInfo>(MesAlarmInfo.class);
|
||||
util.exportExcel(response, list, "生产告警信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产告警信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("mes:alarmInfo:query")
|
||||
@GetMapping(value = "/{alarmInfoId}")
|
||||
public AjaxResult getInfo(@PathVariable("alarmInfoId") Long alarmInfoId)
|
||||
{
|
||||
return success(mesAlarmInfoService.selectMesAlarmInfoByAlarmInfoId(alarmInfoId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产告警信息
|
||||
*/
|
||||
@RequiresPermissions("mes:alarmInfo:add")
|
||||
@Log(title = "生产告警信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesAlarmInfo mesAlarmInfo)
|
||||
{
|
||||
return toAjax(mesAlarmInfoService.insertMesAlarmInfo(mesAlarmInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产告警信息
|
||||
*/
|
||||
@RequiresPermissions("mes:alarmInfo:edit")
|
||||
@Log(title = "生产告警信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesAlarmInfo mesAlarmInfo)
|
||||
{
|
||||
return toAjax(mesAlarmInfoService.updateMesAlarmInfo(mesAlarmInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产告警信息
|
||||
*/
|
||||
@RequiresPermissions("mes:alarmInfo:remove")
|
||||
@Log(title = "生产告警信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{alarmInfoIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] alarmInfoIds)
|
||||
{
|
||||
return toAjax(mesAlarmInfoService.deleteMesAlarmInfoByAlarmInfoIds(alarmInfoIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.hw.mes.domain;
|
||||
|
||||
import java.util.List;
|
||||
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.hw.common.core.annotation.Excel;
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产告警信息对象 mes_alarm_info
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public class MesAlarmInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键标识 */
|
||||
private Long alarmInfoId;
|
||||
|
||||
/** 报警类型(1库存报警) */
|
||||
@Excel(name = "报警类型(1库存报警)")
|
||||
private String alarmInfoType;
|
||||
|
||||
/** 处理状态(0未处理 1已处理) */
|
||||
@Excel(name = "处理状态(0未处理 1已处理)")
|
||||
private String handleStatus;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createDate;
|
||||
|
||||
/** 最后更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updateDate;
|
||||
|
||||
/** 库存告警信息明细信息 */
|
||||
private List<MesStockAlarmDetail> mesStockAlarmDetailList;
|
||||
|
||||
public void setAlarmInfoId(Long alarmInfoId)
|
||||
{
|
||||
this.alarmInfoId = alarmInfoId;
|
||||
}
|
||||
|
||||
public Long getAlarmInfoId()
|
||||
{
|
||||
return alarmInfoId;
|
||||
}
|
||||
public void setAlarmInfoType(String alarmInfoType)
|
||||
{
|
||||
this.alarmInfoType = alarmInfoType;
|
||||
}
|
||||
|
||||
public String getAlarmInfoType()
|
||||
{
|
||||
return alarmInfoType;
|
||||
}
|
||||
public void setHandleStatus(String handleStatus)
|
||||
{
|
||||
this.handleStatus = handleStatus;
|
||||
}
|
||||
|
||||
public String getHandleStatus()
|
||||
{
|
||||
return handleStatus;
|
||||
}
|
||||
public void setCreateDate(Date createDate)
|
||||
{
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public Date getCreateDate()
|
||||
{
|
||||
return createDate;
|
||||
}
|
||||
public void setUpdateDate(Date updateDate)
|
||||
{
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
public Date getUpdateDate()
|
||||
{
|
||||
return updateDate;
|
||||
}
|
||||
|
||||
public List<MesStockAlarmDetail> getMesStockAlarmDetailList()
|
||||
{
|
||||
return mesStockAlarmDetailList;
|
||||
}
|
||||
|
||||
public void setMesStockAlarmDetailList(List<MesStockAlarmDetail> mesStockAlarmDetailList)
|
||||
{
|
||||
this.mesStockAlarmDetailList = mesStockAlarmDetailList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("alarmInfoId", getAlarmInfoId())
|
||||
.append("alarmInfoType", getAlarmInfoType())
|
||||
.append("handleStatus", getHandleStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createDate", getCreateDate())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateDate", getUpdateDate())
|
||||
.append("mesStockAlarmDetailList", getMesStockAlarmDetailList())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,185 @@
|
||||
package com.hw.mes.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.hw.common.core.annotation.Excel;
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 销售订单使用物料情况对象 mes_sale_order_material
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public class MesSaleOrderMaterial extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键标识 */
|
||||
private Long saleOrderMaterialId;
|
||||
|
||||
/** 销售订单编号 */
|
||||
@Excel(name = "销售订单编号")
|
||||
private String saleorderCode;
|
||||
|
||||
/** 物料ID */
|
||||
// @Excel(name = "物料ID")
|
||||
private Long materialId;
|
||||
|
||||
/** 物料编码 */
|
||||
@Excel(name = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
/** 物料名称 */
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/** 物料规格 */
|
||||
@Excel(name = "物料规格")
|
||||
private String materialSpec;
|
||||
|
||||
/** 出库数量 */
|
||||
// @Excel(name = "出库数量")
|
||||
private BigDecimal outstockAmount;
|
||||
|
||||
/** 分摊使用的数量 */
|
||||
@Excel(name = "使用数量")
|
||||
private BigDecimal usedAmount;
|
||||
|
||||
private BigDecimal realOutstockAmount;//实际出库数量
|
||||
|
||||
private BigDecimal totalUsedAmount;//总共分摊使用数量
|
||||
|
||||
private BigDecimal oriUsedAmount;//修改前的原分摊使用数量
|
||||
|
||||
private int index;//序号
|
||||
|
||||
public void setSaleOrderMaterialId(Long saleOrderMaterialId)
|
||||
{
|
||||
this.saleOrderMaterialId = saleOrderMaterialId;
|
||||
}
|
||||
|
||||
public Long getSaleOrderMaterialId()
|
||||
{
|
||||
return saleOrderMaterialId;
|
||||
}
|
||||
public void setSaleorderCode(String saleorderCode)
|
||||
{
|
||||
this.saleorderCode = saleorderCode;
|
||||
}
|
||||
|
||||
public String getSaleorderCode()
|
||||
{
|
||||
return saleorderCode;
|
||||
}
|
||||
public void setMaterialId(Long materialId)
|
||||
{
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public Long getMaterialId()
|
||||
{
|
||||
return materialId;
|
||||
}
|
||||
public void setMaterialCode(String materialCode)
|
||||
{
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public String getMaterialCode()
|
||||
{
|
||||
return materialCode;
|
||||
}
|
||||
public void setMaterialName(String materialName)
|
||||
{
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public String getMaterialName()
|
||||
{
|
||||
return materialName;
|
||||
}
|
||||
public void setMaterialSpec(String materialSpec)
|
||||
{
|
||||
this.materialSpec = materialSpec;
|
||||
}
|
||||
|
||||
public String getMaterialSpec()
|
||||
{
|
||||
return materialSpec;
|
||||
}
|
||||
public void setOutstockAmount(BigDecimal outstockAmount)
|
||||
{
|
||||
this.outstockAmount = outstockAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getOutstockAmount()
|
||||
{
|
||||
return outstockAmount;
|
||||
}
|
||||
public void setUsedAmount(BigDecimal usedAmount)
|
||||
{
|
||||
usedAmount = usedAmount == null ? BigDecimal.ZERO : usedAmount;
|
||||
usedAmount = usedAmount.setScale(2, RoundingMode.HALF_UP);
|
||||
|
||||
this.usedAmount = usedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getUsedAmount()
|
||||
{
|
||||
return usedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getRealOutstockAmount() {
|
||||
return realOutstockAmount;
|
||||
}
|
||||
|
||||
public void setRealOutstockAmount(BigDecimal realOutstockAmount) {
|
||||
this.realOutstockAmount = realOutstockAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalUsedAmount() {
|
||||
return totalUsedAmount;
|
||||
}
|
||||
|
||||
public void setTotalUsedAmount(BigDecimal totalUsedAmount) {
|
||||
this.totalUsedAmount = totalUsedAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getOriUsedAmount() {
|
||||
return oriUsedAmount;
|
||||
}
|
||||
|
||||
public void setOriUsedAmount(BigDecimal oriUsedAmount) {
|
||||
this.oriUsedAmount = oriUsedAmount;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("saleOrderMaterialId", getSaleOrderMaterialId())
|
||||
.append("saleorderCode", getSaleorderCode())
|
||||
.append("materialId", getMaterialId())
|
||||
.append("materialCode", getMaterialCode())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("materialSpec", getMaterialSpec())
|
||||
.append("outstockAmount", getOutstockAmount())
|
||||
.append("usedAmount", getUsedAmount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
package com.hw.mes.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.hw.common.core.annotation.Excel;
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 库存告警信息明细对象 mes_stock_alarm_detail
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public class MesStockAlarmDetail extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键标识 */
|
||||
private Long stockAlarmDetailId;
|
||||
|
||||
/** 报警信息ID */
|
||||
@Excel(name = "报警信息ID")
|
||||
private Long alarmInfoId;
|
||||
|
||||
/** 物料ID */
|
||||
@Excel(name = "物料ID")
|
||||
private Long materialId;
|
||||
|
||||
/** 物料编码 */
|
||||
@Excel(name = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
/** 物料名称 */
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/** 物料规格 */
|
||||
@Excel(name = "物料规格")
|
||||
private String materialSpec;
|
||||
|
||||
/** 安全库存数量;仓库存放的总数量 */
|
||||
@Excel(name = "安全库存数量;仓库存放的总数量")
|
||||
private BigDecimal safeStockAmount;
|
||||
|
||||
/** 库存数量;手动冻结的,暂时可不用 */
|
||||
@Excel(name = "库存数量;手动冻结的,暂时可不用")
|
||||
private BigDecimal stockAmount;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createDate;
|
||||
|
||||
/** 最后更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updateDate;
|
||||
|
||||
public void setStockAlarmDetailId(Long stockAlarmDetailId)
|
||||
{
|
||||
this.stockAlarmDetailId = stockAlarmDetailId;
|
||||
}
|
||||
|
||||
public Long getStockAlarmDetailId()
|
||||
{
|
||||
return stockAlarmDetailId;
|
||||
}
|
||||
public void setAlarmInfoId(Long alarmInfoId)
|
||||
{
|
||||
this.alarmInfoId = alarmInfoId;
|
||||
}
|
||||
|
||||
public Long getAlarmInfoId()
|
||||
{
|
||||
return alarmInfoId;
|
||||
}
|
||||
public void setMaterialId(Long materialId)
|
||||
{
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public Long getMaterialId()
|
||||
{
|
||||
return materialId;
|
||||
}
|
||||
public void setMaterialCode(String materialCode)
|
||||
{
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public String getMaterialCode()
|
||||
{
|
||||
return materialCode;
|
||||
}
|
||||
public void setMaterialName(String materialName)
|
||||
{
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public String getMaterialName()
|
||||
{
|
||||
return materialName;
|
||||
}
|
||||
public void setMaterialSpec(String materialSpec)
|
||||
{
|
||||
this.materialSpec = materialSpec;
|
||||
}
|
||||
|
||||
public String getMaterialSpec()
|
||||
{
|
||||
return materialSpec;
|
||||
}
|
||||
public void setSafeStockAmount(BigDecimal safeStockAmount)
|
||||
{
|
||||
this.safeStockAmount = safeStockAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSafeStockAmount()
|
||||
{
|
||||
return safeStockAmount;
|
||||
}
|
||||
public void setStockAmount(BigDecimal stockAmount)
|
||||
{
|
||||
this.stockAmount = stockAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getStockAmount()
|
||||
{
|
||||
return stockAmount;
|
||||
}
|
||||
public void setCreateDate(Date createDate)
|
||||
{
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public Date getCreateDate()
|
||||
{
|
||||
return createDate;
|
||||
}
|
||||
public void setUpdateDate(Date updateDate)
|
||||
{
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
public Date getUpdateDate()
|
||||
{
|
||||
return updateDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("stockAlarmDetailId", getStockAlarmDetailId())
|
||||
.append("alarmInfoId", getAlarmInfoId())
|
||||
.append("materialId", getMaterialId())
|
||||
.append("materialCode", getMaterialCode())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("materialSpec", getMaterialSpec())
|
||||
.append("safeStockAmount", getSafeStockAmount())
|
||||
.append("stockAmount", getStockAmount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createDate", getCreateDate())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateDate", getUpdateDate())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.hw.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.mes.domain.MesAlarmInfo;
|
||||
import com.hw.mes.domain.MesStockAlarmDetail;
|
||||
|
||||
/**
|
||||
* 生产告警信息Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public interface MesAlarmInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产告警信息
|
||||
*
|
||||
* @param alarmInfoId 生产告警信息主键
|
||||
* @return 生产告警信息
|
||||
*/
|
||||
public MesAlarmInfo selectMesAlarmInfoByAlarmInfoId(Long alarmInfoId);
|
||||
|
||||
/**
|
||||
* 查询生产告警信息列表
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息
|
||||
* @return 生产告警信息集合
|
||||
*/
|
||||
public List<MesAlarmInfo> selectMesAlarmInfoList(MesAlarmInfo mesAlarmInfo);
|
||||
|
||||
/**
|
||||
* 新增生产告警信息
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesAlarmInfo(MesAlarmInfo mesAlarmInfo);
|
||||
|
||||
/**
|
||||
* 修改生产告警信息
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesAlarmInfo(MesAlarmInfo mesAlarmInfo);
|
||||
|
||||
/**
|
||||
* 删除生产告警信息
|
||||
*
|
||||
* @param alarmInfoId 生产告警信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesAlarmInfoByAlarmInfoId(Long alarmInfoId);
|
||||
|
||||
/**
|
||||
* 批量删除生产告警信息
|
||||
*
|
||||
* @param alarmInfoIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesAlarmInfoByAlarmInfoIds(Long[] alarmInfoIds);
|
||||
|
||||
/**
|
||||
* 批量删除库存告警信息明细
|
||||
*
|
||||
* @param alarmInfoIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesStockAlarmDetailByAlarmInfoIds(Long[] alarmInfoIds);
|
||||
|
||||
/**
|
||||
* 批量新增库存告警信息明细
|
||||
*
|
||||
* @param mesStockAlarmDetailList 库存告警信息明细列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchMesStockAlarmDetail(List<MesStockAlarmDetail> mesStockAlarmDetailList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过生产告警信息主键删除库存告警信息明细信息
|
||||
*
|
||||
* @param alarmInfoId 生产告警信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesStockAlarmDetailByAlarmInfoId(Long alarmInfoId);
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.hw.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.mes.domain.MesSaleOrderMaterial;
|
||||
|
||||
/**
|
||||
* 销售订单使用物料情况Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public interface MesSaleOrderMaterialMapper
|
||||
{
|
||||
/**
|
||||
* 查询销售订单使用物料情况
|
||||
*
|
||||
* @param saleOrderMaterialId 销售订单使用物料情况主键
|
||||
* @return 销售订单使用物料情况
|
||||
*/
|
||||
public MesSaleOrderMaterial selectMesSaleOrderMaterialBySaleOrderMaterialId(Long saleOrderMaterialId);
|
||||
|
||||
/**
|
||||
* 查询销售订单使用物料情况列表
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 销售订单使用物料情况集合
|
||||
*/
|
||||
public List<MesSaleOrderMaterial> selectMesSaleOrderMaterialList(MesSaleOrderMaterial mesSaleOrderMaterial);
|
||||
|
||||
/**
|
||||
* 新增销售订单使用物料情况
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesSaleOrderMaterial(MesSaleOrderMaterial mesSaleOrderMaterial);
|
||||
|
||||
/**
|
||||
* 修改销售订单使用物料情况
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesSaleOrderMaterial(MesSaleOrderMaterial mesSaleOrderMaterial);
|
||||
|
||||
/**
|
||||
* 删除销售订单使用物料情况
|
||||
*
|
||||
* @param saleOrderMaterialId 销售订单使用物料情况主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesSaleOrderMaterialBySaleOrderMaterialId(Long saleOrderMaterialId);
|
||||
|
||||
/**
|
||||
* 批量删除销售订单使用物料情况
|
||||
*
|
||||
* @param saleOrderMaterialIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesSaleOrderMaterialBySaleOrderMaterialIds(Long[] saleOrderMaterialIds);
|
||||
|
||||
|
||||
/**
|
||||
* 批量新增销售订单使用物料情况
|
||||
*
|
||||
* @param mesSaleOrderMaterialList 销售订单使用物料情况列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchMesSaleOrderMaterial(List<MesSaleOrderMaterial> mesSaleOrderMaterialList);
|
||||
|
||||
|
||||
/**
|
||||
* 查询销售订单易耗品使用物料情况列表
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 销售订单使用物料情况集合
|
||||
*/
|
||||
public List<MesSaleOrderMaterial> selectSaleOrderMaterialUsedInfos(MesSaleOrderMaterial mesSaleOrderMaterial);
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.mes.domain.MesAlarmInfo;
|
||||
|
||||
/**
|
||||
* 生产告警信息Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public interface IMesAlarmInfoService
|
||||
{
|
||||
/**
|
||||
* 查询生产告警信息
|
||||
*
|
||||
* @param alarmInfoId 生产告警信息主键
|
||||
* @return 生产告警信息
|
||||
*/
|
||||
public MesAlarmInfo selectMesAlarmInfoByAlarmInfoId(Long alarmInfoId);
|
||||
|
||||
/**
|
||||
* 查询生产告警信息列表
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息
|
||||
* @return 生产告警信息集合
|
||||
*/
|
||||
public List<MesAlarmInfo> selectMesAlarmInfoList(MesAlarmInfo mesAlarmInfo);
|
||||
|
||||
/**
|
||||
* 新增生产告警信息
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesAlarmInfo(MesAlarmInfo mesAlarmInfo);
|
||||
|
||||
/**
|
||||
* 修改生产告警信息
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesAlarmInfo(MesAlarmInfo mesAlarmInfo);
|
||||
|
||||
/**
|
||||
* 批量删除生产告警信息
|
||||
*
|
||||
* @param alarmInfoIds 需要删除的生产告警信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesAlarmInfoByAlarmInfoIds(Long[] alarmInfoIds);
|
||||
|
||||
/**
|
||||
* 删除生产告警信息信息
|
||||
*
|
||||
* @param alarmInfoId 生产告警信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesAlarmInfoByAlarmInfoId(Long alarmInfoId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.mes.domain.MesSaleOrderMaterial;
|
||||
|
||||
/**
|
||||
* 销售订单使用物料情况Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public interface IMesSaleOrderMaterialService
|
||||
{
|
||||
/**
|
||||
* 查询销售订单使用物料情况
|
||||
*
|
||||
* @param saleOrderMaterialId 销售订单使用物料情况主键
|
||||
* @return 销售订单使用物料情况
|
||||
*/
|
||||
public MesSaleOrderMaterial selectMesSaleOrderMaterialBySaleOrderMaterialId(Long saleOrderMaterialId);
|
||||
|
||||
/**
|
||||
* 查询销售订单使用物料情况列表
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 销售订单使用物料情况集合
|
||||
*/
|
||||
public List<MesSaleOrderMaterial> selectMesSaleOrderMaterialList(MesSaleOrderMaterial mesSaleOrderMaterial);
|
||||
|
||||
/**
|
||||
* 新增销售订单使用物料情况
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesSaleOrderMaterial(MesSaleOrderMaterial mesSaleOrderMaterial);
|
||||
|
||||
/**
|
||||
* 修改销售订单使用物料情况
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesSaleOrderMaterial(MesSaleOrderMaterial mesSaleOrderMaterial);
|
||||
|
||||
/**
|
||||
* 批量删除销售订单使用物料情况
|
||||
*
|
||||
* @param saleOrderMaterialIds 需要删除的销售订单使用物料情况主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesSaleOrderMaterialBySaleOrderMaterialIds(Long[] saleOrderMaterialIds);
|
||||
|
||||
/**
|
||||
* 删除销售订单使用物料情况信息
|
||||
*
|
||||
* @param saleOrderMaterialId 销售订单使用物料情况主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesSaleOrderMaterialBySaleOrderMaterialId(Long saleOrderMaterialId);
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.hw.mes.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import com.hw.common.core.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.hw.mes.domain.MesStockAlarmDetail;
|
||||
import com.hw.mes.mapper.MesAlarmInfoMapper;
|
||||
import com.hw.mes.domain.MesAlarmInfo;
|
||||
import com.hw.mes.service.IMesAlarmInfoService;
|
||||
|
||||
/**
|
||||
* 生产告警信息Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
@Service
|
||||
public class MesAlarmInfoServiceImpl implements IMesAlarmInfoService
|
||||
{
|
||||
@Autowired
|
||||
private MesAlarmInfoMapper mesAlarmInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询生产告警信息
|
||||
*
|
||||
* @param alarmInfoId 生产告警信息主键
|
||||
* @return 生产告警信息
|
||||
*/
|
||||
@Override
|
||||
public MesAlarmInfo selectMesAlarmInfoByAlarmInfoId(Long alarmInfoId)
|
||||
{
|
||||
return mesAlarmInfoMapper.selectMesAlarmInfoByAlarmInfoId(alarmInfoId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产告警信息列表
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息
|
||||
* @return 生产告警信息
|
||||
*/
|
||||
@Override
|
||||
public List<MesAlarmInfo> selectMesAlarmInfoList(MesAlarmInfo mesAlarmInfo)
|
||||
{
|
||||
return mesAlarmInfoMapper.selectMesAlarmInfoList(mesAlarmInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产告警信息
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertMesAlarmInfo(MesAlarmInfo mesAlarmInfo)
|
||||
{
|
||||
int rows = mesAlarmInfoMapper.insertMesAlarmInfo(mesAlarmInfo);
|
||||
insertMesStockAlarmDetail(mesAlarmInfo);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产告警信息
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateMesAlarmInfo(MesAlarmInfo mesAlarmInfo)
|
||||
{
|
||||
mesAlarmInfoMapper.deleteMesStockAlarmDetailByAlarmInfoId(mesAlarmInfo.getAlarmInfoId());
|
||||
insertMesStockAlarmDetail(mesAlarmInfo);
|
||||
return mesAlarmInfoMapper.updateMesAlarmInfo(mesAlarmInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产告警信息
|
||||
*
|
||||
* @param alarmInfoIds 需要删除的生产告警信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteMesAlarmInfoByAlarmInfoIds(Long[] alarmInfoIds)
|
||||
{
|
||||
mesAlarmInfoMapper.deleteMesStockAlarmDetailByAlarmInfoIds(alarmInfoIds);
|
||||
return mesAlarmInfoMapper.deleteMesAlarmInfoByAlarmInfoIds(alarmInfoIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产告警信息信息
|
||||
*
|
||||
* @param alarmInfoId 生产告警信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteMesAlarmInfoByAlarmInfoId(Long alarmInfoId)
|
||||
{
|
||||
mesAlarmInfoMapper.deleteMesStockAlarmDetailByAlarmInfoId(alarmInfoId);
|
||||
return mesAlarmInfoMapper.deleteMesAlarmInfoByAlarmInfoId(alarmInfoId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存告警信息明细信息
|
||||
*
|
||||
* @param mesAlarmInfo 生产告警信息对象
|
||||
*/
|
||||
public void insertMesStockAlarmDetail(MesAlarmInfo mesAlarmInfo)
|
||||
{
|
||||
List<MesStockAlarmDetail> mesStockAlarmDetailList = mesAlarmInfo.getMesStockAlarmDetailList();
|
||||
Long alarmInfoId = mesAlarmInfo.getAlarmInfoId();
|
||||
if (StringUtils.isNotNull(mesStockAlarmDetailList))
|
||||
{
|
||||
List<MesStockAlarmDetail> list = new ArrayList<MesStockAlarmDetail>();
|
||||
for (MesStockAlarmDetail mesStockAlarmDetail : mesStockAlarmDetailList)
|
||||
{
|
||||
mesStockAlarmDetail.setAlarmInfoId(alarmInfoId);
|
||||
list.add(mesStockAlarmDetail);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
mesAlarmInfoMapper.batchMesStockAlarmDetail(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.hw.mes.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hw.mes.mapper.MesSaleOrderMaterialMapper;
|
||||
import com.hw.mes.domain.MesSaleOrderMaterial;
|
||||
import com.hw.mes.service.IMesSaleOrderMaterialService;
|
||||
|
||||
/**
|
||||
* 销售订单使用物料情况Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
@Service
|
||||
public class MesSaleOrderMaterialServiceImpl implements IMesSaleOrderMaterialService
|
||||
{
|
||||
@Autowired
|
||||
private MesSaleOrderMaterialMapper mesSaleOrderMaterialMapper;
|
||||
|
||||
/**
|
||||
* 查询销售订单使用物料情况
|
||||
*
|
||||
* @param saleOrderMaterialId 销售订单使用物料情况主键
|
||||
* @return 销售订单使用物料情况
|
||||
*/
|
||||
@Override
|
||||
public MesSaleOrderMaterial selectMesSaleOrderMaterialBySaleOrderMaterialId(Long saleOrderMaterialId)
|
||||
{
|
||||
return mesSaleOrderMaterialMapper.selectMesSaleOrderMaterialBySaleOrderMaterialId(saleOrderMaterialId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询销售订单使用物料情况列表
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 销售订单使用物料情况
|
||||
*/
|
||||
@Override
|
||||
public List<MesSaleOrderMaterial> selectMesSaleOrderMaterialList(MesSaleOrderMaterial mesSaleOrderMaterial)
|
||||
{
|
||||
return mesSaleOrderMaterialMapper.selectMesSaleOrderMaterialList(mesSaleOrderMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增销售订单使用物料情况
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMesSaleOrderMaterial(MesSaleOrderMaterial mesSaleOrderMaterial)
|
||||
{
|
||||
mesSaleOrderMaterial.setCreateTime(DateUtils.getNowDate());
|
||||
return mesSaleOrderMaterialMapper.insertMesSaleOrderMaterial(mesSaleOrderMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改销售订单使用物料情况
|
||||
*
|
||||
* @param mesSaleOrderMaterial 销售订单使用物料情况
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMesSaleOrderMaterial(MesSaleOrderMaterial mesSaleOrderMaterial)
|
||||
{
|
||||
mesSaleOrderMaterial.setUpdateTime(DateUtils.getNowDate());
|
||||
return mesSaleOrderMaterialMapper.updateMesSaleOrderMaterial(mesSaleOrderMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除销售订单使用物料情况
|
||||
*
|
||||
* @param saleOrderMaterialIds 需要删除的销售订单使用物料情况主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesSaleOrderMaterialBySaleOrderMaterialIds(Long[] saleOrderMaterialIds)
|
||||
{
|
||||
return mesSaleOrderMaterialMapper.deleteMesSaleOrderMaterialBySaleOrderMaterialIds(saleOrderMaterialIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除销售订单使用物料情况信息
|
||||
*
|
||||
* @param saleOrderMaterialId 销售订单使用物料情况主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesSaleOrderMaterialBySaleOrderMaterialId(Long saleOrderMaterialId)
|
||||
{
|
||||
return mesSaleOrderMaterialMapper.deleteMesSaleOrderMaterialBySaleOrderMaterialId(saleOrderMaterialId);
|
||||
}
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
<?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.hw.mes.mapper.MesAlarmInfoMapper">
|
||||
|
||||
<resultMap type="MesAlarmInfo" id="MesAlarmInfoResult">
|
||||
<result property="alarmInfoId" column="alarm_info_id" />
|
||||
<result property="alarmInfoType" column="alarm_info_type" />
|
||||
<result property="handleStatus" column="handle_status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateDate" column="update_date" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="MesAlarmInfoMesStockAlarmDetailResult" type="MesAlarmInfo" extends="MesAlarmInfoResult">
|
||||
<collection property="mesStockAlarmDetailList" notNullColumn="sub_stock_alarm_detail_id" javaType="java.util.List" resultMap="MesStockAlarmDetailResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="MesStockAlarmDetail" id="MesStockAlarmDetailResult">
|
||||
<result property="stockAlarmDetailId" column="sub_stock_alarm_detail_id" />
|
||||
<result property="alarmInfoId" column="sub_alarm_info_id" />
|
||||
<result property="materialId" column="sub_material_id" />
|
||||
<result property="materialCode" column="sub_material_code" />
|
||||
<result property="materialName" column="sub_material_name" />
|
||||
<result property="materialSpec" column="sub_material_spec" />
|
||||
<result property="safeStockAmount" column="sub_safe_stock_amount" />
|
||||
<result property="stockAmount" column="sub_stock_amount" />
|
||||
<result property="createBy" column="sub_create_by" />
|
||||
<result property="createDate" column="sub_create_date" />
|
||||
<result property="updateBy" column="sub_update_by" />
|
||||
<result property="updateDate" column="sub_update_date" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesAlarmInfoVo">
|
||||
select alarm_info_id, alarm_info_type, handle_status, create_by, create_date, update_by, update_date from mes_alarm_info
|
||||
</sql>
|
||||
|
||||
<select id="selectMesAlarmInfoList" parameterType="MesAlarmInfo" resultMap="MesAlarmInfoResult">
|
||||
<include refid="selectMesAlarmInfoVo"/>
|
||||
<where>
|
||||
<if test="alarmInfoType != null and alarmInfoType != ''"> and alarm_info_type = #{alarmInfoType}</if>
|
||||
<if test="handleStatus != null and handleStatus != ''"> and handle_status = #{handleStatus}</if>
|
||||
<if test="createDate != null "> and create_date = #{createDate}</if>
|
||||
<if test="updateDate != null "> and update_date = #{updateDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesAlarmInfoByAlarmInfoId" parameterType="Long" resultMap="MesAlarmInfoMesStockAlarmDetailResult">
|
||||
select a.alarm_info_id, a.alarm_info_type, a.handle_status, a.create_by, a.create_date, a.update_by, a.update_date,
|
||||
b.stock_alarm_detail_id as sub_stock_alarm_detail_id, b.alarm_info_id as sub_alarm_info_id, b.material_id as sub_material_id, b.material_code as sub_material_code, b.material_name as sub_material_name, b.material_spec as sub_material_spec, b.safe_stock_amount as sub_safe_stock_amount, b.stock_amount as sub_stock_amount, b.create_by as sub_create_by, b.create_date as sub_create_date, b.update_by as sub_update_by, b.update_date as sub_update_date
|
||||
from mes_alarm_info a
|
||||
left join mes_stock_alarm_detail b on b.alarm_info_id = a.alarm_info_id
|
||||
where a.alarm_info_id = #{alarmInfoId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesAlarmInfo" parameterType="MesAlarmInfo" useGeneratedKeys="true" keyProperty="alarmInfoId">
|
||||
insert into mes_alarm_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmInfoType != null and alarmInfoType != ''">alarm_info_type,</if>
|
||||
<if test="handleStatus != null and handleStatus != ''">handle_status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateDate != null">update_date,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmInfoType != null and alarmInfoType != ''">#{alarmInfoType},</if>
|
||||
<if test="handleStatus != null and handleStatus != ''">#{handleStatus},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateDate != null">#{updateDate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesAlarmInfo" parameterType="MesAlarmInfo">
|
||||
update mes_alarm_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="alarmInfoType != null and alarmInfoType != ''">alarm_info_type = #{alarmInfoType},</if>
|
||||
<if test="handleStatus != null and handleStatus != ''">handle_status = #{handleStatus},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateDate != null">update_date = #{updateDate},</if>
|
||||
</trim>
|
||||
where alarm_info_id = #{alarmInfoId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesAlarmInfoByAlarmInfoId" parameterType="Long">
|
||||
delete from mes_alarm_info where alarm_info_id = #{alarmInfoId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesAlarmInfoByAlarmInfoIds" parameterType="String">
|
||||
delete from mes_alarm_info where alarm_info_id in
|
||||
<foreach item="alarmInfoId" collection="array" open="(" separator="," close=")">
|
||||
#{alarmInfoId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesStockAlarmDetailByAlarmInfoIds" parameterType="String">
|
||||
delete from mes_stock_alarm_detail where alarm_info_id in
|
||||
<foreach item="alarmInfoId" collection="array" open="(" separator="," close=")">
|
||||
#{alarmInfoId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesStockAlarmDetailByAlarmInfoId" parameterType="Long">
|
||||
delete from mes_stock_alarm_detail where alarm_info_id = #{alarmInfoId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchMesStockAlarmDetail">
|
||||
insert into mes_stock_alarm_detail( stock_alarm_detail_id, alarm_info_id, material_id, material_code, material_name, material_spec, safe_stock_amount, stock_amount, create_by, create_date, update_by, update_date) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.stockAlarmDetailId}, #{item.alarmInfoId}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.materialSpec}, #{item.safeStockAmount}, #{item.stockAmount}, #{item.createBy}, #{item.createDate}, #{item.updateBy}, #{item.updateDate})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
@ -0,0 +1,137 @@
|
||||
<?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.hw.mes.mapper.MesSaleOrderMaterialMapper">
|
||||
|
||||
<resultMap type="MesSaleOrderMaterial" id="MesSaleOrderMaterialResult">
|
||||
<result property="saleOrderMaterialId" column="sale_order_material_id" />
|
||||
<result property="saleorderCode" column="saleorder_code" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialSpec" column="material_spec" />
|
||||
<result property="realOutstockAmount" column="real_outstock_amount" />
|
||||
<result property="usedAmount" column="used_amount" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
|
||||
|
||||
<result property="totalUsedAmount" column="total_used_amount" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<sql id="selectMesSaleOrderMaterialVo">
|
||||
select sale_order_material_id, saleorder_code, material_id, material_code, material_name, material_spec, real_outstock_amount, used_amount, create_by, create_time, update_by, update_time from mes_sale_order_material
|
||||
</sql>
|
||||
|
||||
<select id="selectMesSaleOrderMaterialList" parameterType="MesSaleOrderMaterial" resultMap="MesSaleOrderMaterialResult">
|
||||
<include refid="selectMesSaleOrderMaterialVo"/>
|
||||
<where>
|
||||
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code = #{saleorderCode}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="materialSpec != null and materialSpec != ''"> and material_spec = #{materialSpec}</if>
|
||||
<if test="usedAmount != null "> and used_amount = #{usedAmount}</if>
|
||||
</where>
|
||||
order by saleorder_code
|
||||
</select>
|
||||
|
||||
<select id="selectMesSaleOrderMaterialBySaleOrderMaterialId" parameterType="Long" resultMap="MesSaleOrderMaterialResult">
|
||||
<include refid="selectMesSaleOrderMaterialVo"/>
|
||||
where sale_order_material_id = #{saleOrderMaterialId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesSaleOrderMaterial" parameterType="MesSaleOrderMaterial" useGeneratedKeys="true" keyProperty="saleOrderMaterialId">
|
||||
insert into mes_sale_order_material
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="saleorderCode != null and saleorderCode != ''">saleorder_code,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialSpec != null">material_spec,</if>
|
||||
<if test="realOutstockAmount != null">real_outstock_amount,</if>
|
||||
<if test="usedAmount != null">used_amount,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="saleorderCode != null and saleorderCode != ''">#{saleorderCode},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialSpec != null">#{materialSpec},</if>
|
||||
<if test="outstockAmount != null">#{outstockAmount},</if>
|
||||
<if test="usedAmount != null">#{usedAmount},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesSaleOrderMaterial" parameterType="MesSaleOrderMaterial">
|
||||
update mes_sale_order_material
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="saleorderCode != null and saleorderCode != ''">saleorder_code = #{saleorderCode},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialSpec != null">material_spec = #{materialSpec},</if>
|
||||
<if test="realOutstockAmount != null">real_outstock_amount = #{realOutstockAmount},</if>
|
||||
<if test="usedAmount != null">used_amount = #{usedAmount},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where sale_order_material_id = #{saleOrderMaterialId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesSaleOrderMaterialBySaleOrderMaterialId" parameterType="Long">
|
||||
delete from mes_sale_order_material where sale_order_material_id = #{saleOrderMaterialId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesSaleOrderMaterialBySaleOrderMaterialIds" parameterType="String">
|
||||
delete from mes_sale_order_material where sale_order_material_id in
|
||||
<foreach item="saleOrderMaterialId" collection="array" open="(" separator="," close=")">
|
||||
#{saleOrderMaterialId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
|
||||
<insert id="batchMesSaleOrderMaterial">
|
||||
insert into mes_sale_order_material( sale_order_material_id, saleorder_code, material_id, material_code, material_name, material_spec, real_outstock_amount, used_amount, create_by, create_time, update_by, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.saleOrderMaterialId}, #{item.saleorderCode}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.materialSpec}, #{item.outstockAmount}, #{item.usedAmount}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="selectSaleOrderMaterialUsedInfos" parameterType="MesSaleOrderMaterial"
|
||||
resultMap="MesSaleOrderMaterialResult">
|
||||
select mbmi.material_id,
|
||||
mbmi.material_code,
|
||||
mbmi.material_name,
|
||||
mbmi.material_spec,
|
||||
msom.used_amount,
|
||||
msom.sale_order_material_id,
|
||||
msom.saleorder_code,
|
||||
(select sum(ifnull(real_outstock_amount,0)) from wms_raw_outstock wro where wro.material_id=mbmi.material_id and wro.real_outstock_amount >0) as real_outstock_amount,
|
||||
(select sum(ifnull(used_amount,0)) from mes_sale_order_material msom where msom.material_id=mbmi.material_id) as total_used_amount
|
||||
|
||||
from mes_base_material_info mbmi left join mes_sale_order_material msom on mbmi.material_id=msom.material_id and msom.saleorder_code = #{saleorderCode}
|
||||
<where>
|
||||
and mbmi.low_value_consumable_flag = '1'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询销售订单使用物料情况列表
|
||||
export function listSaleOrderMaterial(query) {
|
||||
return request({
|
||||
url: '/mes/saleOrderMaterial/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售订单使用物料情况详细
|
||||
export function getSaleOrderMaterial(saleOrderMaterialId) {
|
||||
return request({
|
||||
url: '/mes/saleOrderMaterial/' + saleOrderMaterialId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增销售订单使用物料情况
|
||||
export function addSaleOrderMaterial(data) {
|
||||
return request({
|
||||
url: '/mes/saleOrderMaterial',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改销售订单使用物料情况
|
||||
export function updateSaleOrderMaterial(data) {
|
||||
return request({
|
||||
url: '/mes/saleOrderMaterial',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除销售订单使用物料情况
|
||||
export function delSaleOrderMaterial(saleOrderMaterialId) {
|
||||
return request({
|
||||
url: '/mes/saleOrderMaterial/' + saleOrderMaterialId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue