新增物料类型处理逻辑,确保在保存和编辑称重记录时自动设置默认物料类型。更新前端表单以支持密炼物料的选择和显示,优化用户体验。添加分类字典和数据字典的事件广播功能,增强系统的实时数据同步能力。
This commit is contained in:
@@ -379,6 +379,7 @@ public class MesXslDesktopAnonController {
|
||||
mesXslWeightRecord.getGrossWeight().subtract(mesXslWeightRecord.getTareWeight()));
|
||||
}
|
||||
applyWeightBillType(mesXslWeightRecord);
|
||||
applyMaterialTypeDefault(mesXslWeightRecord);
|
||||
weightRecordService.save(mesXslWeightRecord);
|
||||
stompNotify.publishWeightRecordChanged("add", mesXslWeightRecord.getId());
|
||||
return Result.OK("添加成功!");
|
||||
@@ -396,6 +397,7 @@ public class MesXslDesktopAnonController {
|
||||
mesXslWeightRecord.getGrossWeight().subtract(mesXslWeightRecord.getTareWeight()));
|
||||
}
|
||||
applyWeightBillType(mesXslWeightRecord);
|
||||
applyMaterialTypeDefault(mesXslWeightRecord);
|
||||
boolean ok = weightRecordService.updateById(mesXslWeightRecord);
|
||||
if (!ok) {
|
||||
return Result.error("数据已被他人修改,请刷新后重试");
|
||||
@@ -436,6 +438,13 @@ public class MesXslDesktopAnonController {
|
||||
}
|
||||
}
|
||||
|
||||
private void applyMaterialTypeDefault(MesXslWeightRecord record) {
|
||||
if (oConvertUtils.isEmpty(record.getMaterialType())) {
|
||||
// 默认“自动”,桌面端手动勾选时会传“2”
|
||||
record.setMaterialType("1");
|
||||
}
|
||||
}
|
||||
|
||||
private void applyVehicleBelong(MesXslVehicle v) {
|
||||
if (oConvertUtils.isEmpty(v.getVehicleBelong())) {
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRawMaterialEntry;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRawMaterialEntryService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 原料入场记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-05-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Tag(name = "原料入场记录")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslRawMaterialEntry")
|
||||
@Slf4j
|
||||
public class MesXslRawMaterialEntryController extends JeecgController<MesXslRawMaterialEntry, IMesXslRawMaterialEntryService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslRawMaterialEntryService mesXslRawMaterialEntryService;
|
||||
|
||||
@Operation(summary = "原料入场记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRawMaterialEntry>> queryPageList(MesXslRawMaterialEntry mesXslRawMaterialEntry,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslRawMaterialEntry> queryWrapper = QueryGenerator.initQueryWrapper(mesXslRawMaterialEntry, req.getParameterMap());
|
||||
Page<MesXslRawMaterialEntry> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslRawMaterialEntry> pageList = mesXslRawMaterialEntryService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "原料入场记录-添加")
|
||||
@Operation(summary = "原料入场记录-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_raw_material_entry:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslRawMaterialEntry mesXslRawMaterialEntry) {
|
||||
mesXslRawMaterialEntryService.save(mesXslRawMaterialEntry);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "原料入场记录-编辑")
|
||||
@Operation(summary = "原料入场记录-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_raw_material_entry:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslRawMaterialEntry mesXslRawMaterialEntry) {
|
||||
mesXslRawMaterialEntryService.updateById(mesXslRawMaterialEntry);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "原料入场记录-通过id删除")
|
||||
@Operation(summary = "原料入场记录-通过id删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_raw_material_entry:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslRawMaterialEntryService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "原料入场记录-批量删除")
|
||||
@Operation(summary = "原料入场记录-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_raw_material_entry:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.mesXslRawMaterialEntryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "原料入场记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslRawMaterialEntry> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslRawMaterialEntry mesXslRawMaterialEntry = mesXslRawMaterialEntryService.getById(id);
|
||||
if (mesXslRawMaterialEntry == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(mesXslRawMaterialEntry);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_raw_material_entry:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslRawMaterialEntry mesXslRawMaterialEntry) {
|
||||
return super.exportXls(request, mesXslRawMaterialEntry, MesXslRawMaterialEntry.class, "原料入场记录");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_raw_material_entry:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslRawMaterialEntry.class);
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,7 @@ public class MesXslWeightRecordController extends JeecgController<MesXslWeightRe
|
||||
mesXslWeightRecord.setBillNo("BDH-" + dateStr + seq);
|
||||
}
|
||||
computeBillType(mesXslWeightRecord);
|
||||
applyMaterialTypeDefault(mesXslWeightRecord);
|
||||
computeNetWeight(mesXslWeightRecord);
|
||||
mesXslWeightRecordService.save(mesXslWeightRecord);
|
||||
stompNotifyService.publishWeightRecordChanged("add", mesXslWeightRecord.getId());
|
||||
@@ -77,6 +78,7 @@ public class MesXslWeightRecordController extends JeecgController<MesXslWeightRe
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslWeightRecord mesXslWeightRecord) {
|
||||
computeBillType(mesXslWeightRecord);
|
||||
applyMaterialTypeDefault(mesXslWeightRecord);
|
||||
computeNetWeight(mesXslWeightRecord);
|
||||
mesXslWeightRecordService.updateById(mesXslWeightRecord);
|
||||
stompNotifyService.publishWeightRecordChanged("edit", mesXslWeightRecord.getId());
|
||||
@@ -147,4 +149,11 @@ public class MesXslWeightRecordController extends JeecgController<MesXslWeightRe
|
||||
record.setBillType("3");
|
||||
}
|
||||
}
|
||||
|
||||
private void applyMaterialTypeDefault(MesXslWeightRecord record) {
|
||||
if (record.getMaterialType() == null || record.getMaterialType().isBlank()) {
|
||||
// 默认“自动”,手动模式由前端显式传“2”
|
||||
record.setMaterialType("1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 原料入场记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-05-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_raw_material_entry")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "原料入场记录")
|
||||
public class MesXslRawMaterialEntry implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Excel(name = "条码", width = 20)
|
||||
@Schema(description = "条码")
|
||||
private String barcode;
|
||||
|
||||
@Excel(name = "批次号", width = 20)
|
||||
@Schema(description = "批次号")
|
||||
private String batchNo;
|
||||
|
||||
@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 entryTime;
|
||||
|
||||
@Schema(description = "榜单ID")
|
||||
private String weightRecordId;
|
||||
|
||||
@Excel(name = "榜单号", width = 20)
|
||||
@Schema(description = "榜单号")
|
||||
private String billNo;
|
||||
|
||||
@Schema(description = "物料ID")
|
||||
private String materialId;
|
||||
|
||||
@Excel(name = "物料名称", width = 20)
|
||||
@Schema(description = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Excel(name = "供料客户", width = 20)
|
||||
@Schema(description = "供料客户")
|
||||
private String supplyCustomer;
|
||||
|
||||
@Schema(description = "供应商ID")
|
||||
private String supplierId;
|
||||
|
||||
@Excel(name = "供应商名称", width = 25)
|
||||
@Schema(description = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Excel(name = "厂家物料名称", width = 25)
|
||||
@Schema(description = "厂家物料名称")
|
||||
private String manufacturerMaterialName;
|
||||
|
||||
@Excel(name = "保质期", width = 15)
|
||||
@Schema(description = "保质期")
|
||||
private String shelfLife;
|
||||
|
||||
@Excel(name = "总重(KG)", width = 12)
|
||||
@Schema(description = "总重(KG)")
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
@Excel(name = "总份数", width = 10)
|
||||
@Schema(description = "总份数")
|
||||
private Integer totalPortions;
|
||||
|
||||
@Excel(name = "每份总重(KG)", width = 12)
|
||||
@Schema(description = "每份总重(KG)")
|
||||
private BigDecimal portionWeight;
|
||||
|
||||
@Excel(name = "每份包数", width = 10)
|
||||
@Schema(description = "每份包数")
|
||||
private Integer portionPackages;
|
||||
|
||||
@Excel(name = "检测结果", width = 12, dicCode = "xslmes_test_result")
|
||||
@Dict(dicCode = "xslmes_test_result")
|
||||
@Schema(description = "检测结果(字典 xslmes_test_result:0未检 1合格 2不合格)")
|
||||
private String testResult;
|
||||
|
||||
@Excel(name = "检测状态", width = 12, dicCode = "xslmes_test_status")
|
||||
@Dict(dicCode = "xslmes_test_status")
|
||||
@Schema(description = "检测状态(字典 xslmes_test_status:0送样 1已批准)")
|
||||
private String testStatus;
|
||||
|
||||
@Excel(name = "打印标记", width = 12, dicCode = "xslmes_print_flag")
|
||||
@Dict(dicCode = "xslmes_print_flag")
|
||||
@Schema(description = "打印标记(字典 xslmes_print_flag:1已打印 0未打印)")
|
||||
private String printFlag;
|
||||
|
||||
@Excel(name = "入库结存", width = 10, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@Schema(description = "入库结存(字典 yn,1是 0否)")
|
||||
private String stockBalance;
|
||||
|
||||
@Excel(name = "库位", width = 15)
|
||||
@Schema(description = "库位")
|
||||
private String warehouseLocation;
|
||||
|
||||
@Excel(name = "卸货人", width = 15)
|
||||
@Schema(description = "卸货人")
|
||||
private String unloadOperator;
|
||||
|
||||
@Excel(name = "是否特采", width = 10, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@Schema(description = "是否特采(字典 yn,1是 0否)")
|
||||
private String isSpecialAdoption;
|
||||
|
||||
@Excel(name = "特采操作人", width = 15)
|
||||
@Schema(description = "特采操作人")
|
||||
private String specialAdoptionOperator;
|
||||
|
||||
@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 specialAdoptionTime;
|
||||
|
||||
@Excel(name = "特采原因", width = 30)
|
||||
@Schema(description = "特采原因")
|
||||
private String specialAdoptionReason;
|
||||
|
||||
@Excel(name = "状态", width = 10, dicCode = "xslmes_entry_status")
|
||||
@Dict(dicCode = "xslmes_entry_status")
|
||||
@Schema(description = "状态(字典 xslmes_entry_status)")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "备注", width = 30)
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
/**创建人*/
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -23,6 +24,26 @@ import java.util.Date;
|
||||
@Accessors(chain = true)
|
||||
@TableName("mes_xsl_weight_record")
|
||||
@Schema(description = "地磅数据记录")
|
||||
@JsonPropertyOrder({
|
||||
"billNo",
|
||||
"weighDate",
|
||||
"inoutDirection",
|
||||
"vehicleId",
|
||||
"plateNumber",
|
||||
"senderUnit",
|
||||
"receiverUnit",
|
||||
// 将“密炼物料”放到“毛重”之前:桌面端可能按 JSON 字段顺序动态生成列
|
||||
"mixerMaterialIds",
|
||||
"mixerMaterialNames",
|
||||
"materialType",
|
||||
"grossWeight",
|
||||
"tareWeight",
|
||||
"netWeight",
|
||||
"driverName",
|
||||
"driverPhone",
|
||||
"billType",
|
||||
"tenantId"
|
||||
})
|
||||
public class MesXslWeightRecord extends JeecgEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -57,10 +78,6 @@ public class MesXslWeightRecord extends JeecgEntity implements Serializable {
|
||||
@Schema(description = "收货单位(出厂时为客户简称)")
|
||||
private String receiverUnit;
|
||||
|
||||
@Excel(name = "货物名称", width = 20)
|
||||
@Schema(description = "货物名称")
|
||||
private String goodsName;
|
||||
|
||||
@Excel(name = "毛重(KG)", width = 12)
|
||||
@Schema(description = "毛重(KG),实际称量")
|
||||
private BigDecimal grossWeight;
|
||||
@@ -86,6 +103,19 @@ public class MesXslWeightRecord extends JeecgEntity implements Serializable {
|
||||
@Schema(description = "单据类型:1已称毛重 2称重完成")
|
||||
private String billType;
|
||||
|
||||
@Excel(name = "密炼物料ID", width = 30)
|
||||
@Schema(description = "密炼物料ID(分号分隔)")
|
||||
private String mixerMaterialIds;
|
||||
|
||||
@Excel(name = "密炼物料名称", width = 30)
|
||||
@Schema(description = "密炼物料名称(分号分隔)")
|
||||
private String mixerMaterialNames;
|
||||
|
||||
@Excel(name = "类型", width = 10, dicCode = "xslmes_weight_material_type")
|
||||
@Dict(dicCode = "xslmes_weight_material_type")
|
||||
@Schema(description = "磅单物料类型:1自动 2手动")
|
||||
private String materialType;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRawMaterialEntry;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 原料入场记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-05-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface MesXslRawMaterialEntryMapper extends BaseMapper<MesXslRawMaterialEntry> {
|
||||
}
|
||||
@@ -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.MesXslRawMaterialEntryMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRawMaterialEntry;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 原料入场记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-05-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IMesXslRawMaterialEntryService extends IService<MesXslRawMaterialEntry> {
|
||||
}
|
||||
@@ -45,6 +45,16 @@ public class MesXslStompNotifyService {
|
||||
publish("/topic/sync/mes-mixer-materials", "MIXER_MATERIAL_CHANGED", "mixerMaterialId", mixerMaterialId, action);
|
||||
}
|
||||
|
||||
/** 广播分类字典变更事件到 /topic/sync/sys-categories */
|
||||
public void publishSysCategoryChanged(String action, String categoryId) {
|
||||
publish("/topic/sync/sys-categories", "SYS_CATEGORY_CHANGED", "categoryId", categoryId, action);
|
||||
}
|
||||
|
||||
/** 广播数据字典变更事件到 /topic/sync/sys-dicts */
|
||||
public void publishSysDictChanged(String action, String dictId) {
|
||||
publish("/topic/sync/sys-dicts", "SYS_DICT_CHANGED", "dictId", dictId, action);
|
||||
}
|
||||
|
||||
// ─────────────────────────── 私有辅助 ────────────────────────────
|
||||
|
||||
private void publish(String topic, String cmd, String idKey, String idValue, String action) {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRawMaterialEntry;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRawMaterialEntryMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRawMaterialEntryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 原料入场记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-05-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class MesXslRawMaterialEntryServiceImpl extends ServiceImpl<MesXslRawMaterialEntryMapper, MesXslRawMaterialEntry> implements IMesXslRawMaterialEntryService {
|
||||
}
|
||||
@@ -28,6 +28,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.messaging.simp.SimpMessagingTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
@@ -51,6 +52,8 @@ import java.util.stream.Collectors;
|
||||
public class SysCategoryController {
|
||||
@Autowired
|
||||
private ISysCategoryService sysCategoryService;
|
||||
@Autowired
|
||||
private SimpMessagingTemplate stompTemplate;
|
||||
|
||||
/**
|
||||
* 分类编码0
|
||||
@@ -128,6 +131,7 @@ public class SysCategoryController {
|
||||
try {
|
||||
sysCategoryService.addSysCategory(sysCategory);
|
||||
result.success("添加成功!");
|
||||
publishCategoryChanged("add", sysCategory.getId());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
@@ -149,10 +153,11 @@ public class SysCategoryController {
|
||||
}else {
|
||||
sysCategoryService.updateSysCategory(sysCategory);
|
||||
result.success("修改成功!");
|
||||
publishCategoryChanged("edit", sysCategory.getId());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param id
|
||||
@@ -167,11 +172,11 @@ public class SysCategoryController {
|
||||
}else {
|
||||
this.sysCategoryService.deleteSysCategory(id);
|
||||
result.success("删除成功!");
|
||||
publishCategoryChanged("delete", id);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
@@ -185,10 +190,11 @@ public class SysCategoryController {
|
||||
}else {
|
||||
this.sysCategoryService.deleteSysCategory(ids);
|
||||
result.success("删除成功!");
|
||||
publishCategoryChanged("deleteBatch", null);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
@@ -625,5 +631,16 @@ public class SysCategoryController {
|
||||
}
|
||||
}
|
||||
|
||||
private void publishCategoryChanged(String action, String categoryId) {
|
||||
try {
|
||||
String json = "{\"cmd\":\"SYS_CATEGORY_CHANGED\",\"action\":\"" + action + "\""
|
||||
+ (categoryId != null ? ",\"categoryId\":\"" + categoryId + "\"" : "")
|
||||
+ ",\"timestamp\":" + System.currentTimeMillis() + "}";
|
||||
stompTemplate.convertAndSend("/topic/sync/sys-categories", json);
|
||||
} catch (Exception e) {
|
||||
log.debug("广播分类字典变更失败: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.messaging.simp.SimpMessagingTemplate;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -77,6 +78,8 @@ public class SysDictController {
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Autowired
|
||||
private SimpMessagingTemplate stompTemplate;
|
||||
@Autowired
|
||||
private ShiroRealm shiroRealm;
|
||||
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@@ -502,6 +505,7 @@ public class SysDictController {
|
||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
sysDictService.save(sysDict);
|
||||
result.success("保存成功!");
|
||||
publishDictChanged("add", sysDict.getId());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
@@ -526,6 +530,7 @@ public class SysDictController {
|
||||
boolean ok = sysDictService.updateById(sysDict);
|
||||
if(ok) {
|
||||
result.success("编辑成功!");
|
||||
publishDictChanged("edit", sysDict.getId());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -544,6 +549,7 @@ public class SysDictController {
|
||||
boolean ok = sysDictService.removeById(id);
|
||||
if(ok) {
|
||||
result.success("删除成功!");
|
||||
publishDictChanged("delete", id);
|
||||
}else{
|
||||
result.error500("删除失败!");
|
||||
}
|
||||
@@ -565,6 +571,7 @@ public class SysDictController {
|
||||
}else {
|
||||
sysDictService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("删除成功!");
|
||||
publishDictChanged("deleteBatch", null);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -870,4 +877,15 @@ public class SysDictController {
|
||||
sysDictService.editDictByLowAppId(sysDictVo);
|
||||
return Result.ok("编辑成功");
|
||||
}
|
||||
|
||||
private void publishDictChanged(String action, String dictId) {
|
||||
try {
|
||||
String json = "{\"cmd\":\"SYS_DICT_CHANGED\",\"action\":\"" + action + "\""
|
||||
+ (dictId != null ? ",\"dictId\":\"" + dictId + "\"" : "")
|
||||
+ ",\"timestamp\":" + System.currentTimeMillis() + "}";
|
||||
stompTemplate.convertAndSend("/topic/sync/sys-dicts", json);
|
||||
} catch (Exception e) {
|
||||
log.debug("广播数据字典变更失败: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.jeecg.modules.system.entity.SysDictItem;
|
||||
import org.jeecg.modules.system.service.ISysDictItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.messaging.simp.SimpMessagingTemplate;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -48,6 +49,8 @@ public class SysDictItemController {
|
||||
|
||||
@Autowired
|
||||
private ISysDictItemService sysDictItemService;
|
||||
@Autowired
|
||||
private SimpMessagingTemplate stompTemplate;
|
||||
|
||||
/**
|
||||
* @功能:查询字典数据
|
||||
@@ -83,6 +86,7 @@ public class SysDictItemController {
|
||||
sysDictItem.setCreateTime(new Date());
|
||||
sysDictItemService.save(sysDictItem);
|
||||
result.success("保存成功!");
|
||||
publishDictChanged("add", sysDictItem.getId());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
@@ -109,11 +113,12 @@ public class SysDictItemController {
|
||||
//TODO 返回false说明什么?
|
||||
if(ok) {
|
||||
result.success("编辑成功!");
|
||||
publishDictChanged("edit", sysDictItem.getId());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @功能:删除字典数据
|
||||
* @param id
|
||||
@@ -131,11 +136,12 @@ public class SysDictItemController {
|
||||
boolean ok = sysDictItemService.removeById(id);
|
||||
if(ok) {
|
||||
result.success("删除成功!");
|
||||
publishDictChanged("delete", id);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @功能:批量删除字典数据
|
||||
* @param ids
|
||||
@@ -151,6 +157,7 @@ public class SysDictItemController {
|
||||
}else {
|
||||
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("删除成功!");
|
||||
publishDictChanged("deleteBatch", null);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -182,5 +189,15 @@ public class SysDictItemController {
|
||||
return Result.error("该值不可用,系统中已存在!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void publishDictChanged(String action, String itemId) {
|
||||
try {
|
||||
String json = "{\"cmd\":\"SYS_DICT_CHANGED\",\"action\":\"" + action + "\""
|
||||
+ (itemId != null ? ",\"dictId\":\"" + itemId + "\"" : "") + "}";
|
||||
stompTemplate.convertAndSend("/topic/sync/sys-dicts", json);
|
||||
} catch (Exception e) {
|
||||
log.warn("[数据字典] STOMP推送失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE mes_xsl_weight_record
|
||||
ADD COLUMN mixer_material_ids VARCHAR(2000) NULL COMMENT '密炼物料ID(分号分隔)',
|
||||
ADD COLUMN mixer_material_names VARCHAR(2000) NULL COMMENT '密炼物料名称(分号分隔)';
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE mes_xsl_weight_record DROP COLUMN goods_name;
|
||||
@@ -0,0 +1,48 @@
|
||||
-- 磅单新增物料类型字段 + 字典(幂等)
|
||||
|
||||
-- 1) 表结构:物料类型(1自动 2手动)
|
||||
SET @material_type_exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'mes_xsl_weight_record'
|
||||
AND COLUMN_NAME = 'material_type'
|
||||
);
|
||||
SET @ddl_material_type := IF(
|
||||
@material_type_exists = 0,
|
||||
'ALTER TABLE `mes_xsl_weight_record` ADD COLUMN `material_type` varchar(10) DEFAULT NULL COMMENT ''物料类型(字典xslmes_weight_material_type:1自动 2手动)'' AFTER `mixer_material_names`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE stmt_material_type FROM @ddl_material_type;
|
||||
EXECUTE stmt_material_type;
|
||||
DEALLOCATE PREPARE stmt_material_type;
|
||||
|
||||
-- 2) 历史数据默认自动
|
||||
UPDATE `mes_xsl_weight_record`
|
||||
SET `material_type` = '1'
|
||||
WHERE `material_type` IS NULL OR `material_type` = '';
|
||||
|
||||
-- 3) 字典主表
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES磅单物料类型', 'xslmes_weight_material_type', '磅单密炼物料来源类型:自动/手动', 0, 'admin', NOW(), 0, 0
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_weight_material_type' AND `del_flag` = 0);
|
||||
|
||||
-- 4) 字典项:自动
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '自动', '1', 1, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_weight_material_type'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_dict_item` i
|
||||
WHERE i.`dict_id` = d.`id` AND i.`item_value` = '1'
|
||||
);
|
||||
|
||||
-- 5) 字典项:手动
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '手动', '2', 2, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_weight_material_type'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_dict_item` i
|
||||
WHERE i.`dict_id` = d.`id` AND i.`item_value` = '2'
|
||||
);
|
||||
@@ -0,0 +1,155 @@
|
||||
-- 原料入场记录:建表 + 字典 + 菜单权限(幂等)
|
||||
|
||||
-- ===================== 1. 建表 =====================
|
||||
CREATE TABLE IF NOT EXISTS `mes_xsl_raw_material_entry` (
|
||||
`id` varchar(36) NOT NULL COMMENT '主键',
|
||||
`barcode` varchar(100) DEFAULT NULL COMMENT '条码',
|
||||
`batch_no` varchar(100) DEFAULT NULL COMMENT '批次号',
|
||||
`entry_time` datetime DEFAULT NULL COMMENT '入场时间',
|
||||
`weight_record_id` varchar(36) DEFAULT NULL COMMENT '榜单ID',
|
||||
`bill_no` varchar(100) DEFAULT NULL COMMENT '榜单号',
|
||||
`material_id` varchar(36) DEFAULT NULL COMMENT '物料ID',
|
||||
`material_name` varchar(200) DEFAULT NULL COMMENT '物料名称',
|
||||
`supply_customer` varchar(200) DEFAULT NULL COMMENT '供料客户',
|
||||
`supplier_id` varchar(36) DEFAULT NULL COMMENT '供应商ID',
|
||||
`supplier_name` varchar(200) DEFAULT NULL COMMENT '供应商名称',
|
||||
`manufacturer_material_name` varchar(200) DEFAULT NULL COMMENT '厂家物料名称',
|
||||
`shelf_life` varchar(100) DEFAULT NULL COMMENT '保质期',
|
||||
`total_weight` decimal(10,2) DEFAULT NULL COMMENT '总重(KG)',
|
||||
`total_portions` int DEFAULT NULL COMMENT '总份数',
|
||||
`portion_weight` decimal(10,2) DEFAULT NULL COMMENT '每份总重(KG)',
|
||||
`portion_packages` int DEFAULT NULL COMMENT '每份包数',
|
||||
`test_result` varchar(10) DEFAULT NULL COMMENT '检测结果(字典 xslmes_test_result:0未检 1合格 2不合格)',
|
||||
`test_status` varchar(10) DEFAULT NULL COMMENT '检测状态(字典 xslmes_test_status:0送样 1已批准)',
|
||||
`print_flag` varchar(10) DEFAULT NULL COMMENT '打印标记(字典 xslmes_print_flag:1已打印 0未打印)',
|
||||
`stock_balance` varchar(2) DEFAULT NULL COMMENT '入库结存(字典 yn:1是 0否)',
|
||||
`warehouse_location` varchar(100) DEFAULT NULL COMMENT '库位',
|
||||
`unload_operator` varchar(100) DEFAULT NULL COMMENT '卸货人',
|
||||
`is_special_adoption` varchar(2) DEFAULT NULL COMMENT '是否特采(字典 yn:1是 0否)',
|
||||
`special_adoption_operator` varchar(100) DEFAULT NULL COMMENT '特采操作人',
|
||||
`special_adoption_time` datetime DEFAULT NULL COMMENT '特采时间',
|
||||
`special_adoption_reason` text COMMENT '特采原因',
|
||||
`status` varchar(10) DEFAULT NULL COMMENT '状态(字典 xslmes_entry_status)',
|
||||
`remark` text 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 '更新时间',
|
||||
`tenant_id` int DEFAULT 1002 COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_rme_barcode` (`barcode`),
|
||||
KEY `idx_rme_batch_no` (`batch_no`),
|
||||
KEY `idx_rme_entry_time` (`entry_time`),
|
||||
KEY `idx_rme_bill_no` (`bill_no`),
|
||||
KEY `idx_rme_material_id` (`material_id`),
|
||||
KEY `idx_rme_supplier_id` (`supplier_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='原料入场记录';
|
||||
|
||||
-- ===================== 2. 检测结果字典 =====================
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES检测结果', 'xslmes_test_result', '原料入场检测结果:未检/合格/不合格', 0, 'admin', NOW(), 0, 1002
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_test_result' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '未检', '0', 1, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_test_result'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '0');
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '合格', '1', 2, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_test_result'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1');
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '不合格', '2', 3, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_test_result'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '2');
|
||||
|
||||
-- ===================== 3. 检测状态字典 =====================
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES检测状态', 'xslmes_test_status', '原料入场检测状态:送样/已批准', 0, 'admin', NOW(), 0, 1002
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_test_status' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '送样', '0', 1, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_test_status'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '0');
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '已批准', '1', 2, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_test_status'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1');
|
||||
|
||||
-- ===================== 4. 打印标记字典 =====================
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES打印标记', 'xslmes_print_flag', '原料入场打印标记:已打印/未打印', 0, 'admin', NOW(), 0, 1002
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_print_flag' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '已打印', '1', 1, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_print_flag'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1');
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '未打印', '0', 2, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_print_flag'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '0');
|
||||
|
||||
-- ===================== 3. 入场记录状态字典 =====================
|
||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'MES入场记录状态', 'xslmes_entry_status', '原料入场记录状态:待处理/已入库/已拒收', 0, 'admin', NOW(), 0, 1002
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `sys_dict` WHERE `dict_code` = 'xslmes_entry_status' AND `del_flag` = 0);
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '待处理', '0', 1, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_entry_status'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '0');
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '已入库', '1', 2, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_entry_status'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '1');
|
||||
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
SELECT REPLACE(UUID(), '-', ''), d.id, '已拒收', '2', 3, 1, 'admin', NOW()
|
||||
FROM `sys_dict` d
|
||||
WHERE d.`dict_code` = 'xslmes_entry_status'
|
||||
AND NOT EXISTS (SELECT 1 FROM `sys_dict_item` i WHERE i.`dict_id` = d.id AND i.`item_value` = '2');
|
||||
|
||||
-- ===================== 4. 菜单权限(父菜单:MES XSL 1900000000000000300)=====================
|
||||
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 '1900000000000000530', '1900000000000000300', '原料入场记录', '/xslmes/mesXslRawMaterialEntry', 'xslmes/mesXslRawMaterialEntry/MesXslRawMaterialEntryList', 1, NULL, NULL, 1, NULL, '0', 11.00, 0, 'ant-design:file-text-outlined', 0, 1, 0, 0, '原料入场记录', 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000530');
|
||||
|
||||
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 '1900000000000000531', '1900000000000000530', '添加', NULL, NULL, 0, NULL, NULL, 2, 'xslmes:mes_xsl_raw_material_entry:add', '1', 1.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000531');
|
||||
|
||||
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 '1900000000000000532', '1900000000000000530', '编辑', NULL, NULL, 0, NULL, NULL, 2, 'xslmes:mes_xsl_raw_material_entry:edit', '1', 2.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000532');
|
||||
|
||||
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 '1900000000000000533', '1900000000000000530', '删除', NULL, NULL, 0, NULL, NULL, 2, 'xslmes:mes_xsl_raw_material_entry:delete', '1', 3.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000533');
|
||||
|
||||
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 '1900000000000000534', '1900000000000000530', '批量删除', NULL, NULL, 0, NULL, NULL, 2, 'xslmes:mes_xsl_raw_material_entry:deleteBatch', '1', 4.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000534');
|
||||
|
||||
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 '1900000000000000535', '1900000000000000530', '导出', NULL, NULL, 0, NULL, NULL, 2, 'xslmes:mes_xsl_raw_material_entry:exportXls', '1', 5.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000535');
|
||||
|
||||
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 '1900000000000000536', '1900000000000000530', '导入', NULL, NULL, 0, NULL, NULL, 2, 'xslmes:mes_xsl_raw_material_entry:importExcel', '1', 6.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', NOW(), 'admin', NOW(), 0, 0, '1', 0
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `sys_permission` WHERE `id` = '1900000000000000536');
|
||||
Reference in New Issue
Block a user