生产工单功能
This commit is contained in:
parent
0b54f312fb
commit
70faef6f1d
@ -20,7 +20,7 @@ public class SysAutoCodePart extends BaseEntity {
|
||||
|
||||
private Integer partLength;
|
||||
|
||||
private String dateFormart;
|
||||
private String dateFormat;
|
||||
|
||||
private String inputCharacter;
|
||||
|
||||
@ -93,12 +93,12 @@ public class SysAutoCodePart extends BaseEntity {
|
||||
this.partLength = partLength;
|
||||
}
|
||||
|
||||
public String getDateFormart() {
|
||||
return dateFormart;
|
||||
public String getDateFormat() {
|
||||
return dateFormat;
|
||||
}
|
||||
|
||||
public void setDateFormart(String dateFormart) {
|
||||
this.dateFormart = dateFormart;
|
||||
public void setDateFormat(String dateFormat) {
|
||||
this.dateFormat = dateFormat;
|
||||
}
|
||||
|
||||
public String getInputCharacter() {
|
||||
@ -167,7 +167,7 @@ public class SysAutoCodePart extends BaseEntity {
|
||||
", partCode='" + partCode + '\'' +
|
||||
", partName='" + partName + '\'' +
|
||||
", partLength=" + partLength +
|
||||
", dateFormart='" + dateFormart + '\'' +
|
||||
", dateFormat='" + dateFormat + '\'' +
|
||||
", inputCharacter='" + inputCharacter + '\'' +
|
||||
", fixCharacter='" + fixCharacter + '\'' +
|
||||
", seriaStartNo=" + seriaStartNo +
|
||||
|
@ -40,6 +40,8 @@ public class MdProductBom extends BaseEntity
|
||||
@Excel(name = "BOM物料规格")
|
||||
private String bomItemSpec;
|
||||
|
||||
|
||||
|
||||
/** BOM物料单位 */
|
||||
@Excel(name = "BOM物料单位")
|
||||
private String unitOfMeasure;
|
||||
|
@ -0,0 +1,104 @@
|
||||
package com.ktg.mes.pro.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.pro.domain.ProWorkorderBom;
|
||||
import com.ktg.mes.pro.service.IProWorkorderBomService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产工单BOM组成Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pro/workorderbom")
|
||||
public class ProWorkorderBomController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProWorkorderBomService proWorkorderBomService;
|
||||
|
||||
/**
|
||||
* 查询生产工单BOM组成列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pro:workorderbom:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProWorkorderBom proWorkorderBom)
|
||||
{
|
||||
startPage();
|
||||
List<ProWorkorderBom> list = proWorkorderBomService.selectProWorkorderBomList(proWorkorderBom);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产工单BOM组成列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pro:workorderbom:export')")
|
||||
@Log(title = "生产工单BOM组成", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProWorkorderBom proWorkorderBom)
|
||||
{
|
||||
List<ProWorkorderBom> list = proWorkorderBomService.selectProWorkorderBomList(proWorkorderBom);
|
||||
ExcelUtil<ProWorkorderBom> util = new ExcelUtil<ProWorkorderBom>(ProWorkorderBom.class);
|
||||
util.exportExcel(response, list, "生产工单BOM组成数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产工单BOM组成详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pro:workorderbom:query')")
|
||||
@GetMapping(value = "/{lineId}")
|
||||
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
|
||||
{
|
||||
return AjaxResult.success(proWorkorderBomService.selectProWorkorderBomByLineId(lineId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工单BOM组成
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pro:workorderbom:add')")
|
||||
@Log(title = "生产工单BOM组成", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProWorkorderBom proWorkorderBom)
|
||||
{
|
||||
return toAjax(proWorkorderBomService.insertProWorkorderBom(proWorkorderBom));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工单BOM组成
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pro:workorderbom:edit')")
|
||||
@Log(title = "生产工单BOM组成", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProWorkorderBom proWorkorderBom)
|
||||
{
|
||||
return toAjax(proWorkorderBomService.updateProWorkorderBom(proWorkorderBom));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工单BOM组成
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pro:workorderbom:remove')")
|
||||
@Log(title = "生产工单BOM组成", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{lineIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] lineIds)
|
||||
{
|
||||
return toAjax(proWorkorderBomService.deleteProWorkorderBomByLineIds(lineIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
package com.ktg.mes.pro.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.md.domain.MdProductBom;
|
||||
import com.ktg.mes.md.service.IMdProductBomService;
|
||||
import com.ktg.mes.pro.domain.ProWorkorderBom;
|
||||
import com.ktg.mes.pro.service.IProWorkorderBomService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.pro.domain.ProWorkorder;
|
||||
import com.ktg.mes.pro.service.IProWorkorderService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产工单Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/pro/workorder")
|
||||
public class ProWorkorderController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProWorkorderService proWorkorderService;
|
||||
|
||||
@Autowired
|
||||
private IProWorkorderBomService proWorkorderBomService;
|
||||
|
||||
@Autowired
|
||||
private IMdProductBomService mdProductBomService;
|
||||
|
||||
/**
|
||||
* 查询生产工单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProWorkorder proWorkorder)
|
||||
{
|
||||
startPage();
|
||||
List<ProWorkorder> list = proWorkorderService.selectProWorkorderList(proWorkorder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产工单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:export')")
|
||||
@Log(title = "生产工单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProWorkorder proWorkorder)
|
||||
{
|
||||
List<ProWorkorder> list = proWorkorderService.selectProWorkorderList(proWorkorder);
|
||||
ExcelUtil<ProWorkorder> util = new ExcelUtil<ProWorkorder>(ProWorkorder.class);
|
||||
util.exportExcel(response, list, "生产工单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产工单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:query')")
|
||||
@GetMapping(value = "/{workorderId}")
|
||||
public AjaxResult getInfo(@PathVariable("workorderId") Long workorderId)
|
||||
{
|
||||
return AjaxResult.success(proWorkorderService.selectProWorkorderByWorkorderId(workorderId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:add')")
|
||||
@Log(title = "生产工单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProWorkorder proWorkorder)
|
||||
{
|
||||
return toAjax(proWorkorderService.insertProWorkorder(proWorkorder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:edit')")
|
||||
@Log(title = "生产工单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProWorkorder proWorkorder)
|
||||
{
|
||||
return toAjax(proWorkorderService.updateProWorkorder(proWorkorder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:remove')")
|
||||
@Log(title = "生产工单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{workorderIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] workorderIds)
|
||||
{
|
||||
return toAjax(proWorkorderService.deleteProWorkorderByWorkorderIds(workorderIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据生产工单中的产品生成对应的BOM组成物料清单
|
||||
* @param workOrderId
|
||||
*/
|
||||
private void generateBomLine(Long workOrderId){
|
||||
|
||||
ProWorkorder workorder = proWorkorderService.selectProWorkorderByWorkorderId(workOrderId);
|
||||
Long itemId = workorder.getProductId(); //得到当前工单生产的物料/产品ID
|
||||
|
||||
MdProductBom param = new MdProductBom();
|
||||
param.setItemId(itemId);
|
||||
List<MdProductBom> boms = mdProductBomService.selectMdProductBomList(param);
|
||||
|
||||
ProWorkorderBom proWorkorderBom = new ProWorkorderBom();
|
||||
if(!CollUtil.isEmpty(boms)){
|
||||
for (MdProductBom bom: boms
|
||||
) {
|
||||
proWorkorderBom.setWorkorderId(workOrderId);
|
||||
proWorkorderBom.setItemId(bom.getBomItemId());
|
||||
proWorkorderBom.setItemCode(bom.getBomItemCode());
|
||||
proWorkorderBom.setItemName(bom.getBomItemName());
|
||||
proWorkorderBom.setItemSpc(bom.getBomItemSpec());
|
||||
proWorkorderBom.setUnitOfMeasure(bom.getUnitOfMeasure());
|
||||
proWorkorderBom.setItemOrProduct(""); //TODO
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
308
ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProWorkorder.java
Normal file
308
ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProWorkorder.java
Normal file
@ -0,0 +1,308 @@
|
||||
package com.ktg.mes.pro.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.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产工单对象 pro_workorder
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
public class ProWorkorder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 工单ID */
|
||||
private Long workorderId;
|
||||
|
||||
/** 工单编码 */
|
||||
@Excel(name = "工单编码")
|
||||
private String workorderCode;
|
||||
|
||||
/** 工单名称 */
|
||||
@Excel(name = "工单名称")
|
||||
private String workorderName;
|
||||
|
||||
/** 来源类型 */
|
||||
@Excel(name = "来源类型")
|
||||
private String orderSource;
|
||||
|
||||
/** 来源单据 */
|
||||
@Excel(name = "来源单据")
|
||||
private String sourceCode;
|
||||
|
||||
/** 产品ID */
|
||||
@Excel(name = "产品ID")
|
||||
private Long productId;
|
||||
|
||||
/** 产品编号 */
|
||||
@Excel(name = "产品编号")
|
||||
private String productCode;
|
||||
|
||||
/** 产品名称 */
|
||||
@Excel(name = "产品名称")
|
||||
private String productName;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String productSpc;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 生产数量 */
|
||||
@Excel(name = "生产数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 客户ID */
|
||||
@Excel(name = "客户ID")
|
||||
private Long clientId;
|
||||
|
||||
/** 客户编码 */
|
||||
@Excel(name = "客户编码")
|
||||
private String clientCode;
|
||||
|
||||
/** 客户名称 */
|
||||
@Excel(name = "客户名称")
|
||||
private String clientName;
|
||||
|
||||
/** 需求日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date requestDate;
|
||||
|
||||
/** 单据状态 */
|
||||
@Excel(name = "单据状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setWorkorderId(Long workorderId)
|
||||
{
|
||||
this.workorderId = workorderId;
|
||||
}
|
||||
|
||||
public Long getWorkorderId()
|
||||
{
|
||||
return workorderId;
|
||||
}
|
||||
public void setWorkorderCode(String workorderCode)
|
||||
{
|
||||
this.workorderCode = workorderCode;
|
||||
}
|
||||
|
||||
public String getWorkorderCode()
|
||||
{
|
||||
return workorderCode;
|
||||
}
|
||||
public void setWorkorderName(String workorderName)
|
||||
{
|
||||
this.workorderName = workorderName;
|
||||
}
|
||||
|
||||
public String getWorkorderName()
|
||||
{
|
||||
return workorderName;
|
||||
}
|
||||
public void setOrderSource(String orderSource)
|
||||
{
|
||||
this.orderSource = orderSource;
|
||||
}
|
||||
|
||||
public String getOrderSource()
|
||||
{
|
||||
return orderSource;
|
||||
}
|
||||
public void setSourceCode(String sourceCode)
|
||||
{
|
||||
this.sourceCode = sourceCode;
|
||||
}
|
||||
|
||||
public String getSourceCode()
|
||||
{
|
||||
return sourceCode;
|
||||
}
|
||||
public void setProductId(Long productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public Long getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
public void setProductCode(String productCode)
|
||||
{
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductCode()
|
||||
{
|
||||
return productCode;
|
||||
}
|
||||
public void setProductName(String productName)
|
||||
{
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductName()
|
||||
{
|
||||
return productName;
|
||||
}
|
||||
public void setProductSpc(String productSpc)
|
||||
{
|
||||
this.productSpc = productSpc;
|
||||
}
|
||||
|
||||
public String getProductSpc()
|
||||
{
|
||||
return productSpc;
|
||||
}
|
||||
public void setUnitOfMeasure(String unitOfMeasure)
|
||||
{
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure()
|
||||
{
|
||||
return unitOfMeasure;
|
||||
}
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
public void setClientId(Long clientId)
|
||||
{
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public Long getClientId()
|
||||
{
|
||||
return clientId;
|
||||
}
|
||||
public void setClientCode(String clientCode)
|
||||
{
|
||||
this.clientCode = clientCode;
|
||||
}
|
||||
|
||||
public String getClientCode()
|
||||
{
|
||||
return clientCode;
|
||||
}
|
||||
public void setClientName(String clientName)
|
||||
{
|
||||
this.clientName = clientName;
|
||||
}
|
||||
|
||||
public String getClientName()
|
||||
{
|
||||
return clientName;
|
||||
}
|
||||
public void setRequestDate(Date requestDate)
|
||||
{
|
||||
this.requestDate = requestDate;
|
||||
}
|
||||
|
||||
public Date getRequestDate()
|
||||
{
|
||||
return requestDate;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("workorderId", getWorkorderId())
|
||||
.append("workorderCode", getWorkorderCode())
|
||||
.append("workorderName", getWorkorderName())
|
||||
.append("orderSource", getOrderSource())
|
||||
.append("sourceCode", getSourceCode())
|
||||
.append("productId", getProductId())
|
||||
.append("productCode", getProductCode())
|
||||
.append("productName", getProductName())
|
||||
.append("productSpc", getProductSpc())
|
||||
.append("unitOfMeasure", getUnitOfMeasure())
|
||||
.append("quantity", getQuantity())
|
||||
.append("clientId", getClientId())
|
||||
.append("clientCode", getClientCode())
|
||||
.append("clientName", getClientName())
|
||||
.append("requestDate", getRequestDate())
|
||||
.append("status", getStatus())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,207 @@
|
||||
package com.ktg.mes.pro.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产工单BOM组成对象 pro_workorder_bom
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
public class ProWorkorderBom extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** BOM行ID */
|
||||
private Long lineId;
|
||||
|
||||
/** 生产工单ID */
|
||||
@Excel(name = "生产工单ID")
|
||||
private Long workorderId;
|
||||
|
||||
/** BOM物料ID */
|
||||
@Excel(name = "BOM物料ID")
|
||||
private Long itemId;
|
||||
|
||||
/** BOM物料编号 */
|
||||
@Excel(name = "BOM物料编号")
|
||||
private String itemCode;
|
||||
|
||||
/** BOM物料名称 */
|
||||
@Excel(name = "BOM物料名称")
|
||||
private String itemName;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String itemSpc;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 物料产品标识 */
|
||||
@Excel(name = "物料产品标识")
|
||||
private String itemOrProduct;
|
||||
|
||||
/** 预计使用量 */
|
||||
@Excel(name = "预计使用量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setLineId(Long lineId)
|
||||
{
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public Long getLineId()
|
||||
{
|
||||
return lineId;
|
||||
}
|
||||
public void setWorkorderId(Long workorderId)
|
||||
{
|
||||
this.workorderId = workorderId;
|
||||
}
|
||||
|
||||
public Long getWorkorderId()
|
||||
{
|
||||
return workorderId;
|
||||
}
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
public void setItemCode(String itemCode)
|
||||
{
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemCode()
|
||||
{
|
||||
return itemCode;
|
||||
}
|
||||
public void setItemName(String itemName)
|
||||
{
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getItemName()
|
||||
{
|
||||
return itemName;
|
||||
}
|
||||
public void setItemSpc(String itemSpc)
|
||||
{
|
||||
this.itemSpc = itemSpc;
|
||||
}
|
||||
|
||||
public String getItemSpc()
|
||||
{
|
||||
return itemSpc;
|
||||
}
|
||||
public void setUnitOfMeasure(String unitOfMeasure)
|
||||
{
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure()
|
||||
{
|
||||
return unitOfMeasure;
|
||||
}
|
||||
public void setItemOrProduct(String itemOrProduct)
|
||||
{
|
||||
this.itemOrProduct = itemOrProduct;
|
||||
}
|
||||
|
||||
public String getItemOrProduct()
|
||||
{
|
||||
return itemOrProduct;
|
||||
}
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("lineId", getLineId())
|
||||
.append("workorderId", getWorkorderId())
|
||||
.append("itemId", getItemId())
|
||||
.append("itemCode", getItemCode())
|
||||
.append("itemName", getItemName())
|
||||
.append("itemSpc", getItemSpc())
|
||||
.append("unitOfMeasure", getUnitOfMeasure())
|
||||
.append("itemOrProduct", getItemOrProduct())
|
||||
.append("quantity", getQuantity())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.pro.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProWorkorderBom;
|
||||
|
||||
/**
|
||||
* 生产工单BOM组成Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
public interface ProWorkorderBomMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产工单BOM组成
|
||||
*
|
||||
* @param lineId 生产工单BOM组成主键
|
||||
* @return 生产工单BOM组成
|
||||
*/
|
||||
public ProWorkorderBom selectProWorkorderBomByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询生产工单BOM组成列表
|
||||
*
|
||||
* @param proWorkorderBom 生产工单BOM组成
|
||||
* @return 生产工单BOM组成集合
|
||||
*/
|
||||
public List<ProWorkorderBom> selectProWorkorderBomList(ProWorkorderBom proWorkorderBom);
|
||||
|
||||
/**
|
||||
* 新增生产工单BOM组成
|
||||
*
|
||||
* @param proWorkorderBom 生产工单BOM组成
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProWorkorderBom(ProWorkorderBom proWorkorderBom);
|
||||
|
||||
/**
|
||||
* 修改生产工单BOM组成
|
||||
*
|
||||
* @param proWorkorderBom 生产工单BOM组成
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProWorkorderBom(ProWorkorderBom proWorkorderBom);
|
||||
|
||||
/**
|
||||
* 删除生产工单BOM组成
|
||||
*
|
||||
* @param lineId 生产工单BOM组成主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkorderBomByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 批量删除生产工单BOM组成
|
||||
*
|
||||
* @param lineIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkorderBomByLineIds(Long[] lineIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.pro.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProWorkorder;
|
||||
|
||||
/**
|
||||
* 生产工单Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
public interface ProWorkorderMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产工单
|
||||
*
|
||||
* @param workorderId 生产工单主键
|
||||
* @return 生产工单
|
||||
*/
|
||||
public ProWorkorder selectProWorkorderByWorkorderId(Long workorderId);
|
||||
|
||||
/**
|
||||
* 查询生产工单列表
|
||||
*
|
||||
* @param proWorkorder 生产工单
|
||||
* @return 生产工单集合
|
||||
*/
|
||||
public List<ProWorkorder> selectProWorkorderList(ProWorkorder proWorkorder);
|
||||
|
||||
/**
|
||||
* 新增生产工单
|
||||
*
|
||||
* @param proWorkorder 生产工单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProWorkorder(ProWorkorder proWorkorder);
|
||||
|
||||
/**
|
||||
* 修改生产工单
|
||||
*
|
||||
* @param proWorkorder 生产工单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProWorkorder(ProWorkorder proWorkorder);
|
||||
|
||||
/**
|
||||
* 删除生产工单
|
||||
*
|
||||
* @param workorderId 生产工单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkorderByWorkorderId(Long workorderId);
|
||||
|
||||
/**
|
||||
* 批量删除生产工单
|
||||
*
|
||||
* @param workorderIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkorderByWorkorderIds(Long[] workorderIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.pro.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProWorkorderBom;
|
||||
|
||||
/**
|
||||
* 生产工单BOM组成Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
public interface IProWorkorderBomService
|
||||
{
|
||||
/**
|
||||
* 查询生产工单BOM组成
|
||||
*
|
||||
* @param lineId 生产工单BOM组成主键
|
||||
* @return 生产工单BOM组成
|
||||
*/
|
||||
public ProWorkorderBom selectProWorkorderBomByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询生产工单BOM组成列表
|
||||
*
|
||||
* @param proWorkorderBom 生产工单BOM组成
|
||||
* @return 生产工单BOM组成集合
|
||||
*/
|
||||
public List<ProWorkorderBom> selectProWorkorderBomList(ProWorkorderBom proWorkorderBom);
|
||||
|
||||
/**
|
||||
* 新增生产工单BOM组成
|
||||
*
|
||||
* @param proWorkorderBom 生产工单BOM组成
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProWorkorderBom(ProWorkorderBom proWorkorderBom);
|
||||
|
||||
/**
|
||||
* 修改生产工单BOM组成
|
||||
*
|
||||
* @param proWorkorderBom 生产工单BOM组成
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProWorkorderBom(ProWorkorderBom proWorkorderBom);
|
||||
|
||||
/**
|
||||
* 批量删除生产工单BOM组成
|
||||
*
|
||||
* @param lineIds 需要删除的生产工单BOM组成主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkorderBomByLineIds(Long[] lineIds);
|
||||
|
||||
/**
|
||||
* 删除生产工单BOM组成信息
|
||||
*
|
||||
* @param lineId 生产工单BOM组成主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkorderBomByLineId(Long lineId);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.ktg.mes.pro.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProWorkorder;
|
||||
|
||||
/**
|
||||
* 生产工单Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
public interface IProWorkorderService
|
||||
{
|
||||
/**
|
||||
* 查询生产工单
|
||||
*
|
||||
* @param workorderId 生产工单主键
|
||||
* @return 生产工单
|
||||
*/
|
||||
public ProWorkorder selectProWorkorderByWorkorderId(Long workorderId);
|
||||
|
||||
/**
|
||||
* 查询生产工单列表
|
||||
*
|
||||
* @param proWorkorder 生产工单
|
||||
* @return 生产工单集合
|
||||
*/
|
||||
public List<ProWorkorder> selectProWorkorderList(ProWorkorder proWorkorder);
|
||||
|
||||
/**
|
||||
* 新增生产工单
|
||||
*
|
||||
* @param proWorkorder 生产工单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProWorkorder(ProWorkorder proWorkorder);
|
||||
|
||||
/**
|
||||
* 修改生产工单
|
||||
*
|
||||
* @param proWorkorder 生产工单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProWorkorder(ProWorkorder proWorkorder);
|
||||
|
||||
/**
|
||||
* 批量删除生产工单
|
||||
*
|
||||
* @param workorderIds 需要删除的生产工单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkorderByWorkorderIds(Long[] workorderIds);
|
||||
|
||||
/**
|
||||
* 删除生产工单信息
|
||||
*
|
||||
* @param workorderId 生产工单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWorkorderByWorkorderId(Long workorderId);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.pro.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.pro.mapper.ProWorkorderBomMapper;
|
||||
import com.ktg.mes.pro.domain.ProWorkorderBom;
|
||||
import com.ktg.mes.pro.service.IProWorkorderBomService;
|
||||
|
||||
/**
|
||||
* 生产工单BOM组成Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
@Service
|
||||
public class ProWorkorderBomServiceImpl implements IProWorkorderBomService
|
||||
{
|
||||
@Autowired
|
||||
private ProWorkorderBomMapper proWorkorderBomMapper;
|
||||
|
||||
/**
|
||||
* 查询生产工单BOM组成
|
||||
*
|
||||
* @param lineId 生产工单BOM组成主键
|
||||
* @return 生产工单BOM组成
|
||||
*/
|
||||
@Override
|
||||
public ProWorkorderBom selectProWorkorderBomByLineId(Long lineId)
|
||||
{
|
||||
return proWorkorderBomMapper.selectProWorkorderBomByLineId(lineId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产工单BOM组成列表
|
||||
*
|
||||
* @param proWorkorderBom 生产工单BOM组成
|
||||
* @return 生产工单BOM组成
|
||||
*/
|
||||
@Override
|
||||
public List<ProWorkorderBom> selectProWorkorderBomList(ProWorkorderBom proWorkorderBom)
|
||||
{
|
||||
return proWorkorderBomMapper.selectProWorkorderBomList(proWorkorderBom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工单BOM组成
|
||||
*
|
||||
* @param proWorkorderBom 生产工单BOM组成
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProWorkorderBom(ProWorkorderBom proWorkorderBom)
|
||||
{
|
||||
proWorkorderBom.setCreateTime(DateUtils.getNowDate());
|
||||
return proWorkorderBomMapper.insertProWorkorderBom(proWorkorderBom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工单BOM组成
|
||||
*
|
||||
* @param proWorkorderBom 生产工单BOM组成
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProWorkorderBom(ProWorkorderBom proWorkorderBom)
|
||||
{
|
||||
proWorkorderBom.setUpdateTime(DateUtils.getNowDate());
|
||||
return proWorkorderBomMapper.updateProWorkorderBom(proWorkorderBom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产工单BOM组成
|
||||
*
|
||||
* @param lineIds 需要删除的生产工单BOM组成主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProWorkorderBomByLineIds(Long[] lineIds)
|
||||
{
|
||||
return proWorkorderBomMapper.deleteProWorkorderBomByLineIds(lineIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工单BOM组成信息
|
||||
*
|
||||
* @param lineId 生产工单BOM组成主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProWorkorderBomByLineId(Long lineId)
|
||||
{
|
||||
return proWorkorderBomMapper.deleteProWorkorderBomByLineId(lineId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.pro.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.pro.mapper.ProWorkorderMapper;
|
||||
import com.ktg.mes.pro.domain.ProWorkorder;
|
||||
import com.ktg.mes.pro.service.IProWorkorderService;
|
||||
|
||||
/**
|
||||
* 生产工单Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-09
|
||||
*/
|
||||
@Service
|
||||
public class ProWorkorderServiceImpl implements IProWorkorderService
|
||||
{
|
||||
@Autowired
|
||||
private ProWorkorderMapper proWorkorderMapper;
|
||||
|
||||
/**
|
||||
* 查询生产工单
|
||||
*
|
||||
* @param workorderId 生产工单主键
|
||||
* @return 生产工单
|
||||
*/
|
||||
@Override
|
||||
public ProWorkorder selectProWorkorderByWorkorderId(Long workorderId)
|
||||
{
|
||||
return proWorkorderMapper.selectProWorkorderByWorkorderId(workorderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产工单列表
|
||||
*
|
||||
* @param proWorkorder 生产工单
|
||||
* @return 生产工单
|
||||
*/
|
||||
@Override
|
||||
public List<ProWorkorder> selectProWorkorderList(ProWorkorder proWorkorder)
|
||||
{
|
||||
return proWorkorderMapper.selectProWorkorderList(proWorkorder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工单
|
||||
*
|
||||
* @param proWorkorder 生产工单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProWorkorder(ProWorkorder proWorkorder)
|
||||
{
|
||||
proWorkorder.setCreateTime(DateUtils.getNowDate());
|
||||
return proWorkorderMapper.insertProWorkorder(proWorkorder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工单
|
||||
*
|
||||
* @param proWorkorder 生产工单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProWorkorder(ProWorkorder proWorkorder)
|
||||
{
|
||||
proWorkorder.setUpdateTime(DateUtils.getNowDate());
|
||||
return proWorkorderMapper.updateProWorkorder(proWorkorder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产工单
|
||||
*
|
||||
* @param workorderIds 需要删除的生产工单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProWorkorderByWorkorderIds(Long[] workorderIds)
|
||||
{
|
||||
return proWorkorderMapper.deleteProWorkorderByWorkorderIds(workorderIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工单信息
|
||||
*
|
||||
* @param workorderId 生产工单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProWorkorderByWorkorderId(Long workorderId)
|
||||
{
|
||||
return proWorkorderMapper.deleteProWorkorderByWorkorderId(workorderId);
|
||||
}
|
||||
}
|
@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="contact2Email != null and contact2Email != ''"> and contact2_email = #{contact2Email}</if>
|
||||
<if test="creditCode != null and creditCode != ''"> and credit_code = #{creditCode}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
and client_id != 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
127
ktg-mes/src/main/resources/mapper/pro/ProWorkorderBomMapper.xml
Normal file
127
ktg-mes/src/main/resources/mapper/pro/ProWorkorderBomMapper.xml
Normal file
@ -0,0 +1,127 @@
|
||||
<?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.ktg.mes.pro.mapper.ProWorkorderBomMapper">
|
||||
|
||||
<resultMap type="ProWorkorderBom" id="ProWorkorderBomResult">
|
||||
<result property="lineId" column="line_id" />
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="itemSpc" column="item_spc" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="itemOrProduct" column="item_or_product" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProWorkorderBomVo">
|
||||
select line_id, workorder_id, item_id, item_code, item_name, item_spc, unit_of_measure, item_or_product, quantity, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_workorder_bom
|
||||
</sql>
|
||||
|
||||
<select id="selectProWorkorderBomList" parameterType="ProWorkorderBom" resultMap="ProWorkorderBomResult">
|
||||
<include refid="selectProWorkorderBomVo"/>
|
||||
<where>
|
||||
<if test="workorderId != null "> and workorder_id = #{workorderId}</if>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="itemSpc != null and itemSpc != ''"> and item_spc = #{itemSpc}</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
|
||||
<if test="itemOrProduct != null and itemOrProduct != ''"> and item_or_product = #{itemOrProduct}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProWorkorderBomByLineId" parameterType="Long" resultMap="ProWorkorderBomResult">
|
||||
<include refid="selectProWorkorderBomVo"/>
|
||||
where line_id = #{lineId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProWorkorderBom" parameterType="ProWorkorderBom" useGeneratedKeys="true" keyProperty="lineId">
|
||||
insert into pro_workorder_bom
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workorderId != null">workorder_id,</if>
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code,</if>
|
||||
<if test="itemName != null and itemName != ''">item_name,</if>
|
||||
<if test="itemSpc != null">item_spc,</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure,</if>
|
||||
<if test="itemOrProduct != null and itemOrProduct != ''">item_or_product,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="workorderId != null">#{workorderId},</if>
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">#{itemCode},</if>
|
||||
<if test="itemName != null and itemName != ''">#{itemName},</if>
|
||||
<if test="itemSpc != null">#{itemSpc},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">#{unitOfMeasure},</if>
|
||||
<if test="itemOrProduct != null and itemOrProduct != ''">#{itemOrProduct},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProWorkorderBom" parameterType="ProWorkorderBom">
|
||||
update pro_workorder_bom
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workorderId != null">workorder_id = #{workorderId},</if>
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code = #{itemCode},</if>
|
||||
<if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
|
||||
<if test="itemSpc != null">item_spc = #{itemSpc},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="itemOrProduct != null and itemOrProduct != ''">item_or_product = #{itemOrProduct},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where line_id = #{lineId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProWorkorderBomByLineId" parameterType="Long">
|
||||
delete from pro_workorder_bom where line_id = #{lineId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProWorkorderBomByLineIds" parameterType="String">
|
||||
delete from pro_workorder_bom where line_id in
|
||||
<foreach item="lineId" collection="array" open="(" separator="," close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
162
ktg-mes/src/main/resources/mapper/pro/ProWorkorderMapper.xml
Normal file
162
ktg-mes/src/main/resources/mapper/pro/ProWorkorderMapper.xml
Normal file
@ -0,0 +1,162 @@
|
||||
<?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.ktg.mes.pro.mapper.ProWorkorderMapper">
|
||||
|
||||
<resultMap type="ProWorkorder" id="ProWorkorderResult">
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="workorderCode" column="workorder_code" />
|
||||
<result property="workorderName" column="workorder_name" />
|
||||
<result property="orderSource" column="order_source" />
|
||||
<result property="sourceCode" column="source_code" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productSpc" column="product_spc" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="clientCode" column="client_code" />
|
||||
<result property="clientName" column="client_name" />
|
||||
<result property="requestDate" column="request_date" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProWorkorderVo">
|
||||
select workorder_id, workorder_code, workorder_name, order_source, source_code, product_id, product_code, product_name, product_spc, unit_of_measure, quantity, client_id, client_code, client_name, request_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_workorder
|
||||
</sql>
|
||||
|
||||
<select id="selectProWorkorderList" parameterType="ProWorkorder" resultMap="ProWorkorderResult">
|
||||
<include refid="selectProWorkorderVo"/>
|
||||
<where>
|
||||
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
|
||||
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
|
||||
<if test="orderSource != null and orderSource != ''"> and order_source = #{orderSource}</if>
|
||||
<if test="sourceCode != null and sourceCode != ''"> and source_code = #{sourceCode}</if>
|
||||
<if test="productId != null "> and product_id = #{productId}</if>
|
||||
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="productSpc != null and productSpc != ''"> and product_spc = #{productSpc}</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="clientId != null "> and client_id = #{clientId}</if>
|
||||
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode}</if>
|
||||
<if test="clientName != null and clientName != ''"> and client_name like concat('%', #{clientName}, '%')</if>
|
||||
<if test="requestDate != null "> and request_date = #{requestDate}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProWorkorderByWorkorderId" parameterType="Long" resultMap="ProWorkorderResult">
|
||||
<include refid="selectProWorkorderVo"/>
|
||||
where workorder_id = #{workorderId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProWorkorder" parameterType="ProWorkorder" useGeneratedKeys="true" keyProperty="workorderId">
|
||||
insert into pro_workorder
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
|
||||
<if test="workorderName != null and workorderName != ''">workorder_name,</if>
|
||||
<if test="orderSource != null and orderSource != ''">order_source,</if>
|
||||
<if test="sourceCode != null">source_code,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productCode != null and productCode != ''">product_code,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
<if test="productSpc != null">product_spc,</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="clientId != null">client_id,</if>
|
||||
<if test="clientCode != null">client_code,</if>
|
||||
<if test="clientName != null">client_name,</if>
|
||||
<if test="requestDate != null">request_date,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
|
||||
<if test="workorderName != null and workorderName != ''">#{workorderName},</if>
|
||||
<if test="orderSource != null and orderSource != ''">#{orderSource},</if>
|
||||
<if test="sourceCode != null">#{sourceCode},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productCode != null and productCode != ''">#{productCode},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="productSpc != null">#{productSpc},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">#{unitOfMeasure},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="clientId != null">#{clientId},</if>
|
||||
<if test="clientCode != null">#{clientCode},</if>
|
||||
<if test="clientName != null">#{clientName},</if>
|
||||
<if test="requestDate != null">#{requestDate},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProWorkorder" parameterType="ProWorkorder">
|
||||
update pro_workorder
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
|
||||
<if test="workorderName != null and workorderName != ''">workorder_name = #{workorderName},</if>
|
||||
<if test="orderSource != null and orderSource != ''">order_source = #{orderSource},</if>
|
||||
<if test="sourceCode != null">source_code = #{sourceCode},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
|
||||
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
||||
<if test="productSpc != null">product_spc = #{productSpc},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="clientId != null">client_id = #{clientId},</if>
|
||||
<if test="clientCode != null">client_code = #{clientCode},</if>
|
||||
<if test="clientName != null">client_name = #{clientName},</if>
|
||||
<if test="requestDate != null">request_date = #{requestDate},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where workorder_id = #{workorderId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProWorkorderByWorkorderId" parameterType="Long">
|
||||
delete from pro_workorder where workorder_id = #{workorderId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProWorkorderByWorkorderIds" parameterType="String">
|
||||
delete from pro_workorder where workorder_id in
|
||||
<foreach item="workorderId" collection="array" open="(" separator="," close=")">
|
||||
#{workorderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -13,7 +13,7 @@ public class PartTypeNowDateHandler implements PartTypeTemplate {
|
||||
|
||||
@Override
|
||||
public String partHandle(SysAutoCodePart sysAutoCodePart) {
|
||||
String formartDate = sysAutoCodePart.getDateFormart();
|
||||
return DateTimeFormatter.ofPattern(formartDate).format(LocalDateTime.now());
|
||||
String formatDate = sysAutoCodePart.getDateFormat();
|
||||
return DateTimeFormatter.ofPattern(formatDate).format(LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
<result property="partCode" column="part_code" />
|
||||
<result property="partName" column="part_name" />
|
||||
<result property="partLength" column="part_length" />
|
||||
<result property="dateFormat" column="date_formart" />
|
||||
<result property="dateFormat" column="date_format" />
|
||||
<result property="inputCharacter" column="input_character" />
|
||||
<result property="fixCharacter" column="fix_character" />
|
||||
<result property="seriaStartNo" column="seria_start_no" />
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
<sql id="selectSysAutoCodePartVo">
|
||||
select d.part_id,d.rule_id,d.part_index,d.part_type,d.part_code, d.part_name,
|
||||
d.part_length, d.date_formart,d.input_character,d.fix_character,d.seria_start_no,
|
||||
d.part_length, d.date_format,d.input_character,d.fix_character,d.seria_start_no,
|
||||
d.seria_step,d.seria_now_no,d.cycle_flag,d.cycle_method,d.remark,d.create_by,
|
||||
d.create_time,d.update_by,d.update_time
|
||||
from sys_auto_code_part d
|
||||
@ -81,8 +81,8 @@
|
||||
<if test="partLength !=null and partLength !=0">
|
||||
part_length,
|
||||
</if>
|
||||
<if test="dateFormart !=null and dateFormart !=''">
|
||||
date_formart,
|
||||
<if test="dateFormat !=null and dateFormat !=''">
|
||||
date_format,
|
||||
</if>
|
||||
<if test="inputCharacter !=null and inputCharacter !=''">
|
||||
input_character,
|
||||
@ -117,8 +117,8 @@
|
||||
<if test="partLength !=null and partLength !=0">
|
||||
#{partLength},
|
||||
</if>
|
||||
<if test="dateFormart !=null and dateFormart !=''">
|
||||
#{dateFormart},
|
||||
<if test="dateFormat !=null and dateFormat !=''">
|
||||
#{dateFormat},
|
||||
</if>
|
||||
<if test="inputCharacter !=null and inputCharacter !=''">
|
||||
#{inputCharacter},
|
||||
@ -162,8 +162,8 @@
|
||||
<if test="partLength !=null and partLength !=0">
|
||||
part_length = #{partLength},
|
||||
</if>
|
||||
<if test="dateFormart !=null and dateFormart !=''">
|
||||
date_formart = #{dateFormart},
|
||||
<if test="dateFormat !=null and dateFormat !=''">
|
||||
date_format = #{dateFormat},
|
||||
</if>
|
||||
<if test="inputCharacter !=null and inputCharacter !=''">
|
||||
input_character = #{inputCharacter},
|
||||
|
Loading…
Reference in New Issue
Block a user