Browse Source

[feat]品质管理:

品质单
新增查询品质单详情接口
品质单实体类新增仓库id和仓库名称字段
qualityOrder.html新增品质报告按钮
dev
liuxiaoxu 6 months ago
parent
commit
bf918f68d0
  1. 56
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java
  2. 40
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java
  3. 2
      ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml
  4. 10
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml
  5. 17
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html
  6. 5
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html

56
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java

@ -1,15 +1,16 @@
package com.ruoyi.quality.controller;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.ruoyi.quality.domain.QualityOrderDetail;
import com.ruoyi.quality.service.IQualityOrderDetailService;
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 org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.quality.domain.QualityOrder;
@ -34,6 +35,9 @@ public class QualityOrderController extends BaseController
@Autowired
private IQualityOrderService qualityOrderService;
@Autowired
private IQualityOrderDetailService detailService;
@RequiresPermissions("quality:qualityOrder:view")
@GetMapping()
public String qualityOrder()
@ -113,39 +117,37 @@ public class QualityOrderController extends BaseController
}
/**
* 删除品质管理品质单
* 品质单开始品质
*/
@RequiresPermissions("quality:qualityOrder:remove")
@Log(title = "品质管理品质单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
@GetMapping("/startingQuality/{qualityOrderId}")
public String startingQuality(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap)
{
return toAjax(qualityOrderService.deleteQualityOrderByIds(ids));
QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId);
mmap.put("qualityOrder", qualityOrder);
return prefix + "/startingQuality";
}
/**
* 作废品质管理品质单
* 修改保存品质单开始品质
*/
@RequiresPermissions("quality:qualityOrder:cancel")
@Log(title = "品质管理品质单", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@RequiresPermissions("quality:qualityOrder:startingQuality")
@Log(title = "品质管理品质单", businessType = BusinessType.UPDATE)
@PostMapping("/startingQuality")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(qualityOrderService.cancelQualityOrderById(id));
public AjaxResult startingQualitySave(QualityOrder qualityOrder)
{
return toAjax(qualityOrderService.updateQualityOrder(qualityOrder));
}
/**
* 恢复品质管理品质单
* 品质单详情列表
*/
@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));
@RequestMapping("/detailListGroupedBySupplier")
public Map<String, List<QualityOrderDetail>> detailListGroupedBySupplier(String qualityOrderCode) {
List<QualityOrderDetail> allDetails = detailService.selectQualityOrderDetailListByCode(qualityOrderCode);
Map<String, List<QualityOrderDetail>> groupedDetails = allDetails.stream()
.collect(Collectors.groupingBy(QualityOrderDetail::getSupplierCode));
return groupedDetails;
}
}

40
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java

@ -1,6 +1,8 @@
package com.ruoyi.quality.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -56,6 +58,14 @@ public class QualityOrder extends BaseEntity
@Excel(name = "品质不合格数")
private Integer qualityUnqualifiedNum;
/** 仓库Id */
@Excel(name = "仓库Id")
private String warehouseCode;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String warehouseName;
/** 交付质检时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交付质检时间", width = 30, dateFormat = "yyyy-MM-dd")
@ -65,6 +75,9 @@ public class QualityOrder extends BaseEntity
@Excel(name = "品质员工")
private String qualityEmployee;
/** 品质单详情*/
private List<QualityOrderDetail> qualityOrderDetailList;
public void setQualityOrderId(Long qualityOrderId)
{
this.qualityOrderId = qualityOrderId;
@ -174,6 +187,30 @@ public class QualityOrder extends BaseEntity
return qualityEmployee;
}
public String getWarehouseCode() {
return warehouseCode;
}
public void setWarehouseCode(String warehouseCode) {
this.warehouseCode = warehouseCode;
}
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public List<QualityOrderDetail> getQualityOrderDetailList() {
return qualityOrderDetailList;
}
public void setQualityOrderDetailList(List<QualityOrderDetail> qualityOrderDetailList) {
this.qualityOrderDetailList = qualityOrderDetailList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -189,6 +226,9 @@ public class QualityOrder extends BaseEntity
.append("qualityUnqualifiedNum", getQualityUnqualifiedNum())
.append("deliveryInspectionTime", getDeliveryInspectionTime())
.append("qualityEmployee", getQualityEmployee())
.append("warehouseCode", getWarehouseCode())
.append("warehouseName", getWarehouseName())
.append("qualityOrderDetailList",getQualityOrderDetailList())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())

2
ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml

@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where manufacturing_process_autoid = #{manufacturingProcessAutoid}
</select>
<select id="selectQualityManufacturingProcessByCode" parameterType="Long" resultMap="QualityManufacturingProcessResult">
<select id="selectQualityManufacturingProcessByCode" parameterType="String" resultMap="QualityManufacturingProcessResult">
<include refid="selectQualityManufacturingProcessVo"/>
where manufacturing_process_code = #{manufacturingProcessCode}
</select>

10
ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml

@ -17,6 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="qualityUnqualifiedNum" column="quality_unqualified_num" />
<result property="deliveryInspectionTime" column="delivery_inspection_time" />
<result property="qualityEmployee" column="quality_employee" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -25,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectQualityOrderVo">
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
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, warehouse_code, warehouse_name,delivery_inspection_time, quality_employee, remark, create_by, create_time, update_by, update_time from quality_order
</sql>
<select id="selectQualityOrderList" parameterType="QualityOrder" resultMap="QualityOrderResult">
@ -61,6 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityUnqualifiedNum != null">quality_unqualified_num,</if>
<if test="deliveryInspectionTime != null">delivery_inspection_time,</if>
<if test="qualityEmployee != null">quality_employee,</if>
<if test="warehouseCode != null">warehouse_code,</if>
<if test="warehouseName != null">warehouse_name,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -79,6 +83,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityUnqualifiedNum != null">#{qualityUnqualifiedNum},</if>
<if test="deliveryInspectionTime != null">#{deliveryInspectionTime},</if>
<if test="qualityEmployee != null">#{qualityEmployee},</if>
<if test="warehouseCode != null">#{warehouseCode},</if>
<if test="warehouseName != null">#{warehouseName},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -101,6 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityUnqualifiedNum != null">quality_unqualified_num = #{qualityUnqualifiedNum},</if>
<if test="deliveryInspectionTime != null">delivery_inspection_time = #{deliveryInspectionTime},</if>
<if test="qualityEmployee != null">quality_employee = #{qualityEmployee},</if>
<if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if>
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>

17
ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html

@ -61,9 +61,7 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('quality:qualityOrder:edit')}]];
var removeFlag = [[${@permission.hasPermi('quality:qualityOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('quality:qualityOrder:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('quality:qualityOrder:restore')}]];
var qualityFlag = [[${@permission.hasPermi('quality:qualityOrder:startingQuality')}]];
var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]];
var qualityOrderTypeDatas = [[${@dict.getType('quality_order_type')}]];
var qualityStorageStatusDatas = [[${@dict.getType('quality_storage_status')}]];
@ -163,18 +161,19 @@
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.qualityOrderId + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}
actions.push('<a class="btn btn-success btn-xs ' + qualityFlag + '" href="javascript:void(0)" onclick="startingQuality(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>品质</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
//品质
function startingQuality(qualityOrderId){
var url = ctx +'quality/qualityOrder/startingQuality/' + qualityOrderId;
$.modal.open("进行品质",url)
}
</script>
</body>
</html>

5
ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html

@ -91,6 +91,7 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var qualityOrderCode = [[${qualityOrder.qualityOrderCode}]]
@ -188,6 +189,10 @@
{
title: '本次到货数',
field: 'thisArrivedNum',
editable:{
type:'text'
},
required:true
},
{
title: '品质报告',

Loading…
Cancel
Save