diff --git a/os-mes/src/main/java/com/os/mes/prod/controller/ProdPlanExecuteUserController.java b/os-mes/src/main/java/com/os/mes/prod/controller/ProdPlanExecuteUserController.java new file mode 100644 index 0000000..c956b75 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/controller/ProdPlanExecuteUserController.java @@ -0,0 +1,100 @@ +package com.os.mes.prod.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.os.common.annotation.Log; +import com.os.common.core.controller.BaseController; +import com.os.common.core.domain.AjaxResult; +import com.os.common.enums.BusinessType; +import com.os.mes.prod.domain.ProdPlanExecuteUser; +import com.os.mes.prod.service.IProdPlanExecuteUserService; +import com.os.common.utils.poi.ExcelUtil; +import com.os.common.core.page.TableDataInfo; + +/** + * 生产工单执行用户Controller + * + * @author Yinq + * @date 2024-09-26 + */ +@RestController +@RequestMapping("/mes/prod/planExecuteUser") +public class ProdPlanExecuteUserController extends BaseController { + @Autowired + private IProdPlanExecuteUserService prodPlanExecuteUserService; + + /** + * 查询生产工单执行用户列表 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:list')") + @GetMapping("/list") + public TableDataInfo list(ProdPlanExecuteUser prodPlanExecuteUser) { + startPage(); + List list = prodPlanExecuteUserService.selectProdPlanExecuteUserList(prodPlanExecuteUser); + return getDataTable(list); + } + + /** + * 导出生产工单执行用户列表 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:export')") + @Log(title = "生产工单执行用户", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ProdPlanExecuteUser prodPlanExecuteUser) { + List list = prodPlanExecuteUserService.selectProdPlanExecuteUserList(prodPlanExecuteUser); + ExcelUtil util = new ExcelUtil(ProdPlanExecuteUser.class); + util.exportExcel(response, list, "生产工单执行用户数据"); + } + + /** + * 获取生产工单执行用户详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(prodPlanExecuteUserService.selectProdPlanExecuteUserByObjId(objId)); + } + + /** + * 新增生产工单执行用户 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:add')") + @Log(title = "生产工单执行用户", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProdPlanExecuteUser prodPlanExecuteUser) { + prodPlanExecuteUser.setCreateBy(getUsername()); + return toAjax(prodPlanExecuteUserService.insertProdPlanExecuteUser(prodPlanExecuteUser)); + } + + /** + * 修改生产工单执行用户 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:edit')") + @Log(title = "生产工单执行用户", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProdPlanExecuteUser prodPlanExecuteUser) { + prodPlanExecuteUser.setUpdateBy(getUsername()); + return toAjax(prodPlanExecuteUserService.updateProdPlanExecuteUser(prodPlanExecuteUser)); + } + + /** + * 删除生产工单执行用户 + */ + @PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:remove')") + @Log(title = "生产工单执行用户", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(prodPlanExecuteUserService.deleteProdPlanExecuteUserByObjIds(objIds)); + } +} diff --git a/os-mes/src/main/java/com/os/mes/prod/domain/ProdPlanExecuteUser.java b/os-mes/src/main/java/com/os/mes/prod/domain/ProdPlanExecuteUser.java new file mode 100644 index 0000000..08b17bd --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/domain/ProdPlanExecuteUser.java @@ -0,0 +1,266 @@ +package com.os.mes.prod.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.os.common.annotation.Excel; +import com.os.common.core.domain.BaseEntity; + +/** + * 生产工单执行用户对象 prod_plan_execute_user + * + * @author Yinq + * @date 2024-09-26 + */ +public class ProdPlanExecuteUser extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long objId; + + /** + * 订单编号 + */ + @Excel(name = "订单编号") + private String orderCode; + + /** + * 工单编号 + */ + @Excel(name = "工单编号") + private String planCode; + + /** + * 工序编号 + */ + @Excel(name = "工序编号") + private String processCode; + + /** + * 工位编号 + */ + @Excel(name = "工位编号") + private String stationCode; + + /** + * 工位名称 + */ + private String stationName; + + /** + * 员工ID + */ + @Excel(name = "员工ID") + private String staffId; + + /** + * 员工名称 + */ + @Excel(name = "员工名称") + private String staffName; + + /** + * 生产米数 + */ + @Excel(name = "生产米数") + private BigDecimal completeAmount; + + /** + * 工单明细开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "工单明细开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date planBeginDate; + + /** + * 工单明细结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "工单明细结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date planEndDate; + + /** + * 启用标识 + */ + @Excel(name = "启用标识") + private String isFlag; + + /** + * 创建人 + */ + @Excel(name = "创建人") + private String createdBy; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date createdTime; + + /** + * 更新人 + */ + @Excel(name = "更新人") + private String updatedBy; + + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date updatedTime; + + public String getStationName() { + return stationName; + } + + public void setStationName(String stationName) { + this.stationName = stationName; + } + + public String getStaffName() { + return staffName; + } + + public void setStaffName(String staffName) { + this.staffName = staffName; + } + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getOrderCode() { + return orderCode; + } + + public void setPlanCode(String planCode) { + this.planCode = planCode; + } + + public String getPlanCode() { + return planCode; + } + + public void setProcessCode(String processCode) { + this.processCode = processCode; + } + + public String getProcessCode() { + return processCode; + } + + public void setStationCode(String stationCode) { + this.stationCode = stationCode; + } + + public String getStationCode() { + return stationCode; + } + + public void setStaffId(String staffId) { + this.staffId = staffId; + } + + public String getStaffId() { + return staffId; + } + + public void setCompleteAmount(BigDecimal completeAmount) { + this.completeAmount = completeAmount; + } + + public BigDecimal getCompleteAmount() { + return completeAmount; + } + + public void setPlanBeginDate(Date planBeginDate) { + this.planBeginDate = planBeginDate; + } + + public Date getPlanBeginDate() { + return planBeginDate; + } + + public void setPlanEndDate(Date planEndDate) { + this.planEndDate = planEndDate; + } + + public Date getPlanEndDate() { + return planEndDate; + } + + public void setIsFlag(String isFlag) { + this.isFlag = isFlag; + } + + public String getIsFlag() { + return isFlag; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedTime(Date createdTime) { + this.createdTime = createdTime; + } + + public Date getCreatedTime() { + return createdTime; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedTime(Date updatedTime) { + this.updatedTime = updatedTime; + } + + public Date getUpdatedTime() { + return updatedTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("orderCode", getOrderCode()) + .append("planCode", getPlanCode()) + .append("processCode", getProcessCode()) + .append("stationCode", getStationCode()) + .append("staffId", getStaffId()) + .append("completeAmount", getCompleteAmount()) + .append("planBeginDate", getPlanBeginDate()) + .append("planEndDate", getPlanEndDate()) + .append("isFlag", getIsFlag()) + .append("createdBy", getCreatedBy()) + .append("createdTime", getCreatedTime()) + .append("updatedBy", getUpdatedBy()) + .append("updatedTime", getUpdatedTime()) + .toString(); + } +} diff --git a/os-mes/src/main/java/com/os/mes/prod/mapper/ProdPlanExecuteUserMapper.java b/os-mes/src/main/java/com/os/mes/prod/mapper/ProdPlanExecuteUserMapper.java new file mode 100644 index 0000000..9d1e4e9 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/mapper/ProdPlanExecuteUserMapper.java @@ -0,0 +1,61 @@ +package com.os.mes.prod.mapper; + +import java.util.List; + +import com.os.mes.prod.domain.ProdPlanExecuteUser; + +/** + * 生产工单执行用户Mapper接口 + * + * @author Yinq + * @date 2024-09-26 + */ +public interface ProdPlanExecuteUserMapper { + /** + * 查询生产工单执行用户 + * + * @param objId 生产工单执行用户主键 + * @return 生产工单执行用户 + */ + public ProdPlanExecuteUser selectProdPlanExecuteUserByObjId(Long objId); + + /** + * 查询生产工单执行用户列表 + * + * @param prodPlanExecuteUser 生产工单执行用户 + * @return 生产工单执行用户集合 + */ + public List selectProdPlanExecuteUserList(ProdPlanExecuteUser prodPlanExecuteUser); + + /** + * 新增生产工单执行用户 + * + * @param prodPlanExecuteUser 生产工单执行用户 + * @return 结果 + */ + public int insertProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser); + + /** + * 修改生产工单执行用户 + * + * @param prodPlanExecuteUser 生产工单执行用户 + * @return 结果 + */ + public int updateProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser); + + /** + * 删除生产工单执行用户 + * + * @param objId 生产工单执行用户主键 + * @return 结果 + */ + public int deleteProdPlanExecuteUserByObjId(Long objId); + + /** + * 批量删除生产工单执行用户 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteProdPlanExecuteUserByObjIds(Long[] objIds); +} diff --git a/os-mes/src/main/java/com/os/mes/prod/service/IProdPlanExecuteUserService.java b/os-mes/src/main/java/com/os/mes/prod/service/IProdPlanExecuteUserService.java new file mode 100644 index 0000000..3239e2e --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/service/IProdPlanExecuteUserService.java @@ -0,0 +1,61 @@ +package com.os.mes.prod.service; + +import java.util.List; + +import com.os.mes.prod.domain.ProdPlanExecuteUser; + +/** + * 生产工单执行用户Service接口 + * + * @author Yinq + * @date 2024-09-26 + */ +public interface IProdPlanExecuteUserService { + /** + * 查询生产工单执行用户 + * + * @param objId 生产工单执行用户主键 + * @return 生产工单执行用户 + */ + public ProdPlanExecuteUser selectProdPlanExecuteUserByObjId(Long objId); + + /** + * 查询生产工单执行用户列表 + * + * @param prodPlanExecuteUser 生产工单执行用户 + * @return 生产工单执行用户集合 + */ + public List selectProdPlanExecuteUserList(ProdPlanExecuteUser prodPlanExecuteUser); + + /** + * 新增生产工单执行用户 + * + * @param prodPlanExecuteUser 生产工单执行用户 + * @return 结果 + */ + public int insertProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser); + + /** + * 修改生产工单执行用户 + * + * @param prodPlanExecuteUser 生产工单执行用户 + * @return 结果 + */ + public int updateProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser); + + /** + * 批量删除生产工单执行用户 + * + * @param objIds 需要删除的生产工单执行用户主键集合 + * @return 结果 + */ + public int deleteProdPlanExecuteUserByObjIds(Long[] objIds); + + /** + * 删除生产工单执行用户信息 + * + * @param objId 生产工单执行用户主键 + * @return 结果 + */ + public int deleteProdPlanExecuteUserByObjId(Long objId); +} diff --git a/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdPlanExecuteUserServiceImpl.java b/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdPlanExecuteUserServiceImpl.java new file mode 100644 index 0000000..d564a0e --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/prod/service/impl/ProdPlanExecuteUserServiceImpl.java @@ -0,0 +1,87 @@ +package com.os.mes.prod.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.os.mes.prod.mapper.ProdPlanExecuteUserMapper; +import com.os.mes.prod.domain.ProdPlanExecuteUser; +import com.os.mes.prod.service.IProdPlanExecuteUserService; + +/** + * 生产工单执行用户Service业务层处理 + * + * @author Yinq + * @date 2024-09-26 + */ +@Service +public class ProdPlanExecuteUserServiceImpl implements IProdPlanExecuteUserService { + @Autowired + private ProdPlanExecuteUserMapper prodPlanExecuteUserMapper; + + /** + * 查询生产工单执行用户 + * + * @param objId 生产工单执行用户主键 + * @return 生产工单执行用户 + */ + @Override + public ProdPlanExecuteUser selectProdPlanExecuteUserByObjId(Long objId) { + return prodPlanExecuteUserMapper.selectProdPlanExecuteUserByObjId(objId); + } + + /** + * 查询生产工单执行用户列表 + * + * @param prodPlanExecuteUser 生产工单执行用户 + * @return 生产工单执行用户 + */ + @Override + public List selectProdPlanExecuteUserList(ProdPlanExecuteUser prodPlanExecuteUser) { + return prodPlanExecuteUserMapper.selectProdPlanExecuteUserList(prodPlanExecuteUser); + } + + /** + * 新增生产工单执行用户 + * + * @param prodPlanExecuteUser 生产工单执行用户 + * @return 结果 + */ + @Override + public int insertProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser) { + return prodPlanExecuteUserMapper.insertProdPlanExecuteUser(prodPlanExecuteUser); + } + + /** + * 修改生产工单执行用户 + * + * @param prodPlanExecuteUser 生产工单执行用户 + * @return 结果 + */ + @Override + public int updateProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser) { + return prodPlanExecuteUserMapper.updateProdPlanExecuteUser(prodPlanExecuteUser); + } + + /** + * 批量删除生产工单执行用户 + * + * @param objIds 需要删除的生产工单执行用户主键 + * @return 结果 + */ + @Override + public int deleteProdPlanExecuteUserByObjIds(Long[] objIds) { + return prodPlanExecuteUserMapper.deleteProdPlanExecuteUserByObjIds(objIds); + } + + /** + * 删除生产工单执行用户信息 + * + * @param objId 生产工单执行用户主键 + * @return 结果 + */ + @Override + public int deleteProdPlanExecuteUserByObjId(Long objId) { + return prodPlanExecuteUserMapper.deleteProdPlanExecuteUserByObjId(objId); + } +} diff --git a/os-mes/src/main/resources/mapper/mes/prod/ProdPlanExecuteUserMapper.xml b/os-mes/src/main/resources/mapper/mes/prod/ProdPlanExecuteUserMapper.xml new file mode 100644 index 0000000..4059c1b --- /dev/null +++ b/os-mes/src/main/resources/mapper/mes/prod/ProdPlanExecuteUserMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select ppeu.obj_id, + ppeu.order_code, + ppeu.plan_code, + ppeu.process_code, + ppeu.station_code, + ppeu.staff_id, + ppeu.complete_amount, + ppeu.plan_begin_date, + ppeu.plan_end_date, + ppeu.is_flag, + ppeu.created_by, + ppeu.created_time, + ppeu.updated_by, + ppeu.updated_time, + bsi.staff_name, + bpl.product_line_name station_name + from prod_plan_execute_user ppeu + left join base_staff_info bsi on bsi.staff_id = ppeu.staff_id + left join base_product_line bpl on bpl.product_line_code = ppeu.station_code + + + + + + + + insert into prod_plan_execute_user + + order_code, + plan_code, + process_code, + station_code, + staff_id, + complete_amount, + plan_begin_date, + plan_end_date, + is_flag, + created_by, + created_time, + updated_by, + updated_time, + + + #{orderCode}, + #{planCode}, + #{processCode}, + #{stationCode}, + #{staffId}, + #{completeAmount}, + #{planBeginDate}, + #{planEndDate}, + #{isFlag}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + + + + + update prod_plan_execute_user + + order_code = #{orderCode}, + plan_code = #{planCode}, + process_code = #{processCode}, + station_code = #{stationCode}, + staff_id = #{staffId}, + complete_amount = #{completeAmount}, + plan_begin_date = #{planBeginDate}, + plan_end_date = #{planEndDate}, + is_flag = #{isFlag}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, + + where obj_id = #{objId} + + + + delete + from prod_plan_execute_user + where obj_id = #{objId} + + + + delete from prod_plan_execute_user where obj_id in + + #{objId} + + + \ No newline at end of file