mes报工
parent
a6890849fe
commit
49188ecaaf
@ -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.MesReportWorkConsume;
|
||||
import com.op.mes.service.IMesReportWorkConsumeService;
|
||||
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-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/reportWorkConsume")
|
||||
public class MesReportWorkConsumeController extends BaseController {
|
||||
@Autowired
|
||||
private IMesReportWorkConsumeService mesReportWorkConsumeService;
|
||||
|
||||
/**
|
||||
* 查询生产报工物料消耗列表
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWorkConsume:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesReportWorkConsume mesReportWorkConsume) {
|
||||
startPage();
|
||||
List<MesReportWorkConsume> list = mesReportWorkConsumeService.selectMesReportWorkConsumeList(mesReportWorkConsume);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产报工物料消耗列表
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWorkConsume:export")
|
||||
@Log(title = "生产报工物料消耗", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesReportWorkConsume mesReportWorkConsume) {
|
||||
List<MesReportWorkConsume> list = mesReportWorkConsumeService.selectMesReportWorkConsumeList(mesReportWorkConsume);
|
||||
ExcelUtil<MesReportWorkConsume> util = new ExcelUtil<MesReportWorkConsume>(MesReportWorkConsume.class);
|
||||
util.exportExcel(response, list, "生产报工物料消耗数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产报工物料消耗详细信息
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWorkConsume:query")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
|
||||
return success(mesReportWorkConsumeService.selectMesReportWorkConsumeByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产报工物料消耗
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWorkConsume:add")
|
||||
@Log(title = "生产报工物料消耗", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesReportWorkConsume mesReportWorkConsume) {
|
||||
mesReportWorkConsume.setRecordId(IdUtils.fastSimpleUUID());
|
||||
return toAjax(mesReportWorkConsumeService.insertMesReportWorkConsume(mesReportWorkConsume));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产报工物料消耗
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWorkConsume:edit")
|
||||
@Log(title = "生产报工物料消耗", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesReportWorkConsume mesReportWorkConsume) {
|
||||
return toAjax(mesReportWorkConsumeService.updateMesReportWorkConsume(mesReportWorkConsume));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产报工物料消耗
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWorkConsume:remove")
|
||||
@Log(title = "生产报工物料消耗", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable String[] recordIds) {
|
||||
return toAjax(mesReportWorkConsumeService.deleteMesReportWorkConsumeByRecordIds(recordIds));
|
||||
}
|
||||
}
|
@ -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.MesReportWork;
|
||||
import com.op.mes.service.IMesReportWorkService;
|
||||
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-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/reportWork")
|
||||
public class MesReportWorkController extends BaseController {
|
||||
@Autowired
|
||||
private IMesReportWorkService mesReportWorkService;
|
||||
|
||||
/**
|
||||
* 查询报工报表列表
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWork:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesReportWork mesReportWork) {
|
||||
startPage();
|
||||
List<MesReportWork> list = mesReportWorkService.selectMesReportWorkList(mesReportWork);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报工报表列表
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWork:export")
|
||||
@Log(title = "报工报表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesReportWork mesReportWork) {
|
||||
List<MesReportWork> list = mesReportWorkService.selectMesReportWorkList(mesReportWork);
|
||||
ExcelUtil<MesReportWork> util = new ExcelUtil<MesReportWork>(MesReportWork.class);
|
||||
util.exportExcel(response, list, "报工报表数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报工报表详细信息
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWork:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(mesReportWorkService.selectMesReportWorkById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报工报表
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWork:add")
|
||||
@Log(title = "报工报表", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesReportWork mesReportWork) {
|
||||
mesReportWork.setId(IdUtils.fastSimpleUUID());
|
||||
return toAjax(mesReportWorkService.insertMesReportWork(mesReportWork));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报工报表
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWork:edit")
|
||||
@Log(title = "报工报表", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesReportWork mesReportWork) {
|
||||
return toAjax(mesReportWorkService.updateMesReportWork(mesReportWork));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报工报表
|
||||
*/
|
||||
@RequiresPermissions("mes:reportWork:remove")
|
||||
@Log(title = "报工报表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(mesReportWorkService.deleteMesReportWorkByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,171 @@
|
||||
package com.op.mes.domain;
|
||||
|
||||
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_report_work_consume
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public class MesReportWorkConsume extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private String recordId;
|
||||
|
||||
/** 工单编码 */
|
||||
@Excel(name = "工单编码")
|
||||
private String workorderCode;
|
||||
|
||||
/** 物料编号 */
|
||||
@Excel(name = "物料编号")
|
||||
private String materialCode;
|
||||
|
||||
/** 物料名称 */
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/** 物料规格型号 */
|
||||
@Excel(name = "物料规格型号")
|
||||
private String materialSpc;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private Long quantity;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
/** 预留字段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 void setRecordId(String recordId) {
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public String getRecordId() {
|
||||
return recordId;
|
||||
}
|
||||
public void setWorkorderCode(String workorderCode) {
|
||||
this.workorderCode = workorderCode;
|
||||
}
|
||||
|
||||
public String getWorkorderCode() {
|
||||
return workorderCode;
|
||||
}
|
||||
public void setMaterialCode(String materialCode) {
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public String getMaterialCode() {
|
||||
return materialCode;
|
||||
}
|
||||
public void setMaterialName(String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
}
|
||||
public void setMaterialSpc(String materialSpc) {
|
||||
this.materialSpc = materialSpc;
|
||||
}
|
||||
|
||||
public String getMaterialSpc() {
|
||||
return materialSpc;
|
||||
}
|
||||
public void setQuantity(Long quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Long getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
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("recordId", getRecordId())
|
||||
.append("workorderCode", getWorkorderCode())
|
||||
.append("materialCode", getMaterialCode())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("materialSpc", getMaterialSpc())
|
||||
.append("quantity", getQuantity())
|
||||
.append("unit", getUnit())
|
||||
.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())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.op.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.mes.domain.MesReportWorkConsume;
|
||||
|
||||
/**
|
||||
* 生产报工物料消耗Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public interface MesReportWorkConsumeMapper {
|
||||
/**
|
||||
* 查询生产报工物料消耗
|
||||
*
|
||||
* @param recordId 生产报工物料消耗主键
|
||||
* @return 生产报工物料消耗
|
||||
*/
|
||||
public MesReportWorkConsume selectMesReportWorkConsumeByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 查询生产报工物料消耗列表
|
||||
*
|
||||
* @param mesReportWorkConsume 生产报工物料消耗
|
||||
* @return 生产报工物料消耗集合
|
||||
*/
|
||||
public List<MesReportWorkConsume> selectMesReportWorkConsumeList(MesReportWorkConsume mesReportWorkConsume);
|
||||
|
||||
/**
|
||||
* 新增生产报工物料消耗
|
||||
*
|
||||
* @param mesReportWorkConsume 生产报工物料消耗
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesReportWorkConsume(MesReportWorkConsume mesReportWorkConsume);
|
||||
|
||||
/**
|
||||
* 修改生产报工物料消耗
|
||||
*
|
||||
* @param mesReportWorkConsume 生产报工物料消耗
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesReportWorkConsume(MesReportWorkConsume mesReportWorkConsume);
|
||||
|
||||
/**
|
||||
* 删除生产报工物料消耗
|
||||
*
|
||||
* @param recordId 生产报工物料消耗主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesReportWorkConsumeByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 批量删除生产报工物料消耗
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesReportWorkConsumeByRecordIds(String[] recordIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.op.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.mes.domain.MesReportWork;
|
||||
|
||||
/**
|
||||
* 报工报表Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public interface MesReportWorkMapper {
|
||||
/**
|
||||
* 查询报工报表
|
||||
*
|
||||
* @param id 报工报表主键
|
||||
* @return 报工报表
|
||||
*/
|
||||
public MesReportWork selectMesReportWorkById(String id);
|
||||
|
||||
/**
|
||||
* 查询报工报表列表
|
||||
*
|
||||
* @param mesReportWork 报工报表
|
||||
* @return 报工报表集合
|
||||
*/
|
||||
public List<MesReportWork> selectMesReportWorkList(MesReportWork mesReportWork);
|
||||
|
||||
/**
|
||||
* 新增报工报表
|
||||
*
|
||||
* @param mesReportWork 报工报表
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesReportWork(MesReportWork mesReportWork);
|
||||
|
||||
/**
|
||||
* 修改报工报表
|
||||
*
|
||||
* @param mesReportWork 报工报表
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesReportWork(MesReportWork mesReportWork);
|
||||
|
||||
/**
|
||||
* 删除报工报表
|
||||
*
|
||||
* @param id 报工报表主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesReportWorkById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除报工报表
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesReportWorkByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.op.mes.domain.MesReportWorkConsume;
|
||||
|
||||
/**
|
||||
* 生产报工物料消耗Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public interface IMesReportWorkConsumeService {
|
||||
/**
|
||||
* 查询生产报工物料消耗
|
||||
*
|
||||
* @param recordId 生产报工物料消耗主键
|
||||
* @return 生产报工物料消耗
|
||||
*/
|
||||
public MesReportWorkConsume selectMesReportWorkConsumeByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 查询生产报工物料消耗列表
|
||||
*
|
||||
* @param mesReportWorkConsume 生产报工物料消耗
|
||||
* @return 生产报工物料消耗集合
|
||||
*/
|
||||
public List<MesReportWorkConsume> selectMesReportWorkConsumeList(MesReportWorkConsume mesReportWorkConsume);
|
||||
|
||||
/**
|
||||
* 新增生产报工物料消耗
|
||||
*
|
||||
* @param mesReportWorkConsume 生产报工物料消耗
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesReportWorkConsume(MesReportWorkConsume mesReportWorkConsume);
|
||||
|
||||
/**
|
||||
* 修改生产报工物料消耗
|
||||
*
|
||||
* @param mesReportWorkConsume 生产报工物料消耗
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesReportWorkConsume(MesReportWorkConsume mesReportWorkConsume);
|
||||
|
||||
/**
|
||||
* 批量删除生产报工物料消耗
|
||||
*
|
||||
* @param recordIds 需要删除的生产报工物料消耗主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesReportWorkConsumeByRecordIds(String[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除生产报工物料消耗信息
|
||||
*
|
||||
* @param recordId 生产报工物料消耗主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesReportWorkConsumeByRecordId(String recordId);
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.op.mes.domain.MesReportWork;
|
||||
|
||||
/**
|
||||
* 报工报表Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public interface IMesReportWorkService {
|
||||
/**
|
||||
* 查询报工报表
|
||||
*
|
||||
* @param id 报工报表主键
|
||||
* @return 报工报表
|
||||
*/
|
||||
public MesReportWork selectMesReportWorkById(String id);
|
||||
|
||||
/**
|
||||
* 查询报工报表列表
|
||||
*
|
||||
* @param mesReportWork 报工报表
|
||||
* @return 报工报表集合
|
||||
*/
|
||||
public List<MesReportWork> selectMesReportWorkList(MesReportWork mesReportWork);
|
||||
|
||||
/**
|
||||
* 新增报工报表
|
||||
*
|
||||
* @param mesReportWork 报工报表
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesReportWork(MesReportWork mesReportWork);
|
||||
|
||||
/**
|
||||
* 修改报工报表
|
||||
*
|
||||
* @param mesReportWork 报工报表
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesReportWork(MesReportWork mesReportWork);
|
||||
|
||||
/**
|
||||
* 批量删除报工报表
|
||||
*
|
||||
* @param ids 需要删除的报工报表主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesReportWorkByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除报工报表信息
|
||||
*
|
||||
* @param id 报工报表主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesReportWorkById(String id);
|
||||
}
|
@ -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.MesReportWorkConsumeMapper;
|
||||
import com.op.mes.domain.MesReportWorkConsume;
|
||||
import com.op.mes.service.IMesReportWorkConsumeService;
|
||||
|
||||
/**
|
||||
* 生产报工物料消耗Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
@Service
|
||||
public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeService {
|
||||
@Autowired
|
||||
private MesReportWorkConsumeMapper mesReportWorkConsumeMapper;
|
||||
|
||||
/**
|
||||
* 查询生产报工物料消耗
|
||||
*
|
||||
* @param recordId 生产报工物料消耗主键
|
||||
* @return 生产报工物料消耗
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public MesReportWorkConsume selectMesReportWorkConsumeByRecordId(String recordId) {
|
||||
return mesReportWorkConsumeMapper.selectMesReportWorkConsumeByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产报工物料消耗列表
|
||||
*
|
||||
* @param mesReportWorkConsume 生产报工物料消耗
|
||||
* @return 生产报工物料消耗
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<MesReportWorkConsume> selectMesReportWorkConsumeList(MesReportWorkConsume mesReportWorkConsume) {
|
||||
return mesReportWorkConsumeMapper.selectMesReportWorkConsumeList(mesReportWorkConsume);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产报工物料消耗
|
||||
*
|
||||
* @param mesReportWorkConsume 生产报工物料消耗
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertMesReportWorkConsume(MesReportWorkConsume mesReportWorkConsume) {
|
||||
mesReportWorkConsume.setCreateTime(DateUtils.getNowDate());
|
||||
return mesReportWorkConsumeMapper.insertMesReportWorkConsume(mesReportWorkConsume);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产报工物料消耗
|
||||
*
|
||||
* @param mesReportWorkConsume 生产报工物料消耗
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateMesReportWorkConsume(MesReportWorkConsume mesReportWorkConsume) {
|
||||
mesReportWorkConsume.setUpdateTime(DateUtils.getNowDate());
|
||||
return mesReportWorkConsumeMapper.updateMesReportWorkConsume(mesReportWorkConsume);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产报工物料消耗
|
||||
*
|
||||
* @param recordIds 需要删除的生产报工物料消耗主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteMesReportWorkConsumeByRecordIds(String[] recordIds) {
|
||||
return mesReportWorkConsumeMapper.deleteMesReportWorkConsumeByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产报工物料消耗信息
|
||||
*
|
||||
* @param recordId 生产报工物料消耗主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteMesReportWorkConsumeByRecordId(String recordId) {
|
||||
return mesReportWorkConsumeMapper.deleteMesReportWorkConsumeByRecordId(recordId);
|
||||
}
|
||||
}
|
@ -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.MesReportWorkMapper;
|
||||
import com.op.mes.domain.MesReportWork;
|
||||
import com.op.mes.service.IMesReportWorkService;
|
||||
|
||||
/**
|
||||
* 报工报表Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
@Service
|
||||
public class MesReportWorkServiceImpl implements IMesReportWorkService {
|
||||
@Autowired
|
||||
private MesReportWorkMapper mesReportWorkMapper;
|
||||
|
||||
/**
|
||||
* 查询报工报表
|
||||
*
|
||||
* @param id 报工报表主键
|
||||
* @return 报工报表
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public MesReportWork selectMesReportWorkById(String id) {
|
||||
return mesReportWorkMapper.selectMesReportWorkById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报工报表列表
|
||||
*
|
||||
* @param mesReportWork 报工报表
|
||||
* @return 报工报表
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<MesReportWork> selectMesReportWorkList(MesReportWork mesReportWork) {
|
||||
return mesReportWorkMapper.selectMesReportWorkList(mesReportWork);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报工报表
|
||||
*
|
||||
* @param mesReportWork 报工报表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertMesReportWork(MesReportWork mesReportWork) {
|
||||
mesReportWork.setCreateTime(DateUtils.getNowDate());
|
||||
return mesReportWorkMapper.insertMesReportWork(mesReportWork);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报工报表
|
||||
*
|
||||
* @param mesReportWork 报工报表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateMesReportWork(MesReportWork mesReportWork) {
|
||||
mesReportWork.setUpdateTime(DateUtils.getNowDate());
|
||||
return mesReportWorkMapper.updateMesReportWork(mesReportWork);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除报工报表
|
||||
*
|
||||
* @param ids 需要删除的报工报表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteMesReportWorkByIds(String[] ids) {
|
||||
return mesReportWorkMapper.deleteMesReportWorkByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报工报表信息
|
||||
*
|
||||
* @param id 报工报表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteMesReportWorkById(String id) {
|
||||
return mesReportWorkMapper.deleteMesReportWorkById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
<?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.MesReportWorkMapper">
|
||||
|
||||
<resultMap type="MesReportWork" id="MesReportWorkResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="reportType" column="report_type" />
|
||||
<result property="reportCode" column="report_code" />
|
||||
<result property="workorderCode" column="workorder_code" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="spec" column="spec" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="quantityFeedback" column="quantity_feedback" />
|
||||
<result property="quantityQualified" column="quantity_qualified" />
|
||||
<result property="quantityUnqualified" column="quantity_unqualified" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="feedbackChannel" column="feedback_channel" />
|
||||
<result property="feedbackTime" column="feedback_time" />
|
||||
<result property="recordUser" column="record_user" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="workTime" column="work_time" />
|
||||
<result property="machineCode" column="machine_code" />
|
||||
<result property="machineName" column="machine_name" />
|
||||
<result property="teamCode" column="team_code" />
|
||||
<result property="shiftCode" column="shift_code" />
|
||||
<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="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesReportWorkVo">
|
||||
select id, report_type, report_code, workorder_code, product_code, product_name, spec, unit, quantity, quantity_feedback, quantity_qualified, quantity_unqualified, user_name, nick_name, feedback_channel, feedback_time, record_user, status, remark, work_time, machine_code, machine_name, team_code, shift_code, attr1, attr2, attr3, attr4, create_by, create_time, update_time, update_by from mes_report_work
|
||||
</sql>
|
||||
|
||||
<select id="selectMesReportWorkList" parameterType="MesReportWork" resultMap="MesReportWorkResult">
|
||||
<include refid="selectMesReportWorkVo"/>
|
||||
<where>
|
||||
<if test="reportType != null and reportType != ''"> and report_type = #{reportType}</if>
|
||||
<if test="reportCode != null and reportCode != ''"> and report_code = #{reportCode}</if>
|
||||
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</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="spec != null and spec != ''"> and spec = #{spec}</if>
|
||||
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="quantityFeedback != null "> and quantity_feedback = #{quantityFeedback}</if>
|
||||
<if test="quantityQualified != null "> and quantity_qualified = #{quantityQualified}</if>
|
||||
<if test="quantityUnqualified != null "> and quantity_unqualified = #{quantityUnqualified}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="feedbackChannel != null and feedbackChannel != ''"> and feedback_channel = #{feedbackChannel}</if>
|
||||
<if test="feedbackTime != null "> and feedback_time = #{feedbackTime}</if>
|
||||
<if test="recordUser != null and recordUser != ''"> and record_user = #{recordUser}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="workTime != null "> and work_time = #{workTime}</if>
|
||||
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
|
||||
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
|
||||
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
|
||||
<if test="shiftCode != null and shiftCode != ''"> and shift_code = #{shiftCode}</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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesReportWorkById" parameterType="String" resultMap="MesReportWorkResult">
|
||||
<include refid="selectMesReportWorkVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesReportWork" parameterType="MesReportWork">
|
||||
insert into mes_report_work
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="reportType != null and reportType != ''">report_type,</if>
|
||||
<if test="reportCode != null">report_code,</if>
|
||||
<if test="workorderCode != null">workorder_code,</if>
|
||||
<if test="productCode != null">product_code,</if>
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="spec != null">spec,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="quantityFeedback != null">quantity_feedback,</if>
|
||||
<if test="quantityQualified != null">quantity_qualified,</if>
|
||||
<if test="quantityUnqualified != null">quantity_unqualified,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="feedbackChannel != null">feedback_channel,</if>
|
||||
<if test="feedbackTime != null">feedback_time,</if>
|
||||
<if test="recordUser != null">record_user,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="workTime != null">work_time,</if>
|
||||
<if test="machineCode != null">machine_code,</if>
|
||||
<if test="machineName != null">machine_name,</if>
|
||||
<if test="teamCode != null">team_code,</if>
|
||||
<if test="shiftCode != null">shift_code,</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="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="reportType != null and reportType != ''">#{reportType},</if>
|
||||
<if test="reportCode != null">#{reportCode},</if>
|
||||
<if test="workorderCode != null">#{workorderCode},</if>
|
||||
<if test="productCode != null">#{productCode},</if>
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="spec != null">#{spec},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="quantityFeedback != null">#{quantityFeedback},</if>
|
||||
<if test="quantityQualified != null">#{quantityQualified},</if>
|
||||
<if test="quantityUnqualified != null">#{quantityUnqualified},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="feedbackChannel != null">#{feedbackChannel},</if>
|
||||
<if test="feedbackTime != null">#{feedbackTime},</if>
|
||||
<if test="recordUser != null">#{recordUser},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="workTime != null">#{workTime},</if>
|
||||
<if test="machineCode != null">#{machineCode},</if>
|
||||
<if test="machineName != null">#{machineName},</if>
|
||||
<if test="teamCode != null">#{teamCode},</if>
|
||||
<if test="shiftCode != null">#{shiftCode},</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="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesReportWork" parameterType="MesReportWork">
|
||||
update mes_report_work
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="reportType != null and reportType != ''">report_type = #{reportType},</if>
|
||||
<if test="reportCode != null">report_code = #{reportCode},</if>
|
||||
<if test="workorderCode != null">workorder_code = #{workorderCode},</if>
|
||||
<if test="productCode != null">product_code = #{productCode},</if>
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="spec != null">spec = #{spec},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="quantityFeedback != null">quantity_feedback = #{quantityFeedback},</if>
|
||||
<if test="quantityQualified != null">quantity_qualified = #{quantityQualified},</if>
|
||||
<if test="quantityUnqualified != null">quantity_unqualified = #{quantityUnqualified},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="feedbackChannel != null">feedback_channel = #{feedbackChannel},</if>
|
||||
<if test="feedbackTime != null">feedback_time = #{feedbackTime},</if>
|
||||
<if test="recordUser != null">record_user = #{recordUser},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="workTime != null">work_time = #{workTime},</if>
|
||||
<if test="machineCode != null">machine_code = #{machineCode},</if>
|
||||
<if test="machineName != null">machine_name = #{machineName},</if>
|
||||
<if test="teamCode != null">team_code = #{teamCode},</if>
|
||||
<if test="shiftCode != null">shift_code = #{shiftCode},</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="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesReportWorkById" parameterType="String">
|
||||
delete from mes_report_work where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesReportWorkByIds" parameterType="String">
|
||||
delete from mes_report_work where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue