Browse Source
品质管理 品质单 修改品质单controller,新增跳转选择出货设备方法、生产入库品质单(其他)开始品质方法; 修改品质单、品质单详情、品质单报告mapper,新增字段; 修改品质报告单service,去除多余方法,新增添加生产成品品质单报告方法、修改保存品质报告按钮、审批流程启动、创建品质报告审核流程、审核通过后更新数据、审核拒绝后更新数据方法; 修改不良分类对象和mapper,新增字段; 修改入库单service相关字段类型; 新增品质报告controller、品质报告关联设备对象和mapper;dev
王晓迪
3 days ago
14 changed files with 1322 additions and 394 deletions
@ -0,0 +1,278 @@ |
|||
package com.ruoyi.quality.controller; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
|
|||
import com.ruoyi.process.general.service.IProcessService; |
|||
import com.ruoyi.quality.domain.QualityOrderReportUnqualified; |
|||
import com.ruoyi.quality.domain.QualityShippingDevice; |
|||
import com.ruoyi.quality.domain.VO.QualityOrderReportVO; |
|||
import com.ruoyi.quality.service.IQualityOrderReportUnqualifiedService; |
|||
import com.ruoyi.quality.service.IQualityShippingDeviceService; |
|||
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO; |
|||
import com.ruoyi.system.service.ISysRoleService; |
|||
import com.ruoyi.warehouse.service.IWarehouseOutOrderService; |
|||
import org.activiti.engine.RuntimeService; |
|||
import org.activiti.engine.TaskService; |
|||
import org.activiti.engine.runtime.ProcessInstance; |
|||
import org.activiti.engine.task.Task; |
|||
import org.apache.commons.lang3.BooleanUtils; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.quality.domain.QualityOrderReport; |
|||
import com.ruoyi.quality.service.IQualityOrderReportService; |
|||
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; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpSession; |
|||
|
|||
/** |
|||
* 品质管理品质报告单Controller |
|||
* |
|||
* @author 刘晓旭 |
|||
* @date 2024-11-19 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/quality/qualityReport") |
|||
public class QualityOrderReportController extends BaseController |
|||
{ |
|||
private String prefix = "quality/qualityReport"; |
|||
|
|||
@Autowired |
|||
private IQualityOrderReportService qualityOrderReportService; |
|||
|
|||
@Autowired |
|||
private IQualityShippingDeviceService qualityShippingDeviceService; |
|||
|
|||
@Autowired |
|||
private IQualityOrderReportUnqualifiedService unqualifiedService; |
|||
|
|||
@Autowired |
|||
private TaskService taskService; |
|||
|
|||
@Autowired |
|||
private RuntimeService runtimeService; |
|||
|
|||
@Autowired |
|||
private IProcessService processService; |
|||
|
|||
@Autowired |
|||
private ISysRoleService roleService; |
|||
|
|||
@RequiresPermissions("quality:qualityReport:view") |
|||
@GetMapping() |
|||
public String qualityReport() |
|||
{ |
|||
return prefix + "/qualityReport"; |
|||
} |
|||
|
|||
|
|||
@RequiresPermissions("quality:qualityReport:iqcView") |
|||
@GetMapping("/iqcQualityReport") |
|||
public String iqcQualityReport() |
|||
{ |
|||
return prefix + "/iqcQualityReport"; |
|||
} |
|||
|
|||
/** |
|||
* 查询品质管理品质单报告列表 |
|||
*/ |
|||
@RequiresPermissions("quality:qualityReport:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(QualityOrderReportVO qualityOrderReport) |
|||
{ |
|||
startPage(); |
|||
List<QualityOrderReportVO> list = qualityOrderReportService.selectQualityOrderReportList(qualityOrderReport); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出品质管理品质单报告列表 |
|||
*/ |
|||
@RequiresPermissions("quality:qualityReport:export") |
|||
@Log(title = "品质管理品质单报告", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(QualityOrderReportVO qualityOrderReport) |
|||
{ |
|||
List<QualityOrderReportVO> list = qualityOrderReportService.selectQualityOrderReportList(qualityOrderReport); |
|||
ExcelUtil<QualityOrderReportVO> util = new ExcelUtil<QualityOrderReportVO>(QualityOrderReportVO.class); |
|||
return util.exportExcel(list, "品质管理品质单报告数据"); |
|||
} |
|||
|
|||
/** |
|||
* 新增品质管理品质单报告 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存品质管理品质报告单 |
|||
*/ |
|||
@Log(title = "品质报告单", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(@RequestBody QualityOrderReportVO qualityOrderReportVO) |
|||
{ |
|||
qualityOrderReportVO.setAuditStatus("0"); |
|||
qualityOrderReportService.submitApply(qualityOrderReportVO); |
|||
return AjaxResult.success(); |
|||
} |
|||
|
|||
/** |
|||
* 加载审批弹窗 |
|||
* @param taskId |
|||
* @param mmap |
|||
* @return |
|||
*/ |
|||
@GetMapping("/showVerifyDialog/{taskId}") |
|||
public String showVerifyDialog(@PathVariable("taskId") String taskId, ModelMap mmap) { |
|||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); |
|||
String processInstanceId = task.getProcessInstanceId(); |
|||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); |
|||
QualityOrderReportVO qualityOrderReportVO = qualityOrderReportService.selectQualityOrderReportById(new Long(processInstance.getBusinessKey())); |
|||
mmap.put("formData", qualityOrderReportVO); |
|||
mmap.put("taskId", taskId); |
|||
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1); |
|||
return prefix + "/task" + verifyName; |
|||
} |
|||
/** |
|||
* 自动绑定页面字段 |
|||
*/ |
|||
@ModelAttribute("preloadObj") |
|||
public QualityOrderReportVO getObj(@RequestParam(value = "requisiteId", required = false) Long qualityOrderReportId, HttpSession session) { |
|||
if (qualityOrderReportId != null) { |
|||
|
|||
return qualityOrderReportService.selectQualityOrderReportById(qualityOrderReportId); |
|||
} |
|||
return new QualityOrderReportVO(); |
|||
} |
|||
/** |
|||
* 完成任务 |
|||
* |
|||
* @return |
|||
*/ |
|||
@RequestMapping(value = "/complete/{taskId}", method = {RequestMethod.POST, RequestMethod.GET}) |
|||
@ResponseBody |
|||
public AjaxResult complete(@PathVariable("taskId") String taskId, @RequestParam(value = "saveEntity", required = false) String saveEntity, |
|||
@ModelAttribute("preloadObj") QualityOrderReportVO qualityOrderReportVO, HttpServletRequest request) { |
|||
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity); |
|||
//获取实例id
|
|||
String instanceId = qualityOrderReportVO.getInstanceId(); |
|||
//获取实例类型
|
|||
String instanceType = qualityOrderReportVO.getInstanceType(); |
|||
boolean approvedFlag = processService.complete(taskId, instanceId, qualityOrderReportVO.getApplyTitle(), qualityOrderReportVO.getQualityOrderReportCode(), "qualityOrderReport", new HashMap<String, Object>(), request); |
|||
QualityOrderReportVO tempQualityReport = qualityOrderReportService.selectQualityOrderReportById(qualityOrderReportVO.getQualityOrderReportId()); |
|||
// 如果任务已结束更新业务表状态
|
|||
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId); |
|||
if (processIsFinish) { |
|||
|
|||
if(!approvedFlag){ |
|||
// 审核状态-审核拒绝
|
|||
tempQualityReport.setAuditStatus("2"); |
|||
qualityOrderReportService.updateDisApprovedInfo(tempQualityReport); |
|||
}else{ |
|||
// 审核状态-审核通过
|
|||
tempQualityReport.setAuditStatus("1"); |
|||
//生产品质
|
|||
if(tempQualityReport.getQualityOrderReportType().equals("0") |
|||
||tempQualityReport.getQualityOrderReportType().equals("1")){ |
|||
qualityOrderReportService.updateApprovedInfo(tempQualityReport); |
|||
} |
|||
} |
|||
} |
|||
qualityOrderReportService.updateMakeOrderQualityReport(tempQualityReport); |
|||
return success("任务已完成"); |
|||
} |
|||
|
|||
/** |
|||
* 品质管理品质单报告详情 |
|||
*/ |
|||
@GetMapping("/detail/{qualityOrderReportId}") |
|||
public String detail(@PathVariable("qualityOrderReportId") Long qualityOrderReportId, ModelMap mmap) |
|||
{ |
|||
QualityOrderReportVO qualityOrderReport = qualityOrderReportService.selectQualityOrderReportById(qualityOrderReportId); |
|||
mmap.put("qualityOrderReport", qualityOrderReport); |
|||
return prefix + "/detail"; |
|||
} |
|||
|
|||
@PostMapping("/getReportDevice") |
|||
@ResponseBody |
|||
public TableDataInfo getReportDevice(QualityShippingDevice qualityShippingDevice) |
|||
{ |
|||
startPage(); |
|||
List<QualityShippingDevice> list = qualityShippingDeviceService.selectQualityShippingDeviceList(qualityShippingDevice); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
@PostMapping("/getReportUnqualified") |
|||
@ResponseBody |
|||
public TableDataInfo getReportUnqualified(QualityOrderReportUnqualified unqualified) |
|||
{ |
|||
startPage(); |
|||
List<QualityOrderReportUnqualified> list = unqualifiedService.selectQualityOrderReportUnqualifiedList(unqualified); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 修改保存品质管理品质单报告 |
|||
*/ |
|||
@RequiresPermissions("quality:qualityReport:edit") |
|||
@Log(title = "品质管理品质单报告", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(QualityOrderReport qualityOrderReport) |
|||
{ |
|||
return toAjax(qualityOrderReportService.updateQualityOrderReport(qualityOrderReport)); |
|||
} |
|||
|
|||
/** |
|||
* 删除品质管理品质单报告 |
|||
*/ |
|||
@RequiresPermissions("quality:qualityReport:remove") |
|||
@Log(title = "品质管理品质单报告", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return toAjax(qualityOrderReportService.deleteQualityOrderReportByIds(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 作废品质管理品质单报告 |
|||
*/ |
|||
@RequiresPermissions("quality:qualityReport:cancel") |
|||
@Log(title = "品质管理品质单报告", businessType = BusinessType.CANCEL) |
|||
@GetMapping( "/cancel/{id}") |
|||
@ResponseBody |
|||
public AjaxResult cancel(@PathVariable("id") Long id){ |
|||
return toAjax(qualityOrderReportService.cancelQualityOrderReportById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 恢复品质管理品质单报告 |
|||
*/ |
|||
@RequiresPermissions("quality:qualityReport:restore") |
|||
@Log(title = "品质管理品质单报告", businessType = BusinessType.RESTORE) |
|||
@GetMapping( "/restore/{id}") |
|||
@ResponseBody |
|||
public AjaxResult restore(@PathVariable("id")Long id) |
|||
{ |
|||
return toAjax(qualityOrderReportService.restoreQualityOrderReportById(id)); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,65 @@ |
|||
package com.ruoyi.quality.domain; |
|||
|
|||
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_report_device |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-11-19 |
|||
*/ |
|||
public class QualityReportDevice extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
private Long id; |
|||
|
|||
/** 出货设备id */ |
|||
@Excel(name = "出货设备id") |
|||
private String shippingDeviceId; |
|||
|
|||
/** 关联品质报告单号 */ |
|||
@Excel(name = "关联品质报告单号") |
|||
private String qualityOrderReportCode; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setShippingDeviceId(String shippingDeviceId) |
|||
{ |
|||
this.shippingDeviceId = shippingDeviceId; |
|||
} |
|||
|
|||
public String getShippingDeviceId() |
|||
{ |
|||
return shippingDeviceId; |
|||
} |
|||
public void setQualityOrderReportCode(String qualityOrderReportCode) |
|||
{ |
|||
this.qualityOrderReportCode = qualityOrderReportCode; |
|||
} |
|||
|
|||
public String getQualityOrderReportCode() |
|||
{ |
|||
return qualityOrderReportCode; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("shippingDeviceId", getShippingDeviceId()) |
|||
.append("qualityOrderReportCode", getQualityOrderReportCode()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,77 @@ |
|||
package com.ruoyi.quality.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.quality.domain.QualityReportDevice; |
|||
|
|||
/** |
|||
* 品质报告单关联出货设备Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-11-19 |
|||
*/ |
|||
public interface QualityReportDeviceMapper |
|||
{ |
|||
/** |
|||
* 查询品质报告单关联出货设备 |
|||
* |
|||
* @param id 品质报告单关联出货设备ID |
|||
* @return 品质报告单关联出货设备 |
|||
*/ |
|||
public QualityReportDevice selectQualityReportDeviceById(Long id); |
|||
|
|||
/** |
|||
* 查询品质报告单关联出货设备列表 |
|||
* |
|||
* @param qualityReportDevice 品质报告单关联出货设备 |
|||
* @return 品质报告单关联出货设备集合 |
|||
*/ |
|||
public List<QualityReportDevice> selectQualityReportDeviceList(QualityReportDevice qualityReportDevice); |
|||
|
|||
/** |
|||
* 新增品质报告单关联出货设备 |
|||
* |
|||
* @param qualityReportDevice 品质报告单关联出货设备 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertQualityReportDevice(QualityReportDevice qualityReportDevice); |
|||
|
|||
/** |
|||
* 修改品质报告单关联出货设备 |
|||
* |
|||
* @param qualityReportDevice 品质报告单关联出货设备 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateQualityReportDevice(QualityReportDevice qualityReportDevice); |
|||
|
|||
/** |
|||
* 删除品质报告单关联出货设备 |
|||
* |
|||
* @param id 品质报告单关联出货设备ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteQualityReportDeviceById(Long id); |
|||
|
|||
/** |
|||
* 批量删除品质报告单关联出货设备 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteQualityReportDeviceByIds(String[] ids); |
|||
|
|||
/** |
|||
* 作废品质报告单关联出货设备 |
|||
* |
|||
* @param id 品质报告单关联出货设备ID |
|||
* @return 结果 |
|||
*/ |
|||
public int cancelQualityReportDeviceById(Long id); |
|||
|
|||
/** |
|||
* 恢复品质报告单关联出货设备 |
|||
* |
|||
* @param id 品质报告单关联出货设备ID |
|||
* @return 结果 |
|||
*/ |
|||
public int restoreQualityReportDeviceById(Long id); |
|||
} |
@ -0,0 +1,70 @@ |
|||
<?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.ruoyi.quality.mapper.QualityReportDeviceMapper"> |
|||
|
|||
<resultMap type="QualityReportDevice" id="QualityReportDeviceResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="shippingDeviceId" column="shipping_device_id" /> |
|||
<result property="qualityOrderReportCode" column="quality_order_report_code" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectQualityReportDeviceVo"> |
|||
select id, shipping_device_id, quality_order_report_code from quality_report_device |
|||
</sql> |
|||
|
|||
<select id="selectQualityReportDeviceList" parameterType="QualityReportDevice" resultMap="QualityReportDeviceResult"> |
|||
<include refid="selectQualityReportDeviceVo"/> |
|||
<where> |
|||
<if test="shippingDeviceId != null and shippingDeviceId != ''"> and shipping_device_id = #{shippingDeviceId}</if> |
|||
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''"> and quality_order_report_code = #{qualityOrderReportCode}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectQualityReportDeviceById" parameterType="Long" resultMap="QualityReportDeviceResult"> |
|||
<include refid="selectQualityReportDeviceVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertQualityReportDevice" parameterType="QualityReportDevice" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into quality_report_device |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="shippingDeviceId != null and shippingDeviceId != ''">shipping_device_id,</if> |
|||
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''">quality_order_report_code,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="shippingDeviceId != null and shippingDeviceId != ''">#{shippingDeviceId},</if> |
|||
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''">#{qualityOrderReportCode},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateQualityReportDevice" parameterType="QualityReportDevice"> |
|||
update quality_report_device |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="shippingDeviceId != null and shippingDeviceId != ''">shipping_device_id = #{shippingDeviceId},</if> |
|||
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''">quality_order_report_code = #{qualityOrderReportCode},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteQualityReportDeviceById" parameterType="Long"> |
|||
delete from quality_report_device where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteQualityReportDeviceByIds" parameterType="String"> |
|||
delete from quality_report_device where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<update id="cancelQualityReportDeviceById" parameterType="Long"> |
|||
update quality_report_device set del_flag = '1' where id = #{id} |
|||
</update> |
|||
|
|||
<update id="restoreQualityReportDeviceById" parameterType="Long"> |
|||
update quality_report_device set del_flag = '0' where id = #{id} |
|||
</update> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue