新增混炼示方密炼PS审批联动同步审批人功能,优化混炼示方的编辑与删除权限控制,增强用户交互体验。

This commit is contained in:
geht
2026-05-26 11:15:00 +08:00
parent 7786369a63
commit c70f7b2b90
6 changed files with 98 additions and 3 deletions

View File

@@ -407,3 +407,10 @@ jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/MesXslRubberQuickTes
jeecgboot-vue3/src/views/xslmes/mesXslRubberQuickTestMethod/components/MesXslRubberQuickTestMethodModal.vue
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java
jeecgboot-vue3/src/components/jeecg/JVxeTable/src/components/cells/JVxeSelectCell.vue
-- author:cursor---date:20260526--for: 【XSLMES-20260526-A61】混炼示方密炼PS校对/审核/批准联动同步审批人 -----------
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixingSpecService.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixingSpecServiceImpl.java
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerPsCompileServiceImpl.java
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts
jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpecList.vue

View File

@@ -10,6 +10,7 @@ import org.jeecg.modules.xslmes.entity.MesXslMixingSpecDownStep;
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecMaterial;
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecStep;
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecTcu;
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
import org.jeecg.modules.xslmes.vo.MesXslMixingSpecPage;
public interface IMesXslMixingSpecService extends IService<MesXslMixingSpec> {
@@ -36,4 +37,14 @@ public interface IMesXslMixingSpecService extends IService<MesXslMixingSpec> {
List<Map<String, String>> queryIssueNumberOptions(String keyword);
List<Map<String, String>> queryPurposeOptions(String keyword);
//update-begin---author:cursor ---date:20260526 for【XSLMES-20260526-A61】混炼示方密炼PS审批联动同步审批人-----------
/**
* 密炼PS校对/审核/批准后按发行编号PS编码同步关联混炼示方审批人
*
* @param ps 已更新后的密炼PS编制单
* @param mixerPsTargetStatus 密炼PS目标状态proofread / audit / approve
*/
void syncFromMixerPsWorkflow(MesXslMixerPsCompile ps, String mixerPsTargetStatus);
//update-end---author:cursor ---date:20260526 for【XSLMES-20260526-A61】混炼示方密炼PS审批联动同步审批人-----------
}

View File

@@ -10,6 +10,7 @@ import org.jeecg.modules.xslmes.common.XslMesBizConstants;
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
import org.jeecg.modules.xslmes.mapper.MesXslMixerPsCompileMapper;
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecService;
import org.jeecg.modules.xslmes.service.IMesXslMixingSpecService;
import org.jeecg.modules.xslmes.service.IMesXslMixerPsCompileService;
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -26,6 +27,9 @@ public class MesXslMixerPsCompileServiceImpl extends ServiceImpl<MesXslMixerPsCo
@Autowired
private IMesXslFormulaSpecService mesXslFormulaSpecService;
@Autowired
private IMesXslMixingSpecService mesXslMixingSpecService;
@Autowired
private IMesXslRubberQuickTestStdService mesXslRubberQuickTestStdService;
@@ -61,6 +65,9 @@ public class MesXslMixerPsCompileServiceImpl extends ServiceImpl<MesXslMixerPsCo
//update-begin---author:cursor ---date:20260522 for【配合示方】密炼PS审批联动同步状态与审批人-----------
mesXslFormulaSpecService.syncFromMixerPsWorkflow(entity, targetStatus);
//update-end---author:cursor ---date:20260522 for【配合示方】密炼PS审批联动同步状态与审批人-----------
//update-begin---author:cursor ---date:20260526 for【XSLMES-20260526-A61】混炼示方密炼PS审批联动同步审批人-----------
mesXslMixingSpecService.syncFromMixerPsWorkflow(entity, targetStatus);
//update-end---author:cursor ---date:20260526 for【XSLMES-20260526-A61】混炼示方密炼PS审批联动同步审批人-----------
//update-begin---author:jiangxh ---date:20260525 for【MES】原材料检验标准PS批准后关联实验标准置已批准-----------
if ("approve".equals(targetStatus)
&& XslMesBizConstants.PS_TYPE_RAW_INSPECT_STD.equals(entity.getPsType())) {

View File

@@ -1,6 +1,7 @@
package org.jeecg.modules.xslmes.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import jakarta.annotation.Resource;
@@ -21,6 +22,7 @@ import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
import org.jeecg.modules.mes.material.service.IMesMixerMaterialService;
import org.jeecg.modules.system.entity.SysCategory;
@@ -30,6 +32,7 @@ import org.jeecg.modules.xslmes.entity.MesXslMixingSpecDownStep;
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecMaterial;
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecStep;
import org.jeecg.modules.xslmes.entity.MesXslMixingSpecTcu;
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
import org.jeecg.modules.xslmes.mapper.MesXslMixingSpecDownStepMapper;
import org.jeecg.modules.xslmes.mapper.MesXslMixingSpecMapper;
import org.jeecg.modules.xslmes.mapper.MesXslMixingSpecMaterialMapper;
@@ -782,4 +785,33 @@ public class MesXslMixingSpecServiceImpl extends ServiceImpl<MesXslMixingSpecMap
return categoryId;
}
//update-end---author:cursor ---date:20260525 for【XSLMES-20260525-A49】删除混炼示方时同步删除B/F段胶密炼物料-----------
//update-begin---author:cursor ---date:20260526 for【XSLMES-20260526-A61】混炼示方密炼PS审批联动同步审批人-----------
@Override
public void syncFromMixerPsWorkflow(MesXslMixerPsCompile ps, String mixerPsTargetStatus) {
if (ps == null || oConvertUtils.isEmpty(ps.getPsCode()) || oConvertUtils.isEmpty(mixerPsTargetStatus)) {
return;
}
LambdaUpdateWrapper<MesXslMixingSpec> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(MesXslMixingSpec::getIssueNumber, ps.getPsCode());
switch (mixerPsTargetStatus) {
case "proofread":
wrapper.set(MesXslMixingSpec::getProofreadBy, ps.getProofreadBy())
.set(MesXslMixingSpec::getProofreadTime, ps.getProofreadTime());
break;
case "audit":
wrapper.set(MesXslMixingSpec::getAuditBy, ps.getAuditBy())
.set(MesXslMixingSpec::getAuditTime, ps.getAuditTime());
break;
case "approve":
wrapper.set(MesXslMixingSpec::getApproveBy, ps.getApproveBy())
.set(MesXslMixingSpec::getApproveTime, ps.getApproveTime());
break;
default:
return;
}
wrapper.set(MesXslMixingSpec::getUpdateTime, new Date());
this.update(wrapper);
}
//update-end---author:cursor ---date:20260526 for【XSLMES-20260526-A61】混炼示方密炼PS审批联动同步审批人-----------
}

View File

@@ -1240,9 +1240,20 @@ export function resolveMixingSpecFormulaStatus(record: Recordable = {}): string
if (record.approveTime) {
return '审批通过';
}
if (record.auditTime) {
return '审核通过';
}
if (record.proofreadTime) {
return '校对通过';
}
return '编制中';
}
/** 混炼示方是否允许编辑/删除与配合示方一致密炼PS校对后锁定 */
export function isMixingSpecEditable(record: Recordable = {}): boolean {
return !record?.proofreadBy && !record?.proofreadTime;
}
/** 参照历史混合步骤:混炼示方选择列表列 */
export const mixingSpecHistorySelectColumns: BasicColumn[] = [
{ title: '示方编号', align: 'center', dataIndex: 'specName', width: 160 },

View File

@@ -37,8 +37,11 @@
import { useListPage } from '/@/hooks/system/useListPage';
import Icon from '/@/components/Icon';
import MesXslMixingSpecModal from './components/MesXslMixingSpecModal.vue';
import { columns, searchFormSchema } from './MesXslMixingSpec.data';
import { columns, searchFormSchema, isMixingSpecEditable } from './MesXslMixingSpec.data';
import { list, deleteOne, batchDelete, getExportUrl, getImportUrl } from './MesXslMixingSpec.api';
import { useMessage } from '/@/hooks/web/useMessage';
const { createMessage } = useMessage();
const queryParam = reactive<any>({});
const [registerModal, { openModal }] = useModal();
@@ -81,6 +84,10 @@
}
function handleEdit(record: Recordable) {
if (!isMixingSpecEditable(record)) {
createMessage.warning('已进入审批流程的混炼示方不允许编辑');
return;
}
openModal(true, { record, isUpdate: true, showFooter: true });
}
@@ -89,6 +96,10 @@
}
function handleDelete(record: Recordable) {
if (!isMixingSpecEditable(record)) {
createMessage.warning('已进入审批流程的混炼示方不允许删除');
return;
}
deleteOne({ id: record.id }, handleSuccess);
}
@@ -102,14 +113,30 @@
}
function getTableActions(record: Recordable) {
const editable = isMixingSpecEditable(record);
return [
{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_mixing_spec:edit' },
{ label: '详情', onClick: handleDetail.bind(null, record) },
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'xslmes:mes_xsl_mixing_spec:edit',
ifShow: editable,
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
ifShow: !editable,
},
{
label: '删除',
auth: 'xslmes:mes_xsl_mixing_spec:delete',
ifShow: editable,
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
ifShow: editable,
},
];
}
</script>