mes报工

highway
A0010407 2 years ago
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,356 @@
package com.op.mes.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* mes_report_work
*
* @author Open Platform
* @date 2023-08-24
*/
public class MesReportWork extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 记录id */
private String id;
/** 报工类型报工类型SELF自行报工、UNI统一报工 */
@Excel(name = "报工类型报工类型SELF自行报工、UNI统一报工")
private String reportType;
/** 报工单编号 */
@Excel(name = "报工单编号")
private String reportCode;
/** 生产工单编码 */
@Excel(name = "生产工单编码")
private String workorderCode;
/** 产品编码 */
@Excel(name = "产品编码")
private String productCode;
/** 产品名称 */
@Excel(name = "产品名称")
private String productName;
/** 规格型号 */
@Excel(name = "规格型号")
private String spec;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 排产数量 */
@Excel(name = "排产数量")
private BigDecimal quantity;
/** 本次报工数量 */
@Excel(name = "本次报工数量")
private BigDecimal quantityFeedback;
/** 合格数量 */
@Excel(name = "合格数量")
private BigDecimal quantityQualified;
/** 不合格数量 */
@Excel(name = "不合格数量")
private BigDecimal quantityUnqualified;
/** 报工人员 */
@Excel(name = "报工人员")
private String userName;
/** 人员名称 */
@Excel(name = "人员名称")
private String nickName;
/** 报工途径PAD、MOBILE、PC */
@Excel(name = "报工途径PAD、MOBILE、PC")
private String feedbackChannel;
/** 报工时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报工时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date feedbackTime;
/** 录入人员 */
@Excel(name = "录入人员")
private String recordUser;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 工时 */
@Excel(name = "工时")
private Long workTime;
/** 线体编码 */
@Excel(name = "线体编码")
private String machineCode;
/** 线体名称 */
@Excel(name = "线体名称")
private String machineName;
/** 班组编码 */
@Excel(name = "班组编码")
private String teamCode;
/** 班次编码 */
@Excel(name = "班次编码")
private String shiftCode;
/** 预留字段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;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setReportType(String reportType) {
this.reportType = reportType;
}
public String getReportType() {
return reportType;
}
public void setReportCode(String reportCode) {
this.reportCode = reportCode;
}
public String getReportCode() {
return reportCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getSpec() {
return spec;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getUnit() {
return unit;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantityFeedback(BigDecimal quantityFeedback) {
this.quantityFeedback = quantityFeedback;
}
public BigDecimal getQuantityFeedback() {
return quantityFeedback;
}
public void setQuantityQualified(BigDecimal quantityQualified) {
this.quantityQualified = quantityQualified;
}
public BigDecimal getQuantityQualified() {
return quantityQualified;
}
public void setQuantityUnqualified(BigDecimal quantityUnqualified) {
this.quantityUnqualified = quantityUnqualified;
}
public BigDecimal getQuantityUnqualified() {
return quantityUnqualified;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserName() {
return userName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getNickName() {
return nickName;
}
public void setFeedbackChannel(String feedbackChannel) {
this.feedbackChannel = feedbackChannel;
}
public String getFeedbackChannel() {
return feedbackChannel;
}
public void setFeedbackTime(Date feedbackTime) {
this.feedbackTime = feedbackTime;
}
public Date getFeedbackTime() {
return feedbackTime;
}
public void setRecordUser(String recordUser) {
this.recordUser = recordUser;
}
public String getRecordUser() {
return recordUser;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setWorkTime(Long workTime) {
this.workTime = workTime;
}
public Long getWorkTime() {
return workTime;
}
public void setMachineCode(String machineCode) {
this.machineCode = machineCode;
}
public String getMachineCode() {
return machineCode;
}
public void setMachineName(String machineName) {
this.machineName = machineName;
}
public String getMachineName() {
return machineName;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamCode() {
return teamCode;
}
public void setShiftCode(String shiftCode) {
this.shiftCode = shiftCode;
}
public String getShiftCode() {
return shiftCode;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("reportType", getReportType())
.append("reportCode", getReportCode())
.append("workorderCode", getWorkorderCode())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("spec", getSpec())
.append("unit", getUnit())
.append("quantity", getQuantity())
.append("quantityFeedback", getQuantityFeedback())
.append("quantityQualified", getQuantityQualified())
.append("quantityUnqualified", getQuantityUnqualified())
.append("userName", getUserName())
.append("nickName", getNickName())
.append("feedbackChannel", getFeedbackChannel())
.append("feedbackTime", getFeedbackTime())
.append("recordUser", getRecordUser())
.append("status", getStatus())
.append("remark", getRemark())
.append("workTime", getWorkTime())
.append("machineCode", getMachineCode())
.append("machineName", getMachineName())
.append("teamCode", getTeamCode())
.append("shiftCode", getShiftCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

@ -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…
Cancel
Save