MES 备料单 生产前准备

highway
A0010407 1 year ago
parent 91c07021ae
commit cccddee368

@ -0,0 +1,100 @@
package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.uuid.IdUtils;
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.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesPrepare;
import com.op.mes.service.IMesPrepareService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2023-08-03
*/
@RestController
@RequestMapping("/prepare")
public class MesPrepareController extends BaseController {
@Autowired
private IMesPrepareService mesPrepareService;
/**
*
*/
@RequiresPermissions("mes:prepare:list")
@GetMapping("/list")
public TableDataInfo list(MesPrepare mesPrepare) {
startPage();
List<MesPrepare> list = mesPrepareService.selectMesPrepareList(mesPrepare);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:prepare:export")
@Log(title = "备料单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesPrepare mesPrepare) {
List<MesPrepare> list = mesPrepareService.selectMesPrepareList(mesPrepare);
ExcelUtil<MesPrepare> util = new ExcelUtil<MesPrepare>(MesPrepare.class);
util.exportExcel(response, list, "备料单数据");
}
/**
*
*/
@RequiresPermissions("mes:prepare:query")
@GetMapping(value = "/{prepareId}")
public AjaxResult getInfo(@PathVariable("prepareId") String prepareId) {
return success(mesPrepareService.selectMesPrepareByPrepareId(prepareId));
}
/**
*
*/
@RequiresPermissions("mes:prepare:add")
@Log(title = "备料单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesPrepare mesPrepare) {
mesPrepare.setPrepareId(IdUtils.fastSimpleUUID());
return toAjax(mesPrepareService.insertMesPrepare(mesPrepare));
}
/**
*
*/
@RequiresPermissions("mes:prepare:edit")
@Log(title = "备料单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesPrepare mesPrepare) {
return toAjax(mesPrepareService.updateMesPrepare(mesPrepare));
}
/**
*
*/
@RequiresPermissions("mes:prepare:remove")
@Log(title = "备料单", businessType = BusinessType.DELETE)
@DeleteMapping("/{prepareIds}")
public AjaxResult remove(@PathVariable String[] prepareIds) {
return toAjax(mesPrepareService.deleteMesPrepareByPrepareIds(prepareIds));
}
}

@ -0,0 +1,100 @@
package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.uuid.IdUtils;
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.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesPrepareValidate;
import com.op.mes.service.IMesPrepareValidateService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2023-08-04
*/
@RestController
@RequestMapping("/validate")
public class MesPrepareValidateController extends BaseController {
@Autowired
private IMesPrepareValidateService mesPrepareValidateService;
/**
*
*/
@RequiresPermissions("mes:validate:list")
@GetMapping("/list")
public TableDataInfo list(MesPrepareValidate mesPrepareValidate) {
startPage();
List<MesPrepareValidate> list = mesPrepareValidateService.selectMesPrepareValidateList(mesPrepareValidate);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:validate:export")
@Log(title = "生产前准备记录报表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesPrepareValidate mesPrepareValidate) {
List<MesPrepareValidate> list = mesPrepareValidateService.selectMesPrepareValidateList(mesPrepareValidate);
ExcelUtil<MesPrepareValidate> util = new ExcelUtil<MesPrepareValidate>(MesPrepareValidate.class);
util.exportExcel(response, list, "生产前准备记录报表数据");
}
/**
*
*/
@RequiresPermissions("mes:validate:query")
@GetMapping(value = "/{validateId}")
public AjaxResult getInfo(@PathVariable("validateId") String validateId) {
return success(mesPrepareValidateService.selectMesPrepareValidateByValidateId(validateId));
}
/**
*
*/
@RequiresPermissions("mes:validate:add")
@Log(title = "生产前准备记录报表", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesPrepareValidate mesPrepareValidate) {
mesPrepareValidate.setValidateId(IdUtils.fastSimpleUUID());
return toAjax(mesPrepareValidateService.insertMesPrepareValidate(mesPrepareValidate));
}
/**
*
*/
@RequiresPermissions("mes:validate:edit")
@Log(title = "生产前准备记录报表", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesPrepareValidate mesPrepareValidate) {
return toAjax(mesPrepareValidateService.updateMesPrepareValidate(mesPrepareValidate));
}
/**
*
*/
@RequiresPermissions("mes:validate:remove")
@Log(title = "生产前准备记录报表", businessType = BusinessType.DELETE)
@DeleteMapping("/{validateIds}")
public AjaxResult remove(@PathVariable String[] validateIds) {
return toAjax(mesPrepareValidateService.deleteMesPrepareValidateByValidateIds(validateIds));
}
}

@ -0,0 +1,340 @@
package com.op.mes.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* mes_prepare
*
* @author Open Platform
* @date 2023-08-03
*/
public class MesPrepare extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 备料单id */
private String prepareId;
/** 工单编码 */
@Excel(name = "工单编码")
private String workorderCode;
/** 工单名称 */
@Excel(name = "工单名称")
private String workorderName;
/** 父工单 */
@Excel(name = "父工单")
private String parentOrder;
/** 订单id */
@Excel(name = "订单id")
private String orderId;
/** 订单编码 */
@Excel(name = "订单编码")
private String orderCode;
/** 产品id */
@Excel(name = "产品id")
private String productId;
/** 产品编号 */
@Excel(name = "产品编号")
private String productCode;
/** 产品类型 */
@Excel(name = "产品类型")
private String prodType;
/** 产品名称 */
@Excel(name = "产品名称")
private String productName;
/** 规格型号 */
@Excel(name = "规格型号")
private String productSpc;
/** 配料计划明细id */
@Excel(name = "配料计划明细id")
private String wetDetailPlanId;
/** 工单生产日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "工单生产日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date productDate;
/** 班次 */
@Excel(name = "班次")
private String shiftId;
/** 所有父节点id */
@Excel(name = "所有父节点id")
private String ancestors;
/** 单据状态 */
@Excel(name = "单据状态")
private String status;
/** 物料编码 */
@Excel(name = "物料编码")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料规格型号 */
@Excel(name = "物料规格型号")
private String materialSpc;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 生产数量 */
@Excel(name = "生产数量")
private String quantity;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private String attr4;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialSpc(String materialSpc) {
this.materialSpc = materialSpc;
}
public String getMaterialSpc() {
return materialSpc;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getUnit() {
return unit;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getQuantity() {
return quantity;
}
public void setPrepareId(String prepareId) {
this.prepareId = prepareId;
}
public String getPrepareId() {
return prepareId;
}
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 setParentOrder(String parentOrder) {
this.parentOrder = parentOrder;
}
public String getParentOrder() {
return parentOrder;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderId() {
return orderId;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductId() {
return productId;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProdType(String prodType) {
this.prodType = prodType;
}
public String getProdType() {
return prodType;
}
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 setWetDetailPlanId(String wetDetailPlanId) {
this.wetDetailPlanId = wetDetailPlanId;
}
public String getWetDetailPlanId() {
return wetDetailPlanId;
}
public void setProductDate(Date productDate) {
this.productDate = productDate;
}
public Date getProductDate() {
return productDate;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String getShiftId() {
return shiftId;
}
public void setAncestors(String ancestors) {
this.ancestors = ancestors;
}
public String getAncestors() {
return ancestors;
}
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(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("prepareId", getPrepareId())
.append("workorderCode", getWorkorderCode())
.append("workorderName", getWorkorderName())
.append("parentOrder", getParentOrder())
.append("orderId", getOrderId())
.append("orderCode", getOrderCode())
.append("productId", getProductId())
.append("productCode", getProductCode())
.append("prodType", getProdType())
.append("productName", getProductName())
.append("productSpc", getProductSpc())
.append("wetDetailPlanId", getWetDetailPlanId())
.append("productDate", getProductDate())
.append("shiftId", getShiftId())
.append("ancestors", getAncestors())
.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())
.append("factoryCode", getFactoryCode())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialSpc", getMaterialSpc())
.append("quantity", getQuantity())
.append("unit", getUnit())
.toString();
}
}

@ -0,0 +1,210 @@
package com.op.mes.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.util.Date;
/**
* mes_prepare_validate
*
* @author Open Platform
* @date 2023-08-04
*/
public class MesPrepareValidate extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 生产前准备id */
private String validateId;
/** 工单编码 */
@Excel(name = "工单编码")
private String workorderCode;
/** 工单名称 */
@Excel(name = "工单名称")
private String workorderName;
/** 产品规格型号 */
@Excel(name = "产品规格型号")
private String productSpc;
/** 产品名称 */
@Excel(name = "产品名称")
private String productName;
/** 单据状态 */
@Excel(name = "单据状态")
private String status;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private String attr4;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/** 准备类型 */
@Excel(name = "准备类型")
private String validateType;
/** 准备内容 */
@Excel(name = "准备内容")
private String validateName;
/** 准备状态 */
@Excel(name = "准备状态")
private String validateStatus;
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getEndTime() {
return endTime;
}
public void setValidateId(String validateId) {
this.validateId = validateId;
}
public String getValidateId() {
return validateId;
}
public void setValidateType(String validateType) {
this.validateType = validateType;
}
public String getValidateType() {
return validateType;
}
public void setValidateName(String validateName) {
this.validateName = validateName;
}
public String getValidateName() {
return validateName;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
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 setProductSpc(String productSpc) {
this.productSpc = productSpc;
}
public String getProductSpc() {
return productSpc;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setValidateStatus(String ValidateStatus) {
this.validateStatus = ValidateStatus;
}
public String getValidateStatus() {
return validateStatus;
}
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(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("validateId", getValidateId())
.append("workorderCode", getWorkorderCode())
.append("workorderName", getWorkorderName())
.append("productSpc", getProductSpc())
.append("productName", getProductName())
.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())
.append("factoryCode", getFactoryCode())
.append("validateType", getValidateType())
.append("validateName", getValidateName())
.append("validatStatus", getStatus())
.append("endTime", getEndTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesPrepare;
/**
* Mapper
*
* @author Open Platform
* @date 2023-08-03
*/
public interface MesPrepareMapper {
/**
*
*
* @param prepareId
* @return
*/
public MesPrepare selectMesPrepareByPrepareId(String prepareId);
/**
*
*
* @param mesPrepare
* @return
*/
public List<MesPrepare> selectMesPrepareList(MesPrepare mesPrepare);
/**
*
*
* @param mesPrepare
* @return
*/
public int insertMesPrepare(MesPrepare mesPrepare);
/**
*
*
* @param mesPrepare
* @return
*/
public int updateMesPrepare(MesPrepare mesPrepare);
/**
*
*
* @param prepareId
* @return
*/
public int deleteMesPrepareByPrepareId(String prepareId);
/**
*
*
* @param prepareIds
* @return
*/
public int deleteMesPrepareByPrepareIds(String[] prepareIds);
}

@ -0,0 +1,61 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesPrepareValidate;
/**
* Mapper
*
* @author Open Platform
* @date 2023-08-04
*/
public interface MesPrepareValidateMapper {
/**
*
*
* @param validateId
* @return
*/
public MesPrepareValidate selectMesPrepareValidateByValidateId(String validateId);
/**
*
*
* @param mesPrepareValidate
* @return
*/
public List<MesPrepareValidate> selectMesPrepareValidateList(MesPrepareValidate mesPrepareValidate);
/**
*
*
* @param mesPrepareValidate
* @return
*/
public int insertMesPrepareValidate(MesPrepareValidate mesPrepareValidate);
/**
*
*
* @param mesPrepareValidate
* @return
*/
public int updateMesPrepareValidate(MesPrepareValidate mesPrepareValidate);
/**
*
*
* @param validateId
* @return
*/
public int deleteMesPrepareValidateByValidateId(String validateId);
/**
*
*
* @param validateIds
* @return
*/
public int deleteMesPrepareValidateByValidateIds(String[] validateIds);
}

@ -0,0 +1,60 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesPrepare;
/**
* Service
*
* @author Open Platform
* @date 2023-08-03
*/
public interface IMesPrepareService {
/**
*
*
* @param prepareId
* @return
*/
public MesPrepare selectMesPrepareByPrepareId(String prepareId);
/**
*
*
* @param mesPrepare
* @return
*/
public List<MesPrepare> selectMesPrepareList(MesPrepare mesPrepare);
/**
*
*
* @param mesPrepare
* @return
*/
public int insertMesPrepare(MesPrepare mesPrepare);
/**
*
*
* @param mesPrepare
* @return
*/
public int updateMesPrepare(MesPrepare mesPrepare);
/**
*
*
* @param prepareIds
* @return
*/
public int deleteMesPrepareByPrepareIds(String[] prepareIds);
/**
*
*
* @param prepareId
* @return
*/
public int deleteMesPrepareByPrepareId(String prepareId);
}

@ -0,0 +1,60 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesPrepareValidate;
/**
* Service
*
* @author Open Platform
* @date 2023-08-04
*/
public interface IMesPrepareValidateService {
/**
*
*
* @param validateId
* @return
*/
public MesPrepareValidate selectMesPrepareValidateByValidateId(String validateId);
/**
*
*
* @param mesPrepareValidate
* @return
*/
public List<MesPrepareValidate> selectMesPrepareValidateList(MesPrepareValidate mesPrepareValidate);
/**
*
*
* @param mesPrepareValidate
* @return
*/
public int insertMesPrepareValidate(MesPrepareValidate mesPrepareValidate);
/**
*
*
* @param mesPrepareValidate
* @return
*/
public int updateMesPrepareValidate(MesPrepareValidate mesPrepareValidate);
/**
*
*
* @param validateIds
* @return
*/
public int deleteMesPrepareValidateByValidateIds(String[] validateIds);
/**
*
*
* @param validateId
* @return
*/
public int deleteMesPrepareValidateByValidateId(String validateId);
}

@ -0,0 +1,97 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesPrepareMapper;
import com.op.mes.domain.MesPrepare;
import com.op.mes.service.IMesPrepareService;
/**
* Service
*
* @author Open Platform
* @date 2023-08-03
*/
@Service
public class MesPrepareServiceImpl implements IMesPrepareService {
@Autowired
private MesPrepareMapper mesPrepareMapper;
/**
*
*
* @param prepareId
* @return
*/
@Override
@DS("#header.poolName")
public MesPrepare selectMesPrepareByPrepareId(String prepareId) {
return mesPrepareMapper.selectMesPrepareByPrepareId(prepareId);
}
/**
*
*
* @param mesPrepare
* @return
*/
@Override
@DS("#header.poolName")
public List<MesPrepare> selectMesPrepareList(MesPrepare mesPrepare) {
return mesPrepareMapper.selectMesPrepareList(mesPrepare);
}
/**
*
*
* @param mesPrepare
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesPrepare(MesPrepare mesPrepare) {
mesPrepare.setCreateTime(DateUtils.getNowDate());
return mesPrepareMapper.insertMesPrepare(mesPrepare);
}
/**
*
*
* @param mesPrepare
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesPrepare(MesPrepare mesPrepare) {
mesPrepare.setUpdateTime(DateUtils.getNowDate());
return mesPrepareMapper.updateMesPrepare(mesPrepare);
}
/**
*
*
* @param prepareIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesPrepareByPrepareIds(String[] prepareIds) {
return mesPrepareMapper.deleteMesPrepareByPrepareIds(prepareIds);
}
/**
*
*
* @param prepareId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesPrepareByPrepareId(String prepareId) {
return mesPrepareMapper.deleteMesPrepareByPrepareId(prepareId);
}
}

@ -0,0 +1,96 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesPrepareValidateMapper;
import com.op.mes.domain.MesPrepareValidate;
import com.op.mes.service.IMesPrepareValidateService;
/**
* Service
*
* @author Open Platform
* @date 2023-08-04
*/
@Service
public class MesPrepareValidateServiceImpl implements IMesPrepareValidateService {
@Autowired
private MesPrepareValidateMapper mesPrepareValidateMapper;
/**
*
*
* @param validateId
* @return
*/
@Override
@DS("#header.poolName")
public MesPrepareValidate selectMesPrepareValidateByValidateId(String validateId) {
return mesPrepareValidateMapper.selectMesPrepareValidateByValidateId(validateId);
}
/**
*
*
* @param mesPrepareValidate
* @return
*/
@Override
@DS("#header.poolName")
public List<MesPrepareValidate> selectMesPrepareValidateList(MesPrepareValidate mesPrepareValidate) {
return mesPrepareValidateMapper.selectMesPrepareValidateList(mesPrepareValidate);
}
/**
*
*
* @param mesPrepareValidate
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesPrepareValidate(MesPrepareValidate mesPrepareValidate) {
mesPrepareValidate.setCreateTime(DateUtils.getNowDate());
return mesPrepareValidateMapper.insertMesPrepareValidate(mesPrepareValidate);
}
/**
*
*
* @param mesPrepareValidate
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesPrepareValidate(MesPrepareValidate mesPrepareValidate) {
mesPrepareValidate.setUpdateTime(DateUtils.getNowDate());
return mesPrepareValidateMapper.updateMesPrepareValidate(mesPrepareValidate);
}
/**
*
*
* @param validateIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesPrepareValidateByValidateIds(String[] validateIds) {
return mesPrepareValidateMapper.deleteMesPrepareValidateByValidateIds(validateIds);
}
/**
*
*
* @param validateId
* @return
*/
@Override
public int deleteMesPrepareValidateByValidateId(String validateId) {
return mesPrepareValidateMapper.deleteMesPrepareValidateByValidateId(validateId);
}
}

@ -0,0 +1,217 @@
<?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.op.mes.mapper.MesPrepareMapper">
<resultMap type="MesPrepare" id="MesPrepareResult">
<result property="prepareId" column="prepare_id" />
<result property="workorderCode" column="workorder_code" />
<result property="workorderName" column="workorder_name" />
<result property="parentOrder" column="parent_order" />
<result property="orderId" column="order_id" />
<result property="orderCode" column="order_code" />
<result property="productId" column="product_id" />
<result property="productCode" column="product_code" />
<result property="prodType" column="prod_type" />
<result property="productName" column="product_name" />
<result property="productSpc" column="product_spc" />
<result property="wetDetailPlanId" column="wet_detail_plan_id" />
<result property="productDate" column="product_date" />
<result property="shiftId" column="shift_id" />
<result property="ancestors" column="ancestors" />
<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" />
<result property="factoryCode" column="factory_code" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialSpc" column="material_spc" />
<result property="unit" column="unit" />
<result property="quantity" column="quantity" />
</resultMap>
<sql id="selectMesPrepareVo">
select prepare_id, workorder_code, workorder_name, parent_order, order_id, order_code, product_id, product_code, prod_type, product_name, product_spc, wet_detail_plan_id, product_date, shift_id, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, material_code, material_name, material_spc, unit, quantity from mes_prepare
</sql>
<select id="selectMesPrepareList" parameterType="MesPrepare" resultMap="MesPrepareResult">
select
ms.prepare_id,
ms.workorder_code,
ms.workorder_name,
ms.parent_order,
ms.order_id,
ms.order_code,
ms.product_id,
ms.product_code,
ms.prod_type,
ms.product_name,
ms.product_spc,
ms.wet_detail_plan_id,
ms.product_date,
ms.shift_id,
ms.ancestors,
ms.status,
ms.remark,
ms.attr1,
ms.attr2,
ms.attr3,
ms.attr4,
ms.create_by,
ms.create_time,
ms.update_by,
ms.update_time,
ms.factory_code,
msd.prepare_id id,
msd.material_code,
msd.material_name,
msd.material_spc,
msd.unit,
msd.quantity
from mes_prepare ms,mes_prepare_detail msd
<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="parentOrder != null and parentOrder != ''"> and parent_order = #{parentOrder}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</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="wetDetailPlanId != null and wetDetailPlanId != ''"> and wet_detail_plan_id = #{wetDetailPlanId}</if>
<if test="productDate != null "> and product_date = #{productDate}</if>
<if test="shiftId != null and shiftId != ''"> and shift_id = #{shiftId}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
</select>
<select id="selectMesPrepareByPrepareId" parameterType="String" resultMap="MesPrepareResult">
<include refid="selectMesPrepareVo"/>
where prepare_id = #{prepareId}
</select>
<!-- <insert id="insertMesPrepare" parameterType="MesPrepare">-->
<!-- insert into mes_prepare-->
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
<!-- <if test="prepareId != null">prepare_id,</if>-->
<!-- <if test="workorderCode != null and workorderCode != ''">workorder_code,</if>-->
<!-- <if test="workorderName != null">workorder_name,</if>-->
<!-- <if test="parentOrder != null and parentOrder != ''">parent_order,</if>-->
<!-- <if test="orderId != null and orderId != ''">order_id,</if>-->
<!-- <if test="orderCode != null">order_code,</if>-->
<!-- <if test="productId != null">product_id,</if>-->
<!-- <if test="productCode != null and productCode != ''">product_code,</if>-->
<!-- <if test="prodType != null">prod_type,</if>-->
<!-- <if test="productName != null and productName != ''">product_name,</if>-->
<!-- <if test="productSpc != null">product_spc,</if>-->
<!-- <if test="wetDetailPlanId != null">wet_detail_plan_id,</if>-->
<!-- <if test="productDate != null">product_date,</if>-->
<!-- <if test="shiftId != null">shift_id,</if>-->
<!-- <if test="ancestors != null">ancestors,</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>-->
<!-- <if test="factoryCode != null">factory_code,</if>-->
<!-- <if test="materialCode != null and materialCode != ''">material_code,</if>-->
<!-- <if test="materialName != null and materialName != ''">material_name,</if>-->
<!-- <if test="materialSpc != null">material_spc,</if>-->
<!-- <if test="unit != null and unit != ''">unit,</if>-->
<!-- <if test="quantity != null">quantity,</if>-->
<!-- </trim>-->
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
<!-- <if test="prepareId != null">#{prepareId},</if>-->
<!-- <if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>-->
<!-- <if test="workorderName != null">#{workorderName},</if>-->
<!-- <if test="parentOrder != null and parentOrder != ''">#{parentOrder},</if>-->
<!-- <if test="orderId != null and orderId != ''">#{orderId},</if>-->
<!-- <if test="orderCode != null">#{orderCode},</if>-->
<!-- <if test="productId != null">#{productId},</if>-->
<!-- <if test="productCode != null and productCode != ''">#{productCode},</if>-->
<!-- <if test="prodType != null">#{prodType},</if>-->
<!-- <if test="productName != null and productName != ''">#{productName},</if>-->
<!-- <if test="productSpc != null">#{productSpc},</if>-->
<!-- <if test="wetDetailPlanId != null">#{wetDetailPlanId},</if>-->
<!-- <if test="productDate != null">#{productDate},</if>-->
<!-- <if test="shiftId != null">#{shiftId},</if>-->
<!-- <if test="ancestors != null">#{ancestors},</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>-->
<!-- <if test="factoryCode != null">#{factoryCode},</if>-->
<!-- <if test="materialCode != null and materialCode != ''">#{materialCode},</if>-->
<!-- <if test="materialName != null and materialName != ''">#{materialName},</if>-->
<!-- <if test="materialSpc != null">#{materialSpc},</if>-->
<!-- <if test="unit != null and unit != ''">#{unit},</if>-->
<!-- <if test="quantity != null">#{quantity},</if>-->
<!-- </trim>-->
<!-- </insert>-->
<!-- <update id="updateMesPrepare" parameterType="MesPrepare">-->
<!-- update mes_prepare-->
<!-- <trim prefix="SET" suffixOverrides=",">-->
<!-- <if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>-->
<!-- <if test="workorderName != null">workorder_name = #{workorderName},</if>-->
<!-- <if test="parentOrder != null and parentOrder != ''">parent_order = #{parentOrder},</if>-->
<!-- <if test="orderId != null and orderId != ''">order_id = #{orderId},</if>-->
<!-- <if test="orderCode != null">order_code = #{orderCode},</if>-->
<!-- <if test="productId != null">product_id = #{productId},</if>-->
<!-- <if test="productCode != null and productCode != ''">product_code = #{productCode},</if>-->
<!-- <if test="prodType != null">prod_type = #{prodType},</if>-->
<!-- <if test="productName != null and productName != ''">product_name = #{productName},</if>-->
<!-- <if test="productSpc != null">product_spc = #{productSpc},</if>-->
<!-- <if test="wetDetailPlanId != null">wet_detail_plan_id = #{wetDetailPlanId},</if>-->
<!-- <if test="productDate != null">product_date = #{productDate},</if>-->
<!-- <if test="shiftId != null">shift_id = #{shiftId},</if>-->
<!-- <if test="ancestors != null">ancestors = #{ancestors},</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>-->
<!-- <if test="factoryCode != null">factory_code = #{factoryCode},</if>-->
<!-- </trim>-->
<!-- where prepare_id = #{prepareId}-->
<!-- </update>-->
<!-- <delete id="deleteMesPrepareByPrepareId" parameterType="String">-->
<!-- delete from mes_prepare where prepare_id = #{prepareId}-->
<!-- </delete>-->
<!-- <delete id="deleteMesPrepareByPrepareIds" parameterType="String">-->
<!-- delete from mes_prepare where prepare_id in -->
<!-- <foreach item="prepareId" collection="array" open="(" separator="," close=")">-->
<!-- #{prepareId}-->
<!-- </foreach>-->
<!-- </delete>-->
</mapper>

@ -0,0 +1,144 @@
<?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.op.mes.mapper.MesPrepareValidateMapper">
<resultMap type="MesPrepareValidate" id="MesPrepareValidateResult">
<result property="validateId" column="validate_id" />
<result property="workorderCode" column="workorder_code" />
<result property="workorderName" column="workorder_name" />
<result property="productSpc" column="product_spc" />
<result property="productName" column="product_name" />
<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" />
<result property="factoryCode" column="factory_code" />
<result property="endTime" column="end_time" />
<result property="validateType" column="validate_type" />
<result property="validateName" column="validate_name" />
<result property="validateStatus" column="validate_status" />
</resultMap>
<sql id="selectMesPrepareValidateVo">
select validate_id, workorder_code, workorder_name, product_spc, product_name, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code from mes_prepare_validate
</sql>
<select id="selectMesPrepareValidateList" parameterType="MesPrepareValidate" resultMap="MesPrepareValidateResult">
select
mpv.validate_id,
mpv.workorder_code,
mpv.workorder_name,
mpv.product_spc,
mpv.product_name,
mpv.status,
mpv.remark,
mpv.create_by,
mpv.create_time,
mpv.update_by,
mpv.update_time,
mpv.factory_code,
mpvd.validate_id id,
mpvd.validate_type,
mpvd.validate_name,
mpvd.end_time
from mes_prepare_validate mpv,mes_prepare_validate_detail mpvd
<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="productSpc != null and productSpc != ''"> and product_spc = #{productSpc}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
</select>
<select id="selectMesPrepareValidateByValidateId" parameterType="String" resultMap="MesPrepareValidateResult">
<include refid="selectMesPrepareValidateVo"/>
where validate_id = #{validateId}
</select>
<insert id="insertMesPrepareValidate" parameterType="MesPrepareValidate">
insert into mes_prepare_validate
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="validateId != null">validate_id,</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
<if test="workorderName != null">workorder_name,</if>
<if test="productSpc != null">product_spc,</if>
<if test="productName != null">product_name,</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>
<if test="factoryCode != null">factory_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="validateId != null">#{validateId},</if>
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
<if test="workorderName != null">#{workorderName},</if>
<if test="productSpc != null">#{productSpc},</if>
<if test="productName != null">#{productName},</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>
<if test="factoryCode != null">#{factoryCode},</if>
</trim>
</insert>
<update id="updateMesPrepareValidate" parameterType="MesPrepareValidate">
update mes_prepare_validate
<trim prefix="SET" suffixOverrides=",">
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
<if test="workorderName != null">workorder_name = #{workorderName},</if>
<if test="productSpc != null">product_spc = #{productSpc},</if>
<if test="productName != null">product_name = #{productName},</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>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim>
where validate_id = #{validateId}
</update>
<delete id="deleteMesPrepareValidateByValidateId" parameterType="String">
delete from mes_prepare_validate where validate_id = #{validateId}
</delete>
<delete id="deleteMesPrepareValidateByValidateIds" parameterType="String">
delete from mes_prepare_validate where validate_id in
<foreach item="validateId" collection="array" open="(" separator="," close=")">
#{validateId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save