diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java new file mode 100644 index 00000000..05283f2b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java @@ -0,0 +1,151 @@ +package com.ruoyi.quality.controller; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.quality.domain.QualityOrder; +import com.ruoyi.quality.service.IQualityOrderService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 品质管理品质单Controller + * + * @author 刘晓旭 + * @date 2024-05-20 + */ +@Controller +@RequestMapping("/quality/qualityOrder") +public class QualityOrderController extends BaseController +{ + private String prefix = "quality/qualityOrder"; + + @Autowired + private IQualityOrderService qualityOrderService; + + @RequiresPermissions("quality:qualityOrder:view") + @GetMapping() + public String qualityOrder() + { + return prefix + "/qualityOrder"; + } + + /** + * 查询品质管理品质单列表 + */ + @RequiresPermissions("quality:qualityOrder:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(QualityOrder qualityOrder) + { + startPage(); + List list = qualityOrderService.selectQualityOrderList(qualityOrder); + return getDataTable(list); + } + + /** + * 导出品质管理品质单列表 + */ + @RequiresPermissions("quality:qualityOrder:export") + @Log(title = "品质管理品质单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(QualityOrder qualityOrder) + { + List list = qualityOrderService.selectQualityOrderList(qualityOrder); + ExcelUtil util = new ExcelUtil(QualityOrder.class); + return util.exportExcel(list, "品质管理品质单数据"); + } + + /** + * 新增品质管理品质单 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存品质管理品质单 + */ + @RequiresPermissions("quality:qualityOrder:add") + @Log(title = "品质管理品质单", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(QualityOrder qualityOrder) + { + return toAjax(qualityOrderService.insertQualityOrder(qualityOrder)); + } + + /** + * 修改品质管理品质单 + */ + @GetMapping("/edit/{qualityOrderId}") + public String edit(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap) + { + QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId); + mmap.put("qualityOrder", qualityOrder); + return prefix + "/edit"; + } + + /** + * 修改保存品质管理品质单 + */ + @RequiresPermissions("quality:qualityOrder:edit") + @Log(title = "品质管理品质单", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(QualityOrder qualityOrder) + { + return toAjax(qualityOrderService.updateQualityOrder(qualityOrder)); + } + + /** + * 删除品质管理品质单 + */ + @RequiresPermissions("quality:qualityOrder:remove") + @Log(title = "品质管理品质单", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(qualityOrderService.deleteQualityOrderByIds(ids)); + } + + /** + * 作废品质管理品质单 + */ + @RequiresPermissions("quality:qualityOrder:cancel") + @Log(title = "品质管理品质单", businessType = BusinessType.CANCEL) + @GetMapping( "/cancel/{id}") + @ResponseBody + public AjaxResult cancel(@PathVariable("id") Long id){ + return toAjax(qualityOrderService.cancelQualityOrderById(id)); + } + + /** + * 恢复品质管理品质单 + */ + @RequiresPermissions("quality:qualityOrder:restore") + @Log(title = "品质管理品质单", businessType = BusinessType.RESTORE) + @GetMapping( "/restore/{id}") + @ResponseBody + public AjaxResult restore(@PathVariable("id")Long id) + { + return toAjax(qualityOrderService.restoreQualityOrderById(id)); + } + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java new file mode 100644 index 00000000..387e220c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java @@ -0,0 +1,199 @@ +package com.ruoyi.quality.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.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 品质管理品质单对象 quality_order + * + * @author 刘晓旭 + * @date 2024-05-20 + */ +public class QualityOrder extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 品质单Id */ + private Long qualityOrderId; + + /** 品质单号 */ + @Excel(name = "品质单号") + private String qualityOrderCode; + + /** 入库单号 */ + @Excel(name = "入库单号") + private String inStorageCode; + + /** 关联订单号 */ + @Excel(name = "关联订单号") + private String relatedOrderCode; + + /** 品质状态 */ + @Excel(name = "品质状态") + private String qualityStatus; + + /** 品质单订单类型 */ + @Excel(name = "品质单订单类型") + private String qualityOrderType; + + /** 品质单入库类型 */ + @Excel(name = "品质单入库类型") + private String qualityStorageStatus; + + /** 本次到货数量 */ + @Excel(name = "本次到货数量") + private Integer thisArrivedNum; + + /** 品质合格数 */ + @Excel(name = "品质合格数") + private Integer qualityQualifiedNum; + + /** 品质不合格数 */ + @Excel(name = "品质不合格数") + private Integer qualityUnqualifiedNum; + + /** 交付质检时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "交付质检时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date deliveryInspectionTime; + + /** 品质员工 */ + @Excel(name = "品质员工") + private String qualityEmployee; + + public void setQualityOrderId(Long qualityOrderId) + { + this.qualityOrderId = qualityOrderId; + } + + public Long getQualityOrderId() + { + return qualityOrderId; + } + public void setQualityOrderCode(String qualityOrderCode) + { + this.qualityOrderCode = qualityOrderCode; + } + + public String getQualityOrderCode() + { + return qualityOrderCode; + } + public void setInStorageCode(String inStorageCode) + { + this.inStorageCode = inStorageCode; + } + + public String getInStorageCode() + { + return inStorageCode; + } + public void setRelatedOrderCode(String relatedOrderCode) + { + this.relatedOrderCode = relatedOrderCode; + } + + public String getRelatedOrderCode() + { + return relatedOrderCode; + } + public void setQualityStatus(String qualityStatus) + { + this.qualityStatus = qualityStatus; + } + + public String getQualityStatus() + { + return qualityStatus; + } + public void setQualityOrderType(String qualityOrderType) + { + this.qualityOrderType = qualityOrderType; + } + + public String getQualityOrderType() + { + return qualityOrderType; + } + public void setQualityStorageStatus(String qualityStorageStatus) + { + this.qualityStorageStatus = qualityStorageStatus; + } + + public String getQualityStorageStatus() + { + return qualityStorageStatus; + } + public void setThisArrivedNum(Integer thisArrivedNum) + { + this.thisArrivedNum = thisArrivedNum; + } + + public Integer getThisArrivedNum() + { + return thisArrivedNum; + } + public void setQualityQualifiedNum(Integer qualityQualifiedNum) + { + this.qualityQualifiedNum = qualityQualifiedNum; + } + + public Integer getQualityQualifiedNum() + { + return qualityQualifiedNum; + } + public void setQualityUnqualifiedNum(Integer qualityUnqualifiedNum) + { + this.qualityUnqualifiedNum = qualityUnqualifiedNum; + } + + public Integer getQualityUnqualifiedNum() + { + return qualityUnqualifiedNum; + } + public void setDeliveryInspectionTime(Date deliveryInspectionTime) + { + this.deliveryInspectionTime = deliveryInspectionTime; + } + + public Date getDeliveryInspectionTime() + { + return deliveryInspectionTime; + } + public void setQualityEmployee(String qualityEmployee) + { + this.qualityEmployee = qualityEmployee; + } + + public String getQualityEmployee() + { + return qualityEmployee; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("qualityOrderId", getQualityOrderId()) + .append("qualityOrderCode", getQualityOrderCode()) + .append("inStorageCode", getInStorageCode()) + .append("relatedOrderCode", getRelatedOrderCode()) + .append("qualityStatus", getQualityStatus()) + .append("qualityOrderType", getQualityOrderType()) + .append("qualityStorageStatus", getQualityStorageStatus()) + .append("thisArrivedNum", getThisArrivedNum()) + .append("qualityQualifiedNum", getQualityQualifiedNum()) + .append("qualityUnqualifiedNum", getQualityUnqualifiedNum()) + .append("deliveryInspectionTime", getDeliveryInspectionTime()) + .append("qualityEmployee", getQualityEmployee()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderMapper.java new file mode 100644 index 00000000..634f35ef --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.quality.mapper; + +import java.util.List; +import com.ruoyi.quality.domain.QualityOrder; + +/** + * 品质管理品质单Mapper接口 + * + * @author 刘晓旭 + * @date 2024-05-20 + */ +public interface QualityOrderMapper +{ + /** + * 查询品质管理品质单 + * + * @param qualityOrderId 品质管理品质单ID + * @return 品质管理品质单 + */ + public QualityOrder selectQualityOrderById(Long qualityOrderId); + + /** + * 查询品质管理品质单列表 + * + * @param qualityOrder 品质管理品质单 + * @return 品质管理品质单集合 + */ + public List selectQualityOrderList(QualityOrder qualityOrder); + + /** + * 新增品质管理品质单 + * + * @param qualityOrder 品质管理品质单 + * @return 结果 + */ + public int insertQualityOrder(QualityOrder qualityOrder); + + /** + * 修改品质管理品质单 + * + * @param qualityOrder 品质管理品质单 + * @return 结果 + */ + public int updateQualityOrder(QualityOrder qualityOrder); + + /** + * 删除品质管理品质单 + * + * @param qualityOrderId 品质管理品质单ID + * @return 结果 + */ + public int deleteQualityOrderById(Long qualityOrderId); + + /** + * 批量删除品质管理品质单 + * + * @param qualityOrderIds 需要删除的数据ID + * @return 结果 + */ + public int deleteQualityOrderByIds(String[] qualityOrderIds); + + /** + * 作废品质管理品质单 + * + * @param qualityOrderId 品质管理品质单ID + * @return 结果 + */ + public int cancelQualityOrderById(Long qualityOrderId); + + /** + * 恢复品质管理品质单 + * + * @param qualityOrderId 品质管理品质单ID + * @return 结果 + */ + public int restoreQualityOrderById(Long qualityOrderId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java new file mode 100644 index 00000000..3d681473 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java @@ -0,0 +1,75 @@ +package com.ruoyi.quality.service; + +import java.util.List; +import com.ruoyi.quality.domain.QualityOrder; + +/** + * 品质管理品质单Service接口 + * + * @author 刘晓旭 + * @date 2024-05-20 + */ +public interface IQualityOrderService +{ + /** + * 查询品质管理品质单 + * + * @param qualityOrderId 品质管理品质单ID + * @return 品质管理品质单 + */ + public QualityOrder selectQualityOrderById(Long qualityOrderId); + + /** + * 查询品质管理品质单列表 + * + * @param qualityOrder 品质管理品质单 + * @return 品质管理品质单集合 + */ + public List selectQualityOrderList(QualityOrder qualityOrder); + + /** + * 新增品质管理品质单 + * + * @param qualityOrder 品质管理品质单 + * @return 结果 + */ + public int insertQualityOrder(QualityOrder qualityOrder); + + /** + * 修改品质管理品质单 + * + * @param qualityOrder 品质管理品质单 + * @return 结果 + */ + public int updateQualityOrder(QualityOrder qualityOrder); + + /** + * 批量删除品质管理品质单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteQualityOrderByIds(String ids); + + /** + * 删除品质管理品质单信息 + * + * @param qualityOrderId 品质管理品质单ID + * @return 结果 + */ + public int deleteQualityOrderById(Long qualityOrderId); + + /** + * 作废品质管理品质单 + * @param qualityOrderId 品质管理品质单ID + * @return + */ + int cancelQualityOrderById(Long qualityOrderId); + + /** + * 恢复品质管理品质单 + * @param qualityOrderId 品质管理品质单ID + * @return + */ + int restoreQualityOrderById(Long qualityOrderId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java new file mode 100644 index 00000000..0beb2176 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java @@ -0,0 +1,126 @@ +package com.ruoyi.quality.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.quality.mapper.QualityOrderMapper; +import com.ruoyi.quality.domain.QualityOrder; +import com.ruoyi.quality.service.IQualityOrderService; +import com.ruoyi.common.core.text.Convert; + +/** + * 品质管理品质单Service业务层处理 + * + * @author 刘晓旭 + * @date 2024-05-20 + */ +@Service +public class QualityOrderServiceImpl implements IQualityOrderService +{ + @Autowired + private QualityOrderMapper qualityOrderMapper; + + /** + * 查询品质管理品质单 + * + * @param qualityOrderId 品质管理品质单ID + * @return 品质管理品质单 + */ + @Override + public QualityOrder selectQualityOrderById(Long qualityOrderId) + { + return qualityOrderMapper.selectQualityOrderById(qualityOrderId); + } + + /** + * 查询品质管理品质单列表 + * + * @param qualityOrder 品质管理品质单 + * @return 品质管理品质单 + */ + @Override + public List selectQualityOrderList(QualityOrder qualityOrder) + { + return qualityOrderMapper.selectQualityOrderList(qualityOrder); + } + + /** + * 新增品质管理品质单 + * + * @param qualityOrder 品质管理品质单 + * @return 结果 + */ + @Override + public int insertQualityOrder(QualityOrder qualityOrder) + { + String loginName = ShiroUtils.getLoginName(); + qualityOrder.setCreateBy(loginName); + qualityOrder.setCreateTime(DateUtils.getNowDate()); + return qualityOrderMapper.insertQualityOrder(qualityOrder); + } + + /** + * 修改品质管理品质单 + * + * @param qualityOrder 品质管理品质单 + * @return 结果 + */ + @Override + public int updateQualityOrder(QualityOrder qualityOrder) + { + String loginName = ShiroUtils.getLoginName(); + qualityOrder.setUpdateBy(loginName); + qualityOrder.setUpdateTime(DateUtils.getNowDate()); + return qualityOrderMapper.updateQualityOrder(qualityOrder); + } + + /** + * 删除品质管理品质单对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteQualityOrderByIds(String ids) + { + return qualityOrderMapper.deleteQualityOrderByIds(Convert.toStrArray(ids)); + } + + /** + * 删除品质管理品质单信息 + * + * @param qualityOrderId 品质管理品质单ID + * @return 结果 + */ + @Override + public int deleteQualityOrderById(Long qualityOrderId) + { + return qualityOrderMapper.deleteQualityOrderById(qualityOrderId); + } + + /** + * 作废品质管理品质单 + * + * @param qualityOrderId 品质管理品质单ID + * @return 结果 + */ + @Override + public int cancelQualityOrderById(Long qualityOrderId) + { + return qualityOrderMapper.cancelQualityOrderById(qualityOrderId); + } + + /** + * 恢复品质管理品质单信息 + * + * @param qualityOrderId 品质管理品质单ID + * @return 结果 + */ + @Override + public int restoreQualityOrderById(Long qualityOrderId) + { + return qualityOrderMapper.restoreQualityOrderById(qualityOrderId); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml new file mode 100644 index 00000000..ca193dc5 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select quality_order_id, quality_order_code, in_storage_code, related_order_code, quality_status, quality_order_type, quality_storage_status, this_arrived_num, quality_qualified_num, quality_unqualified_num, delivery_inspection_time, quality_employee, remark, create_by, create_time, update_by, update_time from quality_order + + + + + + + + insert into quality_order + + quality_order_code, + in_storage_code, + related_order_code, + quality_status, + quality_order_type, + quality_storage_status, + this_arrived_num, + quality_qualified_num, + quality_unqualified_num, + delivery_inspection_time, + quality_employee, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{qualityOrderCode}, + #{inStorageCode}, + #{relatedOrderCode}, + #{qualityStatus}, + #{qualityOrderType}, + #{qualityStorageStatus}, + #{thisArrivedNum}, + #{qualityQualifiedNum}, + #{qualityUnqualifiedNum}, + #{deliveryInspectionTime}, + #{qualityEmployee}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update quality_order + + quality_order_code = #{qualityOrderCode}, + in_storage_code = #{inStorageCode}, + related_order_code = #{relatedOrderCode}, + quality_status = #{qualityStatus}, + quality_order_type = #{qualityOrderType}, + quality_storage_status = #{qualityStorageStatus}, + this_arrived_num = #{thisArrivedNum}, + quality_qualified_num = #{qualityQualifiedNum}, + quality_unqualified_num = #{qualityUnqualifiedNum}, + delivery_inspection_time = #{deliveryInspectionTime}, + quality_employee = #{qualityEmployee}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where quality_order_id = #{qualityOrderId} + + + + delete from quality_order where quality_order_id = #{qualityOrderId} + + + + delete from quality_order where quality_order_id in + + #{qualityOrderId} + + + + + update quality_order set del_flag = '1' where quality_order_id = #{qualityOrderId} + + + + update quality_order set del_flag = '0' where quality_order_id = #{qualityOrderId} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html new file mode 100644 index 00000000..41cccdbc --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html @@ -0,0 +1,180 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file