From 59c9c75298d6672ac4e140f8969b33c1367d463c Mon Sep 17 00:00:00 2001 From: zxy Date: Wed, 8 Apr 2026 17:17:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(example):=20=E6=96=B0=E5=A2=9E=E6=9C=BA?= =?UTF-8?q?=E5=8F=B0=E3=80=81=E5=B7=A5=E5=BA=8F=E5=92=8C=E4=BA=A7=E7=BA=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/jnpf/mapper/MachineMapper.java | 16 ++ .../main/java/jnpf/mapper/ProLineMapper.java | 16 ++ .../src/main/java/jnpf/mapper/ProcMapper.java | 16 ++ .../java/jnpf/service/MachineService.java | 32 +++ .../java/jnpf/service/ProLineService.java | 32 +++ .../main/java/jnpf/service/ProcService.java | 32 +++ .../jnpf/service/impl/MachineServiceImpl.java | 176 ++++++++++++++ .../jnpf/service/impl/ProLineServiceImpl.java | 136 +++++++++++ .../jnpf/service/impl/ProcServiceImpl.java | 139 +++++++++++ .../jnpf/controller/MachineController.java | 160 ++++++++++++ .../jnpf/controller/ProLineController.java | 120 +++++++++ .../java/jnpf/controller/ProcController.java | 117 +++++++++ .../main/java/jnpf/entity/MachineEntity.java | 54 +++++ .../main/java/jnpf/entity/ProLineEntity.java | 44 ++++ .../src/main/java/jnpf/entity/ProcEntity.java | 44 ++++ .../java/jnpf/model/machine/MachineForm.java | 67 ++++++ .../jnpf/model/machine/MachinePagination.java | 45 ++++ .../main/java/jnpf/model/proc/ProcForm.java | 38 +++ .../java/jnpf/model/proc/ProcPagination.java | 39 +++ .../java/jnpf/model/proline/ProLineForm.java | 61 +++++ .../jnpf/model/proline/ProLinePagination.java | 39 +++ .../src/views/example/machine/form.vue | 210 ++++++++++++++++ .../src/views/example/machine/index.vue | 227 ++++++++++++++++++ .../jnpf-web/src/views/example/proc/form.vue | 161 +++++++++++++ .../jnpf-web/src/views/example/proc/index.vue | 166 +++++++++++++ .../src/views/example/proline/form.vue | 161 +++++++++++++ .../src/views/example/proline/index.vue | 175 ++++++++++++++ 27 files changed, 2523 insertions(+) create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/MachineMapper.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ProLineMapper.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ProcMapper.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/MachineService.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ProLineService.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ProcService.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/MachineServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ProLineServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ProcServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/MachineController.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ProLineController.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ProcController.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/MachineEntity.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ProLineEntity.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ProcEntity.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/machine/MachineForm.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/machine/MachinePagination.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proc/ProcForm.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proc/ProcPagination.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proline/ProLineForm.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proline/ProLinePagination.java create mode 100644 jnpf-java-boot/jnpf-web/src/views/example/machine/form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/example/machine/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/example/proc/form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/example/proc/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/example/proline/form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/example/proline/index.vue diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/MachineMapper.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/MachineMapper.java new file mode 100644 index 0000000..d3c5d48 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/MachineMapper.java @@ -0,0 +1,16 @@ +package jnpf.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.MachineEntity; + +/** + * 机台主数据 Mapper + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +public interface MachineMapper extends BaseMapper { + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ProLineMapper.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ProLineMapper.java new file mode 100644 index 0000000..224ddfd --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ProLineMapper.java @@ -0,0 +1,16 @@ +package jnpf.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.ProLineEntity; + +/** + * 产线主数据 Mapper + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +public interface ProLineMapper extends BaseMapper { + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ProcMapper.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ProcMapper.java new file mode 100644 index 0000000..b2a201a --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ProcMapper.java @@ -0,0 +1,16 @@ +package jnpf.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.ProcEntity; + +/** + * 工序主数据 Mapper + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +public interface ProcMapper extends BaseMapper { + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/MachineService.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/MachineService.java new file mode 100644 index 0000000..1d3d996 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/MachineService.java @@ -0,0 +1,32 @@ +package jnpf.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.entity.MachineEntity; +import jnpf.model.machine.MachineForm; +import jnpf.model.machine.MachinePagination; + +import java.util.List; + +/** + * 机台主数据 Service + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +public interface MachineService extends IService { + + + List getList(MachinePagination machinePagination); + MachineEntity getInfo(String id); + + void delete(MachineEntity entity); + + void create(MachineEntity entity); + + boolean update(String id, MachineEntity entity); + String checkForm(MachineForm form, int i); + void saveOrUpdate(MachineForm machineForm, String id, boolean isSave) throws Exception; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ProLineService.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ProLineService.java new file mode 100644 index 0000000..03863c6 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ProLineService.java @@ -0,0 +1,32 @@ +package jnpf.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.entity.ProLineEntity; +import jnpf.model.proline.ProLineForm; +import jnpf.model.proline.ProLinePagination; + +import java.util.List; + +/** + * 产线主数据 Service + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +public interface ProLineService extends IService { + + + List getList(ProLinePagination proLinePagination); + ProLineEntity getInfo(String id); + + void delete(ProLineEntity entity); + + void create(ProLineEntity entity); + + boolean update(String id, ProLineEntity entity); + String checkForm(ProLineForm form, int i); + void saveOrUpdate(ProLineForm proLineForm, String id, boolean isSave) throws Exception; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ProcService.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ProcService.java new file mode 100644 index 0000000..b58ab05 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ProcService.java @@ -0,0 +1,32 @@ +package jnpf.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.entity.ProcEntity; +import jnpf.model.proc.ProcForm; +import jnpf.model.proc.ProcPagination; + +import java.util.List; + +/** + * 工序主数据 Service + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +public interface ProcService extends IService { + + + List getList(ProcPagination procPagination); + ProcEntity getInfo(String id); + + void delete(ProcEntity entity); + + void create(ProcEntity entity); + + boolean update(String id, ProcEntity entity); + String checkForm(ProcForm form, int i); + void saveOrUpdate(ProcForm procForm, String id, boolean isSave) throws Exception; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/MachineServiceImpl.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/MachineServiceImpl.java new file mode 100644 index 0000000..fa20ad2 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/MachineServiceImpl.java @@ -0,0 +1,176 @@ +package jnpf.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.UserInfo; +import jnpf.entity.MachineEntity; +import jnpf.entity.ProLineEntity; +import jnpf.entity.ProcEntity; +import jnpf.mapper.MachineMapper; +import jnpf.model.machine.MachineForm; +import jnpf.model.machine.MachinePagination; +import jnpf.service.MachineService; +import jnpf.service.ProLineService; +import jnpf.service.ProcService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 机台主数据 ServiceImpl + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +@Service +public class MachineServiceImpl extends ServiceImpl implements MachineService { + + @Resource + private UserProvider userProvider; + + @Resource + private ProLineService proLineService; + + @Resource + private ProcService procService; + + @Override + public List getList(MachinePagination machinePagination) { + LambdaQueryWrapper machineWrapper = new LambdaQueryWrapper<>(); + + if (ObjectUtil.isNotEmpty(machinePagination.getMachineCd())) { + machineWrapper.like(MachineEntity::getMachineCd, machinePagination.getMachineCd()); + } + if (ObjectUtil.isNotEmpty(machinePagination.getMachineName())) { + machineWrapper.like(MachineEntity::getMachineName, machinePagination.getMachineName()); + } + if (ObjectUtil.isNotEmpty(machinePagination.getEnabledStatus())) { + machineWrapper.eq(MachineEntity::getEnabledStatus, machinePagination.getEnabledStatus()); + } + if (ObjectUtil.isNotEmpty(machinePagination.getBelgLineId())) { + machineWrapper.eq(MachineEntity::getBelgLineId, machinePagination.getBelgLineId()); + } + if (ObjectUtil.isNotEmpty(machinePagination.getBelgProcId())) { + machineWrapper.eq(MachineEntity::getBelgProcId, machinePagination.getBelgProcId()); + } +// machineWrapper.isNull(MachineEntity::getDeleteMark); + machineWrapper.orderByDesc(MachineEntity::getCreatorTime); + if ("0".equals(machinePagination.getDataType())) { + Page page = new Page<>(machinePagination.getCurrentPage(), machinePagination.getPageSize()); + IPage userIPage = this.page(page, machineWrapper); + List records = userIPage.getRecords(); + + // 获取所有产线和工序数据 + List proLineList = proLineService.list(); + List procList = procService.list(); + + Map proLineMap = proLineList.stream() + .collect(Collectors.toMap(ProLineEntity::getId, ProLineEntity::getProLineName)); + Map procMap = procList.stream() + .collect(Collectors.toMap(ProcEntity::getId, ProcEntity::getProcName)); + + // 设置产线和工序名称 + for (MachineEntity machine : records) { + if (machine.getBelgLineId() != null) { + machine.setBelgLineName(proLineMap.get(machine.getBelgLineId())); + } + if (machine.getBelgProcId() != null) { + machine.setBelgProcName(procMap.get(machine.getBelgProcId())); + } + } + + return machinePagination.setData(records, userIPage.getTotal()); + } else { + return this.list(machineWrapper); + } + } + + @Override + public MachineEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MachineEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(MachineEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, MachineEntity entity) { + return this.updateById(entity); + } + + @Override + public void delete(MachineEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + /** + * 验证表单唯一字段,正则,非空 i-0新增-1修改 + */ + @Override + public String checkForm(MachineForm form, int i) { + boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); + String id = ""; + String countRecover = ""; + if (isUp) { + id = form.getId(); + } + //主表字段验证 + //机台编码唯一性验证 + if (ObjectUtil.isNotEmpty(form.getMachineCd())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(MachineEntity::getMachineCd, form.getMachineCd()); + if (isUp) { + wrapper.ne(MachineEntity::getId, id); + } + long count = this.count(wrapper); + if (count > 0) { + countRecover += "机台编码已存在,请重新输入!"; + } + } + + return countRecover; + } + + /** + * 新增修改数据(事务回滚) + * + * @param id + * @param machineForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(MachineForm machineForm, String id, boolean isSave) throws Exception { + UserInfo userInfo = userProvider.get(); + MachineEntity entity = JsonUtil.getJsonToBean(machineForm, MachineEntity.class); + + if (!isSave) { + // 更新时设置ID + if (StringUtil.isNotEmpty(id)) { + entity.setId(Long.valueOf(id)); + } + } + // 新增时ID由数据库自动生成,不需要设置 + this.saveOrUpdate(entity); + } + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ProLineServiceImpl.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ProLineServiceImpl.java new file mode 100644 index 0000000..23a491b --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ProLineServiceImpl.java @@ -0,0 +1,136 @@ +package jnpf.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.UserInfo; +import jnpf.entity.ProLineEntity; +import jnpf.mapper.ProLineMapper; +import jnpf.model.proline.ProLineForm; +import jnpf.model.proline.ProLinePagination; +import jnpf.service.ProLineService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 产线主数据 ServiceImpl + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +@Service +public class ProLineServiceImpl extends ServiceImpl implements ProLineService { + + @Resource + private UserProvider userProvider; + + @Override + public List getList(ProLinePagination proLinePagination) { + LambdaQueryWrapper proLineWrapper = new LambdaQueryWrapper<>(); + + if (ObjectUtil.isNotEmpty(proLinePagination.getProLineCd())) { + proLineWrapper.like(ProLineEntity::getProLineCd, proLinePagination.getProLineCd()); + } + if (ObjectUtil.isNotEmpty(proLinePagination.getProLineName())) { + proLineWrapper.like(ProLineEntity::getProLineName, proLinePagination.getProLineName()); + } + if (ObjectUtil.isNotEmpty(proLinePagination.getEnabledStatus())) { + proLineWrapper.eq(ProLineEntity::getEnabledStatus, proLinePagination.getEnabledStatus()); + } + proLineWrapper.orderByDesc(ProLineEntity::getCreatorTime); + if ("0".equals(proLinePagination.getDataType())) { + Page page = new Page<>(proLinePagination.getCurrentPage(), proLinePagination.getPageSize()); + IPage userIPage = this.page(page, proLineWrapper); + return proLinePagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + return this.list(proLineWrapper); + } + } + + @Override + public ProLineEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProLineEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ProLineEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, ProLineEntity entity) { + return this.updateById(entity); + } + + @Override + public void delete(ProLineEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + /** + * 验证表单唯一字段,正则,非空 i-0新增-1修改 + */ + @Override + public String checkForm(ProLineForm form, int i) { + boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); + String id = ""; + String countRecover = ""; + if (isUp) { + id = form.getId(); + } + //主表字段验证 + //产线编码唯一性验证 + if (ObjectUtil.isNotEmpty(form.getProLineCd())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProLineEntity::getProLineCd, form.getProLineCd()); + if (isUp) { + wrapper.ne(ProLineEntity::getId, id); + } + long count = this.count(wrapper); + if (count > 0) { + countRecover += "产线编码已存在,请重新输入!"; + } + } + + return countRecover; + } + + /** + * 新增修改数据(事务回滚) + * + * @param id + * @param proLineForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(ProLineForm proLineForm, String id, boolean isSave) throws Exception { + UserInfo userInfo = userProvider.get(); + ProLineEntity entity = JsonUtil.getJsonToBean(proLineForm, ProLineEntity.class); + + if (!isSave) { + // 更新时设置ID + if (StringUtil.isNotEmpty(id)) { + entity.setId(Long.valueOf(id)); + } + } + // 新增时ID由数据库自动生成,不需要设置 + this.saveOrUpdate(entity); + } + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ProcServiceImpl.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ProcServiceImpl.java new file mode 100644 index 0000000..591dcb1 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ProcServiceImpl.java @@ -0,0 +1,139 @@ +package jnpf.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.UserInfo; +import jnpf.entity.ProcEntity; +import jnpf.mapper.ProcMapper; +import jnpf.model.proc.ProcForm; +import jnpf.model.proc.ProcPagination; +import jnpf.service.ProcService; +import jnpf.util.GeneraterSwapUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 工序主数据 ServiceImpl + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +@Service +public class ProcServiceImpl extends ServiceImpl implements ProcService { + @Resource + private GeneraterSwapUtil generaterSwapUtil; + + @Resource + private UserProvider userProvider; + + @Override + public List getList(ProcPagination procPagination) { + LambdaQueryWrapper procWrapper = new LambdaQueryWrapper<>(); + + if (ObjectUtil.isNotEmpty(procPagination.getProcCd())) { + procWrapper.like(ProcEntity::getProcCd, procPagination.getProcCd()); + } + if (ObjectUtil.isNotEmpty(procPagination.getProcName())) { + procWrapper.like(ProcEntity::getProcName, procPagination.getProcName()); + } + if (ObjectUtil.isNotEmpty(procPagination.getEnabledStatus())) { + procWrapper.eq(ProcEntity::getEnabledStatus, procPagination.getEnabledStatus()); + } + procWrapper.orderByDesc(ProcEntity::getCreatorTime); + if ("0".equals(procPagination.getDataType())) { + Page page = new Page<>(procPagination.getCurrentPage(), procPagination.getPageSize()); + IPage userIPage = this.page(page, procWrapper); + return procPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + return this.list(procWrapper); + } + } + + @Override + public ProcEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProcEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ProcEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, ProcEntity entity) { + return this.updateById(entity); + } + + @Override + public void delete(ProcEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + /** + * 验证表单唯一字段,正则,非空 i-0新增-1修改 + */ + @Override + public String checkForm(ProcForm form, int i) { + boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); + String id = ""; + String countRecover = ""; + if (isUp) { + id = form.getId(); + } + //主表字段验证 + //工序编码唯一性验证 + if (ObjectUtil.isNotEmpty(form.getProcCd())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProcEntity::getProcCd, form.getProcCd()); + if (isUp) { + wrapper.ne(ProcEntity::getId, id); + } + long count = this.count(wrapper); + if (count > 0) { + countRecover += "工序编码已存在,请重新输入!"; + } + } + + return countRecover; + } + + /** + * 新增修改数据(事务回滚) + * + * @param id + * @param procForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(ProcForm procForm, String id, boolean isSave) throws Exception { + UserInfo userInfo = userProvider.get(); + ProcEntity entity = JsonUtil.getJsonToBean(procForm, ProcEntity.class); + + if (!isSave) { + // 更新时设置ID + if (StringUtil.isNotEmpty(id)) { + entity.setId(Long.valueOf(id)); + } + } + // 新增时ID由数据库自动生成,不需要设置 + this.saveOrUpdate(entity); + } + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/MachineController.java b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/MachineController.java new file mode 100644 index 0000000..dfedfe0 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/MachineController.java @@ -0,0 +1,160 @@ +package jnpf.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.entity.MachineEntity; +import jnpf.entity.ProcEntity; +import jnpf.entity.ProLineEntity; +import jnpf.model.machine.MachineForm; +import jnpf.model.machine.MachinePagination; +import jnpf.service.MachineService; +import jnpf.service.ProcService; +import jnpf.service.ProLineService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 机台主数据 控制类 + * + */ +@Tag(name = "机台主数据", description = "Machine") +@RestController +@RequestMapping("/api/example/machine") +public class MachineController { + + @Autowired + private MachineService machineService; + + @Autowired + private ProLineService proLineService; + + @Autowired + private ProcService procService; + + /** + * 列表 + * @param machinePagination 分页查询对象 + * @return 列表结果集 + */ + @Operation(summary = "获取机台列表") + @PostMapping("/getList") + public ActionResult getList(@RequestBody MachinePagination machinePagination) { + List list = machineService.getList(machinePagination); + List> realList = list.stream() + .map(JsonUtil::entityToMap) + .collect(Collectors.toList()); + + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(machinePagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 详情 + * @param id 主键 + * @return 详情结果集 + */ + @Operation(summary = "获取机台详情") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + MachineEntity entity = machineService.getInfo(id); + if (entity != null) { + return ActionResult.success(JsonUtil.entityToMap(entity)); + } + return ActionResult.fail("数据不存在"); + } + + /** + * 新建 + * @param machineForm 表单对象 + * @return 新建结果 + */ + @Operation(summary = "新建机台") + @PostMapping + public ActionResult create(@RequestBody @Valid MachineForm machineForm) { + String b = machineService.checkForm(machineForm, 0); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + try { + machineService.saveOrUpdate(machineForm, "", true); + return ActionResult.success("新建成功"); + } catch (Exception e) { + return ActionResult.fail("新建数据失败:" + e.getMessage()); + } + } + + /** + * 编辑 + * @param id 主键 + * @param machineForm 表单对象 + * @return 编辑结果 + */ + @Operation(summary = "更新机台") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid MachineForm machineForm) { + machineForm.setId(id); + String b = machineService.checkForm(machineForm, 1); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + MachineEntity entity = machineService.getInfo(id); + if (entity != null) { + try { + machineService.saveOrUpdate(machineForm, id, false); + return ActionResult.success("更新成功"); + } catch (Exception e) { + return ActionResult.fail("更新数据失败:" + e.getMessage()); + } + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + + /** + * 获取产线下拉列表 + * @return 产线列表 + */ + @Operation(summary = "获取产线下拉列表") + @GetMapping("/getProLineList") + public ActionResult getProLineList() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProLineEntity::getEnabledStatus, 1); + List list = proLineService.list(wrapper); + List> realList = list.stream() + .map(JsonUtil::entityToMap) + .collect(Collectors.toList()); + return ActionResult.success(realList); + } + + /** + * 获取工序列表 + * @return 工序列表 + */ + @Operation(summary = "获取工序列表") + @GetMapping("/getProcList") + public ActionResult getProcList() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProcEntity::getEnabledStatus, 1); + List list = procService.list(wrapper); + List> realList = list.stream() + .map(JsonUtil::entityToMap) + .collect(Collectors.toList()); + return ActionResult.success(realList); + } + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ProLineController.java b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ProLineController.java new file mode 100644 index 0000000..b235e20 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ProLineController.java @@ -0,0 +1,120 @@ +package jnpf.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.entity.ProLineEntity; +import jnpf.model.proline.ProLineForm; +import jnpf.model.proline.ProLinePagination; +import jnpf.service.ProLineService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 产线主数据 控制类 + */ +@Tag(name = "产线主数据", description = "ProLine") +@RestController +@RequestMapping("/api/example/proLine") +public class ProLineController { + + @Autowired + private ProLineService proLineService; + + /** + * 列表 + * + * @param proLinePagination 分页查询对象 + * @return 列表结果集 + */ + @Operation(summary = "获取产线列表") + @PostMapping("/getList") + public ActionResult getList(@RequestBody ProLinePagination proLinePagination) { + List list = proLineService.getList(proLinePagination); + List> realList = list.stream() + .map(JsonUtil::entityToMap) + .collect(Collectors.toList()); + + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(proLinePagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 详情 + * + * @param id 主键 + * @return 详情结果集 + */ + @Operation(summary = "获取产线详情") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + ProLineEntity entity = proLineService.getInfo(id); + if (entity != null) { + return ActionResult.success(JsonUtil.entityToMap(entity)); + } + return ActionResult.fail("数据不存在"); + } + + /** + * 新建 + * + * @param proLineForm 表单对象 + * @return 新建结果 + */ + @Operation(summary = "新建产线") + @PostMapping + public ActionResult create(@RequestBody @Valid ProLineForm proLineForm) { + String b = proLineService.checkForm(proLineForm, 0); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + try { + proLineService.saveOrUpdate(proLineForm, "", true); + return ActionResult.success("新建成功"); + } catch (Exception e) { + return ActionResult.fail("新建数据失败:" + e.getMessage()); + } + } + + /** + * 编辑 + * + * @param id 主键 + * @param proLineForm 表单对象 + * @return 编辑结果 + */ + @Operation(summary = "更新产线") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProLineForm proLineForm) { + proLineForm.setId(id); + String b = proLineService.checkForm(proLineForm, 1); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + ProLineEntity entity = proLineService.getInfo(id); + if (entity != null) { + try { + proLineService.saveOrUpdate(proLineForm, id, false); + return ActionResult.success("更新成功"); + } catch (Exception e) { + return ActionResult.fail("更新数据失败:" + e.getMessage()); + } + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ProcController.java b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ProcController.java new file mode 100644 index 0000000..57d3306 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ProcController.java @@ -0,0 +1,117 @@ +package jnpf.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.entity.ProcEntity; +import jnpf.model.proc.ProcForm; +import jnpf.model.proc.ProcPagination; +import jnpf.service.ProcService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 工序主数据 控制类 + * + */ +@Tag(name = "工序主数据", description = "Proc") +@RestController +@RequestMapping("/api/example/proc") +public class ProcController { + + @Autowired + private ProcService procService; + + /** + * 列表 + * @param procPagination 分页查询对象 + * @return 列表结果集 + */ + @Operation(summary = "获取工序列表") + @PostMapping("/getList") + public ActionResult getList(@RequestBody ProcPagination procPagination) { + List list = procService.getList(procPagination); + List> realList = list.stream() + .map(JsonUtil::entityToMap) + .collect(Collectors.toList()); + + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(procPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 详情 + * @param id 主键 + * @return 详情结果集 + */ + @Operation(summary = "获取工序详情") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + ProcEntity entity = procService.getInfo(id); + if (entity != null) { + return ActionResult.success(JsonUtil.entityToMap(entity)); + } + return ActionResult.fail("数据不存在"); + } + + /** + * 新建 + * @param procForm 表单对象 + * @return 新建结果 + */ + @Operation(summary = "新建工序") + @PostMapping + public ActionResult create(@RequestBody @Valid ProcForm procForm) { + String b = procService.checkForm(procForm, 0); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + try { + procService.saveOrUpdate(procForm, "", true); + return ActionResult.success("新建成功"); + } catch (Exception e) { + return ActionResult.fail("新建数据失败:" + e.getMessage()); + } + } + + /** + * 编辑 + * @param id 主键 + * @param procForm 表单对象 + * @return 编辑结果 + */ + @Operation(summary = "更新工序") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProcForm procForm) { + procForm.setId(id); + String b = procService.checkForm(procForm, 1); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + ProcEntity entity = procService.getInfo(id); + if (entity != null) { + try { + procService.saveOrUpdate(procForm, id, false); + return ActionResult.success("更新成功"); + } catch (Exception e) { + return ActionResult.fail("更新数据失败:" + e.getMessage()); + } + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/MachineEntity.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/MachineEntity.java new file mode 100644 index 0000000..4ecb49f --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/MachineEntity.java @@ -0,0 +1,54 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.util.Date; + +/** + * 机台主数据表 + * + */ +@Data +@TableName("tba_machine") +public class MachineEntity { + @TableId(value = "id", type = IdType.AUTO) + private Long id; + @TableField(value = "f_creator_user_id", fill = FieldFill.INSERT) + private String creatorUserId; + @TableField(value = "f_creator_time", fill = FieldFill.INSERT) + private Date creatorTime; + @TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE) + private String lastModifyUserId; + @TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE) + private Date lastModifyTime; + @TableField(value = "f_delete_user_id", fill = FieldFill.UPDATE) + private String deleteUserId; + @TableField(value = "f_delete_time", fill = FieldFill.UPDATE) + private Date deleteTime; + @TableField(value = "f_delete_mark", updateStrategy = FieldStrategy.IGNORED) + private Integer deleteMark; + @TableField(value = "f_flow_id") + private String flowId; + @TableField(value = "f_flow_task_id") + private String flowTaskId; + @TableField("machine_cd") + private String machineCd; + @TableField("machine_name") + private String machineName; + @TableField(value = "enabled_status", updateStrategy = FieldStrategy.IGNORED) + private Integer enabledStatus; + @TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED) + private String remark; + @TableField(value = "belg_line_id", updateStrategy = FieldStrategy.IGNORED) + private Long belgLineId; + @TableField(value = "belg_proc_id", updateStrategy = FieldStrategy.IGNORED) + private Long belgProcId; + + @TableField(exist = false) + private String belgLineName; + + @TableField(exist = false) + private String belgProcName; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ProLineEntity.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ProLineEntity.java new file mode 100644 index 0000000..96bc42a --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ProLineEntity.java @@ -0,0 +1,44 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.util.Date; + +/** + * 产线主数据表 + * + */ +@Data +@TableName("tba_pro_line") +public class ProLineEntity { + @TableId(value = "id", type = IdType.AUTO) + private Long id; + @TableField(value = "f_creator_user_id", fill = FieldFill.INSERT) + private String creatorUserId; + @TableField(value = "f_creator_time", fill = FieldFill.INSERT) + private Date creatorTime; + @TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE) + private String lastModifyUserId; + @TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE) + private Date lastModifyTime; + @TableField(value = "f_delete_user_id", fill = FieldFill.UPDATE) + private String deleteUserId; + @TableField(value = "f_delete_time", fill = FieldFill.UPDATE) + private Date deleteTime; + @TableField(value = "f_delete_mark", updateStrategy = FieldStrategy.IGNORED) + private Integer deleteMark; + @TableField(value = "f_flow_id") + private String flowId; + @TableField(value = "f_flow_task_id") + private String flowTaskId; + @TableField("pro_line_cd") + private String proLineCd; + @TableField("pro_line_name") + private String proLineName; + @TableField(value = "enabled_status", updateStrategy = FieldStrategy.IGNORED) + private Integer enabledStatus; + @TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED) + private String remark; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ProcEntity.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ProcEntity.java new file mode 100644 index 0000000..0da8f34 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ProcEntity.java @@ -0,0 +1,44 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.util.Date; + +/** + * 工序主数据表 + * + */ +@Data +@TableName("tba_proc") +public class ProcEntity { + @TableId(value = "id", type = IdType.AUTO) + private Long id; + @TableField(value = "f_creator_user_id", fill = FieldFill.INSERT) + private String creatorUserId; + @TableField(value = "f_creator_time", fill = FieldFill.INSERT) + private Date creatorTime; + @TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE) + private String lastModifyUserId; + @TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE) + private Date lastModifyTime; + @TableField(value = "f_delete_user_id", fill = FieldFill.UPDATE) + private String deleteUserId; + @TableField(value = "f_delete_time", fill = FieldFill.UPDATE) + private Date deleteTime; + @TableField(value = "f_delete_mark", updateStrategy = FieldStrategy.IGNORED) + private Integer deleteMark; + @TableField(value = "f_flow_id") + private String flowId; + @TableField(value = "f_flow_task_id") + private String flowTaskId; + @TableField("proc_cd") + private String procCd; + @TableField("proc_name") + private String procName; + @TableField(value = "enabled_status", updateStrategy = FieldStrategy.IGNORED) + private Integer enabledStatus; + @TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED) + private String remark; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/machine/MachineForm.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/machine/MachineForm.java new file mode 100644 index 0000000..daf8df2 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/machine/MachineForm.java @@ -0,0 +1,67 @@ +package jnpf.model.machine; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 机台主数据 Form + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +@Data +public class MachineForm { + + @Schema(description = "主键") + private String id; + + @Schema(description = "机台编码") + private String machineCd; + + @Schema(description = "机台名称") + private String machineName; + + @Schema(description = "状态(1启用 2 未启用)") + private Integer enabledStatus; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + private Date creatorTime; + + @Schema(description = "创建用户ID") + private String creatorUserId; + + @Schema(description = "最后修改时间") + private Date lastModifyTime; + + @Schema(description = "最后修改用户ID") + private String lastModifyUserId; + + @Schema(description = "删除时间") + private Date deleteTime; + + @Schema(description = "删除用户ID") + private String deleteUserId; + + @Schema(description = "删除标记") + private Integer deleteMark; + + @Schema(description = "流程ID") + private String flowId; + + @Schema(description = "流程任务ID") + private String flowTaskId; + + @Schema(description = "所属产线id") + private Long belgLineId; + + @Schema(description = "所属工序id") + private Long belgProcId; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/machine/MachinePagination.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/machine/MachinePagination.java new file mode 100644 index 0000000..91a6175 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/machine/MachinePagination.java @@ -0,0 +1,45 @@ +package jnpf.model.machine; + +import jnpf.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 机台主数据分页查询 + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +@Data +public class MachinePagination extends Pagination { + /** 查询key */ + private String[] selectKey; + /** json */ + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + private String dataType; + /** 高级查询 */ + private String superQueryJson; + /** 功能id */ + private String moduleId; + /** 菜单id */ + private String menuId; + + @Schema(description = "机台编码") + private String machineCd; + + @Schema(description = "机台名称") + private String machineName; + + @Schema(description = "状态(1启用 2 未启用)") + private Integer enabledStatus; + + @Schema(description = "所属产线id") + private Long belgLineId; + + @Schema(description = "所属工序id") + private Long belgProcId; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proc/ProcForm.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proc/ProcForm.java new file mode 100644 index 0000000..dcabd7c --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proc/ProcForm.java @@ -0,0 +1,38 @@ +package jnpf.model.proc; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 工序主数据 Form + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +@Data +public class ProcForm { + + @Schema(description = "主键") + private String id; + + @Schema(description = "工序编码") + private String procCd; + + @Schema(description = "工序名称") + private String procName; + + @Schema(description = "状态(1启用 2 未启用)") + private Integer enabledStatus; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "流程ID") + private String flowId; + + @Schema(description = "流程任务ID") + private String flowTaskId; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proc/ProcPagination.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proc/ProcPagination.java new file mode 100644 index 0000000..19392b5 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proc/ProcPagination.java @@ -0,0 +1,39 @@ +package jnpf.model.proc; + +import jnpf.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 工序主数据分页查询 + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +@Data +public class ProcPagination extends Pagination { + /** 查询key */ + private String[] selectKey; + /** json */ + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + private String dataType; + /** 高级查询 */ + private String superQueryJson; + /** 功能id */ + private String moduleId; + /** 菜单id */ + private String menuId; + + @Schema(description = "工序编码") + private String procCd; + + @Schema(description = "工序名称") + private String procName; + + @Schema(description = "状态(1启用 2 未启用)") + private Integer enabledStatus; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proline/ProLineForm.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proline/ProLineForm.java new file mode 100644 index 0000000..78e50f5 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proline/ProLineForm.java @@ -0,0 +1,61 @@ +package jnpf.model.proline; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 产线主数据 Form + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +@Data +public class ProLineForm { + + @Schema(description = "主键") + private String id; + + @Schema(description = "产线编码") + private String proLineCd; + + @Schema(description = "产线名称") + private String proLineName; + + @Schema(description = "状态(1启用 2 未启用)") + private Integer enabledStatus; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + private Date creatorTime; + + @Schema(description = "创建用户ID") + private String creatorUserId; + + @Schema(description = "最后修改时间") + private Date lastModifyTime; + + @Schema(description = "最后修改用户ID") + private String lastModifyUserId; + + @Schema(description = "删除时间") + private Date deleteTime; + + @Schema(description = "删除用户ID") + private String deleteUserId; + + @Schema(description = "删除标记") + private Integer deleteMark; + + @Schema(description = "流程ID") + private String flowId; + + @Schema(description = "流程任务ID") + private String flowTaskId; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proline/ProLinePagination.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proline/ProLinePagination.java new file mode 100644 index 0000000..cee42fd --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/proline/ProLinePagination.java @@ -0,0 +1,39 @@ +package jnpf.model.proline; + +import jnpf.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 产线主数据分页查询 + * + * @版本: V3.5 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2024-02-04 + */ +@Data +public class ProLinePagination extends Pagination { + /** 查询key */ + private String[] selectKey; + /** json */ + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + private String dataType; + /** 高级查询 */ + private String superQueryJson; + /** 功能id */ + private String moduleId; + /** 菜单id */ + private String menuId; + + @Schema(description = "产线编码") + private String proLineCd; + + @Schema(description = "产线名称") + private String proLineName; + + @Schema(description = "状态(1启用 2 未启用)") + private Integer enabledStatus; + +} diff --git a/jnpf-java-boot/jnpf-web/src/views/example/machine/form.vue b/jnpf-java-boot/jnpf-web/src/views/example/machine/form.vue new file mode 100644 index 0000000..74fc12d --- /dev/null +++ b/jnpf-java-boot/jnpf-web/src/views/example/machine/form.vue @@ -0,0 +1,210 @@ + + + diff --git a/jnpf-java-boot/jnpf-web/src/views/example/machine/index.vue b/jnpf-java-boot/jnpf-web/src/views/example/machine/index.vue new file mode 100644 index 0000000..358e17c --- /dev/null +++ b/jnpf-java-boot/jnpf-web/src/views/example/machine/index.vue @@ -0,0 +1,227 @@ + + + diff --git a/jnpf-java-boot/jnpf-web/src/views/example/proc/form.vue b/jnpf-java-boot/jnpf-web/src/views/example/proc/form.vue new file mode 100644 index 0000000..b56688b --- /dev/null +++ b/jnpf-java-boot/jnpf-web/src/views/example/proc/form.vue @@ -0,0 +1,161 @@ + + + diff --git a/jnpf-java-boot/jnpf-web/src/views/example/proc/index.vue b/jnpf-java-boot/jnpf-web/src/views/example/proc/index.vue new file mode 100644 index 0000000..f5ec5ef --- /dev/null +++ b/jnpf-java-boot/jnpf-web/src/views/example/proc/index.vue @@ -0,0 +1,166 @@ + + + diff --git a/jnpf-java-boot/jnpf-web/src/views/example/proline/form.vue b/jnpf-java-boot/jnpf-web/src/views/example/proline/form.vue new file mode 100644 index 0000000..6e6d24b --- /dev/null +++ b/jnpf-java-boot/jnpf-web/src/views/example/proline/form.vue @@ -0,0 +1,161 @@ + + + diff --git a/jnpf-java-boot/jnpf-web/src/views/example/proline/index.vue b/jnpf-java-boot/jnpf-web/src/views/example/proline/index.vue new file mode 100644 index 0000000..0a26b4f --- /dev/null +++ b/jnpf-java-boot/jnpf-web/src/views/example/proline/index.vue @@ -0,0 +1,175 @@ + + +