Merge branch 'main' of http://27.223.88.102:33000/chenx/qhmes
This commit is contained in:
@@ -0,0 +1,172 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
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.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialSubstituteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
@Tag(name = "MES密炼物料替代对应关系")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslMixerMaterialSubstitute")
|
||||
@Slf4j
|
||||
public class MesXslMixerMaterialSubstituteController
|
||||
extends JeecgController<MesXslMixerMaterialSubstitute, IMesXslMixerMaterialSubstituteService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslMixerMaterialSubstituteService mesXslMixerMaterialSubstituteService;
|
||||
|
||||
@Autowired
|
||||
private IMesMixerMaterialService mesMixerMaterialService;
|
||||
|
||||
@Operation(summary = "MES密炼物料替代对应关系-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslMixerMaterialSubstitute>> queryPageList(
|
||||
MesXslMixerMaterialSubstitute model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
customeRuleMap.put("mixerMaterialId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("substituteMaterialId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<MesXslMixerMaterialSubstitute> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
|
||||
queryWrapper.orderByAsc("serial_no");
|
||||
Page<MesXslMixerMaterialSubstitute> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslMixerMaterialSubstitute> pageList = mesXslMixerMaterialSubstituteService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-添加")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslMixerMaterialSubstitute model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
String err = validateAndFillMaterials(model, false);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
mesXslMixerMaterialSubstituteService.saveWithSerialNo(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-编辑")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixerMaterialSubstitute model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
String err = validateAndFillMaterials(model, true);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
mesXslMixerMaterialSubstituteService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-删除")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslMixerMaterialSubstituteService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼物料替代对应关系-批量删除")
|
||||
@Operation(summary = "MES密炼物料替代对应关系-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslMixerMaterialSubstituteService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES密炼物料替代对应关系-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslMixerMaterialSubstitute> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMixerMaterialSubstitute entity = mesXslMixerMaterialSubstituteService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerMaterialSubstitute model) {
|
||||
return super.exportXls(request, model, MesXslMixerMaterialSubstitute.class, "密炼物料替代对应关系");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_material_substitute:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslMixerMaterialSubstitute.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
private String validateAndFillMaterials(MesXslMixerMaterialSubstitute model, boolean isUpdate) {
|
||||
if (oConvertUtils.isEmpty(model.getMixerMaterialId())) {
|
||||
return "请选择密炼物料";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getSubstituteMaterialId())) {
|
||||
return "请选择替代密炼物料";
|
||||
}
|
||||
if (model.getMixerMaterialId().equals(model.getSubstituteMaterialId())) {
|
||||
return "密炼物料与替代密炼物料不能相同";
|
||||
}
|
||||
|
||||
MesMixerMaterial mixerMaterial = mesMixerMaterialService.getById(model.getMixerMaterialId());
|
||||
if (mixerMaterial == null) {
|
||||
return "所选密炼物料不存在,请重新选择";
|
||||
}
|
||||
MesMixerMaterial substituteMaterial = mesMixerMaterialService.getById(model.getSubstituteMaterialId());
|
||||
if (substituteMaterial == null) {
|
||||
return "所选替代密炼物料不存在,请重新选择";
|
||||
}
|
||||
|
||||
model.setMixerMaterialCode(mixerMaterial.getMaterialCode());
|
||||
model.setMixerMaterialName(mixerMaterial.getMaterialName());
|
||||
model.setSubstituteMaterialCode(substituteMaterial.getMaterialCode());
|
||||
model.setSubstituteMaterialName(substituteMaterial.getMaterialName());
|
||||
|
||||
LambdaQueryWrapper<MesXslMixerMaterialSubstitute> dupQw = new LambdaQueryWrapper<>();
|
||||
dupQw.eq(MesXslMixerMaterialSubstitute::getMixerMaterialId, model.getMixerMaterialId())
|
||||
.eq(MesXslMixerMaterialSubstitute::getSubstituteMaterialId, model.getSubstituteMaterialId());
|
||||
if (isUpdate && oConvertUtils.isNotEmpty(model.getId())) {
|
||||
dupQw.ne(MesXslMixerMaterialSubstitute::getId, model.getId());
|
||||
}
|
||||
if (mesXslMixerMaterialSubstituteService.count(dupQw) > 0) {
|
||||
return "该密炼物料与替代密炼物料的对应关系已存在";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】保存前校验与物料冗余回填-----------
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysDepart;
|
||||
import org.jeecg.modules.system.service.ISysDepartService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerPsCompileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 密炼PS编制
|
||||
*/
|
||||
@Tag(name = "MES密炼PS编制")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslMixerPsCompile")
|
||||
@Slf4j
|
||||
public class MesXslMixerPsCompileController extends JeecgController<MesXslMixerPsCompile, IMesXslMixerPsCompileService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslMixerPsCompileService mesXslMixerPsCompileService;
|
||||
|
||||
@Autowired
|
||||
private ISysDepartService sysDepartService;
|
||||
|
||||
@Operation(summary = "MES密炼PS编制-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslMixerPsCompile>> queryPageList(
|
||||
MesXslMixerPsCompile model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
customeRuleMap.put("psCode", QueryRuleEnum.LIKE);
|
||||
customeRuleMap.put("title", QueryRuleEnum.LIKE);
|
||||
QueryWrapper<MesXslMixerPsCompile> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
|
||||
queryWrapper.orderByDesc("issue_date", "create_time");
|
||||
Page<MesXslMixerPsCompile> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslMixerPsCompile> pageList = mesXslMixerPsCompileService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼PS编制-添加")
|
||||
@Operation(summary = "MES密炼PS编制-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslMixerPsCompile model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】保存前校验与冗余回填-----------
|
||||
String err = validateAndFill(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】保存前校验与冗余回填-----------
|
||||
mesXslMixerPsCompileService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼PS编制-编辑")
|
||||
@Operation(summary = "MES密炼PS编制-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslMixerPsCompile model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】保存前校验与冗余回填-----------
|
||||
String err = validateAndFill(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】保存前校验与冗余回填-----------
|
||||
MesXslMixerPsCompile existing = mesXslMixerPsCompileService.getById(model.getId());
|
||||
if (existing == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
if (!"compile".equals(existing.getStatus())) {
|
||||
return Result.error("仅编制状态的单据允许编辑");
|
||||
}
|
||||
model.setStatus("compile");
|
||||
model.setProofreadBy(existing.getProofreadBy());
|
||||
model.setProofreadTime(existing.getProofreadTime());
|
||||
model.setAuditBy(existing.getAuditBy());
|
||||
model.setAuditTime(existing.getAuditTime());
|
||||
model.setApproveBy(existing.getApproveBy());
|
||||
model.setApproveTime(existing.getApproveTime());
|
||||
mesXslMixerPsCompileService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼PS编制-删除")
|
||||
@Operation(summary = "MES密炼PS编制-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】仅编制状态允许删除-----------
|
||||
MesXslMixerPsCompile existing = mesXslMixerPsCompileService.getById(id);
|
||||
String err = assertCompileStatusForDelete(existing);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】仅编制状态允许删除-----------
|
||||
mesXslMixerPsCompileService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼PS编制-批量删除")
|
||||
@Operation(summary = "MES密炼PS编制-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】仅编制状态允许删除-----------
|
||||
if (oConvertUtils.isEmpty(ids)) {
|
||||
return Result.error("请选择要删除的记录");
|
||||
}
|
||||
for (String id : ids.split(",")) {
|
||||
if (oConvertUtils.isEmpty(id)) {
|
||||
continue;
|
||||
}
|
||||
MesXslMixerPsCompile existing = mesXslMixerPsCompileService.getById(id.trim());
|
||||
String err = assertCompileStatusForDelete(existing);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】仅编制状态允许删除-----------
|
||||
mesXslMixerPsCompileService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES密炼PS编制-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslMixerPsCompile> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslMixerPsCompile entity = mesXslMixerPsCompileService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslMixerPsCompile model) {
|
||||
return super.exportXls(request, model, MesXslMixerPsCompile.class, "密炼PS编制");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslMixerPsCompile.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】校对/审核/批准-----------
|
||||
@AutoLog(value = "MES密炼PS编制-校对")
|
||||
@Operation(summary = "MES密炼PS编制-校对")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:proofread")
|
||||
@PostMapping(value = "/proofread")
|
||||
public Result<String> proofread(@RequestParam(name = "ids") String ids) {
|
||||
return doChangeStatus(ids, "compile", "proofread", "校对");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼PS编制-审核")
|
||||
@Operation(summary = "MES密炼PS编制-审核")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:audit")
|
||||
@PostMapping(value = "/audit")
|
||||
public Result<String> audit(@RequestParam(name = "ids") String ids) {
|
||||
return doChangeStatus(ids, "proofread", "audit", "审核");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES密炼PS编制-批准")
|
||||
@Operation(summary = "MES密炼PS编制-批准")
|
||||
@RequiresPermissions("xslmes:mes_xsl_mixer_ps_compile:approve")
|
||||
@PostMapping(value = "/approve")
|
||||
public Result<String> approve(@RequestParam(name = "ids") String ids) {
|
||||
return doChangeStatus(ids, "audit", "approve", "批准");
|
||||
}
|
||||
|
||||
private Result<String> doChangeStatus(String ids, String expectedStatus, String targetStatus, String actionLabel) {
|
||||
String err = mesXslMixerPsCompileService.changeStatusBatch(
|
||||
ids, expectedStatus, targetStatus, actionLabel, getOperatorName());
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
return Result.OK(actionLabel + "成功!");
|
||||
}
|
||||
|
||||
private String getOperatorName() {
|
||||
LoginUser loginUser = null;
|
||||
try {
|
||||
loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
} catch (Exception e) {
|
||||
log.debug("获取当前登录用户失败", e);
|
||||
}
|
||||
if (loginUser == null) {
|
||||
return null;
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(loginUser.getRealname())) {
|
||||
return loginUser.getRealname();
|
||||
}
|
||||
return loginUser.getUsername();
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】校对/审核/批准-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】保存前校验与冗余回填-----------
|
||||
private String validateAndFill(MesXslMixerPsCompile model) {
|
||||
if (oConvertUtils.isEmpty(model.getReceiveDeptId())) {
|
||||
return "请选择收信部门";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getReferenceDeptId())) {
|
||||
return "请选择参照部门";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getTitle())) {
|
||||
return "请输入标题";
|
||||
}
|
||||
if (oConvertUtils.isEmpty(model.getStatus())) {
|
||||
model.setStatus("compile");
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(model.getFactoryId())) {
|
||||
SysDepart factory = sysDepartService.getById(model.getFactoryId());
|
||||
if (factory == null) {
|
||||
return "所选所属工厂不存在,请重新选择";
|
||||
}
|
||||
model.setFactoryName(factory.getDepartName());
|
||||
} else {
|
||||
model.setFactoryName(null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】保存前校验与冗余回填-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】仅编制状态允许删除-----------
|
||||
private String assertCompileStatusForDelete(MesXslMixerPsCompile entity) {
|
||||
if (entity == null) {
|
||||
return "记录不存在或已删除";
|
||||
}
|
||||
String status = entity.getStatus() == null ? "" : entity.getStatus();
|
||||
if (!"compile".equals(status)) {
|
||||
String psCode = oConvertUtils.isEmpty(entity.getPsCode()) ? entity.getId() : entity.getPsCode();
|
||||
return "PS编码[" + psCode + "]当前状态不允许删除,仅编制状态可删除";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】仅编制状态允许删除-----------
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.mes.material.entity.MesMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslOpenMillParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
@Tag(name = "MES开炼机参数维护")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslOpenMillParam")
|
||||
@Slf4j
|
||||
public class MesXslOpenMillParamController extends JeecgController<MesXslOpenMillParam, IMesXslOpenMillParamService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslOpenMillParamService mesXslOpenMillParamService;
|
||||
|
||||
@Autowired
|
||||
private IMesMaterialService mesMaterialService;
|
||||
|
||||
@Operation(summary = "MES开炼机参数维护-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslOpenMillParam>> queryPageList(
|
||||
MesXslOpenMillParam model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
customeRuleMap.put("materialId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<MesXslOpenMillParam> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(model, req.getParameterMap(), customeRuleMap);
|
||||
Page<MesXslOpenMillParam> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslOpenMillParam> pageList = mesXslOpenMillParamService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-添加")
|
||||
@Operation(summary = "MES开炼机参数维护-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslOpenMillParam model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
String err = validateAndFillMaterial(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
mesXslOpenMillParamService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-编辑")
|
||||
@Operation(summary = "MES开炼机参数维护-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslOpenMillParam model) {
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
String err = validateAndFillMaterial(model);
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
mesXslOpenMillParamService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-删除")
|
||||
@Operation(summary = "MES开炼机参数维护-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslOpenMillParamService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES开炼机参数维护-批量删除")
|
||||
@Operation(summary = "MES开炼机参数维护-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslOpenMillParamService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES开炼机参数维护-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslOpenMillParam> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslOpenMillParam entity = mesXslOpenMillParamService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslOpenMillParam model) {
|
||||
return super.exportXls(request, model, MesXslOpenMillParam.class, "开炼机参数维护");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_open_mill_param:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslOpenMillParam.class);
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
private String validateAndFillMaterial(MesXslOpenMillParam model) {
|
||||
if (oConvertUtils.isEmpty(model.getMaterialId())) {
|
||||
return "请选择胶料";
|
||||
}
|
||||
MesMaterial material = mesMaterialService.getById(model.getMaterialId());
|
||||
if (material == null) {
|
||||
return "所选胶料不存在,请重新选择";
|
||||
}
|
||||
model.setMaterialName(material.getMaterialName());
|
||||
model.setMaterialCode(oConvertUtils.isEmpty(material.getAliasName()) ? "" : material.getAliasName());
|
||||
String timeErr = validateTimeFields(model);
|
||||
if (timeErr != null) {
|
||||
return timeErr;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String validateTimeFields(MesXslOpenMillParam model) {
|
||||
if (isNegative(model.getR0FeedTime())) {
|
||||
return "R0进胶时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR0RingTime())) {
|
||||
return "R0成环时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR0BreakTime())) {
|
||||
return "R0拉断时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR0DischargeTime())) {
|
||||
return "R0排胶时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1FeedTime())) {
|
||||
return "R1进胶时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1RingTime())) {
|
||||
return "R1成环时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1BreakTime())) {
|
||||
return "R1拉断时间不能为负数";
|
||||
}
|
||||
if (isNegative(model.getR1DischargeTime())) {
|
||||
return "R1排胶时间不能为负数";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isNegative(BigDecimal value) {
|
||||
return value != null && value.compareTo(BigDecimal.ZERO) < 0;
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【开炼机参数维护】保存前校验与胶料冗余回填-----------
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixer_material_substitute")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES密炼物料替代对应关系")
|
||||
public class MesXslMixerMaterialSubstitute implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "编号", width = 10)
|
||||
@Schema(description = "编号(租户内自动累加,从1开始)")
|
||||
private Integer serialNo;
|
||||
|
||||
@Excel(name = "密炼物料ID", width = 15, dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "密炼物料ID(关联 mes_mixer_material.id)")
|
||||
private String mixerMaterialId;
|
||||
|
||||
@Excel(name = "密炼物料编码", width = 15)
|
||||
@Schema(description = "密炼物料编码冗余")
|
||||
private String mixerMaterialCode;
|
||||
|
||||
@Excel(name = "密炼物料名称", width = 20)
|
||||
@Schema(description = "密炼物料名称冗余")
|
||||
private String mixerMaterialName;
|
||||
|
||||
@Excel(name = "替代密炼物料ID", width = 15, dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_mixer_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "替代密炼物料ID(关联 mes_mixer_material.id)")
|
||||
private String substituteMaterialId;
|
||||
|
||||
@Excel(name = "替代密炼物料编码", width = 15)
|
||||
@Schema(description = "替代密炼物料编码冗余")
|
||||
private String substituteMaterialCode;
|
||||
|
||||
@Excel(name = "替代密炼物料名称", width = 20)
|
||||
@Schema(description = "替代密炼物料名称冗余")
|
||||
private String substituteMaterialName;
|
||||
|
||||
@Excel(name = "创建人", width = 15)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改人", width = 15)
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String sysOrgCode;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 密炼PS编制
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_mixer_ps_compile")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES密炼PS编制")
|
||||
public class MesXslMixerPsCompile implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "所属工厂", width = 20)
|
||||
@Schema(description = "所属工厂名称冗余(公司)")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "所属工厂ID(sys_depart.id,公司)")
|
||||
private String factoryId;
|
||||
|
||||
@Excel(name = "PS编码", width = 18)
|
||||
@Schema(description = "PS编码")
|
||||
private String psCode;
|
||||
|
||||
@Excel(name = "类型", width = 15, dicCode = "xslmes_ps_belong")
|
||||
@Dict(dicCode = "xslmes_ps_belong")
|
||||
@Schema(description = "类型(字典PS归属)")
|
||||
private String psType;
|
||||
|
||||
@Excel(name = "施工代号", width = 15, dicCode = "xslmes_construction_code")
|
||||
@Dict(dicCode = "xslmes_construction_code")
|
||||
@Schema(description = "施工代号")
|
||||
private String constructionCode;
|
||||
|
||||
@Excel(name = "发放日期", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "发放日期")
|
||||
private Date issueDate;
|
||||
|
||||
@Excel(name = "发送部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
|
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
|
||||
@Schema(description = "发送部门ID")
|
||||
private String sendDeptId;
|
||||
|
||||
@Excel(name = "收信部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
|
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
|
||||
@Schema(description = "收信部门ID")
|
||||
private String receiveDeptId;
|
||||
|
||||
@Excel(name = "参照部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
|
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
|
||||
@Schema(description = "参照部门ID")
|
||||
private String referenceDeptId;
|
||||
|
||||
@Excel(name = "标题", width = 25)
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Excel(name = "目的", width = 30)
|
||||
@Schema(description = "目的")
|
||||
private String purpose;
|
||||
|
||||
@Excel(name = "依据", width = 30)
|
||||
@Schema(description = "依据")
|
||||
private String basis;
|
||||
|
||||
@Excel(name = "内容", width = 40)
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
@Excel(name = "担当", width = 12)
|
||||
@Schema(description = "担当")
|
||||
private String responsiblePerson;
|
||||
|
||||
@Excel(name = "状态", width = 10, dicCode = "xslmes_mixer_ps_status")
|
||||
@Dict(dicCode = "xslmes_mixer_ps_status")
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "校对人", width = 15)
|
||||
@Schema(description = "校对人")
|
||||
private String proofreadBy;
|
||||
|
||||
@Excel(name = "校对时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "校对时间")
|
||||
private Date proofreadTime;
|
||||
|
||||
@Excel(name = "审核人", width = 15)
|
||||
@Schema(description = "审核人")
|
||||
private String auditBy;
|
||||
|
||||
@Excel(name = "审核时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "审核时间")
|
||||
private Date auditTime;
|
||||
|
||||
@Excel(name = "批准人", width = 15)
|
||||
@Schema(description = "批准人")
|
||||
private String approveBy;
|
||||
|
||||
@Excel(name = "批准时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "批准时间")
|
||||
private Date approveTime;
|
||||
|
||||
@Excel(name = "创建人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】创建人翻译为姓名供编制人展示-----------
|
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】创建人翻译为姓名供编制人展示-----------
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改人", width = 15)
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String sysOrgCode;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_open_mill_param")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES开炼机参数维护")
|
||||
public class MesXslOpenMillParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "胶料ID", width = 15, dictTable = "mes_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_material", dicText = "material_name", dicCode = "id")
|
||||
@Schema(description = "胶料ID(关联 mes_material.id)")
|
||||
private String materialId;
|
||||
|
||||
@Excel(name = "胶料名称", width = 20)
|
||||
@Schema(description = "胶料名称冗余")
|
||||
private String materialName;
|
||||
|
||||
@Excel(name = "胶料别名", width = 15)
|
||||
@Schema(description = "胶料别名冗余(取自 mes_material.alias_name)")
|
||||
private String materialCode;
|
||||
|
||||
@Excel(name = "R0进胶时间(秒)", width = 14)
|
||||
@Schema(description = "R0进胶时间(秒)")
|
||||
private BigDecimal r0FeedTime;
|
||||
|
||||
@Excel(name = "R0成环时间(秒)", width = 14)
|
||||
@Schema(description = "R0成环时间(秒)")
|
||||
private BigDecimal r0RingTime;
|
||||
|
||||
@Excel(name = "R0拉断时间(秒)", width = 14)
|
||||
@Schema(description = "R0拉断时间(秒)")
|
||||
private BigDecimal r0BreakTime;
|
||||
|
||||
@Excel(name = "R0排胶时间(秒)", width = 14)
|
||||
@Schema(description = "R0排胶时间(秒)")
|
||||
private BigDecimal r0DischargeTime;
|
||||
|
||||
@Excel(name = "R1进胶时间(秒)", width = 14)
|
||||
@Schema(description = "R1进胶时间(秒)")
|
||||
private BigDecimal r1FeedTime;
|
||||
|
||||
@Excel(name = "R1成环时间(秒)", width = 14)
|
||||
@Schema(description = "R1成环时间(秒)")
|
||||
private BigDecimal r1RingTime;
|
||||
|
||||
@Excel(name = "R1拉断时间(秒)", width = 14)
|
||||
@Schema(description = "R1拉断时间(秒)")
|
||||
private BigDecimal r1BreakTime;
|
||||
|
||||
@Excel(name = "R1排胶时间(秒)", width = 14)
|
||||
@Schema(description = "R1排胶时间(秒)")
|
||||
private BigDecimal r1DischargeTime;
|
||||
|
||||
@Excel(name = "创建人", width = 15)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改人", width = 15)
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
private String sysOrgCode;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslMixerMaterialSubstituteMapper extends BaseMapper<MesXslMixerMaterialSubstitute> {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】查询租户内最大编号-----------
|
||||
@Select("SELECT IFNULL(MAX(serial_no), 0) FROM mes_xsl_mixer_material_substitute "
|
||||
+ "WHERE del_flag = 0 AND (#{tenantId} IS NULL OR tenant_id = #{tenantId})")
|
||||
Integer selectMaxSerialNo(@Param("tenantId") Integer tenantId);
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】查询租户内最大编号-----------
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
|
||||
|
||||
/**
|
||||
* MES 密炼PS编制 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslMixerPsCompileMapper extends BaseMapper<MesXslMixerPsCompile> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslOpenMillParamMapper extends BaseMapper<MesXslOpenMillParam> {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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="org.jeecg.modules.xslmes.mapper.MesXslOpenMillParamMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
public interface IMesXslMixerMaterialSubstituteService extends IService<MesXslMixerMaterialSubstitute> {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
/**
|
||||
* 新增保存(自动分配租户内递增编号)
|
||||
*/
|
||||
boolean saveWithSerialNo(MesXslMixerMaterialSubstitute entity);
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
|
||||
|
||||
/**
|
||||
* MES 密炼PS编制
|
||||
*/
|
||||
public interface IMesXslMixerPsCompileService extends IService<MesXslMixerPsCompile> {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】批量流转状态-----------
|
||||
/**
|
||||
* 批量变更状态(校验当前状态后更新,并记录操作人/时间)
|
||||
*
|
||||
* @return 失败原因,null 表示成功
|
||||
*/
|
||||
String changeStatusBatch(String ids, String expectedStatus, String targetStatus, String actionLabel, String operatorName);
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】批量流转状态-----------
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
public interface IMesXslOpenMillParamService extends IService<MesXslOpenMillParam> {
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialSubstitute;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixerMaterialSubstituteMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialSubstituteService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* MES 密炼物料替代对应关系
|
||||
*/
|
||||
@Service
|
||||
public class MesXslMixerMaterialSubstituteServiceImpl
|
||||
extends ServiceImpl<MesXslMixerMaterialSubstituteMapper, MesXslMixerMaterialSubstitute>
|
||||
implements IMesXslMixerMaterialSubstituteService {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean saveWithSerialNo(MesXslMixerMaterialSubstitute entity) {
|
||||
if (entity.getSerialNo() == null) {
|
||||
Integer maxSerial = baseMapper.selectMaxSerialNo(entity.getTenantId());
|
||||
entity.setSerialNo(maxSerial == null ? 1 : maxSerial + 1);
|
||||
}
|
||||
return save(entity);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼物料替代对应关系】新增时分配编号-----------
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerPsCompile;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixerPsCompileMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerPsCompileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* MES 密炼PS编制
|
||||
*/
|
||||
@Service
|
||||
public class MesXslMixerPsCompileServiceImpl extends ServiceImpl<MesXslMixerPsCompileMapper, MesXslMixerPsCompile>
|
||||
implements IMesXslMixerPsCompileService {
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260520 for:【密炼PS编制】批量流转状态-----------
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String changeStatusBatch(String ids, String expectedStatus, String targetStatus, String actionLabel,
|
||||
String operatorName) {
|
||||
if (oConvertUtils.isEmpty(ids)) {
|
||||
return "请选择要" + actionLabel + "的记录";
|
||||
}
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
Date now = new Date();
|
||||
for (String id : idList) {
|
||||
if (oConvertUtils.isEmpty(id)) {
|
||||
continue;
|
||||
}
|
||||
MesXslMixerPsCompile entity = getById(id.trim());
|
||||
if (entity == null) {
|
||||
return "记录不存在或已删除";
|
||||
}
|
||||
String current = entity.getStatus() == null ? "" : entity.getStatus();
|
||||
if (!expectedStatus.equals(current)) {
|
||||
String psCode = oConvertUtils.isEmpty(entity.getPsCode()) ? id : entity.getPsCode();
|
||||
return "PS编码[" + psCode + "]当前状态不允许" + actionLabel + ",请先完成上一环节";
|
||||
}
|
||||
entity.setStatus(targetStatus);
|
||||
fillWorkflowInfo(entity, targetStatus, operatorName, now);
|
||||
updateById(entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void fillWorkflowInfo(MesXslMixerPsCompile entity, String targetStatus, String operatorName, Date now) {
|
||||
if ("proofread".equals(targetStatus)) {
|
||||
entity.setProofreadBy(operatorName);
|
||||
entity.setProofreadTime(now);
|
||||
} else if ("audit".equals(targetStatus)) {
|
||||
entity.setAuditBy(operatorName);
|
||||
entity.setAuditTime(now);
|
||||
} else if ("approve".equals(targetStatus)) {
|
||||
entity.setApproveBy(operatorName);
|
||||
entity.setApproveTime(now);
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260520 for:【密炼PS编制】批量流转状态-----------
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslOpenMillParam;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslOpenMillParamMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslOpenMillParamService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 开炼机参数维护
|
||||
*/
|
||||
@Service
|
||||
public class MesXslOpenMillParamServiceImpl extends ServiceImpl<MesXslOpenMillParamMapper, MesXslOpenMillParam>
|
||||
implements IMesXslOpenMillParamService {
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
-- 一级菜单:MES密炼工程(目录;子菜单可后续挂接)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`)
|
||||
SELECT '1900000000000000800', '', 'MES密炼工程', '/xslmesMixerEngineering', 'layouts/RouteView', 1, 'MesMixerEngineeringRoot', NULL, 0, NULL, '0', 82.00, 0, 'ant-design:experiment-outlined', 0, 0, 0, 0, 'MES 密炼工程(一级目录,子菜单可后续挂接或从系统管理中调整)', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '1900000000000000800'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES密炼工程' AND IFNULL(`parent_id`, '') = '')
|
||||
);
|
||||
|
||||
-- admin 角色授权(幂等)
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, '1900000000000000800', NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000800')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = '1900000000000000800'
|
||||
);
|
||||
|
||||
-- 目录有子菜单时 is_leaf 必须为 0(幂等修正)
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `component` = 'layouts/RouteView', `menu_type` = 0, `update_time` = NOW()
|
||||
WHERE `id` = '1900000000000000800' AND `del_flag` = 0;
|
||||
@@ -0,0 +1,49 @@
|
||||
-- 一级菜单:MES技术管理、MES能源管理(目录;子菜单可后续挂接)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- MES技术管理
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`)
|
||||
SELECT '1900000000000000810', '', 'MES技术管理', '/xslmesTechManagement', 'layouts/RouteView', 1, 'MesTechManagementRoot', NULL, 0, NULL, '0', 82.50, 0, 'ant-design:tool-outlined', 0, 0, 0, 0, 'MES 技术管理(一级目录,子菜单可后续挂接或从系统管理中调整)', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '1900000000000000810'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES技术管理' AND IFNULL(`parent_id`, '') = '')
|
||||
);
|
||||
|
||||
-- MES能源管理
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`)
|
||||
SELECT '1900000000000000820', '', 'MES能源管理', '/xslmesEnergyManagement', 'layouts/RouteView', 1, 'MesEnergyManagementRoot', NULL, 0, NULL, '0', 83.00, 0, 'ant-design:thunderbolt-outlined', 0, 0, 0, 0, 'MES 能源管理(一级目录,子菜单可后续挂接或从系统管理中调整)', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '1900000000000000820'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 0 AND `name` = 'MES能源管理' AND IFNULL(`parent_id`, '') = '')
|
||||
);
|
||||
|
||||
-- admin 角色授权:MES技术管理(幂等)
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, '1900000000000000810', NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000810')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = '1900000000000000810'
|
||||
);
|
||||
|
||||
-- admin 角色授权:MES能源管理(幂等)
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, '1900000000000000820', NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000820')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = '1900000000000000820'
|
||||
);
|
||||
|
||||
-- 目录有子菜单时 is_leaf 必须为 0(幂等修正)
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `component` = 'layouts/RouteView', `menu_type` = 0, `update_time` = NOW()
|
||||
WHERE `id` IN ('1900000000000000810', '1900000000000000820') AND `del_flag` = 0;
|
||||
@@ -0,0 +1,96 @@
|
||||
-- 开炼机参数维护:建表 + 菜单(挂 MES技术管理)+ admin 授权
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_open_mill_param` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`material_id` varchar(32) NOT NULL COMMENT '胶料ID(关联 mes_material.id)',
|
||||
`material_name` varchar(200) DEFAULT NULL COMMENT '胶料名称冗余',
|
||||
`material_code` varchar(100) DEFAULT NULL COMMENT '胶料编码冗余',
|
||||
`r0_feed_time` decimal(10,2) DEFAULT NULL COMMENT 'R0进胶时间(秒)',
|
||||
`r0_ring_time` decimal(10,2) DEFAULT NULL COMMENT 'R0成环时间(秒)',
|
||||
`r0_break_time` decimal(10,2) DEFAULT NULL COMMENT 'R0拉断时间(秒)',
|
||||
`r0_discharge_time` decimal(10,2) DEFAULT NULL COMMENT 'R0排胶时间(秒)',
|
||||
`r1_feed_time` decimal(10,2) DEFAULT NULL COMMENT 'R1进胶时间(秒)',
|
||||
`r1_ring_time` decimal(10,2) DEFAULT NULL COMMENT 'R1成环时间(秒)',
|
||||
`r1_break_time` decimal(10,2) DEFAULT NULL COMMENT 'R1拉断时间(秒)',
|
||||
`r1_discharge_time` decimal(10,2) DEFAULT NULL COMMENT 'R1排胶时间(秒)',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除(0正常 1已删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_momp_material_id` (`material_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES开炼机参数维护';
|
||||
|
||||
-- 父级目录有子菜单时必须 is_leaf=0,否则菜单管理树/侧边栏不会展开子节点
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `update_time` = NOW()
|
||||
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
|
||||
|
||||
-- 二级菜单:开炼机参数维护(父级 MES技术管理 1900000000000000810)
|
||||
INSERT INTO `sys_permission` (
|
||||
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
|
||||
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
|
||||
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
|
||||
`del_flag`, `rule_flag`, `status`, `internal_or_external`
|
||||
)
|
||||
SELECT
|
||||
'177925970995501', '1900000000000000810', '开炼机参数维护', '/xslmes/mesXslOpenMillParam',
|
||||
'xslmes/mesXslOpenMillParam/MesXslOpenMillParamList', 1, 'MesXslOpenMillParamList', NULL,
|
||||
1, NULL, '0', 1.00, 0, 'ant-design:setting-outlined', 0, 1,
|
||||
0, 0, 'MES开炼机参数维护', 'admin', NOW(), 'admin', NOW(),
|
||||
0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '177925970995501'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 1 AND `name` = '开炼机参数维护' AND `parent_id` = '1900000000000000810')
|
||||
);
|
||||
|
||||
-- 按钮权限
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995502', '177925970995501', '新增', 2, 'xslmes:mes_xsl_open_mill_param:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995502');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995503', '177925970995501', '编辑', 2, 'xslmes:mes_xsl_open_mill_param:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995503');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995504', '177925970995501', '删除', 2, 'xslmes:mes_xsl_open_mill_param:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995504');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995505', '177925970995501', '批量删除', 2, 'xslmes:mes_xsl_open_mill_param:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995505');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995506', '177925970995501', '导出', 2, 'xslmes:mes_xsl_open_mill_param:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995506');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995507', '177925970995501', '导入', 2, 'xslmes:mes_xsl_open_mill_param:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995507');
|
||||
|
||||
-- admin 角色授权
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'177925970995501',
|
||||
'177925970995502',
|
||||
'177925970995503',
|
||||
'177925970995504',
|
||||
'177925970995505',
|
||||
'177925970995506',
|
||||
'177925970995507'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
|
||||
);
|
||||
@@ -0,0 +1,12 @@
|
||||
-- 修复 MES 一级目录菜单:目录节点 is_leaf 必须为 0,否则侧边栏/菜单管理树无法展开子菜单
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
UPDATE `sys_permission`
|
||||
SET
|
||||
`is_leaf` = 0,
|
||||
`component` = 'layouts/RouteView',
|
||||
`menu_type` = 0,
|
||||
`update_by` = 'admin',
|
||||
`update_time` = NOW()
|
||||
WHERE `id` IN ('1900000000000000800', '1900000000000000810', '1900000000000000820')
|
||||
AND `del_flag` = 0;
|
||||
@@ -0,0 +1,130 @@
|
||||
-- MES胶料分类(分类字典 sys_category)
|
||||
-- 前端 JCategorySelect 使用 pcode = XSLMES_RUBBER
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- 根节点:MES胶料分类
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000001', '0', 'MES胶料分类', 'XSLMES_RUBBER', '1', 'admin', NOW()
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER');
|
||||
|
||||
-- 胶料类别(叶子节点,顺序与业务下拉一致)
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000101', root.`id`, '胎面胶', 'XSLMES_RUBBER_TMJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_TMJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000102', root.`id`, '包布胶', 'XSLMES_RUBBER_BBJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_BBJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000103', root.`id`, '子口胶片', 'XSLMES_RUBBER_ZKKJP', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZKKJP');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000104', root.`id`, '三角胶', 'XSLMES_RUBBER_SJJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_SJJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000105', root.`id`, '带束层胶', 'XSLMES_RUBBER_DSJC', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_DSJC');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000106', root.`id`, '输送带胶', 'XSLMES_RUBBER_SSDJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_SSDJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000107', root.`id`, '胶糊胶', 'XSLMES_RUBBER_JHJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JHJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000108', root.`id`, '过渡层', 'XSLMES_RUBBER_GDC', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GDC');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000109', root.`id`, '终炼返炼', 'XSLMES_RUBBER_ZLFL', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZLFL');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000110', root.`id`, '塑炼胶', 'XSLMES_RUBBER_SLJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_SLJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000111', root.`id`, '注射胶', 'XSLMES_RUBBER_ZSJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZSJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000112', root.`id`, '胎侧胶', 'XSLMES_RUBBER_TCJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_TCJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000113', root.`id`, '缠绕胶', 'XSLMES_RUBBER_CRJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_CRJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000114', root.`id`, '骨板胶', 'XSLMES_RUBBER_GBJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GBJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000115', root.`id`, '外层胶', 'XSLMES_RUBBER_WCJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_WCJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000116', root.`id`, '胶芯胶', 'XSLMES_RUBBER_JXJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JXJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000117', root.`id`, '胶囊胶', 'XSLMES_RUBBER_JNJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JNJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000118', root.`id`, '冠带条', 'XSLMES_RUBBER_GDT', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GDT');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000119', root.`id`, '子口耐磨胶', 'XSLMES_RUBBER_ZKNMJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_ZKNMJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000120', root.`id`, '缓冲胶', 'XSLMES_RUBBER_HCJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_HCJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000121', root.`id`, '钢丝胶', 'XSLMES_RUBBER_GSJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GSJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000122', root.`id`, '出口胎面', 'XSLMES_RUBBER_CKTM', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_CKTM');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000123', root.`id`, '帘线胶', 'XSLMES_RUBBER_LXJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_LXJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000124', root.`id`, '基部胶', 'XSLMES_RUBBER_JBJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JBJ');
|
||||
@@ -0,0 +1,27 @@
|
||||
-- MES胶料分类:追加 5 项(已执行 V3.9.2_80 的环境增量脚本)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000120', root.`id`, '缓冲胶', 'XSLMES_RUBBER_HCJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_HCJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000121', root.`id`, '钢丝胶', 'XSLMES_RUBBER_GSJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_GSJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000122', root.`id`, '出口胎面', 'XSLMES_RUBBER_CKTM', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_CKTM');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000123', root.`id`, '帘线胶', 'XSLMES_RUBBER_LXJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_LXJ');
|
||||
|
||||
INSERT INTO `sys_category` (`id`, `pid`, `name`, `code`, `has_child`, `create_by`, `create_time`)
|
||||
SELECT '1994000000000000124', root.`id`, '基部胶', 'XSLMES_RUBBER_JBJ', '0', 'admin', NOW()
|
||||
FROM `sys_category` root WHERE root.`code` = 'XSLMES_RUBBER'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_category` WHERE `code` = 'XSLMES_RUBBER_JBJ');
|
||||
@@ -0,0 +1,28 @@
|
||||
-- 修复 MES胶料分类名称乱码(PowerShell 管道导入时中文被替换成 ?)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
UPDATE `sys_category` SET `name` = 'MES胶料分类', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER';
|
||||
UPDATE `sys_category` SET `name` = '胎面胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_TMJ';
|
||||
UPDATE `sys_category` SET `name` = '包布胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_BBJ';
|
||||
UPDATE `sys_category` SET `name` = '子口胶片', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZKKJP';
|
||||
UPDATE `sys_category` SET `name` = '三角胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_SJJ';
|
||||
UPDATE `sys_category` SET `name` = '带束层胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_DSJC';
|
||||
UPDATE `sys_category` SET `name` = '输送带胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_SSDJ';
|
||||
UPDATE `sys_category` SET `name` = '胶糊胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JHJ';
|
||||
UPDATE `sys_category` SET `name` = '过渡层', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GDC';
|
||||
UPDATE `sys_category` SET `name` = '终炼返炼', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZLFL';
|
||||
UPDATE `sys_category` SET `name` = '塑炼胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_SLJ';
|
||||
UPDATE `sys_category` SET `name` = '注射胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZSJ';
|
||||
UPDATE `sys_category` SET `name` = '胎侧胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_TCJ';
|
||||
UPDATE `sys_category` SET `name` = '缠绕胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_CRJ';
|
||||
UPDATE `sys_category` SET `name` = '骨板胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GBJ';
|
||||
UPDATE `sys_category` SET `name` = '外层胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_WCJ';
|
||||
UPDATE `sys_category` SET `name` = '胶芯胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JXJ';
|
||||
UPDATE `sys_category` SET `name` = '胶囊胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JNJ';
|
||||
UPDATE `sys_category` SET `name` = '冠带条', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GDT';
|
||||
UPDATE `sys_category` SET `name` = '子口耐磨胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_ZKNMJ';
|
||||
UPDATE `sys_category` SET `name` = '缓冲胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_HCJ';
|
||||
UPDATE `sys_category` SET `name` = '钢丝胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_GSJ';
|
||||
UPDATE `sys_category` SET `name` = '出口胎面', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_CKTM';
|
||||
UPDATE `sys_category` SET `name` = '帘线胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_LXJ';
|
||||
UPDATE `sys_category` SET `name` = '基部胶', `update_by` = 'admin', `update_time` = NOW() WHERE `code` = 'XSLMES_RUBBER_JBJ';
|
||||
@@ -0,0 +1,90 @@
|
||||
-- 密炼物料替代对应关系:建表 + 菜单(挂 MES技术管理)+ admin 授权
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_mixer_material_substitute` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`serial_no` int DEFAULT NULL COMMENT '编号(租户内自动累加,从1开始)',
|
||||
`mixer_material_id` varchar(32) NOT NULL COMMENT '密炼物料ID(关联 mes_mixer_material.id)',
|
||||
`mixer_material_code` varchar(100) DEFAULT NULL COMMENT '密炼物料编码冗余',
|
||||
`mixer_material_name` varchar(200) DEFAULT NULL COMMENT '密炼物料名称冗余',
|
||||
`substitute_material_id` varchar(32) NOT NULL COMMENT '替代密炼物料ID(关联 mes_mixer_material.id)',
|
||||
`substitute_material_code` varchar(100) DEFAULT NULL COMMENT '替代密炼物料编码冗余',
|
||||
`substitute_material_name` varchar(200) DEFAULT NULL COMMENT '替代密炼物料名称冗余',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除(0正常 1已删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mxmms_mixer_material_id` (`mixer_material_id`),
|
||||
KEY `idx_mxmms_substitute_material_id` (`substitute_material_id`),
|
||||
KEY `idx_mxmms_tenant_serial` (`tenant_id`, `serial_no`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES密炼物料替代对应关系';
|
||||
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `update_time` = NOW()
|
||||
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
|
||||
|
||||
INSERT INTO `sys_permission` (
|
||||
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
|
||||
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
|
||||
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
|
||||
`del_flag`, `rule_flag`, `status`, `internal_or_external`
|
||||
)
|
||||
SELECT
|
||||
'177925970995511', '1900000000000000810', '密炼物料替代对应关系', '/xslmes/mesXslMixerMaterialSubstitute',
|
||||
'xslmes/mesXslMixerMaterialSubstitute/MesXslMixerMaterialSubstituteList', 1, 'MesXslMixerMaterialSubstituteList', NULL,
|
||||
1, NULL, '0', 2.00, 0, 'ant-design:swap-outlined', 0, 1,
|
||||
0, 0, 'MES密炼物料替代对应关系', 'admin', NOW(), 'admin', NOW(),
|
||||
0, 0, '1', 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_permission`
|
||||
WHERE `id` = '177925970995511'
|
||||
OR (`del_flag` = 0 AND `menu_type` = 1 AND `name` = '密炼物料替代对应关系' AND `parent_id` = '1900000000000000810')
|
||||
);
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995512', '177925970995511', '新增', 2, 'xslmes:mes_xsl_mixer_material_substitute:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995512');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995513', '177925970995511', '编辑', 2, 'xslmes:mes_xsl_mixer_material_substitute:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995513');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995514', '177925970995511', '删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995514');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995515', '177925970995511', '批量删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995515');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995516', '177925970995511', '导出', 2, 'xslmes:mes_xsl_mixer_material_substitute:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995516');
|
||||
|
||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
SELECT '177925970995517', '177925970995511', '导入', 2, 'xslmes:mes_xsl_mixer_material_substitute:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW()
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '177925970995517');
|
||||
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'177925970995511',
|
||||
'177925970995512',
|
||||
'177925970995513',
|
||||
'177925970995514',
|
||||
'177925970995515',
|
||||
'177925970995516',
|
||||
'177925970995517'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
|
||||
);
|
||||
@@ -0,0 +1,52 @@
|
||||
-- 密炼物料替代对应关系:菜单补跑脚本(遇 1213 死锁时单独执行)
|
||||
-- 说明:建表已成功时可只跑本脚本;建议先暂停后端,逐条执行或整段执行一次
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `update_time` = NOW()
|
||||
WHERE `id` = '1900000000000000810';
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (
|
||||
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
|
||||
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
|
||||
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
|
||||
`del_flag`, `rule_flag`, `status`, `internal_or_external`
|
||||
) VALUES (
|
||||
'177925970995511', '1900000000000000810', '密炼物料替代对应关系', '/xslmes/mesXslMixerMaterialSubstitute',
|
||||
'xslmes/mesXslMixerMaterialSubstitute/MesXslMixerMaterialSubstituteList', 1, 'MesXslMixerMaterialSubstituteList', NULL,
|
||||
1, NULL, '0', 2.00, 0, 'ant-design:swap-outlined', 0, 1,
|
||||
0, 0, 'MES密炼物料替代对应关系', 'admin', NOW(), 'admin', NOW(),
|
||||
0, 0, '1', 0
|
||||
);
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995512', '177925970995511', '新增', 2, 'xslmes:mes_xsl_mixer_material_substitute:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995513', '177925970995511', '编辑', 2, 'xslmes:mes_xsl_mixer_material_substitute:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995514', '177925970995511', '删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995515', '177925970995511', '批量删除', 2, 'xslmes:mes_xsl_mixer_material_substitute:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995516', '177925970995511', '导出', 2, 'xslmes:mes_xsl_mixer_material_substitute:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995517', '177925970995511', '导入', 2, 'xslmes:mes_xsl_mixer_material_substitute:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'177925970995511', '177925970995512', '177925970995513', '177925970995514',
|
||||
'177925970995515', '177925970995516', '177925970995517'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
|
||||
);
|
||||
@@ -0,0 +1,39 @@
|
||||
-- mes_material 胶料字段补全(幂等,可重复执行)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
SET @db = DATABASE();
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'erp_code') = 0,
|
||||
'ALTER TABLE `mes_material` ADD COLUMN `erp_code` varchar(64) DEFAULT NULL COMMENT ''ERP编号'' AFTER `customer_id`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'final_shelf_life_days') = 0,
|
||||
'ALTER TABLE `mes_material` ADD COLUMN `final_shelf_life_days` int DEFAULT NULL COMMENT ''终炼胶保质期(天)'' AFTER `erp_code`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'master_shelf_life_days') = 0,
|
||||
'ALTER TABLE `mes_material` ADD COLUMN `master_shelf_life_days` int DEFAULT NULL COMMENT ''母炼胶保质期(天)'' AFTER `final_shelf_life_days`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'min_standing_hours') = 0,
|
||||
'ALTER TABLE `mes_material` ADD COLUMN `min_standing_hours` int DEFAULT NULL COMMENT ''最小停放时间(时)'' AFTER `master_shelf_life_days`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_material' AND COLUMN_NAME = 'is_special_rubber') = 0,
|
||||
'ALTER TABLE `mes_material` ADD COLUMN `is_special_rubber` tinyint DEFAULT 0 COMMENT ''是否为特种胶(0否1是)'' AFTER `enable_flag`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
@@ -0,0 +1,47 @@
|
||||
-- MES 字典:PS归属、施工代号(租户 1002)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
VALUES ('1995000000000000001', 'PS归属', 'xslmes_ps_belong', 'MES PS归属', 0, 'admin', NOW(), 0, 1002);
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000101', '1995000000000000001', '密炼示方', 'ml_formula', 1, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000102', '1995000000000000001', '原材料检验标准', 'raw_inspect_std', 2, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000103', '1995000000000000001', '密炼作业指导书', 'ml_work_instruction', 3, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
VALUES ('1995000000000000002', '施工代号', 'xslmes_construction_code', 'MES 施工代号', 0, 'admin', NOW(), 0, 1002);
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000201', '1995000000000000002', '实验施工', 'exp_construction', 1, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000202', '1995000000000000002', '量试施工', 'trial_construction', 2, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000203', '1995000000000000002', '正规施工', 'formal_construction', 3, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000204', '1995000000000000002', '混配合', 'mixing_compound', 4, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000205', '1995000000000000002', '药品计量', 'chemical_dosing', 5, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000206', '1995000000000000002', '硫化施工', 'vulcanization_construction', 6, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000207', '1995000000000000002', '原材料检测标准', 'raw_test_std', 7, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000208', '1995000000000000002', '硫化作业指导书', 'vulcanization_work_instruction', 8, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000209', '1995000000000000002', '密炼作业指导书', 'ml_work_instruction', 9, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000210', '1995000000000000002', '半制品作业指导书', 'semi_product_work_instruction', 10, 1, 'admin', NOW());
|
||||
@@ -0,0 +1,96 @@
|
||||
-- 密炼PS编制:状态字典 + 建表 + 菜单(挂 MES技术管理)+ admin 授权
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
VALUES ('1995000000000000003', '密炼PS状态', 'xslmes_mixer_ps_status', 'MES密炼PS编制状态', 0, 'admin', NOW(), 0, 1002);
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000301', '1995000000000000003', '编制', 'compile', 1, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000302', '1995000000000000003', '校对', 'proofread', 2, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000303', '1995000000000000003', '审核', 'audit', 3, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000304', '1995000000000000003', '批准', 'approve', 4, 1, 'admin', NOW());
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_mixer_ps_compile` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`factory_id` varchar(32) DEFAULT NULL COMMENT '所属工厂ID(sys_depart.id,公司)',
|
||||
`factory_name` varchar(200) DEFAULT NULL COMMENT '所属工厂名称冗余',
|
||||
`ps_code` varchar(100) DEFAULT NULL COMMENT 'PS编码',
|
||||
`ps_type` varchar(64) DEFAULT NULL COMMENT '类型(字典xslmes_ps_belong)',
|
||||
`construction_code` varchar(64) DEFAULT NULL COMMENT '施工代号(字典xslmes_construction_code)',
|
||||
`issue_date` date DEFAULT NULL COMMENT '发放日期',
|
||||
`send_dept_id` varchar(32) DEFAULT NULL COMMENT '发送部门ID',
|
||||
`receive_dept_id` varchar(32) DEFAULT NULL COMMENT '收信部门ID',
|
||||
`reference_dept_id` varchar(32) DEFAULT NULL COMMENT '参照部门ID',
|
||||
`title` varchar(500) DEFAULT NULL COMMENT '标题',
|
||||
`purpose` text COMMENT '目的',
|
||||
`basis` text COMMENT '依据',
|
||||
`content` text COMMENT '内容',
|
||||
`responsible_person` varchar(100) DEFAULT NULL COMMENT '担当',
|
||||
`status` varchar(32) DEFAULT 'compile' COMMENT '状态(字典xslmes_mixer_ps_status)',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户ID',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` int NOT NULL DEFAULT 0 COMMENT '逻辑删除(0正常 1已删除)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mxmps_ps_code` (`ps_code`),
|
||||
KEY `idx_mxmps_issue_date` (`issue_date`),
|
||||
KEY `idx_mxmps_status` (`status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES密炼PS编制';
|
||||
|
||||
UPDATE `sys_permission`
|
||||
SET `is_leaf` = 0, `update_time` = NOW()
|
||||
WHERE `id` = '1900000000000000810' AND `is_leaf` = 1;
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (
|
||||
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
|
||||
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
|
||||
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
|
||||
`del_flag`, `rule_flag`, `status`, `internal_or_external`
|
||||
) VALUES (
|
||||
'177925970995518', '1900000000000000810', '密炼PS编制', '/xslmes/mesXslMixerPsCompile',
|
||||
'xslmes/mesXslMixerPsCompile/MesXslMixerPsCompileList', 1, 'MesXslMixerPsCompileList', NULL,
|
||||
1, NULL, '0', 3.00, 0, 'ant-design:file-text-outlined', 0, 1,
|
||||
0, 0, 'MES密炼PS编制', 'admin', NOW(), 'admin', NOW(),
|
||||
0, 0, '1', 0
|
||||
);
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995519', '177925970995518', '新增', 2, 'xslmes:mes_xsl_mixer_ps_compile:add', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995520', '177925970995518', '编辑', 2, 'xslmes:mes_xsl_mixer_ps_compile:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995521', '177925970995518', '删除', 2, 'xslmes:mes_xsl_mixer_ps_compile:delete', '1', 3.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995522', '177925970995518', '批量删除', 2, 'xslmes:mes_xsl_mixer_ps_compile:deleteBatch', '1', 4.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995523', '177925970995518', '导出', 2, 'xslmes:mes_xsl_mixer_ps_compile:exportXls', '1', 5.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995524', '177925970995518', '导入', 2, 'xslmes:mes_xsl_mixer_ps_compile:importExcel', '1', 6.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'177925970995518', '177925970995519', '177925970995520',
|
||||
'177925970995521', '177925970995522', '177925970995523', '177925970995524'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
|
||||
);
|
||||
@@ -0,0 +1,36 @@
|
||||
-- 密炼PS编制:状态字典调整为 编制→校对→审核→批准,并增加按钮权限
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
UPDATE `sys_dict_item`
|
||||
SET `item_text` = '校对', `item_value` = 'proofread', `sort_order` = 2, `update_by` = 'admin', `update_time` = NOW()
|
||||
WHERE `dict_id` = '1995000000000000003' AND (`item_value` = 'submitted' OR `id` = '1995000000000000302');
|
||||
|
||||
UPDATE `sys_dict_item`
|
||||
SET `item_text` = '审核', `item_value` = 'audit', `sort_order` = 3, `update_by` = 'admin', `update_time` = NOW()
|
||||
WHERE `dict_id` = '1995000000000000003' AND (`item_value` = 'approved' OR `id` = '1995000000000000303');
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000304', '1995000000000000003', '批准', 'approve', 4, 1, 'admin', NOW());
|
||||
|
||||
UPDATE `mes_xsl_mixer_ps_compile` SET `status` = 'proofread' WHERE `status` = 'submitted';
|
||||
UPDATE `mes_xsl_mixer_ps_compile` SET `status` = 'audit' WHERE `status` = 'approved';
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995525', '177925970995518', '校对', 2, 'xslmes:mes_xsl_mixer_ps_compile:proofread', '1', 7.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995526', '177925970995518', '审核', 2, 'xslmes:mes_xsl_mixer_ps_compile:audit', '1', 8.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995527', '177925970995518', '批准', 2, 'xslmes:mes_xsl_mixer_ps_compile:approve', '1', 9.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN ('177925970995525', '177925970995526', '177925970995527')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
|
||||
);
|
||||
@@ -0,0 +1,52 @@
|
||||
-- 密炼PS编制:校对/审核/批准人时间字段;收信/参照部门支持多选(逗号分隔存储)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
SET @db = DATABASE();
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'proofread_by') = 0,
|
||||
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `proofread_by` varchar(50) DEFAULT NULL COMMENT ''校对人'' AFTER `status`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'proofread_time') = 0,
|
||||
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `proofread_time` datetime DEFAULT NULL COMMENT ''校对时间'' AFTER `proofread_by`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'audit_by') = 0,
|
||||
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `audit_by` varchar(50) DEFAULT NULL COMMENT ''审核人'' AFTER `proofread_time`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'audit_time') = 0,
|
||||
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `audit_time` datetime DEFAULT NULL COMMENT ''审核时间'' AFTER `audit_by`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'approve_by') = 0,
|
||||
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `approve_by` varchar(50) DEFAULT NULL COMMENT ''批准人'' AFTER `audit_time`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @sql = IF(
|
||||
(SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'mes_xsl_mixer_ps_compile' AND COLUMN_NAME = 'approve_time') = 0,
|
||||
'ALTER TABLE `mes_xsl_mixer_ps_compile` ADD COLUMN `approve_time` datetime DEFAULT NULL COMMENT ''批准时间'' AFTER `approve_by`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
ALTER TABLE `mes_xsl_mixer_ps_compile`
|
||||
MODIFY COLUMN `receive_dept_id` varchar(500) DEFAULT NULL COMMENT '收信部门ID(多个逗号分隔)';
|
||||
|
||||
ALTER TABLE `mes_xsl_mixer_ps_compile`
|
||||
MODIFY COLUMN `reference_dept_id` varchar(500) DEFAULT NULL COMMENT '参照部门ID(多个逗号分隔)';
|
||||
@@ -0,0 +1,44 @@
|
||||
-- PS审批历史:状态展示字典(键值与原状态一致,批准改为正式发布)+ 菜单
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
VALUES ('1995000000000000004', '密炼PS审批历史状态', 'xslmes_mixer_ps_history_status', 'PS审批历史状态展示(approve显示为正式发布)', 0, 'admin', NOW(), 0, 1002);
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000401', '1995000000000000004', '编制', 'compile', 1, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000402', '1995000000000000004', '校对', 'proofread', 2, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000403', '1995000000000000004', '审核', 'audit', 3, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000000404', '1995000000000000004', '正式发布', 'approve', 4, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (
|
||||
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
|
||||
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
|
||||
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
|
||||
`del_flag`, `rule_flag`, `status`, `internal_or_external`
|
||||
) VALUES (
|
||||
'177925970995528', '1900000000000000810', 'PS审批历史', '/xslmes/mesXslMixerPsHistory',
|
||||
'xslmes/mesXslMixerPsHistory/MesXslMixerPsHistoryList', 1, 'MesXslMixerPsHistoryList', NULL,
|
||||
1, NULL, '0', 4.00, 0, 'ant-design:history-outlined', 0, 1,
|
||||
0, 0, '查询密炼PS编制已批准记录', 'admin', NOW(), 'admin', NOW(),
|
||||
0, 0, '1', 0
|
||||
);
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995529', '177925970995528', '导出', 2, 'xslmes:mes_xsl_mixer_ps_history:exportXls', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN ('177925970995528', '177925970995529')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.id AND rp.`permission_id` = p.id
|
||||
);
|
||||
@@ -0,0 +1,30 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslMixerMaterialSubstitute/list',
|
||||
save = '/xslmes/mesXslMixerMaterialSubstitute/add',
|
||||
edit = '/xslmes/mesXslMixerMaterialSubstitute/edit',
|
||||
deleteOne = '/xslmes/mesXslMixerMaterialSubstitute/delete',
|
||||
deleteBatch = '/xslmes/mesXslMixerMaterialSubstitute/deleteBatch',
|
||||
importExcel = '/xslmes/mesXslMixerMaterialSubstitute/importExcel',
|
||||
exportXls = '/xslmes/mesXslMixerMaterialSubstitute/exportXls',
|
||||
queryById = '/xslmes/mesXslMixerMaterialSubstitute/queryById',
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
export const deleteOne = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const batchDelete = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url, params }, { successMessageMode: 'none' });
|
||||
};
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
@@ -0,0 +1,102 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '编号', align: 'center', dataIndex: 'serialNo', width: 80 },
|
||||
{ title: '密炼物料编码', align: 'center', dataIndex: 'mixerMaterialCode', width: 130 },
|
||||
{ title: '密炼物料名称', align: 'center', dataIndex: 'mixerMaterialName', width: 160 },
|
||||
{ title: '替代密炼物料编码', align: 'center', dataIndex: 'substituteMaterialCode', width: 140 },
|
||||
{ title: '替代密炼物料名称', align: 'center', dataIndex: 'substituteMaterialName', width: 160 },
|
||||
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100, defaultHidden: true },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165 },
|
||||
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100, defaultHidden: true },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '密炼物料',
|
||||
field: 'mixerMaterialId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'mes_mixer_material,material_name,id',
|
||||
placeholder: '请选择密炼物料',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '密炼物料编码', field: 'mixerMaterialCode', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '密炼物料名称', field: 'mixerMaterialName', component: 'JInput', colProps: { span: 6 } },
|
||||
{
|
||||
label: '替代密炼物料',
|
||||
field: 'substituteMaterialId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'mes_mixer_material,material_name,id',
|
||||
placeholder: '请选择替代密炼物料',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '替代物料编码', field: 'substituteMaterialCode', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '替代物料名称', field: 'substituteMaterialName', component: 'JInput', colProps: { span: 6 } },
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{
|
||||
label: '编号',
|
||||
field: 'serialNo',
|
||||
component: 'InputNumber',
|
||||
componentProps: { disabled: true, placeholder: '保存后自动生成', style: { width: '100%' } },
|
||||
ifShow: ({ values }) => !!values.serialNo,
|
||||
},
|
||||
{
|
||||
label: '密炼物料',
|
||||
field: 'mixerMaterialName',
|
||||
component: 'Input',
|
||||
slot: 'mixerMaterialPicker',
|
||||
dynamicRules: () => [{ required: true, message: '请选择密炼物料' }],
|
||||
},
|
||||
{ label: '', field: 'mixerMaterialId', component: 'Input', show: false },
|
||||
{
|
||||
label: '密炼物料编码',
|
||||
field: 'mixerMaterialCode',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '选择密炼物料后自动带出' },
|
||||
},
|
||||
{
|
||||
label: '替代密炼物料',
|
||||
field: 'substituteMaterialName',
|
||||
component: 'Input',
|
||||
slot: 'substituteMaterialPicker',
|
||||
dynamicRules: () => [{ required: true, message: '请选择替代密炼物料' }],
|
||||
},
|
||||
{ label: '', field: 'substituteMaterialId', component: 'Input', show: false },
|
||||
{
|
||||
label: '替代密炼物料编码',
|
||||
field: 'substituteMaterialCode',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '选择替代密炼物料后自动带出' },
|
||||
},
|
||||
];
|
||||
|
||||
export const superQuerySchema = {
|
||||
serialNo: { title: '编号', order: 0, view: 'number' },
|
||||
mixerMaterialId: {
|
||||
title: '密炼物料',
|
||||
order: 1,
|
||||
view: 'sel_search',
|
||||
dictTable: 'mes_mixer_material',
|
||||
dictCode: 'id',
|
||||
dictText: 'material_name',
|
||||
},
|
||||
mixerMaterialCode: { title: '密炼物料编码', order: 2, view: 'text' },
|
||||
mixerMaterialName: { title: '密炼物料名称', order: 3, view: 'text' },
|
||||
substituteMaterialId: {
|
||||
title: '替代密炼物料',
|
||||
order: 4,
|
||||
view: 'sel_search',
|
||||
dictTable: 'mes_mixer_material',
|
||||
dictCode: 'id',
|
||||
dictText: 'material_name',
|
||||
},
|
||||
substituteMaterialCode: { title: '替代密炼物料编码', order: 5, view: 'text' },
|
||||
substituteMaterialName: { title: '替代密炼物料名称', order: 6, view: 'text' },
|
||||
};
|
||||
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_material_substitute:add'"
|
||||
@click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined"
|
||||
>
|
||||
新增
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_material_substitute:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_material_substitute:importExcel'"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>
|
||||
导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'xslmes:mes_xsl_mixer_material_substitute:deleteBatch'">
|
||||
批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'xslmes:mes_xsl_mixer_material_substitute:edit',
|
||||
},
|
||||
]"
|
||||
:dropDownActions="getDropDownAction(record)"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslMixerMaterialSubstituteModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslMixerMaterialSubstitute" setup>
|
||||
import { reactive } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import Icon from '/@/components/Icon';
|
||||
import MesXslMixerMaterialSubstituteModal from './components/MesXslMixerMaterialSubstituteModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './MesXslMixerMaterialSubstitute.data';
|
||||
import { list, deleteOne, batchDelete, getExportUrl, getImportUrl } from './MesXslMixerMaterialSubstitute.api';
|
||||
|
||||
const queryParam = reactive<any>({});
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '密炼物料替代对应关系',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 110,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
},
|
||||
actionColumn: {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
beforeFetch: (params) => Object.assign(params, queryParam),
|
||||
},
|
||||
exportConfig: {
|
||||
name: '密炼物料替代对应关系',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).forEach((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
openModal(true, { isUpdate: false, showFooter: true });
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: true });
|
||||
}
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
function batchHandleDelete() {
|
||||
batchDelete({ ids: selectedRowKeys.value.join(',') }, handleSuccess);
|
||||
}
|
||||
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
}
|
||||
|
||||
function getDropDownAction(record: Recordable) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
|
||||
auth: 'xslmes:mes_xsl_mixer_material_substitute:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="860" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm">
|
||||
<template #mixerMaterialPicker="{ model }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input
|
||||
v-model:value="model.mixerMaterialName"
|
||||
read-only
|
||||
placeholder="请点击选择密炼物料"
|
||||
style="flex: 1"
|
||||
:disabled="isDetail"
|
||||
/>
|
||||
<a-button type="primary" :disabled="isDetail" @click="openMixerSelect('mixer')">选择</a-button>
|
||||
<a-button v-if="model.mixerMaterialId && !isDetail" @click="clearMixer('mixer', model)">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
<template #substituteMaterialPicker="{ model }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input
|
||||
v-model:value="model.substituteMaterialName"
|
||||
read-only
|
||||
placeholder="请点击选择替代密炼物料"
|
||||
style="flex: 1"
|
||||
:disabled="isDetail"
|
||||
/>
|
||||
<a-button type="primary" :disabled="isDetail" @click="openMixerSelect('substitute')">选择</a-button>
|
||||
<a-button v-if="model.substituteMaterialId && !isDetail" @click="clearMixer('substitute', model)">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
</BasicForm>
|
||||
<MesMixerMaterialSelectModal @register="registerMixerModal" @select="onMixerSelect" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import MesMixerMaterialSelectModal from '/@/views/mes/material/modules/MesMixerMaterialSelectModal.vue';
|
||||
import { formSchema } from '../MesXslMixerMaterialSubstitute.data';
|
||||
import { saveOrUpdate } from '../MesXslMixerMaterialSubstitute.api';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
const pickerTarget = ref<'mixer' | 'substitute'>('mixer');
|
||||
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, getFieldsValue, scrollToField }] = useForm({
|
||||
labelWidth: 140,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const [registerMixerModal, { openModal: openMixerModal }] = useModal();
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue({ ...data.record });
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : unref(isDetail) ? '详情' : '编辑'));
|
||||
|
||||
function openMixerSelect(target: 'mixer' | 'substitute') {
|
||||
pickerTarget.value = target;
|
||||
const values = getFieldsValue();
|
||||
const mid = target === 'mixer' ? values?.mixerMaterialId : values?.substituteMaterialId;
|
||||
openMixerModal(true, { mixerMaterialId: mid });
|
||||
}
|
||||
|
||||
function onMixerSelect(payload: Recordable | null) {
|
||||
if (!payload) {
|
||||
return;
|
||||
}
|
||||
if (pickerTarget.value === 'mixer') {
|
||||
setFieldsValue({
|
||||
mixerMaterialId: payload.mixerMaterialId,
|
||||
mixerMaterialName: payload.materialName || '',
|
||||
mixerMaterialCode: '',
|
||||
});
|
||||
fillMaterialCode(payload.mixerMaterialId, 'mixer');
|
||||
} else {
|
||||
setFieldsValue({
|
||||
substituteMaterialId: payload.mixerMaterialId,
|
||||
substituteMaterialName: payload.materialName || '',
|
||||
substituteMaterialCode: '',
|
||||
});
|
||||
fillMaterialCode(payload.mixerMaterialId, 'substitute');
|
||||
}
|
||||
}
|
||||
|
||||
async function fillMaterialCode(id: string, target: 'mixer' | 'substitute') {
|
||||
if (!id) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const { queryById } = await import('/@/views/mes/material/MesMixerMaterial.api');
|
||||
const raw = await queryById({ id });
|
||||
const row = (raw as Recordable)?.materialCode != null ? raw : (raw as Recordable)?.result;
|
||||
if (row?.materialCode) {
|
||||
if (target === 'mixer') {
|
||||
setFieldsValue({ mixerMaterialCode: row.materialCode, mixerMaterialName: row.materialName || '' });
|
||||
} else {
|
||||
setFieldsValue({ substituteMaterialCode: row.materialCode, substituteMaterialName: row.materialName || '' });
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
function clearMixer(target: 'mixer' | 'substitute', model: Recordable) {
|
||||
if (target === 'mixer') {
|
||||
model.mixerMaterialId = '';
|
||||
model.mixerMaterialName = '';
|
||||
model.mixerMaterialCode = '';
|
||||
} else {
|
||||
model.substituteMaterialId = '';
|
||||
model.substituteMaterialName = '';
|
||||
model.substituteMaterialCode = '';
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
if (!values.mixerMaterialId) {
|
||||
createMessage.warning('请选择密炼物料');
|
||||
return;
|
||||
}
|
||||
if (!values.substituteMaterialId) {
|
||||
createMessage.warning('请选择替代密炼物料');
|
||||
return;
|
||||
}
|
||||
if (values.mixerMaterialId === values.substituteMaterialId) {
|
||||
createMessage.warning('密炼物料与替代密炼物料不能相同');
|
||||
return;
|
||||
}
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, unref(isUpdate));
|
||||
createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e: any) {
|
||||
if (e?.errorFields) {
|
||||
const firstField = e.errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(e);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,39 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslMixerPsCompile/list',
|
||||
save = '/xslmes/mesXslMixerPsCompile/add',
|
||||
edit = '/xslmes/mesXslMixerPsCompile/edit',
|
||||
deleteOne = '/xslmes/mesXslMixerPsCompile/delete',
|
||||
deleteBatch = '/xslmes/mesXslMixerPsCompile/deleteBatch',
|
||||
importExcel = '/xslmes/mesXslMixerPsCompile/importExcel',
|
||||
exportXls = '/xslmes/mesXslMixerPsCompile/exportXls',
|
||||
queryById = '/xslmes/mesXslMixerPsCompile/queryById',
|
||||
proofread = '/xslmes/mesXslMixerPsCompile/proofread',
|
||||
audit = '/xslmes/mesXslMixerPsCompile/audit',
|
||||
approve = '/xslmes/mesXslMixerPsCompile/approve',
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
export const deleteOne = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const batchDelete = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url, params }, { successMessageMode: 'none' });
|
||||
};
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
export const proofread = (params: { ids: string }) => defHttp.post({ url: Api.proofread, params }, { joinParamsToUrl: true });
|
||||
|
||||
export const audit = (params: { ids: string }) => defHttp.post({ url: Api.audit, params }, { joinParamsToUrl: true });
|
||||
|
||||
export const approve = (params: { ids: string }) => defHttp.post({ url: Api.approve, params }, { joinParamsToUrl: true });
|
||||
@@ -0,0 +1,286 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
const colHalf = { span: 12 };
|
||||
|
||||
const deptSelectBase = {
|
||||
sync: false,
|
||||
checkStrictly: true,
|
||||
defaultExpandLevel: 2,
|
||||
};
|
||||
|
||||
const deptSelectSingleProps = {
|
||||
...deptSelectBase,
|
||||
multiple: false,
|
||||
};
|
||||
|
||||
const deptSelectProps = {
|
||||
...deptSelectBase,
|
||||
multiple: true,
|
||||
};
|
||||
|
||||
const hasWorkflowInfo = ({ values }) =>
|
||||
!!(values.proofreadBy || values.proofreadTime || values.auditBy || values.auditTime || values.approveBy || values.approveTime);
|
||||
|
||||
function sectionDivider(label: string, field: string, ifShow?: FormSchema['ifShow']): FormSchema {
|
||||
return {
|
||||
field,
|
||||
label,
|
||||
component: 'Divider',
|
||||
componentProps: { orientation: 'left', plain: false },
|
||||
colProps: { span: 24 },
|
||||
ifShow,
|
||||
};
|
||||
}
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: 'PS编码', align: 'center', dataIndex: 'psCode', width: 140 },
|
||||
{ title: '类型', align: 'center', dataIndex: 'psType_dictText', width: 110 },
|
||||
{ title: '发放日期', align: 'center', dataIndex: 'issueDate', width: 110 },
|
||||
{ title: '发送部门', align: 'center', dataIndex: 'sendDeptId_dictText', width: 120 },
|
||||
{ title: '收信部门', align: 'center', dataIndex: 'receiveDeptId_dictText', width: 160 },
|
||||
{ title: '参照部门', align: 'center', dataIndex: 'referenceDeptId_dictText', width: 160 },
|
||||
{ title: '标题', align: 'center', dataIndex: 'title', width: 180 },
|
||||
{ title: '目的', align: 'center', dataIndex: 'purpose', width: 160, defaultHidden: true },
|
||||
{ title: '依据', align: 'center', dataIndex: 'basis', width: 160, defaultHidden: true },
|
||||
{ title: '担当', align: 'center', dataIndex: 'responsiblePerson', width: 90 },
|
||||
{ title: '状态', align: 'center', dataIndex: 'status_dictText', width: 90 },
|
||||
{
|
||||
title: '编制人',
|
||||
align: 'center',
|
||||
dataIndex: 'compileBy',
|
||||
width: 100,
|
||||
customRender: ({ record }) => record?.createBy_dictText || record?.createBy || '',
|
||||
},
|
||||
{ title: '校对人', align: 'center', dataIndex: 'proofreadBy', width: 100, defaultHidden: true },
|
||||
{ title: '校对时间', align: 'center', dataIndex: 'proofreadTime', width: 165, defaultHidden: true },
|
||||
{ title: '审核人', align: 'center', dataIndex: 'auditBy', width: 100, defaultHidden: true },
|
||||
{ title: '审核时间', align: 'center', dataIndex: 'auditTime', width: 165, defaultHidden: true },
|
||||
{ title: '批准人', align: 'center', dataIndex: 'approveBy', width: 100, defaultHidden: true },
|
||||
{ title: '批准时间', align: 'center', dataIndex: 'approveTime', width: 165, defaultHidden: true },
|
||||
{ title: '所属工厂', align: 'center', dataIndex: 'factoryName', width: 120, defaultHidden: true },
|
||||
{ title: '施工代号', align: 'center', dataIndex: 'constructionCode_dictText', width: 110, defaultHidden: true },
|
||||
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100, defaultHidden: true },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165 },
|
||||
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100, defaultHidden: true },
|
||||
{ title: '修改时间', align: 'center', dataIndex: 'updateTime', width: 165, defaultHidden: true },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: 'PS编码', field: 'psCode', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '标题', field: 'title', component: 'JInput', colProps: { span: 6 } },
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'JDictSelectTag',
|
||||
defaultValue: 'compile',
|
||||
componentProps: { dictCode: 'xslmes_mixer_ps_status', placeholder: '请选择状态' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '开始日期',
|
||||
field: 'issueDate_begin',
|
||||
component: 'DatePicker',
|
||||
componentProps: { valueFormat: 'YYYY-MM-DD', placeholder: '发放日期起' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '结束日期',
|
||||
field: 'issueDate_end',
|
||||
component: 'DatePicker',
|
||||
componentProps: { valueFormat: 'YYYY-MM-DD', placeholder: '发放日期止' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
field: 'psType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'xslmes_ps_belong' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
|
||||
sectionDivider('基本信息', 'dividerBasic'),
|
||||
{
|
||||
label: 'PS编码',
|
||||
field: 'psCode',
|
||||
component: 'Input',
|
||||
colProps: colHalf,
|
||||
componentProps: { placeholder: '请输入PS编码', allowClear: true },
|
||||
},
|
||||
{
|
||||
label: 'PS归属',
|
||||
field: 'psType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'xslmes_ps_belong', placeholder: '请选择PS归属' },
|
||||
colProps: colHalf,
|
||||
},
|
||||
{
|
||||
label: '施工代号',
|
||||
field: 'constructionCode',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'xslmes_construction_code', placeholder: '请选择施工代号' },
|
||||
colProps: colHalf,
|
||||
},
|
||||
{
|
||||
label: '发放日期',
|
||||
field: 'issueDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: { valueFormat: 'YYYY-MM-DD', style: { width: '100%' }, placeholder: '请选择发放日期' },
|
||||
colProps: colHalf,
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'JDictSelectTag',
|
||||
defaultValue: 'compile',
|
||||
componentProps: { dictCode: 'xslmes_mixer_ps_status', disabled: true },
|
||||
colProps: colHalf,
|
||||
},
|
||||
{
|
||||
label: '编制人',
|
||||
field: 'compileBy',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, bordered: false, placeholder: '保存后按创建人显示' },
|
||||
colProps: colHalf,
|
||||
itemProps: { class: 'ps-workflow-item' },
|
||||
},
|
||||
{
|
||||
label: '担当',
|
||||
field: 'responsiblePerson',
|
||||
component: 'Input',
|
||||
colProps: colHalf,
|
||||
componentProps: { placeholder: '请输入担当', allowClear: true },
|
||||
},
|
||||
{
|
||||
label: '标题',
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
componentProps: { placeholder: '请输入标题', allowClear: true },
|
||||
dynamicRules: () => [{ required: true, message: '请输入标题' }],
|
||||
},
|
||||
|
||||
sectionDivider('组织与部门', 'dividerDept'),
|
||||
{
|
||||
label: '所属工厂',
|
||||
field: 'factoryId',
|
||||
component: 'JSelectDept',
|
||||
componentProps: deptSelectSingleProps,
|
||||
colProps: colHalf,
|
||||
},
|
||||
{
|
||||
label: '发送部门',
|
||||
field: 'sendDeptId',
|
||||
component: 'JSelectDept',
|
||||
componentProps: deptSelectSingleProps,
|
||||
colProps: colHalf,
|
||||
},
|
||||
{
|
||||
label: '收信部门',
|
||||
field: 'receiveDeptId',
|
||||
component: 'JSelectDept',
|
||||
componentProps: deptSelectProps,
|
||||
colProps: colHalf,
|
||||
dynamicRules: () => [{ required: true, message: '请选择收信部门' }],
|
||||
},
|
||||
{
|
||||
label: '参照部门',
|
||||
field: 'referenceDeptId',
|
||||
component: 'JSelectDept',
|
||||
componentProps: deptSelectProps,
|
||||
colProps: colHalf,
|
||||
dynamicRules: () => [{ required: true, message: '请选择参照部门' }],
|
||||
},
|
||||
|
||||
sectionDivider('文档内容', 'dividerContent'),
|
||||
{
|
||||
label: '目的',
|
||||
field: 'purpose',
|
||||
component: 'InputTextArea',
|
||||
componentProps: { rows: 3, placeholder: '请输入目的', maxlength: 500, showCount: true },
|
||||
colProps: colHalf,
|
||||
},
|
||||
{
|
||||
label: '依据',
|
||||
field: 'basis',
|
||||
component: 'InputTextArea',
|
||||
componentProps: { rows: 3, placeholder: '请输入依据', maxlength: 500, showCount: true },
|
||||
colProps: colHalf,
|
||||
},
|
||||
{
|
||||
label: '内容',
|
||||
field: 'content',
|
||||
component: 'InputTextArea',
|
||||
componentProps: { rows: 5, placeholder: '请输入内容', maxlength: 2000, showCount: true },
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
|
||||
sectionDivider('审批记录', 'dividerWorkflow', hasWorkflowInfo),
|
||||
{
|
||||
label: '校对人',
|
||||
field: 'proofreadBy',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, bordered: false },
|
||||
colProps: colHalf,
|
||||
itemProps: { class: 'ps-workflow-item' },
|
||||
ifShow: ({ values }) => !!values.proofreadBy,
|
||||
},
|
||||
{
|
||||
label: '校对时间',
|
||||
field: 'proofreadTime',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, bordered: false },
|
||||
colProps: colHalf,
|
||||
itemProps: { class: 'ps-workflow-item' },
|
||||
ifShow: ({ values }) => !!values.proofreadTime,
|
||||
},
|
||||
{
|
||||
label: '审核人',
|
||||
field: 'auditBy',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, bordered: false },
|
||||
colProps: colHalf,
|
||||
itemProps: { class: 'ps-workflow-item' },
|
||||
ifShow: ({ values }) => !!values.auditBy,
|
||||
},
|
||||
{
|
||||
label: '审核时间',
|
||||
field: 'auditTime',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, bordered: false },
|
||||
colProps: colHalf,
|
||||
itemProps: { class: 'ps-workflow-item' },
|
||||
ifShow: ({ values }) => !!values.auditTime,
|
||||
},
|
||||
{
|
||||
label: '批准人',
|
||||
field: 'approveBy',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, bordered: false },
|
||||
colProps: colHalf,
|
||||
itemProps: { class: 'ps-workflow-item' },
|
||||
ifShow: ({ values }) => !!values.approveBy,
|
||||
},
|
||||
{
|
||||
label: '批准时间',
|
||||
field: 'approveTime',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, bordered: false },
|
||||
colProps: colHalf,
|
||||
itemProps: { class: 'ps-workflow-item' },
|
||||
ifShow: ({ values }) => !!values.approveTime,
|
||||
},
|
||||
];
|
||||
|
||||
export const superQuerySchema = {
|
||||
psCode: { title: 'PS编码', order: 0, view: 'text' },
|
||||
psType: { title: '类型', order: 1, view: 'list', dictCode: 'xslmes_ps_belong' },
|
||||
constructionCode: { title: '施工代号', order: 2, view: 'list', dictCode: 'xslmes_construction_code' },
|
||||
issueDate: { title: '发放日期', order: 3, view: 'date' },
|
||||
title: { title: '标题', order: 4, view: 'text' },
|
||||
status: { title: '状态', order: 5, view: 'list', dictCode: 'xslmes_mixer_ps_status' },
|
||||
responsiblePerson: { title: '担当', order: 6, view: 'text' },
|
||||
};
|
||||
@@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_ps_compile:add'"
|
||||
@click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined"
|
||||
>
|
||||
新增
|
||||
</a-button>
|
||||
<a-button
|
||||
v-auth="'xslmes:mes_xsl_mixer_ps_compile:proofread'"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
preIcon="ant-design:check-circle-outlined"
|
||||
@click="handleProofread"
|
||||
>
|
||||
校对
|
||||
</a-button>
|
||||
<a-button
|
||||
v-auth="'xslmes:mes_xsl_mixer_ps_compile:audit'"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
preIcon="ant-design:audit-outlined"
|
||||
@click="handleAudit"
|
||||
>
|
||||
审核
|
||||
</a-button>
|
||||
<a-button
|
||||
v-auth="'xslmes:mes_xsl_mixer_ps_compile:approve'"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
preIcon="ant-design:safety-certificate-outlined"
|
||||
@click="handleApprove"
|
||||
>
|
||||
批准
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_ps_compile:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_ps_compile:importExcel'"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>
|
||||
导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0 && hasCompileSelection">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'xslmes:mes_xsl_mixer_ps_compile:deleteBatch'">
|
||||
批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'xslmes:mes_xsl_mixer_ps_compile:edit',
|
||||
ifShow: isCompileStatus(record),
|
||||
},
|
||||
]"
|
||||
:dropDownActions="getDropDownAction(record)"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslMixerPsCompileModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslMixerPsCompile" setup>
|
||||
import { computed, reactive } from 'vue';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import Icon from '/@/components/Icon';
|
||||
import MesXslMixerPsCompileModal from './components/MesXslMixerPsCompileModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './MesXslMixerPsCompile.data';
|
||||
import {
|
||||
list,
|
||||
deleteOne,
|
||||
batchDelete,
|
||||
getExportUrl,
|
||||
getImportUrl,
|
||||
proofread,
|
||||
audit,
|
||||
approve,
|
||||
} from './MesXslMixerPsCompile.api';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
|
||||
const queryParam = reactive<any>({});
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '密炼PS编制',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
tableSetting: { cacheKey: 'mesXslMixerPsCompile_v20260520' },
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 90,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
},
|
||||
actionColumn: {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
beforeFetch: (params) => Object.assign(params, queryParam),
|
||||
},
|
||||
exportConfig: {
|
||||
name: '密炼PS编制',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
const isCompileStatus = (record?: Recordable) => !record?.status || record.status === 'compile';
|
||||
|
||||
const hasCompileSelection = computed(
|
||||
() => selectedRows.value.length > 0 && selectedRows.value.every((row) => isCompileStatus(row)),
|
||||
);
|
||||
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).forEach((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
openModal(true, { isUpdate: false, showFooter: true });
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
if (record.status && record.status !== 'compile') {
|
||||
createMessage.warning('仅编制状态的单据允许编辑');
|
||||
return;
|
||||
}
|
||||
openModal(true, { record, isUpdate: true, showFooter: true });
|
||||
}
|
||||
|
||||
function handleStatusAction(action: 'proofread' | 'audit' | 'approve', label: string) {
|
||||
if (selectedRowKeys.value.length === 0) {
|
||||
createMessage.warning('请先选择要' + label + '的记录');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '确认' + label,
|
||||
content: `确定对选中的 ${selectedRowKeys.value.length} 条记录执行${label}吗?`,
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
const ids = selectedRowKeys.value.join(',');
|
||||
const fn = action === 'proofread' ? proofread : action === 'audit' ? audit : approve;
|
||||
await fn({ ids });
|
||||
createMessage.success(label + '成功');
|
||||
handleSuccess();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleProofread() {
|
||||
handleStatusAction('proofread', '校对');
|
||||
}
|
||||
|
||||
function handleAudit() {
|
||||
handleStatusAction('audit', '审核');
|
||||
}
|
||||
|
||||
function handleApprove() {
|
||||
handleStatusAction('approve', '批准');
|
||||
}
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
function handleDelete(record: Recordable) {
|
||||
if (!isCompileStatus(record)) {
|
||||
createMessage.warning('仅编制状态的单据允许删除');
|
||||
return;
|
||||
}
|
||||
deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
function batchHandleDelete() {
|
||||
if (!hasCompileSelection.value) {
|
||||
createMessage.warning('仅编制状态的单据允许删除,请取消已流转记录的勾选');
|
||||
return;
|
||||
}
|
||||
batchDelete({ ids: selectedRowKeys.value.join(',') }, handleSuccess);
|
||||
}
|
||||
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
}
|
||||
|
||||
function getDropDownAction(record: Recordable) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
|
||||
auth: 'xslmes:mes_xsl_mixer_ps_compile:delete',
|
||||
ifShow: isCompileStatus(record),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
@register="registerModal"
|
||||
destroyOnClose
|
||||
:title="title"
|
||||
:width="1000"
|
||||
wrapClassName="ps-compile-modal-wrap"
|
||||
@ok="handleSubmit"
|
||||
>
|
||||
<div class="ps-compile-modal-body">
|
||||
<BasicForm @register="registerForm" />
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { formSchema } from '../MesXslMixerPsCompile.data';
|
||||
import { saveOrUpdate } from '../MesXslMixerPsCompile.api';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const userStore = useUserStore();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
const modalTitleOverride = ref('');
|
||||
const statusDictCode = ref('xslmes_mixer_ps_status');
|
||||
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, scrollToField, updateSchema }] = useForm({
|
||||
labelWidth: 96,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
rowProps: { gutter: 16 },
|
||||
compact: true,
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !data?.showFooter;
|
||||
modalTitleOverride.value = data?.modalTitle || '';
|
||||
statusDictCode.value = data?.statusDictCode || 'xslmes_mixer_ps_status';
|
||||
await updateSchema([
|
||||
{
|
||||
field: 'status',
|
||||
componentProps: { dictCode: statusDictCode.value, disabled: true },
|
||||
},
|
||||
]);
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue(normalizeRecord(data.record));
|
||||
} else {
|
||||
await setFieldsValue({ compileBy: resolveCompileBy() });
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const title = computed(() => {
|
||||
if (modalTitleOverride.value) {
|
||||
return modalTitleOverride.value;
|
||||
}
|
||||
return !unref(isUpdate) ? '新增PS' : unref(isDetail) ? 'PS详情' : '编辑PS';
|
||||
});
|
||||
|
||||
function parseDeptIds(value: unknown): string[] {
|
||||
if (Array.isArray(value)) {
|
||||
return value.filter((v) => v != null && String(v).trim() !== '').map(String);
|
||||
}
|
||||
if (value == null || value === '') {
|
||||
return [];
|
||||
}
|
||||
return String(value)
|
||||
.split(',')
|
||||
.map((v) => v.trim())
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
function joinDeptIds(value: unknown): string {
|
||||
const arr = parseDeptIds(value);
|
||||
return arr.length ? arr.join(',') : '';
|
||||
}
|
||||
|
||||
function resolveCompileBy(record?: Recordable) {
|
||||
if (record?.createBy_dictText || record?.createBy) {
|
||||
return record.createBy_dictText || record.createBy || '';
|
||||
}
|
||||
const user = userStore.getUserInfo;
|
||||
return user?.realname || user?.username || '';
|
||||
}
|
||||
|
||||
function normalizeRecord(record?: Recordable) {
|
||||
if (!record) {
|
||||
return record;
|
||||
}
|
||||
return {
|
||||
...record,
|
||||
compileBy: resolveCompileBy(record),
|
||||
receiveDeptId: parseDeptIds(record.receiveDeptId),
|
||||
referenceDeptId: parseDeptIds(record.referenceDeptId),
|
||||
};
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
delete values.compileBy;
|
||||
values.receiveDeptId = joinDeptIds(values.receiveDeptId);
|
||||
values.referenceDeptId = joinDeptIds(values.referenceDeptId);
|
||||
if (!values.receiveDeptId) {
|
||||
createMessage.warning('请选择收信部门');
|
||||
return;
|
||||
}
|
||||
if (!values.referenceDeptId) {
|
||||
createMessage.warning('请选择参照部门');
|
||||
return;
|
||||
}
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, unref(isUpdate));
|
||||
createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e: any) {
|
||||
if (e?.errorFields) {
|
||||
const firstField = e.errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(e);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ps-compile-modal-body {
|
||||
padding: 4px 8px 0;
|
||||
max-height: calc(100vh - 220px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
:deep(.ant-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-divider-horizontal.ant-divider-with-text-left) {
|
||||
margin: 8px 0 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
border-color: #e8e8e8;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-form-item) {
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
:deep(.ps-workflow-item) {
|
||||
margin-bottom: 8px;
|
||||
|
||||
.ant-form-item-label > label {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
.ant-input[disabled] {
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
cursor: default;
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.JSelectDept .j-select-row) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="less">
|
||||
.ps-compile-modal-wrap {
|
||||
.ant-modal-body {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,2 @@
|
||||
/** 复用密炼PS编制接口,仅查询已批准(approve)记录 */
|
||||
export { list, getExportUrl } from '../mesXslMixerPsCompile/MesXslMixerPsCompile.api';
|
||||
@@ -0,0 +1,89 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
/** PS审批历史专用状态字典(键值与原状态一致,批准显示为正式发布) */
|
||||
export const PS_HISTORY_STATUS_DICT = 'xslmes_mixer_ps_history_status';
|
||||
|
||||
const historyStatusTextMap: Record<string, string> = {
|
||||
compile: '编制',
|
||||
proofread: '校对',
|
||||
audit: '审核',
|
||||
approve: '正式发布',
|
||||
};
|
||||
|
||||
export function renderHistoryStatus(text?: string) {
|
||||
if (!text) {
|
||||
return '';
|
||||
}
|
||||
return historyStatusTextMap[text] || text;
|
||||
}
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: 'PS编码', align: 'center', dataIndex: 'psCode', width: 140 },
|
||||
{ title: '类型', align: 'center', dataIndex: 'psType_dictText', width: 110 },
|
||||
{ title: '发放日期', align: 'center', dataIndex: 'issueDate', width: 110 },
|
||||
{ title: '发送部门', align: 'center', dataIndex: 'sendDeptId_dictText', width: 120 },
|
||||
{ title: '收信部门', align: 'center', dataIndex: 'receiveDeptId_dictText', width: 160 },
|
||||
{ title: '参照部门', align: 'center', dataIndex: 'referenceDeptId_dictText', width: 160 },
|
||||
{ title: '标题', align: 'center', dataIndex: 'title', width: 180 },
|
||||
{ title: '担当', align: 'center', dataIndex: 'responsiblePerson', width: 90 },
|
||||
{
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status',
|
||||
width: 100,
|
||||
customRender: ({ text }) => renderHistoryStatus(text),
|
||||
},
|
||||
{
|
||||
title: '编制人',
|
||||
align: 'center',
|
||||
dataIndex: 'compileBy',
|
||||
width: 100,
|
||||
customRender: ({ record }) => record?.createBy_dictText || record?.createBy || '',
|
||||
},
|
||||
{ title: '校对人', align: 'center', dataIndex: 'proofreadBy', width: 100 },
|
||||
{ title: '校对时间', align: 'center', dataIndex: 'proofreadTime', width: 165 },
|
||||
{ title: '审核人', align: 'center', dataIndex: 'auditBy', width: 100 },
|
||||
{ title: '审核时间', align: 'center', dataIndex: 'auditTime', width: 165 },
|
||||
{ title: '发布人', align: 'center', dataIndex: 'approveBy', width: 100 },
|
||||
{ title: '发布时间', align: 'center', dataIndex: 'approveTime', width: 165 },
|
||||
{ title: '所属工厂', align: 'center', dataIndex: 'factoryName', width: 120, defaultHidden: true },
|
||||
{ title: '施工代号', align: 'center', dataIndex: 'constructionCode_dictText', width: 110, defaultHidden: true },
|
||||
{ title: '目的', align: 'center', dataIndex: 'purpose', width: 160, defaultHidden: true },
|
||||
{ title: '依据', align: 'center', dataIndex: 'basis', width: 160, defaultHidden: true },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165, defaultHidden: true },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '开始日期',
|
||||
field: 'issueDate_begin',
|
||||
component: 'DatePicker',
|
||||
componentProps: { valueFormat: 'YYYY-MM-DD', placeholder: '发放日期起' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '结束日期',
|
||||
field: 'issueDate_end',
|
||||
component: 'DatePicker',
|
||||
componentProps: { valueFormat: 'YYYY-MM-DD', placeholder: '发放日期止' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: 'PS编码', field: 'psCode', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '标题', field: 'title', component: 'JInput', colProps: { span: 6 } },
|
||||
{
|
||||
label: '类型',
|
||||
field: 'psType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'xslmes_ps_belong' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
];
|
||||
|
||||
export const superQuerySchema = {
|
||||
psCode: { title: 'PS编码', order: 0, view: 'text' },
|
||||
psType: { title: '类型', order: 1, view: 'list', dictCode: 'xslmes_ps_belong' },
|
||||
constructionCode: { title: '施工代号', order: 2, view: 'list', dictCode: 'xslmes_construction_code' },
|
||||
issueDate: { title: '发放日期', order: 3, view: 'date' },
|
||||
title: { title: '标题', order: 4, view: 'text' },
|
||||
responsiblePerson: { title: '担当', order: 5, view: 'text' },
|
||||
};
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #tableTitle>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_ps_history:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslMixerPsCompileModal @register="registerModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslMixerPsHistory" setup>
|
||||
import { reactive } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import MesXslMixerPsCompileModal from '../mesXslMixerPsCompile/components/MesXslMixerPsCompileModal.vue';
|
||||
import { PS_HISTORY_STATUS_DICT, columns, searchFormSchema, superQuerySchema } from './MesXslMixerPsHistory.data';
|
||||
import { list, getExportUrl } from './MesXslMixerPsHistory.api';
|
||||
|
||||
const APPROVED_STATUS = 'approve';
|
||||
const queryParam = reactive<any>({ status: APPROVED_STATUS });
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'PS审批历史',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
tableSetting: { cacheKey: 'mesXslMixerPsHistory_v20260520' },
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 90,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
},
|
||||
actionColumn: {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params.status = APPROVED_STATUS;
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: 'PS审批历史',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }] = tableContext;
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).forEach((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
queryParam.status = APPROVED_STATUS;
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
modalTitle: 'PS审批历史详情',
|
||||
statusDictCode: PS_HISTORY_STATUS_DICT,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,34 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslOpenMillParam/list',
|
||||
save = '/xslmes/mesXslOpenMillParam/add',
|
||||
edit = '/xslmes/mesXslOpenMillParam/edit',
|
||||
deleteOne = '/xslmes/mesXslOpenMillParam/delete',
|
||||
deleteBatch = '/xslmes/mesXslOpenMillParam/deleteBatch',
|
||||
importExcel = '/xslmes/mesXslOpenMillParam/importExcel',
|
||||
exportXls = '/xslmes/mesXslOpenMillParam/exportXls',
|
||||
queryById = '/xslmes/mesXslOpenMillParam/queryById',
|
||||
queryMaterialById = '/mes/material/material/queryById',
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
export const queryMaterialById = (params: { id: string }) =>
|
||||
defHttp.get({ url: Api.queryMaterialById, params }, { successMessageMode: 'none' });
|
||||
|
||||
export const deleteOne = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const batchDelete = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url, params }, { successMessageMode: 'none' });
|
||||
};
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
@@ -0,0 +1,124 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '胶料名称', align: 'center', dataIndex: 'materialName', width: 160 },
|
||||
{ title: '胶料别名', align: 'center', dataIndex: 'materialCode', width: 130 },
|
||||
{ title: 'R0进胶时间(秒)', align: 'center', dataIndex: 'r0FeedTime', width: 120 },
|
||||
{ title: 'R0成环时间(秒)', align: 'center', dataIndex: 'r0RingTime', width: 120 },
|
||||
{ title: 'R0拉断时间(秒)', align: 'center', dataIndex: 'r0BreakTime', width: 120 },
|
||||
{ title: 'R0排胶时间(秒)', align: 'center', dataIndex: 'r0DischargeTime', width: 120 },
|
||||
{ title: 'R1进胶时间(秒)', align: 'center', dataIndex: 'r1FeedTime', width: 120 },
|
||||
{ title: 'R1成环时间(秒)', align: 'center', dataIndex: 'r1RingTime', width: 120 },
|
||||
{ title: 'R1拉断时间(秒)', align: 'center', dataIndex: 'r1BreakTime', width: 120 },
|
||||
{ title: 'R1排胶时间(秒)', align: 'center', dataIndex: 'r1DischargeTime', width: 120 },
|
||||
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100, defaultHidden: true },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165 },
|
||||
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100, defaultHidden: true },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '胶料',
|
||||
field: 'materialId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'mes_material,material_name,id',
|
||||
placeholder: '请选择胶料',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '胶料别名', field: 'materialCode', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '胶料名称', field: 'materialName', component: 'JInput', colProps: { span: 6 } },
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{
|
||||
label: '胶料',
|
||||
field: 'materialId',
|
||||
component: 'Input',
|
||||
slot: 'materialPicker',
|
||||
dynamicRules: () => [{ required: true, message: '请选择胶料' }],
|
||||
},
|
||||
{
|
||||
label: '胶料名称',
|
||||
field: 'materialName',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '选择胶料后自动带出' },
|
||||
},
|
||||
{
|
||||
label: '胶料别名',
|
||||
field: 'materialCode',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '选择胶料后自动带出别名' },
|
||||
},
|
||||
{
|
||||
label: 'R0进胶时间',
|
||||
field: 'r0FeedTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R0成环时间',
|
||||
field: 'r0RingTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R0拉断时间',
|
||||
field: 'r0BreakTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R0排胶时间',
|
||||
field: 'r0DischargeTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R1进胶时间',
|
||||
field: 'r1FeedTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R1成环时间',
|
||||
field: 'r1RingTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R1拉断时间',
|
||||
field: 'r1BreakTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: 'R1排胶时间',
|
||||
field: 'r1DischargeTime',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '单位:秒', style: { width: '100%' } },
|
||||
},
|
||||
];
|
||||
|
||||
export const superQuerySchema = {
|
||||
materialId: {
|
||||
title: '胶料',
|
||||
order: 0,
|
||||
view: 'sel_search',
|
||||
dictTable: 'mes_material',
|
||||
dictCode: 'id',
|
||||
dictText: 'material_name',
|
||||
},
|
||||
materialCode: { title: '胶料别名', order: 1, view: 'text' },
|
||||
materialName: { title: '胶料名称', order: 2, view: 'text' },
|
||||
r0FeedTime: { title: 'R0进胶时间', order: 3, view: 'number' },
|
||||
r0RingTime: { title: 'R0成环时间', order: 4, view: 'number' },
|
||||
r0BreakTime: { title: 'R0拉断时间', order: 5, view: 'number' },
|
||||
r0DischargeTime: { title: 'R0排胶时间', order: 6, view: 'number' },
|
||||
r1FeedTime: { title: 'R1进胶时间', order: 7, view: 'number' },
|
||||
r1RingTime: { title: 'R1成环时间', order: 8, view: 'number' },
|
||||
r1BreakTime: { title: 'R1拉断时间', order: 9, view: 'number' },
|
||||
r1DischargeTime: { title: 'R1排胶时间', order: 10, view: 'number' },
|
||||
};
|
||||
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'xslmes:mes_xsl_open_mill_param:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">
|
||||
新增
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_open_mill_param:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_open_mill_param:importExcel'"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>
|
||||
导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'xslmes:mes_xsl_open_mill_param:deleteBatch'">
|
||||
批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_open_mill_param:edit' },
|
||||
]"
|
||||
:dropDownActions="getDropDownAction(record)"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslOpenMillParamModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslOpenMillParam" setup>
|
||||
import { reactive } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import Icon from '/@/components/Icon';
|
||||
import MesXslOpenMillParamModal from './components/MesXslOpenMillParamModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './MesXslOpenMillParam.data';
|
||||
import { list, deleteOne, batchDelete, getExportUrl, getImportUrl } from './MesXslOpenMillParam.api';
|
||||
|
||||
const queryParam = reactive<any>({});
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '开炼机参数维护',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 100,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
},
|
||||
actionColumn: {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
beforeFetch: (params) => Object.assign(params, queryParam),
|
||||
},
|
||||
exportConfig: {
|
||||
name: '开炼机参数维护',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).forEach((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
openModal(true, { isUpdate: false, showFooter: true });
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: true });
|
||||
}
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
function batchHandleDelete() {
|
||||
batchDelete({ ids: selectedRowKeys.value.join(',') }, handleSuccess);
|
||||
}
|
||||
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
}
|
||||
|
||||
function getDropDownAction(record: Recordable) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
|
||||
auth: 'xslmes:mes_xsl_open_mill_param:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm">
|
||||
<template #materialPicker="{ model, field }">
|
||||
<JDictSelectTag
|
||||
v-model:value="model[field]"
|
||||
dictCode="mes_material,material_name,id"
|
||||
placeholder="请选择胶料"
|
||||
:disabled="isDetail"
|
||||
@update:value="(v) => onMaterialChange(model, v)"
|
||||
/>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { formSchema } from '../MesXslOpenMillParam.data';
|
||||
import { saveOrUpdate, queryMaterialById } from '../MesXslOpenMillParam.api';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
/** 避免弹窗初始化回显时误触发物料回填 */
|
||||
const skipMaterialChange = ref(false);
|
||||
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
||||
labelWidth: 130,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
skipMaterialChange.value = true;
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue({ ...data.record });
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
skipMaterialChange.value = false;
|
||||
});
|
||||
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : unref(isDetail) ? '详情' : '编辑'));
|
||||
|
||||
async function onMaterialChange(model: Recordable, val: unknown) {
|
||||
if (skipMaterialChange.value) {
|
||||
return;
|
||||
}
|
||||
const id = val != null && val !== '' ? String(val) : '';
|
||||
if (!id) {
|
||||
model.materialName = '';
|
||||
model.materialCode = '';
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const raw = await queryMaterialById({ id });
|
||||
const row = (raw as Recordable)?.materialName != null ? raw : (raw as Recordable)?.result;
|
||||
if (row) {
|
||||
model.materialName = row.materialName ?? '';
|
||||
model.materialCode = row.aliasName ?? '';
|
||||
}
|
||||
} catch {
|
||||
model.materialName = '';
|
||||
model.materialCode = '';
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
if (!values.materialId) {
|
||||
createMessage.warning('请选择胶料');
|
||||
return;
|
||||
}
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, unref(isUpdate));
|
||||
createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e: any) {
|
||||
if (e?.errorFields) {
|
||||
const firstField = e.errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(e);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -18,6 +18,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yitter.IdGenerator;
|
||||
using YY.Admin.Core;
|
||||
using YY.Admin.Core.Const;
|
||||
using YY.Admin.Core.Extension;
|
||||
using YY.Admin.Core.Option;
|
||||
using YY.Admin.Core.SeedData;
|
||||
@@ -259,6 +260,8 @@ namespace YY.Admin.Core.SqlSugar
|
||||
EnsureJeecgSysUserMirrorTable(dbProvider, config);
|
||||
// 兜底:确保 Jeecg 数据字典同构表存在(数据字典页面“同步数据字典”写入此表)
|
||||
EnsureJeecgSysDictItemMirrorTable(dbProvider, config);
|
||||
// 兼容旧库:补齐桌面端登录设置相关 sys_config 项
|
||||
EnsureDesktopLoginConfigSeed(dbProvider, config);
|
||||
//// 初始化视图
|
||||
//if (config.DbSettings.EnableInitView) InitView(dbProvider);
|
||||
// 初始化种子数据
|
||||
@@ -389,6 +392,59 @@ namespace YY.Admin.Core.SqlSugar
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 兼容旧库:补齐桌面端「登录设置」所需的 sys_config 配置项(升级前库可能缺少这些 code)
|
||||
/// </summary>
|
||||
private static void EnsureDesktopLoginConfigSeed(SqlSugarScopeProvider dbProvider, DbConnectionConfig config)
|
||||
{
|
||||
try
|
||||
{
|
||||
var tableName = dbProvider.EntityMaintenance.GetEntityInfo(typeof(SysConfig)).DbTableName;
|
||||
if (!dbProvider.DbMaintenance.IsAnyTable(tableName, false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var loginConfigCodes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
ConfigConst.SysTokenExpire,
|
||||
ConfigConst.SysRefreshTokenExpire,
|
||||
ConfigConst.SysTokenIdleExtendMinutes,
|
||||
ConfigConst.SysTokenCheckIntervalMinutes,
|
||||
ConfigConst.SysTokenNeverExpire,
|
||||
};
|
||||
|
||||
var seedRows = new SysConfigSeedData().HasData()
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c.Code) && loginConfigCodes.Contains(c.Code))
|
||||
.ToList();
|
||||
if (seedRows.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var existingCodes = dbProvider.Queryable<SysConfig>()
|
||||
.Where(c => loginConfigCodes.Contains(c.Code))
|
||||
.Select(c => c.Code)
|
||||
.ToList()
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c))
|
||||
.ToHashSet(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
var missing = seedRows
|
||||
.Where(s => !existingCodes.Contains(s.Code!))
|
||||
.ToList();
|
||||
if (missing.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dbProvider.Insertable(missing).ExecuteCommand();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 无权限、从库只读等场景不阻断启动
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 若 sys_menu 缺少桌面默认首页标记列,则 ALTER 补齐(与实体 SysMenu.IsDefaultDesktopHome 一致)
|
||||
/// </summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using SqlSugar;
|
||||
using YY.Admin.Core;
|
||||
using YY.Admin.Core.Const;
|
||||
using YY.Admin.Core.SeedData;
|
||||
|
||||
namespace YY.Admin.Services.Service.Config
|
||||
{
|
||||
@@ -41,7 +42,28 @@ namespace YY.Admin.Services.Service.Config
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
if (n <= 0)
|
||||
return (false, "未找到对应配置项或无需更新");
|
||||
{
|
||||
// 旧库可能缺少新增配置项,按种子模板补插后再写入
|
||||
var seed = new SysConfigSeedData().HasData()
|
||||
.FirstOrDefault(c => string.Equals(c.Code, code, StringComparison.OrdinalIgnoreCase));
|
||||
if (seed == null)
|
||||
return (false, "未找到对应配置项或无需更新");
|
||||
|
||||
var row = new SysConfig
|
||||
{
|
||||
Id = seed.Id,
|
||||
Name = seed.Name,
|
||||
Code = seed.Code,
|
||||
Value = value,
|
||||
SysFlag = seed.SysFlag,
|
||||
GroupCode = seed.GroupCode,
|
||||
OrderNo = seed.OrderNo,
|
||||
Remark = seed.Remark,
|
||||
CreateTime = DateTime.Now,
|
||||
UpdateTime = DateTime.Now,
|
||||
};
|
||||
await _dbContext.Insertable(row).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
_sysCacheService.Remove($"{CacheConst.KeyConfig}{code}");
|
||||
return (true, "保存成功");
|
||||
|
||||
Binary file not shown.
@@ -25,7 +25,8 @@ WizardStyle=modern
|
||||
PrivilegesRequired=admin
|
||||
ArchitecturesAllowed=x64compatible
|
||||
ArchitecturesInstallIn64BitMode=x64compatible
|
||||
MinVersion=10.0.17763
|
||||
; 客户工控机常见 Win Server 2016(10.0.14393);调试目录直拷可运行,仅安装器原 17763 门槛过严
|
||||
MinVersion=10.0.14393
|
||||
DisableProgramGroupPage=no
|
||||
DisableDirPage=no
|
||||
UninstallDisplayIcon={app}\{#MyAppExeName}
|
||||
|
||||
Reference in New Issue
Block a user