更新VSCode配置,启用Maven支持,设置Java 17环境,调整MybatisPlusSaasConfig以开启系统租户控制并添加新租户表。更新pom.xml以包含新模块jeecg-module-xslmes,优化Vue3环境配置以统一API路径,增强代理设置以支持完整的后端路径。修复useForm钩子中的字段重置逻辑,改进axios配置以处理相对URL的上下文路径问题。
This commit is contained in:
22
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/pom.xml
Normal file
22
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/pom.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jeecg-boot-module</artifactId>
|
||||
<groupId>org.jeecgframework.boot3</groupId>
|
||||
<version>3.9.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jeecg-module-xslmes</artifactId>
|
||||
<name>jeecg-module-xslmes</name>
|
||||
<description>MES XSL 业务模块(Java 包:org.jeecg.modules.xslmes)</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot3</groupId>
|
||||
<artifactId>jeecg-boot-base-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.jeecg.modules.xslmes.constant;
|
||||
|
||||
/**
|
||||
* 客户业务状态(与「逻辑删除」无关)。删除仅由 del_flag 表示,一般不再写入 status。
|
||||
* <p>
|
||||
* 字典 xslmes_customer_status:0=启用,1=停用,2=删除(可选)。
|
||||
*/
|
||||
public final class MesXslCustomerBizStatus {
|
||||
|
||||
private MesXslCustomerBizStatus() {}
|
||||
|
||||
/** 启用 */
|
||||
public static final String ENABLED = "0";
|
||||
|
||||
/** 停用 */
|
||||
public static final String DISABLED = "1";
|
||||
|
||||
/** 删除(字典项,业务上建议仅用 del_flag) */
|
||||
public static final String DELETED = "2";
|
||||
|
||||
public static boolean isDisabled(String status) {
|
||||
return DISABLED.equals(status);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.xslmes.constant;
|
||||
|
||||
/**
|
||||
* MES 仓库分类(分类字典 sys_category,根编码 {@link #ROOT_CODE})
|
||||
*/
|
||||
public final class MesXslWarehouseCategory {
|
||||
|
||||
private MesXslWarehouseCategory() {}
|
||||
|
||||
/** 根节点编码,与 JCategorySelect 的 pcode 一致 */
|
||||
public static final String ROOT_CODE = "XSLMES_WH";
|
||||
|
||||
/** 客户库(二楼):须关联客户 */
|
||||
public static final String CUSTOMER_CATEGORY_CODE = "XSLMES_WH_F2_KH";
|
||||
/** 供应商库(二楼):须关联供应商 */
|
||||
public static final String SUPPLIER_CATEGORY_CODE = "XSLMES_WH_F2_GYS";
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
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 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.xslmes.constant.MesXslCustomerBizStatus;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslCustomer;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslCustomerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* MES 客户管理
|
||||
*/
|
||||
@Tag(name = "MES客户管理")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslCustomer")
|
||||
@Slf4j
|
||||
public class MesXslCustomerController extends JeecgController<MesXslCustomer, IMesXslCustomerService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslCustomerService mesXslCustomerService;
|
||||
|
||||
@Operation(summary = "MES客户管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslCustomer>> queryPageList(
|
||||
MesXslCustomer mesXslCustomer,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslCustomer> queryWrapper = QueryGenerator.initQueryWrapper(mesXslCustomer, req.getParameterMap());
|
||||
Page<MesXslCustomer> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslCustomer> pageList = mesXslCustomerService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES客户管理-添加")
|
||||
@Operation(summary = "MES客户管理-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_customer:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslCustomer mesXslCustomer) {
|
||||
// 新增默认启用(0);空白或未传时写入启用,并与 iz_enable 对齐
|
||||
String st = mesXslCustomer.getStatus();
|
||||
if (st != null) {
|
||||
st = st.trim();
|
||||
mesXslCustomer.setStatus(st.isEmpty() ? null : st);
|
||||
}
|
||||
if (mesXslCustomer.getStatus() == null || mesXslCustomer.getStatus().isEmpty()) {
|
||||
mesXslCustomer.setStatus(MesXslCustomerBizStatus.ENABLED);
|
||||
}
|
||||
mesXslCustomerService.syncIzEnableWithStatus(mesXslCustomer);
|
||||
mesXslCustomerService.save(mesXslCustomer);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES客户管理-编辑")
|
||||
@Operation(summary = "MES客户管理-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_customer:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslCustomer mesXslCustomer) {
|
||||
if (mesXslCustomer.getStatus() != null) {
|
||||
String s = mesXslCustomer.getStatus().trim();
|
||||
mesXslCustomer.setStatus(s.isEmpty() ? null : s);
|
||||
}
|
||||
mesXslCustomerService.syncIzEnableWithStatus(mesXslCustomer);
|
||||
mesXslCustomerService.updateById(mesXslCustomer);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES客户管理-启用/停用")
|
||||
@Operation(summary = "MES客户管理-启用/停用(字典 xslmes_customer_status:0启用 1停用)")
|
||||
@RequiresPermissions("xslmes:mes_xsl_customer:updateStatus")
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public Result<String> updateStatus(
|
||||
@RequestParam(name = "id", required = true) String id,
|
||||
@RequestParam(name = "status", required = true) String status) {
|
||||
if (status != null) {
|
||||
status = status.trim();
|
||||
}
|
||||
if (!MesXslCustomerBizStatus.ENABLED.equals(status) && !MesXslCustomerBizStatus.DISABLED.equals(status)) {
|
||||
return Result.error("状态参数非法");
|
||||
}
|
||||
// 与 MesXslUnitController.updateStatus 一致用 lambdaUpdate;并同步 iz_enable(字典 1 停用时为 0)
|
||||
int izEnable = MesXslCustomerBizStatus.DISABLED.equals(status) ? 0 : 1;
|
||||
boolean updated = mesXslCustomerService.lambdaUpdate()
|
||||
.eq(MesXslCustomer::getId, id)
|
||||
.set(MesXslCustomer::getStatus, status)
|
||||
.set(MesXslCustomer::getIzEnable, izEnable)
|
||||
.update();
|
||||
if (updated) {
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
// MySQL 在 SET 值与库中完全一致时可能返回 0 行;或需二次确认是否已是目标状态
|
||||
MesXslCustomer cur = mesXslCustomerService.getById(id);
|
||||
if (cur != null && Objects.equals(status, cur.getStatus())) {
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
return Result.error("操作失败,请确认记录存在且租户与当前登录一致(tenant_id 勿为空)");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES客户管理-删除")
|
||||
@Operation(summary = "MES客户管理-删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_customer:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslCustomerService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES客户管理-批量删除")
|
||||
@Operation(summary = "MES客户管理-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_customer:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslCustomerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES客户管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslCustomer> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslCustomer entity = mesXslCustomerService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_customer:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslCustomer mesXslCustomer) {
|
||||
return super.exportXls(request, mesXslCustomer, MesXslCustomer.class, "MES客户管理");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_customer:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslCustomer.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
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 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.xslmes.entity.MesXslInstrument;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslInstrumentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* MES 器具管理
|
||||
*/
|
||||
@Tag(name = "MES器具管理")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslInstrument")
|
||||
@Slf4j
|
||||
public class MesXslInstrumentController extends JeecgController<MesXslInstrument, IMesXslInstrumentService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslInstrumentService mesXslInstrumentService;
|
||||
|
||||
@Operation(summary = "MES器具管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslInstrument>> queryPageList(
|
||||
MesXslInstrument mesXslInstrument,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslInstrument> queryWrapper = QueryGenerator.initQueryWrapper(mesXslInstrument, req.getParameterMap());
|
||||
Page<MesXslInstrument> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslInstrument> pageList = mesXslInstrumentService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES器具管理-添加")
|
||||
@Operation(summary = "MES器具管理-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_instrument:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslInstrument mesXslInstrument) {
|
||||
if (mesXslInstrument.getStatus() == null || mesXslInstrument.getStatus().isEmpty()) {
|
||||
mesXslInstrument.setStatus("0");
|
||||
}
|
||||
mesXslInstrumentService.save(mesXslInstrument);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES器具管理-编辑")
|
||||
@Operation(summary = "MES器具管理-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_instrument:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslInstrument mesXslInstrument) {
|
||||
mesXslInstrumentService.updateById(mesXslInstrument);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES器具管理-停用/启用")
|
||||
@Operation(summary = "MES器具管理-停用/启用")
|
||||
@RequiresPermissions("xslmes:mes_xsl_instrument:updateStatus")
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public Result<String> updateStatus(
|
||||
@RequestParam(name = "id", required = true) String id,
|
||||
@RequestParam(name = "status", required = true) String status) {
|
||||
if (!"0".equals(status) && !"1".equals(status)) {
|
||||
return Result.error("状态参数非法");
|
||||
}
|
||||
boolean ok = mesXslInstrumentService.lambdaUpdate()
|
||||
.eq(MesXslInstrument::getId, id)
|
||||
.set(MesXslInstrument::getStatus, status)
|
||||
.update();
|
||||
return ok ? Result.OK("操作成功") : Result.error("操作失败");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES器具管理-删除")
|
||||
@Operation(summary = "MES器具管理-删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_instrument:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslInstrumentService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES器具管理-批量删除")
|
||||
@Operation(summary = "MES器具管理-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_instrument:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslInstrumentService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES器具管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslInstrument> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslInstrument entity = mesXslInstrumentService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_instrument:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslInstrument mesXslInstrument) {
|
||||
return super.exportXls(request, mesXslInstrument, MesXslInstrument.class, "MES器具管理");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_instrument:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslInstrument.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
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 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.xslmes.entity.MesXslSupplier;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslSupplierService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* MES 供应商管理
|
||||
*/
|
||||
@Tag(name = "MES供应商管理")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslSupplier")
|
||||
@Slf4j
|
||||
public class MesXslSupplierController extends JeecgController<MesXslSupplier, IMesXslSupplierService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslSupplierService mesXslSupplierService;
|
||||
|
||||
@Operation(summary = "MES供应商管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslSupplier>> queryPageList(
|
||||
MesXslSupplier mesXslSupplier,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslSupplier> queryWrapper = QueryGenerator.initQueryWrapper(mesXslSupplier, req.getParameterMap());
|
||||
Page<MesXslSupplier> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslSupplier> pageList = mesXslSupplierService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES供应商管理-添加")
|
||||
@Operation(summary = "MES供应商管理-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_supplier:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslSupplier mesXslSupplier) {
|
||||
if (mesXslSupplier.getStatus() == null || mesXslSupplier.getStatus().isEmpty()) {
|
||||
mesXslSupplier.setStatus("0");
|
||||
}
|
||||
mesXslSupplierService.save(mesXslSupplier);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES供应商管理-编辑")
|
||||
@Operation(summary = "MES供应商管理-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_supplier:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslSupplier mesXslSupplier) {
|
||||
mesXslSupplierService.updateById(mesXslSupplier);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES供应商管理-停用/启用")
|
||||
@Operation(summary = "MES供应商管理-停用/启用")
|
||||
@RequiresPermissions("xslmes:mes_xsl_supplier:updateStatus")
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public Result<String> updateStatus(
|
||||
@RequestParam(name = "id", required = true) String id,
|
||||
@RequestParam(name = "status", required = true) String status) {
|
||||
if (!"0".equals(status) && !"1".equals(status)) {
|
||||
return Result.error("状态参数非法");
|
||||
}
|
||||
boolean ok = mesXslSupplierService.lambdaUpdate()
|
||||
.eq(MesXslSupplier::getId, id)
|
||||
.set(MesXslSupplier::getStatus, status)
|
||||
.update();
|
||||
return ok ? Result.OK("操作成功") : Result.error("操作失败");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES供应商管理-删除")
|
||||
@Operation(summary = "MES供应商管理-删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_supplier:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslSupplierService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES供应商管理-批量删除")
|
||||
@Operation(summary = "MES供应商管理-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_supplier:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslSupplierService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES供应商管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslSupplier> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslSupplier entity = mesXslSupplierService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_supplier:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslSupplier mesXslSupplier) {
|
||||
return super.exportXls(request, mesXslSupplier, MesXslSupplier.class, "MES供应商管理");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_supplier:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslSupplier.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
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 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.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslUnit;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslUnitService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* MES 单位管理
|
||||
*/
|
||||
@Tag(name = "MES单位管理")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslUnit")
|
||||
@Slf4j
|
||||
public class MesXslUnitController extends JeecgController<MesXslUnit, IMesXslUnitService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslUnitService mesXslUnitService;
|
||||
|
||||
@Operation(summary = "MES单位管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslUnit>> queryPageList(
|
||||
MesXslUnit mesXslUnit,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "treeCategoryId", required = false) String treeCategoryId,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslUnit> queryWrapper = QueryGenerator.initQueryWrapper(mesXslUnit, req.getParameterMap());
|
||||
if (oConvertUtils.isNotEmpty(treeCategoryId)) {
|
||||
List<String> ids = mesXslUnitService.listDescendantCategoryIds(treeCategoryId);
|
||||
queryWrapper.in("category_id", ids);
|
||||
}
|
||||
Page<MesXslUnit> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslUnit> pageList = mesXslUnitService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES单位管理-添加")
|
||||
@Operation(summary = "MES单位管理-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_unit:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslUnit mesXslUnit) {
|
||||
if (mesXslUnit.getStatus() == null || mesXslUnit.getStatus().isEmpty()) {
|
||||
mesXslUnit.setStatus("0");
|
||||
}
|
||||
mesXslUnitService.save(mesXslUnit);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES单位管理-编辑")
|
||||
@Operation(summary = "MES单位管理-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_unit:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslUnit mesXslUnit) {
|
||||
mesXslUnitService.updateById(mesXslUnit);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES单位管理-停用/启用")
|
||||
@Operation(summary = "MES单位管理-停用/启用")
|
||||
@RequiresPermissions("xslmes:mes_xsl_unit:updateStatus")
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public Result<String> updateStatus(
|
||||
@RequestParam(name = "id", required = true) String id,
|
||||
@RequestParam(name = "status", required = true) String status) {
|
||||
if (!"0".equals(status) && !"1".equals(status)) {
|
||||
return Result.error("状态参数非法");
|
||||
}
|
||||
boolean ok = mesXslUnitService.lambdaUpdate()
|
||||
.eq(MesXslUnit::getId, id)
|
||||
.set(MesXslUnit::getStatus, status)
|
||||
.update();
|
||||
return ok ? Result.OK("操作成功") : Result.error("操作失败");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES单位管理-删除")
|
||||
@Operation(summary = "MES单位管理-删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_unit:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslUnitService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES单位管理-批量删除")
|
||||
@Operation(summary = "MES单位管理-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_unit:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslUnitService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES单位管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslUnit> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslUnit entity = mesXslUnitService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_unit:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslUnit mesXslUnit) {
|
||||
return super.exportXls(request, mesXslUnit, MesXslUnit.class, "MES单位管理");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_unit:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslUnit.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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 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.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslVehicle;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslVehicleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* MES 车辆管理
|
||||
*/
|
||||
@Tag(name = "MES车辆管理")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslVehicle")
|
||||
@Slf4j
|
||||
public class MesXslVehicleController extends JeecgController<MesXslVehicle, IMesXslVehicleService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslVehicleService mesXslVehicleService;
|
||||
|
||||
@Operation(summary = "MES车辆管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslVehicle>> queryPageList(
|
||||
MesXslVehicle mesXslVehicle,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslVehicle> queryWrapper = QueryGenerator.initQueryWrapper(mesXslVehicle, req.getParameterMap());
|
||||
Page<MesXslVehicle> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslVehicle> pageList = mesXslVehicleService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES车辆管理-添加")
|
||||
@Operation(summary = "MES车辆管理-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_vehicle:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslVehicle mesXslVehicle) {
|
||||
if (oConvertUtils.isEmpty(mesXslVehicle.getVehicleBelong())) {
|
||||
return Result.error("车辆归属不能为空");
|
||||
}
|
||||
if (mesXslVehicle.getStatus() == null || mesXslVehicle.getStatus().isEmpty()) {
|
||||
mesXslVehicle.setStatus("0");
|
||||
}
|
||||
applyVehicleBelong(mesXslVehicle);
|
||||
mesXslVehicleService.save(mesXslVehicle);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES车辆管理-编辑")
|
||||
@Operation(summary = "MES车辆管理-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_vehicle:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslVehicle mesXslVehicle) {
|
||||
if (oConvertUtils.isEmpty(mesXslVehicle.getVehicleBelong())) {
|
||||
return Result.error("车辆归属不能为空");
|
||||
}
|
||||
applyVehicleBelong(mesXslVehicle);
|
||||
mesXslVehicleService.updateById(mesXslVehicle);
|
||||
// updateById 默认不更新 null 字段,互斥侧需在库中显式置 NULL
|
||||
forceNullOppositeFieldsInDb(mesXslVehicle.getId(), mesXslVehicle.getVehicleBelong());
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 按车辆归属清理互斥字段:客户/供应商/本公司
|
||||
*/
|
||||
private void applyVehicleBelong(MesXslVehicle v) {
|
||||
if (oConvertUtils.isEmpty(v.getVehicleBelong())) {
|
||||
return;
|
||||
}
|
||||
String b = v.getVehicleBelong();
|
||||
if ("1".equals(b)) {
|
||||
v.setSupplierId(null);
|
||||
v.setSupplierName(null);
|
||||
v.setSupplierShortName(null);
|
||||
} else if ("2".equals(b)) {
|
||||
v.setCustomerIds(null);
|
||||
v.setCustomerShortName(null);
|
||||
} else if ("3".equals(b)) {
|
||||
v.setCustomerIds(null);
|
||||
v.setCustomerShortName(null);
|
||||
v.setSupplierId(null);
|
||||
v.setSupplierName(null);
|
||||
v.setSupplierShortName(null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将互斥侧客户/供应商字段在数据库中置为 NULL(MyBatis-Plus updateById 会忽略 null)
|
||||
*/
|
||||
private void forceNullOppositeFieldsInDb(String id, String vehicleBelong) {
|
||||
if (oConvertUtils.isEmpty(id) || oConvertUtils.isEmpty(vehicleBelong)) {
|
||||
return;
|
||||
}
|
||||
LambdaUpdateWrapper<MesXslVehicle> uw = new LambdaUpdateWrapper<MesXslVehicle>().eq(MesXslVehicle::getId, id);
|
||||
if ("1".equals(vehicleBelong)) {
|
||||
uw.set(MesXslVehicle::getSupplierId, null)
|
||||
.set(MesXslVehicle::getSupplierName, null)
|
||||
.set(MesXslVehicle::getSupplierShortName, null);
|
||||
} else if ("2".equals(vehicleBelong)) {
|
||||
uw.set(MesXslVehicle::getCustomerIds, null).set(MesXslVehicle::getCustomerShortName, null);
|
||||
} else if ("3".equals(vehicleBelong)) {
|
||||
uw.set(MesXslVehicle::getCustomerIds, null)
|
||||
.set(MesXslVehicle::getCustomerShortName, null)
|
||||
.set(MesXslVehicle::getSupplierId, null)
|
||||
.set(MesXslVehicle::getSupplierName, null)
|
||||
.set(MesXslVehicle::getSupplierShortName, null);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
mesXslVehicleService.update(null, uw);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES车辆管理-停用/启用")
|
||||
@Operation(summary = "MES车辆管理-停用/启用")
|
||||
@RequiresPermissions("xslmes:mes_xsl_vehicle:updateStatus")
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public Result<String> updateStatus(
|
||||
@RequestParam(name = "id", required = true) String id,
|
||||
@RequestParam(name = "status", required = true) String status) {
|
||||
if (!"0".equals(status) && !"1".equals(status)) {
|
||||
return Result.error("状态参数非法");
|
||||
}
|
||||
boolean ok = mesXslVehicleService.lambdaUpdate()
|
||||
.eq(MesXslVehicle::getId, id)
|
||||
.set(MesXslVehicle::getStatus, status)
|
||||
.update();
|
||||
return ok ? Result.OK("操作成功") : Result.error("操作失败");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES车辆管理-删除")
|
||||
@Operation(summary = "MES车辆管理-删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_vehicle:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslVehicleService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES车辆管理-批量删除")
|
||||
@Operation(summary = "MES车辆管理-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_vehicle:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslVehicleService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES车辆管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslVehicle> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslVehicle entity = mesXslVehicleService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_vehicle:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslVehicle mesXslVehicle) {
|
||||
return super.exportXls(request, mesXslVehicle, MesXslVehicle.class, "MES车辆管理");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_vehicle:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslVehicle.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
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 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.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslWarehouse;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslWarehouseService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* MES 仓库管理
|
||||
*/
|
||||
@Tag(name = "MES仓库管理")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslWarehouse")
|
||||
@Slf4j
|
||||
public class MesXslWarehouseController extends JeecgController<MesXslWarehouse, IMesXslWarehouseService> {
|
||||
|
||||
@Autowired
|
||||
private IMesXslWarehouseService mesXslWarehouseService;
|
||||
|
||||
@Operation(summary = "MES仓库管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslWarehouse>> queryPageList(
|
||||
MesXslWarehouse mesXslWarehouse,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "treeCategoryId", required = false) String treeCategoryId,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslWarehouse> queryWrapper = QueryGenerator.initQueryWrapper(mesXslWarehouse, req.getParameterMap());
|
||||
if (oConvertUtils.isNotEmpty(treeCategoryId)) {
|
||||
queryWrapper.eq("warehouse_category", treeCategoryId);
|
||||
}
|
||||
Page<MesXslWarehouse> page = new Page<>(pageNo, pageSize);
|
||||
IPage<MesXslWarehouse> pageList = mesXslWarehouseService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES仓库管理-添加")
|
||||
@Operation(summary = "MES仓库管理-添加")
|
||||
@RequiresPermissions("xslmes:mes_xsl_warehouse:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MesXslWarehouse mesXslWarehouse) {
|
||||
if (mesXslWarehouse.getStatus() == null || mesXslWarehouse.getStatus().isEmpty()) {
|
||||
mesXslWarehouse.setStatus("0");
|
||||
}
|
||||
mesXslWarehouseService.save(mesXslWarehouse);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES仓库管理-编辑")
|
||||
@Operation(summary = "MES仓库管理-编辑")
|
||||
@RequiresPermissions("xslmes:mes_xsl_warehouse:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslWarehouse mesXslWarehouse) {
|
||||
mesXslWarehouseService.updateById(mesXslWarehouse);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES仓库管理-停用/启用")
|
||||
@Operation(summary = "MES仓库管理-停用/启用(字典 xslmes_unit_status:0启用 1停用)")
|
||||
@RequiresPermissions("xslmes:mes_xsl_warehouse:updateStatus")
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public Result<String> updateStatus(
|
||||
@RequestParam(name = "id", required = true) String id,
|
||||
@RequestParam(name = "status", required = true) String status) {
|
||||
if (!"0".equals(status) && !"1".equals(status)) {
|
||||
return Result.error("状态参数非法");
|
||||
}
|
||||
boolean ok = mesXslWarehouseService.lambdaUpdate()
|
||||
.eq(MesXslWarehouse::getId, id)
|
||||
.set(MesXslWarehouse::getStatus, status)
|
||||
.update();
|
||||
return ok ? Result.OK("操作成功") : Result.error("操作失败");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES仓库管理-删除")
|
||||
@Operation(summary = "MES仓库管理-删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_warehouse:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mesXslWarehouseService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES仓库管理-批量删除")
|
||||
@Operation(summary = "MES仓库管理-批量删除")
|
||||
@RequiresPermissions("xslmes:mes_xsl_warehouse:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mesXslWarehouseService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@Operation(summary = "MES仓库管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslWarehouse> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslWarehouse entity = mesXslWarehouseService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_warehouse:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslWarehouse mesXslWarehouse) {
|
||||
return super.exportXls(request, mesXslWarehouse, MesXslWarehouse.class, "MES仓库管理");
|
||||
}
|
||||
|
||||
@RequiresPermissions("xslmes:mes_xsl_warehouse:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesXslWarehouse.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* MES 客户管理
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("mes_xsl_customer")
|
||||
@Schema(description = "MES客户管理")
|
||||
public class MesXslCustomer extends JeecgEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "客户编码", width = 20)
|
||||
@Schema(description = "客户编码")
|
||||
private String customerCode;
|
||||
|
||||
@Excel(name = "客户名称", width = 28)
|
||||
@Schema(description = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
@Excel(name = "客户简称", width = 18)
|
||||
@Schema(description = "客户简称")
|
||||
private String customerShortName;
|
||||
|
||||
@Excel(name = "客户区域", width = 15, dicCode = "xslmes_customer_region")
|
||||
@Dict(dicCode = "xslmes_customer_region")
|
||||
@Schema(description = "客户区域")
|
||||
private String customerRegion;
|
||||
|
||||
@Excel(name = "ERP编码", width = 18)
|
||||
@Schema(description = "ERP编码")
|
||||
private String erpCode;
|
||||
|
||||
@Excel(name = "状态", width = 12, dicCode = "xslmes_customer_status")
|
||||
@Dict(dicCode = "xslmes_customer_status")
|
||||
@Schema(description = "业务状态(字典 xslmes_customer_status:0启用1停用2删除);逻辑删除见 del_flag")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "删除状态(0正常 1已删除)")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@Excel(name = "客户描述", width = 36)
|
||||
@Schema(description = "客户描述")
|
||||
private String customerDesc;
|
||||
|
||||
@Excel(name = "是否启用", width = 10)
|
||||
@Schema(description = "是否启用:停用(status=1) 为 0,否则为 1(由服务端同步)")
|
||||
private Integer izEnable;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* MES 器具管理
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("mes_xsl_instrument")
|
||||
@Schema(description = "MES器具管理")
|
||||
public class MesXslInstrument extends JeecgEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "编号条码", width = 22)
|
||||
@Schema(description = "编号/条码")
|
||||
private String barcode;
|
||||
|
||||
@Excel(name = "状态", width = 10, dicCode = "xslmes_instrument_status")
|
||||
@Dict(dicCode = "xslmes_instrument_status")
|
||||
@Schema(description = "状态:0启用 1停用")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "规格型号", width = 18, dicCode = "xslmes_instrument_spec")
|
||||
@Dict(dicCode = "xslmes_instrument_spec")
|
||||
@Schema(description = "规格型号")
|
||||
private String specModel;
|
||||
|
||||
@Excel(name = "备注", width = 28)
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "删除状态(0正常 1已删除)")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* MES 供应商管理
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("mes_xsl_supplier")
|
||||
@Schema(description = "MES供应商管理")
|
||||
public class MesXslSupplier extends JeecgEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "编码", width = 18)
|
||||
@Schema(description = "编码")
|
||||
private String supplierCode;
|
||||
|
||||
@Excel(name = "名称", width = 24)
|
||||
@Schema(description = "名称")
|
||||
private String supplierName;
|
||||
|
||||
@Excel(name = "简称", width = 16)
|
||||
@Schema(description = "简称")
|
||||
private String supplierShortName;
|
||||
|
||||
@Excel(name = "ERP编码", width = 18)
|
||||
@Schema(description = "ERP编码")
|
||||
private String erpCode;
|
||||
|
||||
@Excel(name = "备注", width = 28)
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Excel(name = "状态", width = 10, dicCode = "xslmes_supplier_status")
|
||||
@Dict(dicCode = "xslmes_supplier_status")
|
||||
@Schema(description = "状态:0启用 1停用")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "删除状态(0正常 1已删除)")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* MES 单位
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("mes_xsl_unit")
|
||||
@Schema(description = "MES单位")
|
||||
public class MesXslUnit extends JeecgEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "编码", width = 18)
|
||||
@Schema(description = "编码")
|
||||
private String unitCode;
|
||||
|
||||
@Excel(name = "名称", width = 20)
|
||||
@Schema(description = "名称")
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "ERP编码", width = 18)
|
||||
@Schema(description = "ERP编码")
|
||||
private String erpCode;
|
||||
|
||||
@Excel(name = "所属分类", width = 20, dictTable = "sys_category", dicText = "name", dicCode = "id")
|
||||
@Dict(dictTable = "sys_category", dicText = "name", dicCode = "id")
|
||||
@Schema(description = "所属分类(sys_category.id,根编码 XSLMES_UNIT)")
|
||||
private String categoryId;
|
||||
|
||||
@Excel(name = "描述", width = 40)
|
||||
@Schema(description = "描述")
|
||||
private String unitDesc;
|
||||
|
||||
@Excel(name = "状态", width = 10, dicCode = "xslmes_unit_status")
|
||||
@Dict(dicCode = "xslmes_unit_status")
|
||||
@Schema(description = "状态:0启用 1停用")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "删除状态(0正常 1已删除)")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* MES 车辆管理
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("mes_xsl_vehicle")
|
||||
@Schema(description = "MES车辆管理")
|
||||
public class MesXslVehicle extends JeecgEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "车牌号", width = 18)
|
||||
@Schema(description = "车牌号")
|
||||
private String plateNumber;
|
||||
|
||||
@Excel(name = "车辆归属", width = 12, dicCode = "xslmes_vehicle_belong")
|
||||
@Dict(dicCode = "xslmes_vehicle_belong")
|
||||
@Schema(description = "车辆归属:1客户 2供应商 3本公司")
|
||||
private String vehicleBelong;
|
||||
|
||||
@Excel(name = "车辆皮重KG", width = 14)
|
||||
@Schema(description = "车辆皮重(KG)")
|
||||
private BigDecimal tareWeightKg;
|
||||
|
||||
@Excel(name = "装载量", width = 14)
|
||||
@Schema(description = "装载量")
|
||||
private BigDecimal loadCapacity;
|
||||
|
||||
@Excel(name = "单位ID", width = 22)
|
||||
@Schema(description = "单位ID(mes_xsl_unit.id)")
|
||||
private String unitId;
|
||||
|
||||
@Excel(name = "单位", width = 10)
|
||||
@Schema(description = "单位(名称,与所选单位一致)")
|
||||
private String loadUnit;
|
||||
|
||||
@Excel(name = "客户ID", width = 36)
|
||||
@Schema(description = "客户ID,多选逗号分隔")
|
||||
private String customerIds;
|
||||
|
||||
@Excel(name = "客户简称", width = 28)
|
||||
@Schema(description = "客户简称展示")
|
||||
private String customerShortName;
|
||||
|
||||
@Excel(name = "供应商ID", width = 22)
|
||||
@Schema(description = "供应商ID")
|
||||
private String supplierId;
|
||||
|
||||
@Excel(name = "供应商名称", width = 24)
|
||||
@Schema(description = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Excel(name = "供应商简称", width = 18)
|
||||
@Schema(description = "供应商简称")
|
||||
private String supplierShortName;
|
||||
|
||||
@Excel(name = "车长", width = 12)
|
||||
@Schema(description = "车长")
|
||||
private BigDecimal vehicleLength;
|
||||
|
||||
@Excel(name = "车宽", width = 12)
|
||||
@Schema(description = "车宽")
|
||||
private BigDecimal vehicleWidth;
|
||||
|
||||
@Excel(name = "车高", width = 12)
|
||||
@Schema(description = "车高")
|
||||
private BigDecimal vehicleHeight;
|
||||
|
||||
@Excel(name = "司机", width = 14)
|
||||
@Schema(description = "司机")
|
||||
private String driverName;
|
||||
|
||||
@Excel(name = "联系电话", width = 16)
|
||||
@Schema(description = "联系电话")
|
||||
private String driverPhone;
|
||||
|
||||
@Excel(name = "状态", width = 10, dicCode = "xslmes_vehicle_status")
|
||||
@Dict(dicCode = "xslmes_vehicle_status")
|
||||
@Schema(description = "状态:0启用 1停用")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "删除状态(0正常 1已删除)")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* MES 仓库管理
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("mes_xsl_warehouse")
|
||||
@Schema(description = "MES仓库管理")
|
||||
public class MesXslWarehouse extends JeecgEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "仓库编码", width = 18)
|
||||
@Schema(description = "仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@Excel(name = "仓库名称", width = 22)
|
||||
@Schema(description = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@Excel(name = "仓库分类", width = 14, dictTable = "sys_category", dicText = "name", dicCode = "id")
|
||||
@Dict(dictTable = "sys_category", dicText = "name", dicCode = "id")
|
||||
@Schema(description = "仓库分类(sys_category.id,根编码 XSLMES_WH)")
|
||||
private String warehouseCategory;
|
||||
|
||||
@Excel(name = "ERP编码", width = 18)
|
||||
@Schema(description = "ERP编码")
|
||||
private String erpCode;
|
||||
|
||||
@Excel(name = "状态", width = 10, dicCode = "xslmes_unit_status")
|
||||
@Dict(dicCode = "xslmes_unit_status")
|
||||
@Schema(description = "状态:0启用 1停用")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "客户ID")
|
||||
private String customerId;
|
||||
|
||||
@Excel(name = "客户简称", width = 16)
|
||||
@Schema(description = "客户简称")
|
||||
private String customerShortName;
|
||||
|
||||
@Schema(description = "供应商ID")
|
||||
private String supplierId;
|
||||
|
||||
@Excel(name = "供应商简称", width = 14)
|
||||
@Schema(description = "供应商简称")
|
||||
private String supplierShortName;
|
||||
|
||||
@Schema(description = "删除状态(0正常 1已删除)")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -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.MesXslCustomer;
|
||||
|
||||
/**
|
||||
* MES 客户管理 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslCustomerMapper extends BaseMapper<MesXslCustomer> {
|
||||
}
|
||||
@@ -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.MesXslInstrument;
|
||||
|
||||
/**
|
||||
* MES 器具管理 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslInstrumentMapper extends BaseMapper<MesXslInstrument> {
|
||||
}
|
||||
@@ -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.MesXslSupplier;
|
||||
|
||||
/**
|
||||
* MES 供应商管理 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslSupplierMapper extends BaseMapper<MesXslSupplier> {
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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.MesXslUnit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* MES 单位 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslUnitMapper extends BaseMapper<MesXslUnit> {
|
||||
|
||||
/** 分类字典子树:含自身及所有后代 id(MySQL 8 递归 CTE) */
|
||||
@Select("WITH RECURSIVE unit_cat_tree AS ( "
|
||||
+ " SELECT id FROM sys_category WHERE id = #{rootId} "
|
||||
+ " UNION ALL "
|
||||
+ " SELECT c.id FROM sys_category c INNER JOIN unit_cat_tree t ON c.pid = t.id "
|
||||
+ ") SELECT id FROM unit_cat_tree")
|
||||
List<String> listDescendantCategoryIds(@Param("rootId") String rootId);
|
||||
}
|
||||
@@ -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.MesXslVehicle;
|
||||
|
||||
/**
|
||||
* MES 车辆管理 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslVehicleMapper extends BaseMapper<MesXslVehicle> {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
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.MesXslWarehouse;
|
||||
|
||||
/**
|
||||
* MES 仓库管理 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesXslWarehouseMapper extends BaseMapper<MesXslWarehouse> {
|
||||
|
||||
/** 按分类字典主键取编码(用于客户库/供应商库等业务判断) */
|
||||
@Select("SELECT code FROM sys_category WHERE id = #{id}")
|
||||
String queryCategoryCodeById(@Param("id") String id);
|
||||
}
|
||||
@@ -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.MesXslCustomerMapper">
|
||||
</mapper>
|
||||
@@ -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.MesXslSupplierMapper">
|
||||
</mapper>
|
||||
@@ -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.MesXslUnitMapper">
|
||||
</mapper>
|
||||
@@ -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.MesXslVehicleMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* MES XSL 业务模块(Maven 工程名:jeecg-module-xslmes)。
|
||||
* 包含:客户管理({@link org.jeecg.modules.xslmes.entity.MesXslCustomer})等。
|
||||
*/
|
||||
package org.jeecg.modules.xslmes;
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslCustomer;
|
||||
|
||||
/**
|
||||
* MES 客户管理
|
||||
*/
|
||||
public interface IMesXslCustomerService extends IService<MesXslCustomer> {
|
||||
|
||||
/**
|
||||
* 按业务状态同步 izEnable:停用(字典值 1)为 0,其余为 1。删除仅 del_flag,与 status 无关。
|
||||
*/
|
||||
void syncIzEnableWithStatus(MesXslCustomer entity);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInstrument;
|
||||
|
||||
/**
|
||||
* MES 器具管理
|
||||
*/
|
||||
public interface IMesXslInstrumentService extends IService<MesXslInstrument> {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslSupplier;
|
||||
|
||||
/**
|
||||
* MES 供应商管理
|
||||
*/
|
||||
public interface IMesXslSupplierService extends IService<MesXslSupplier> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslUnit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* MES 单位
|
||||
*/
|
||||
public interface IMesXslUnitService extends IService<MesXslUnit> {
|
||||
|
||||
/** 单位分类(sys_category)选中节点及其所有下级 id,用于列表筛选 */
|
||||
List<String> listDescendantCategoryIds(String rootId);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslVehicle;
|
||||
|
||||
/**
|
||||
* MES 车辆管理
|
||||
*/
|
||||
public interface IMesXslVehicleService extends IService<MesXslVehicle> {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslWarehouse;
|
||||
|
||||
/**
|
||||
* MES 仓库管理
|
||||
*/
|
||||
public interface IMesXslWarehouseService extends IService<MesXslWarehouse> {
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.constant.MesXslCustomerBizStatus;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslCustomer;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslCustomerMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslCustomerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 客户管理
|
||||
*/
|
||||
@Service
|
||||
public class MesXslCustomerServiceImpl extends ServiceImpl<MesXslCustomerMapper, MesXslCustomer> implements IMesXslCustomerService {
|
||||
|
||||
@Override
|
||||
public void syncIzEnableWithStatus(MesXslCustomer entity) {
|
||||
if (entity == null) {
|
||||
return;
|
||||
}
|
||||
String s = entity.getStatus();
|
||||
if (s != null) {
|
||||
s = s.trim();
|
||||
}
|
||||
// 仅停用(字典值1) 为未启用,其余字典值视为启用
|
||||
if (MesXslCustomerBizStatus.isDisabled(s)) {
|
||||
entity.setIzEnable(0);
|
||||
} else {
|
||||
entity.setIzEnable(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInstrument;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslInstrumentMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslInstrumentService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 器具管理
|
||||
*/
|
||||
@Service
|
||||
public class MesXslInstrumentServiceImpl extends ServiceImpl<MesXslInstrumentMapper, MesXslInstrument> implements IMesXslInstrumentService {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslSupplier;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslSupplierMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslSupplierService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 供应商管理
|
||||
*/
|
||||
@Service
|
||||
public class MesXslSupplierServiceImpl extends ServiceImpl<MesXslSupplierMapper, MesXslSupplier> implements IMesXslSupplierService {
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslUnit;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslUnitMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslUnitService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* MES 单位
|
||||
*/
|
||||
@Service
|
||||
public class MesXslUnitServiceImpl extends ServiceImpl<MesXslUnitMapper, MesXslUnit> implements IMesXslUnitService {
|
||||
|
||||
@Override
|
||||
public List<String> listDescendantCategoryIds(String rootId) {
|
||||
return baseMapper.listDescendantCategoryIds(rootId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslVehicle;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslVehicleMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslVehicleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 车辆管理
|
||||
*/
|
||||
@Service
|
||||
public class MesXslVehicleServiceImpl extends ServiceImpl<MesXslVehicleMapper, MesXslVehicle> implements IMesXslVehicleService {
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.constant.MesXslWarehouseCategory;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslWarehouse;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslWarehouseMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslWarehouseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* MES 仓库管理
|
||||
*/
|
||||
@Service
|
||||
public class MesXslWarehouseServiceImpl extends ServiceImpl<MesXslWarehouseMapper, MesXslWarehouse> implements IMesXslWarehouseService {
|
||||
|
||||
@Override
|
||||
public boolean save(MesXslWarehouse entity) {
|
||||
normalizePartners(entity);
|
||||
validatePartners(entity);
|
||||
return super.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateById(MesXslWarehouse entity) {
|
||||
normalizePartners(entity);
|
||||
validatePartners(entity);
|
||||
return super.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 非客户库清空客户;非供应商库清空供应商(切换分类时避免脏数据)
|
||||
*/
|
||||
private void normalizePartners(MesXslWarehouse e) {
|
||||
if (oConvertUtils.isEmpty(e.getWarehouseCategory())) {
|
||||
e.setCustomerId(null);
|
||||
e.setCustomerShortName(null);
|
||||
e.setSupplierId(null);
|
||||
e.setSupplierShortName(null);
|
||||
return;
|
||||
}
|
||||
String code = baseMapper.queryCategoryCodeById(e.getWarehouseCategory());
|
||||
if (!MesXslWarehouseCategory.CUSTOMER_CATEGORY_CODE.equals(code)) {
|
||||
e.setCustomerId(null);
|
||||
e.setCustomerShortName(null);
|
||||
}
|
||||
if (!MesXslWarehouseCategory.SUPPLIER_CATEGORY_CODE.equals(code)) {
|
||||
e.setSupplierId(null);
|
||||
e.setSupplierShortName(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void validatePartners(MesXslWarehouse e) {
|
||||
if (oConvertUtils.isEmpty(e.getWarehouseCategory())) {
|
||||
return;
|
||||
}
|
||||
String code = baseMapper.queryCategoryCodeById(e.getWarehouseCategory());
|
||||
if (MesXslWarehouseCategory.CUSTOMER_CATEGORY_CODE.equals(code)) {
|
||||
if (oConvertUtils.isEmpty(e.getCustomerId())) {
|
||||
throw new JeecgBootException("仓库分类为客户库时,请选择客户");
|
||||
}
|
||||
} else if (MesXslWarehouseCategory.SUPPLIER_CATEGORY_CODE.equals(code)) {
|
||||
if (oConvertUtils.isEmpty(e.getSupplierId())) {
|
||||
throw new JeecgBootException("仓库分类为供应商库时,请选择供应商");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
<module>jeecg-module-demo</module>
|
||||
<module>jeecg-boot-module-airag</module>
|
||||
<module>jeecg-module-print</module>
|
||||
<module>jeecg-module-xslmes</module>
|
||||
</modules>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user