diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/MesPrepareDetailController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/MesPrepareDetailController.java new file mode 100644 index 00000000..5d5c634e --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/MesPrepareDetailController.java @@ -0,0 +1,97 @@ +package com.op.mes.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.mes.domain.MesPrepareDetail; +import com.op.mes.service.IMesPrepareDetailService; +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; + +/** + * mes备料单明细Controller + * + * @author Open Platform + * @date 2023-08-04 + */ +@RestController +@RequestMapping("/prepareDetail") +public class MesPrepareDetailController extends BaseController { + @Autowired + private IMesPrepareDetailService mesPrepareDetailService; + + /** + * 查询mes备料单明细列表 + */ + @RequiresPermissions("mes:prepareDetail:list") + @GetMapping("/list") + public TableDataInfo list(MesPrepareDetail mesPrepareDetail) { + startPage(); + List list = mesPrepareDetailService.selectMesPrepareDetailList(mesPrepareDetail); + return getDataTable(list); + } + + /** + * 导出mes备料单明细列表 + */ + @RequiresPermissions("mes:prepareDetail:export") + @Log(title = "mes备料单明细", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesPrepareDetail mesPrepareDetail) { + List list = mesPrepareDetailService.selectMesPrepareDetailList(mesPrepareDetail); + ExcelUtil util = new ExcelUtil(MesPrepareDetail.class); + util.exportExcel(response, list, "mes备料单明细数据"); + } + + /** + * 获取mes备料单明细详细信息 + */ + @RequiresPermissions("mes:prepareDetail:query") + @GetMapping(value = "/{recordId}") + public AjaxResult getInfo(@PathVariable("recordId") String recordId) { + return success(mesPrepareDetailService.selectMesPrepareDetailByRecordId(recordId)); + } + + /** + * 新增mes备料单明细 + */ + @RequiresPermissions("mes:prepareDetail:add") + @Log(title = "mes备料单明细", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesPrepareDetail mesPrepareDetail) { + return toAjax(mesPrepareDetailService.insertMesPrepareDetail(mesPrepareDetail)); + } + + /** + * 修改mes备料单明细 + */ + @RequiresPermissions("mes:prepareDetail:edit") + @Log(title = "mes备料单明细", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesPrepareDetail mesPrepareDetail) { + return toAjax(mesPrepareDetailService.updateMesPrepareDetail(mesPrepareDetail)); + } + + /** + * 删除mes备料单明细 + */ + @RequiresPermissions("mes:prepareDetail:remove") + @Log(title = "mes备料单明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{recordIds}") + public AjaxResult remove(@PathVariable String[] recordIds) { + return toAjax(mesPrepareDetailService.deleteMesPrepareDetailByRecordIds(recordIds)); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/MesPrepareDetail.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/MesPrepareDetail.java new file mode 100644 index 00000000..6aa48196 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/MesPrepareDetail.java @@ -0,0 +1,222 @@ +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备料单明细对象 mes_prepare_detail + * + * @author Open Platform + * @date 2023-08-04 + */ +public class MesPrepareDetail extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** ID */ + private String recordId; + + /** 备料主ID */ + @Excel(name = "备料主ID") + private String prepareId; + + /** 物料编号 */ + @Excel(name = "物料编号") + private String materialCode; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materailName; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String materailSpc; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 生产数量 */ + @Excel(name = "生产数量") + private Long quantity; + + /** 工单生产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "工单生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productDate; + + /** 班次 */ + @Excel(name = "班次") + private String shiftId; + + /** 单据状态 */ + @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 prodType; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String factoryCode; + + public void setRecordId(String recordId) { + this.recordId = recordId; + } + + public String getRecordId() { + return recordId; + } + public void setPrepareId(String prepareId) { + this.prepareId = prepareId; + } + + public String getPrepareId() { + return prepareId; + } + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialCode() { + return materialCode; + } + public void setMaterailName(String materailName) { + this.materailName = materailName; + } + + public String getMaterailName() { + return materailName; + } + public void setMaterailSpc(String materailSpc) { + this.materailSpc = materailSpc; + } + + public String getMaterailSpc() { + return materailSpc; + } + public void setUnit(String unit) { + this.unit = unit; + } + + public String getUnit() { + return unit; + } + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public Long getQuantity() { + return quantity; + } + 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 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 setProdType(String prodType) { + this.prodType = prodType; + } + + public String getProdType() { + return prodType; + } + 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("recordId", getRecordId()) + .append("prepareId", getPrepareId()) + .append("materialCode", getMaterialCode()) + .append("materailName", getMaterailName()) + .append("materailSpc", getMaterailSpc()) + .append("unit", getUnit()) + .append("quantity", getQuantity()) + .append("productDate", getProductDate()) + .append("shiftId", getShiftId()) + .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("prodType", getProdType()) + .append("factoryCode", getFactoryCode()) + .toString(); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/MesPrepareDetailMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/MesPrepareDetailMapper.java new file mode 100644 index 00000000..0c00dd2d --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/MesPrepareDetailMapper.java @@ -0,0 +1,61 @@ +package com.op.mes.mapper; + +import java.util.List; + +import com.op.mes.domain.MesPrepareDetail; + +/** + * mes备料单明细Mapper接口 + * + * @author Open Platform + * @date 2023-08-04 + */ +public interface MesPrepareDetailMapper { + /** + * 查询mes备料单明细 + * + * @param recordId mes备料单明细主键 + * @return mes备料单明细 + */ + public MesPrepareDetail selectMesPrepareDetailByRecordId(String recordId); + + /** + * 查询mes备料单明细列表 + * + * @param mesPrepareDetail mes备料单明细 + * @return mes备料单明细集合 + */ + public List selectMesPrepareDetailList(MesPrepareDetail mesPrepareDetail); + + /** + * 新增mes备料单明细 + * + * @param mesPrepareDetail mes备料单明细 + * @return 结果 + */ + public int insertMesPrepareDetail(MesPrepareDetail mesPrepareDetail); + + /** + * 修改mes备料单明细 + * + * @param mesPrepareDetail mes备料单明细 + * @return 结果 + */ + public int updateMesPrepareDetail(MesPrepareDetail mesPrepareDetail); + + /** + * 删除mes备料单明细 + * + * @param recordId mes备料单明细主键 + * @return 结果 + */ + public int deleteMesPrepareDetailByRecordId(String recordId); + + /** + * 批量删除mes备料单明细 + * + * @param recordIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesPrepareDetailByRecordIds(String[] recordIds); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IMesPrepareDetailService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IMesPrepareDetailService.java new file mode 100644 index 00000000..75b0c857 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IMesPrepareDetailService.java @@ -0,0 +1,60 @@ +package com.op.mes.service; + +import java.util.List; +import com.op.mes.domain.MesPrepareDetail; + +/** + * mes备料单明细Service接口 + * + * @author Open Platform + * @date 2023-08-04 + */ +public interface IMesPrepareDetailService { + /** + * 查询mes备料单明细 + * + * @param recordId mes备料单明细主键 + * @return mes备料单明细 + */ + public MesPrepareDetail selectMesPrepareDetailByRecordId(String recordId); + + /** + * 查询mes备料单明细列表 + * + * @param mesPrepareDetail mes备料单明细 + * @return mes备料单明细集合 + */ + public List selectMesPrepareDetailList(MesPrepareDetail mesPrepareDetail); + + /** + * 新增mes备料单明细 + * + * @param mesPrepareDetail mes备料单明细 + * @return 结果 + */ + public int insertMesPrepareDetail(MesPrepareDetail mesPrepareDetail); + + /** + * 修改mes备料单明细 + * + * @param mesPrepareDetail mes备料单明细 + * @return 结果 + */ + public int updateMesPrepareDetail(MesPrepareDetail mesPrepareDetail); + + /** + * 批量删除mes备料单明细 + * + * @param recordIds 需要删除的mes备料单明细主键集合 + * @return 结果 + */ + public int deleteMesPrepareDetailByRecordIds(String[] recordIds); + + /** + * 删除mes备料单明细信息 + * + * @param recordId mes备料单明细主键 + * @return 结果 + */ + public int deleteMesPrepareDetailByRecordId(String recordId); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/MesPrepareDetailServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/MesPrepareDetailServiceImpl.java new file mode 100644 index 00000000..bda7f3fc --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/MesPrepareDetailServiceImpl.java @@ -0,0 +1,89 @@ +package com.op.mes.service.impl; + +import java.util.List; +import com.op.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.mes.mapper.MesPrepareDetailMapper; +import com.op.mes.domain.MesPrepareDetail; +import com.op.mes.service.IMesPrepareDetailService; + +/** + * mes备料单明细Service业务层处理 + * + * @author Open Platform + * @date 2023-08-04 + */ +@Service +public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService { + @Autowired + private MesPrepareDetailMapper mesPrepareDetailMapper; + + /** + * 查询mes备料单明细 + * + * @param recordId mes备料单明细主键 + * @return mes备料单明细 + */ + @Override + public MesPrepareDetail selectMesPrepareDetailByRecordId(String recordId) { + return mesPrepareDetailMapper.selectMesPrepareDetailByRecordId(recordId); + } + + /** + * 查询mes备料单明细列表 + * + * @param mesPrepareDetail mes备料单明细 + * @return mes备料单明细 + */ + @Override + public List selectMesPrepareDetailList(MesPrepareDetail mesPrepareDetail) { + return mesPrepareDetailMapper.selectMesPrepareDetailList(mesPrepareDetail); + } + + /** + * 新增mes备料单明细 + * + * @param mesPrepareDetail mes备料单明细 + * @return 结果 + */ + @Override + public int insertMesPrepareDetail(MesPrepareDetail mesPrepareDetail) { + mesPrepareDetail.setCreateTime(DateUtils.getNowDate()); + return mesPrepareDetailMapper.insertMesPrepareDetail(mesPrepareDetail); + } + + /** + * 修改mes备料单明细 + * + * @param mesPrepareDetail mes备料单明细 + * @return 结果 + */ + @Override + public int updateMesPrepareDetail(MesPrepareDetail mesPrepareDetail) { + mesPrepareDetail.setUpdateTime(DateUtils.getNowDate()); + return mesPrepareDetailMapper.updateMesPrepareDetail(mesPrepareDetail); + } + + /** + * 批量删除mes备料单明细 + * + * @param recordIds 需要删除的mes备料单明细主键 + * @return 结果 + */ + @Override + public int deleteMesPrepareDetailByRecordIds(String[] recordIds) { + return mesPrepareDetailMapper.deleteMesPrepareDetailByRecordIds(recordIds); + } + + /** + * 删除mes备料单明细信息 + * + * @param recordId mes备料单明细主键 + * @return 结果 + */ + @Override + public int deleteMesPrepareDetailByRecordId(String recordId) { + return mesPrepareDetailMapper.deleteMesPrepareDetailByRecordId(recordId); + } +} diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/MesPrepareDetailMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/MesPrepareDetailMapper.xml new file mode 100644 index 00000000..b9934f24 --- /dev/null +++ b/op-modules/op-wms/src/main/resources/mapper/wms/MesPrepareDetailMapper.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select record_id, prepare_id, material_code, materail_name, materail_spc, unit, quantity, product_date, shift_id, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, prod_type, factory_code from mes_prepare_detail + + + + + + + + insert into mes_prepare_detail + + record_id, + prepare_id, + material_code, + materail_name, + materail_spc, + unit, + quantity, + product_date, + shift_id, + status, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + prod_type, + factory_code, + + + #{recordId}, + #{prepareId}, + #{materialCode}, + #{materailName}, + #{materailSpc}, + #{unit}, + #{quantity}, + #{productDate}, + #{shiftId}, + #{status}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{prodType}, + #{factoryCode}, + + + + + update mes_prepare_detail + + prepare_id = #{prepareId}, + material_code = #{materialCode}, + materail_name = #{materailName}, + materail_spc = #{materailSpc}, + unit = #{unit}, + quantity = #{quantity}, + product_date = #{productDate}, + shift_id = #{shiftId}, + status = #{status}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + prod_type = #{prodType}, + factory_code = #{factoryCode}, + + where record_id = #{recordId} + + + + delete from mes_prepare_detail where record_id = #{recordId} + + + + delete from mes_prepare_detail where record_id in + + #{recordId} + + + \ No newline at end of file