密炼物料信息
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
package org.jeecg.modules.mes.material.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.List;
|
||||
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.modules.mes.material.entity.MesMixerMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMixerMaterialService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "MES-密炼物料信息")
|
||||
@RestController
|
||||
@RequestMapping("/mes/material/mixerMaterial")
|
||||
public class MesMixerMaterialController extends JeecgController<MesMixerMaterial, IMesMixerMaterialService> {
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesMixerMaterial>> queryPageList(
|
||||
MesMixerMaterial model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesMixerMaterial> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
IPage<MesMixerMaterial> pageList = service.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-密炼物料信息-添加")
|
||||
@Operation(summary = "MES-密炼物料信息-添加")
|
||||
@RequiresPermissions("mes:mes_mixer_material:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesMixerMaterial model) {
|
||||
service.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-密炼物料信息-编辑")
|
||||
@Operation(summary = "MES-密炼物料信息-编辑")
|
||||
@RequiresPermissions("mes:mes_mixer_material:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesMixerMaterial model) {
|
||||
service.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-密炼物料信息-通过id删除")
|
||||
@Operation(summary = "MES-密炼物料信息-通过id删除")
|
||||
@RequiresPermissions("mes:mes_mixer_material:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id") String id) {
|
||||
service.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-密炼物料信息-批量删除")
|
||||
@Operation(summary = "MES-密炼物料信息-批量删除")
|
||||
@RequiresPermissions("mes:mes_mixer_material:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
service.removeByIds(idList);
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesMixerMaterial> queryById(@RequestParam(name = "id") String id) {
|
||||
return Result.OK(service.getById(id));
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_mixer_material:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesMixerMaterial model) {
|
||||
return super.exportXls(request, model, MesMixerMaterial.class, "MES密炼物料信息");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_mixer_material:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesMixerMaterial.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.jeecg.modules.mes.material.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;
|
||||
|
||||
@Data
|
||||
@TableName("mes_mixer_material")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES密炼物料信息")
|
||||
public class MesMixerMaterial implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "物料编码", width = 15)
|
||||
private String materialCode;
|
||||
@Excel(name = "物料名称", width = 20)
|
||||
private String materialName;
|
||||
@Excel(name = "ERP编号", width = 15)
|
||||
private String erpCode;
|
||||
|
||||
@Excel(name = "物料大类", width = 15, dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
private String majorCategoryId;
|
||||
|
||||
@Excel(name = "物料小类", width = 15, dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
private String minorCategoryId;
|
||||
|
||||
@Excel(name = "物料描述", width = 25)
|
||||
private String materialDesc;
|
||||
@Excel(name = "物料别名", width = 15)
|
||||
private String aliasName;
|
||||
|
||||
@Excel(name = "投管状态", width = 12, replace = {"在投管_1", "未投管_0"})
|
||||
private Integer feedManageStatus;
|
||||
@Excel(name = "使用状态", width = 12, replace = {"使用中_1", "停用_0"})
|
||||
private Integer useStatus;
|
||||
|
||||
@Excel(name = "比重", width = 10)
|
||||
private BigDecimal specificGravity;
|
||||
@Excel(name = "保质期(天)", width = 12)
|
||||
private Integer shelfLifeDays;
|
||||
@Excel(name = "最短烘胶时间(分钟)", width = 18)
|
||||
private Integer minBakeMinutes;
|
||||
@Excel(name = "总安全库存KG", width = 14)
|
||||
private BigDecimal totalSafetyStockKg;
|
||||
@Excel(name = "合格品安全库存KG", width = 16)
|
||||
private BigDecimal qualifiedSafetyStockKg;
|
||||
|
||||
@Excel(name = "备注", width = 20)
|
||||
private String remark;
|
||||
|
||||
private Integer tenantId;
|
||||
private String sysOrgCode;
|
||||
private String createBy;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
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;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.mes.material.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
|
||||
|
||||
public interface MesMixerMaterialMapper extends BaseMapper<MesMixerMaterial> {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.mes.material.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
|
||||
|
||||
public interface IMesMixerMaterialService extends IService<MesMixerMaterial> {}
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.jeecg.modules.mes.material.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
|
||||
import org.jeecg.modules.mes.material.mapper.MesMixerMaterialMapper;
|
||||
import org.jeecg.modules.mes.material.service.IMesMixerMaterialService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MesMixerMaterialServiceImpl extends ServiceImpl<MesMixerMaterialMapper, MesMixerMaterial>
|
||||
implements IMesMixerMaterialService {}
|
||||
Reference in New Issue
Block a user