Browse Source

[fix]销售模块:bom信息修改业务流程删除在修改功能上线程

dev
zhangsiqi 7 months ago
parent
commit
f98f27b3e4
  1. 2
      ruoyi-activiti/src/main/java/com/ruoyi/process/todoitem/mapper/BizTodoItemMapper.java
  2. 13
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java
  3. 20
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  4. 6
      ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml
  5. 145
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
  6. 24
      ruoyi-admin/src/main/resources/templates/erp/material/edit.html

2
ruoyi-activiti/src/main/java/com/ruoyi/process/todoitem/mapper/BizTodoItemMapper.java

@ -77,7 +77,7 @@ public interface BizTodoItemMapper {
@Select("SELECT * FROM BIZ_TODO_ITEM WHERE TASK_ID = #{taskId} AND TODO_USER_ID = #{todoUserId}") @Select("SELECT * FROM BIZ_TODO_ITEM WHERE TASK_ID = #{taskId} AND TODO_USER_ID = #{todoUserId}")
BizTodoItem selectTodoItemByCondition(@Param(value = "taskId") String taskId, @Param(value = "todoUserId") String todoUserId); BizTodoItem selectTodoItemByCondition(@Param(value = "taskId") String taskId, @Param(value = "todoUserId") String todoUserId);
@Select("SELECT USER_ID_ FROM ACT_ID_MEMBERSHIP WHERE USER_ID_ = (SELECT USER_ID_ FROM ACT_RU_IDENTITYLINK WHERE TASK_ID_ = #{taskId})") @Select("SELECT USER_ID_ FROM ACT_ID_MEMBERSHIP WHERE USER_ID_ in (SELECT USER_ID_ FROM ACT_RU_IDENTITYLINK WHERE TASK_ID_ = #{taskId})")
String selectTodoUserByTaskId(String id); String selectTodoUserByTaskId(String id);
/** /**

13
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java

@ -57,6 +57,8 @@ public class ErpBom extends BaseEntity
@Excel(name = "描述",sort = 4) @Excel(name = "描述",sort = 4)
private String describe; private String describe;
private String warehouseDept;
/** 用量 */ /** 用量 */
@Excel(name = "用量",sort = 8) @Excel(name = "用量",sort = 8)
private Long useNum; private Long useNum;
@ -194,7 +196,16 @@ public class ErpBom extends BaseEntity
{ {
return unit; return unit;
} }
public void setBrand(String brand)
public String getWarehouseDept() {
return warehouseDept;
}
public void setWarehouseDept(String warehouseDept) {
this.warehouseDept = warehouseDept;
}
public void setBrand(String brand)
{ {
this.brand = brand; this.brand = brand;
} }

20
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -212,26 +212,6 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
} }
attachFileService.updateAttachIdByIdList(photoAttachId, fileIdList); attachFileService.updateAttachIdByIdList(photoAttachId, fileIdList);
} }
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id);
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息修改审批-"+DateUtils.dateTimeNow();
String instanceType = "cancel";
BeanUtils.copyProperties(erpMaterialVo,erpMaterial);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,erpMaterial, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
erpMaterial.setCancelInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
erpMaterial.setAuditStatus("1");
// 使用状态-已作废
erpMaterial.setUseStatus("2");
}
return erpMaterialMapper.updateErpMaterial(erpMaterial); return erpMaterialMapper.updateErpMaterial(erpMaterial);
} }

6
ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml

@ -67,7 +67,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectErpBomVo"> <sql id="selectErpBomVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark, bom_no, material_no, material_name, material_type, process_method, unit, brand, `describe`, use_num, loss_rate, parent_id, `level`, sort_no, audit_status, use_status,instance_id,instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,apply_title,apply_user,apply_time from erp_bom select id, del_flag, create_by, create_time, update_by, update_time, remark, bom_no,
material_no, material_name, material_type, process_method, unit, brand, `describe`,
use_num, loss_rate, parent_id, `level`, sort_no, audit_status, use_status,instance_id,
instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,apply_title,
apply_user,apply_time from erp_bom
</sql> </sql>
<select id="selectErpBomList" parameterType="ErpBomVo" resultMap="ErpBomResult"> <select id="selectErpBomList" parameterType="ErpBomVo" resultMap="ErpBomResult">

145
ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

@ -2,8 +2,6 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head> <head>
<th:block th:include="include :: header('bom列表')" /> <th:block th:include="include :: header('bom列表')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-table-fixed-columns-css" />
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
@ -98,10 +96,7 @@
</div> </div>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script th:src="@{/js/activiti.js}"></script> <script th:src="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('erp:bom:edit')}]]; var editFlag = [[${@permission.hasPermi('erp:bom:edit')}]];
var removeFlag = [[${@permission.hasPermi('erp:bom:remove')}]]; var removeFlag = [[${@permission.hasPermi('erp:bom:remove')}]];
@ -117,10 +112,6 @@
var loginName = currentUser.loginName; var loginName = currentUser.loginName;
var prefix = ctx + "erp/bom"; var prefix = ctx + "erp/bom";
$(function() { $(function() {
// $('#selectMaterialType').on('select2:select', function (e) {
// var data = e.params.data;
// $("#materialType").val(data.id);
// });
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
createUrl: prefix + "/add", createUrl: prefix + "/add",
@ -134,8 +125,9 @@
importTemplateUrl: prefix + "/importTemplate", importTemplateUrl: prefix + "/importTemplate",
modalName: "bom", modalName: "bom",
detailView: true, detailView: true,
rightFixedColumns: true, // 是否启用冻结列(右侧) fixedColumns: true, // 启用冻结列
fixedRightNumber: 1, rightFixedColumns:1,
fixedRightNumber: 1, // 冻结右列个数
//指定父id列 //指定父id列
onExpandRow : function(index, row, $detail) { onExpandRow : function(index, row, $detail) {
$detail.html('<h4>一阶</h4><table class="table-container" id="one_level_table_'+row.id+'"></table>' + $detail.html('<h4>一阶</h4><table class="table-container" id="one_level_table_'+row.id+'"></table>' +
@ -149,35 +141,12 @@
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
{ {title: '主键ID',field: 'id'},
field: 'id', { title: '流程实例ID',field: 'instanceId',visible: false},
title: '主键ID' { title: '流程提交实例ID',field: 'submitInstanceId',visible: false},
}, {title: '流程作废实例ID', field: 'cancelInstanceId',visible: false},
{ { title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false},
field: 'instanceId', { title: '流程实例类型',field: 'instanceTypeName', visible: false},
title: '流程实例ID',
visible: false
},
{
field: 'submitInstanceId',
title: '流程提交实例ID',
visible: false
},
{
field: 'cancelInstanceId',
title: '流程作废实例ID',
visible: false
},
{
field: 'restoreInstanceId',
title: '流程恢复实例ID',
visible: false
},
{
field: 'instanceTypeName',
title: '流程实例类型',
visible: false
},
{ {
field: 'applyUser', field: 'applyUser',
title: '申请人ID', title: '申请人ID',
@ -226,39 +195,9 @@
return $.table.selectDictLabel(useStatusDatas, value); return $.table.selectDictLabel(useStatusDatas, value);
} }
}, },
{ {title: '工程员',field: 'createBy'},
field: 'createBy', {title: 'bom号',field: 'bomNo',},
title: '工程员', {title: '关联料号',field: 'materialNo'},
formatter: function(value, row, index) {
if (value == null || value == ''){
return '/';
}else{
return value;
}
}
},
{
field: 'bomNo',
title: 'bom号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value;
}
}
},
{
field: 'materialNo',
title: '关联料号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value;
}
}
},
{ {
field: 'photoUrl', field: 'photoUrl',
title: '图片', title: '图片',
@ -266,17 +205,7 @@
return $.table.imageView(value); return $.table.imageView(value);
} }
}, },
{ { title: '物料名称',field: 'materialName'},
field: 'materialName',
title: '物料名称',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value;
}
}
},
{ {
field: 'materialType', field: 'materialType',
title: '物料类型', title: '物料类型',
@ -294,50 +223,11 @@
{ {
field: 'unit', field: 'unit',
title: '单位', title: '单位',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value;
}
}
}, },
{ { title: '品牌',field: 'brand'},
field: 'brand', {title: '描述',field: 'describe'},
title: '品牌', {title: '用量',field: 'useNum'},
formatter:function (value,row,index){ {title: '损耗率',field: 'lossRate',
if (value == null || value == ''){
return '/';
}else{
return value;
}
}
},
{
field: 'describe',
title: '描述',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value;
}
}
},
{
field: 'useNum',
title: '用量',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value;
}
}
},
{
field: 'lossRate',
title: '损耗率',
formatter:function (value,row,index){ formatter:function (value,row,index){
if (value == null || value == ''){ if (value == null || value == ''){
return '/'; return '/';
@ -405,7 +295,6 @@
}] }]
}; };
$.table.init(options); $.table.init(options);
}); });
initOneLevelTable = function(index, row, $detail) { initOneLevelTable = function(index, row, $detail) {
$("#"+"one_level_table_"+row.id).bootstrapTable({ $("#"+"one_level_table_"+row.id).bootstrapTable({

24
ruoyi-admin/src/main/resources/templates/erp/material/edit.html

@ -21,30 +21,6 @@
<input name="materialName" th:field="*{materialName}" class="form-control" type="text"> <input name="materialName" th:field="*{materialName}" class="form-control" type="text">
</div> </div>
</div> </div>
<!--<div class="form-group">
<label class="col-sm-3 control-label">审核状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('auditStatus')}">
<input type="radio" th:id="${'auditStatus_' + dict.dictCode}" name="auditStatus" th:value="${dict.dictValue}" th:field="*{auditStatus}">
<label th:for="${'auditStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">使用状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('useStatus')}">
<input type="radio" th:id="${'useStatus_' + dict.dictCode}" name="useStatus" th:value="${dict.dictValue}" th:field="*{useStatus}">
<label th:for="${'useStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否有生产团队:</label>
<div class="col-sm-8">
<input name="havaProductTem" th:field="*{havaProductTem}" class="form-control" type="text">
</div>
</div>-->
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">是否有生产团队:</label> <label class="col-sm-3 control-label">是否有生产团队:</label>
<div class="col-sm-8"> <div class="col-sm-8">

Loading…
Cancel
Save