From f8a2627c99ab9652c738330d3c54ff3a5058e7f5 Mon Sep 17 00:00:00 2001 From: zxy Date: Wed, 15 Apr 2026 10:10:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(supplier):=20=E6=96=B0=E5=A2=9E=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/jnpf/mapper/SupplierMapper.java | 8 + .../java/jnpf/service/SupplierService.java | 24 ++ .../service/impl/SupplierServiceImpl.java | 123 ++++++++ .../jnpf/controller/SupplierController.java | 105 +++++++ .../jnpf/model/supplier/SupplierConstant.java | 30 ++ .../jnpf/model/supplier/SupplierEntity.java | 96 ++++++ .../jnpf/model/supplier/SupplierForm.java | 67 +++++ .../model/supplier/SupplierPagination.java | 30 ++ .../src/views/example/customer/options.js | 2 +- .../src/views/example/supplier/detail.vue | 185 ++++++++++++ .../src/views/example/supplier/form.vue | 238 +++++++++++++++ .../src/views/example/supplier/index.vue | 277 ++++++++++++++++++ 12 files changed, 1184 insertions(+), 1 deletion(-) create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/SupplierMapper.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/SupplierService.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/SupplierServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/SupplierController.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierConstant.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierEntity.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierForm.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierPagination.java create mode 100644 jnpf-java-boot/jnpf-web/src/views/example/supplier/detail.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/example/supplier/form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/example/supplier/index.vue diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/SupplierMapper.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/SupplierMapper.java new file mode 100644 index 0000000..a0ceed9 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/SupplierMapper.java @@ -0,0 +1,8 @@ +package jnpf.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.model.supplier.SupplierEntity; + +public interface SupplierMapper extends BaseMapper { + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/SupplierService.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/SupplierService.java new file mode 100644 index 0000000..416d27a --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/SupplierService.java @@ -0,0 +1,24 @@ +package jnpf.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.model.supplier.SupplierEntity; +import jnpf.model.supplier.SupplierForm; +import jnpf.model.supplier.SupplierPagination; + +import java.util.List; + +public interface SupplierService extends IService { + List getList(SupplierPagination supplierPagination); + + SupplierEntity getInfo(String id); + + void delete(SupplierEntity entity); + + void create(SupplierEntity entity); + + boolean update(String id, SupplierEntity entity); + + String checkForm(SupplierForm form, int i); + + void saveOrUpdate(SupplierForm supplierForm, String id, boolean isSave) throws Exception; +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/SupplierServiceImpl.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/SupplierServiceImpl.java new file mode 100644 index 0000000..77dfe03 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/SupplierServiceImpl.java @@ -0,0 +1,123 @@ +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.mapper.SupplierMapper; +import jnpf.model.supplier.SupplierEntity; +import jnpf.model.supplier.SupplierForm; +import jnpf.model.supplier.SupplierPagination; +import jnpf.service.SupplierService; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class SupplierServiceImpl extends ServiceImpl implements SupplierService { + + @Resource + private UserProvider userProvider; + + @Override + public List getList(SupplierPagination supplierPagination) { + LambdaQueryWrapper supplierWrapper = new LambdaQueryWrapper<>(); + + if (ObjectUtil.isNotEmpty(supplierPagination.getSupplierNo())) { + supplierWrapper.like(SupplierEntity::getSupplierNo, supplierPagination.getSupplierNo()); + } + if (ObjectUtil.isNotEmpty(supplierPagination.getSupplierName())) { + supplierWrapper.like(SupplierEntity::getSupplierName, supplierPagination.getSupplierName()); + } + if (ObjectUtil.isNotEmpty(supplierPagination.getSupplierType())) { + supplierWrapper.eq(SupplierEntity::getSupplierType, supplierPagination.getSupplierType()); + } + if (ObjectUtil.isNotEmpty(supplierPagination.getStatus())) { + supplierWrapper.eq(SupplierEntity::getStatus, supplierPagination.getStatus()); + } + if (ObjectUtil.isNotEmpty(supplierPagination.getEnabledStatus())) { + supplierWrapper.eq(SupplierEntity::getEnabledStatus, supplierPagination.getEnabledStatus()); + } + + supplierWrapper.eq(SupplierEntity::getDeleteMark, 0); + supplierWrapper.orderByDesc(SupplierEntity::getId); + + if ("0".equals(supplierPagination.getDataType())) { + Page page = new Page<>(supplierPagination.getCurrentPage(), supplierPagination.getPageSize()); + IPage result = this.page(page, supplierWrapper); + return supplierPagination.setData(result.getRecords(), result.getTotal()); + } else { + return this.list(supplierWrapper); + } + } + + @Override + public SupplierEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SupplierEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(SupplierEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, SupplierEntity entity) { + return this.updateById(entity); + } + + @Override + public void delete(SupplierEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public String checkForm(SupplierForm form, int i) { + boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); + String id = ""; + String countRecover = ""; + if (isUp) { + id = String.valueOf(form.getId()); + } + + if (ObjectUtil.isNotEmpty(form.getSupplierNo())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SupplierEntity::getSupplierNo, form.getSupplierNo()); + if (isUp) { + wrapper.ne(SupplierEntity::getId, id); + } + long count = this.count(wrapper); + if (count > 0) { + countRecover += "供应商编码已存在,请重新输入!"; + } + } + + if (StringUtil.isEmpty(form.getSupplierName())) { + return "供应商名称不能为空"; + } + + return countRecover; + } + + @Override + @Transactional + public void saveOrUpdate(SupplierForm supplierForm, String id, boolean isSave) throws Exception { + SupplierEntity entity = getInfo(id); + if (entity == null) { + entity = new SupplierEntity(); + } + BeanUtils.copyProperties(supplierForm, entity); + this.saveOrUpdate(entity); + } +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/SupplierController.java b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/SupplierController.java new file mode 100644 index 0000000..d621f2a --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/SupplierController.java @@ -0,0 +1,105 @@ +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.model.supplier.SupplierEntity; +import jnpf.model.supplier.SupplierForm; +import jnpf.model.supplier.SupplierPagination; +import jnpf.service.SupplierService; +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 = "Supplier") +@RestController +@RequestMapping("/api/scm/supplier") +public class SupplierController { + + @Autowired + private SupplierService supplierService; + + @Operation(summary = "获取供应商列表") + @PostMapping("/getList") + public ActionResult getList(@RequestBody SupplierPagination supplierPagination) { + List list = supplierService.getList(supplierPagination); + List> realList = list.stream() + .map(JsonUtil::entityToMap) + .collect(Collectors.toList()); + + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(supplierPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + @Operation(summary = "获取供应商详情") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + SupplierEntity entity = supplierService.getInfo(id); + if (entity != null) { + return ActionResult.success(JsonUtil.entityToMap(entity)); + } + return ActionResult.fail("数据不存在"); + } + + @Operation(summary = "新建供应商") + @PostMapping + public ActionResult create(@RequestBody @Valid SupplierForm supplierForm) { + String b = supplierService.checkForm(supplierForm, 0); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + try { + supplierService.saveOrUpdate(supplierForm, "", true); + return ActionResult.success("新建成功"); + } catch (Exception e) { + return ActionResult.fail("新建数据失败:" + e.getMessage()); + } + } + + @Operation(summary = "更新供应商") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid SupplierForm supplierForm) { + supplierForm.setId(id); + String b = supplierService.checkForm(supplierForm, 1); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + SupplierEntity entity = supplierService.getInfo(id); + if (entity != null) { + try { + supplierService.saveOrUpdate(supplierForm, id, false); + return ActionResult.success("更新成功"); + } catch (Exception e) { + return ActionResult.fail("更新数据失败:" + e.getMessage()); + } + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + + @Operation(summary = "删除供应商") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + SupplierEntity entity = supplierService.getInfo(id); + if (entity != null) { + try { + supplierService.delete(entity); + return ActionResult.success("删除成功"); + } catch (Exception e) { + return ActionResult.fail("删除失败:" + e.getMessage()); + } + } + return ActionResult.fail("删除失败,数据不存在"); + } +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierConstant.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierConstant.java new file mode 100644 index 0000000..4f765c3 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierConstant.java @@ -0,0 +1,30 @@ +package jnpf.model.supplier; + +import jnpf.util.JsonUtil; +import java.util.Map; + +public class SupplierConstant { + public static final String DBLINKID = "0"; + + public static final Map TABLERENAMES = JsonUtil.getJsonToBean("{\"tba_supplier\":\"Supplier\"}", Map.class); + + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean("{}", Map.class); + + public static final String getFormData() { + StringBuilder sb = new StringBuilder(); + sb.append("{\"popupType\":\"general\",\"idGlobal\":200,\"formBtns\":false,\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":true,\"labelPosition\":\"right\",\"printId\":\"\",\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取 消\",\"confirmButtonText\":\"确 定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"confirmAndAddText\":\"确定并继续操作\",\"hasPrintBtn\":false,\"concurrencyLock\":true,\"classJson\":\"\",\"drawerWidth\":\"600px\",\"printButtonText\":\"打 印\",\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":true,\"size\":\"small\",\"formRules\":\"rules\",\"generalWidth\":\"600px\",\"hasConfirmBtn\":true,\"formStyle\":\"\",\"fields\":[{\"clearable\":true,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商编码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000001,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"showWordLimit\":false,\"__vModel__\":\"supplierNo\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"__config__\":{\"formId\":202,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"showWordLimit\":false,\"__vModel__\":\"supplierName\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"span\":24}"); + return sb.toString(); + } + + public static final String getColumnData() { + StringBuilder sb = new StringBuilder(); + sb.append("{\"showSummary\":false,\"hasPage\":true,\"searchList\":[{\"clearable\":true,\"searchType\":2,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"供应商名称\",\"label\":\"供应商名称\",\"addonAfter\":\"\",\"__config__\":{\"formId\":202,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"supplierName\",\"showWordLimit\":false,\"__vModel__\":\"supplierName\",\"searchMultiple\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"supplierName\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"treeInterfaceId\":\"\",\"treePropsValue\":\"id\",\"ruleList\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"columnOptions\":[{\"clearable\":true,\"suffixIcon\":\"\",\"fullName\":\"供应商编码\",\"addonAfter\":\"\",\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商编码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000001,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"showWordLimit\":false,\"__vModel__\":\"supplierNo\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"supplierNo\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"suffixIcon\":\"\",\"fullName\":\"供应商名称\",\"addonAfter\":\"\",\"__config__\":{\"formId\":202,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"showWordLimit\":false,\"__vModel__\":\"supplierName\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"supplierName\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"treePropsChildren\":\"children\",\"type\":1,\"columnBtnsList\":[{\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"value\":\"edit\"},{\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"value\":\"remove\"},{\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"value\":\"detail\"}],\"thousandsField\":[],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"suffixIcon\":\"\",\"align\":\"left\",\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商编码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000001,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"supplierNo\",\"showWordLimit\":false,\"__vModel__\":\"supplierNo\",\"checked\":true,\"disabled\":false,\"id\":\"supplierNo\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"jnpfKey\":\"input\",\"fullName\":\"供应商编码\",\"label\":\"供应商编码\",\"sortable\":false,\"addonAfter\":\"\",\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\"},{\"suffixIcon\":\"\",\"align\":\"left\",\"__config__\":{\"formId\":202,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"supplierName\",\"showWordLimit\":false,\"__vModel__\":\"supplierName\",\"checked\":true,\"disabled\":false,\"id\":\"supplierName\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"jnpfKey\":\"input\",\"fullName\":\"供应商名称\",\"label\":\"供应商名称\",\"sortable\":false,\"addonAfter\":\"\",\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\"}],\"treeTemplateJson\":[],\"treePropsName\":\"\",\"useColumnPermission\":false,\"treePropsUrl\":\"\",\"treeRelation\":\"\",\"treeSynType\":0,\"btnsList\":[{\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\"},{\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\"},{\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\"},{\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\"}],\"useDataPermission\":false,\"columnList\":[{\"clearable\":true,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"供应商编码\",\"label\":\"供应商编码\",\"sortable\":false,\"align\":\"left\",\"addonAfter\":\"\",\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商编码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000001,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"supplierNo\",\"showWordLimit\":false,\"width\":0,\"__vModel__\":\"supplierNo\",\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"supplierNo\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"供应商名称\",\"label\":\"供应商名称\",\"sortable\":false,\"align\":\"left\",\"addonAfter\":\"\",\"__config__\":{\"formId\":202,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"supplierName\",\"showWordLimit\":false,\"width\":0,\"__vModel__\":\"supplierName\",\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"supplierName\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"sort\":\"desc\",\"thousands\":false,\"hasSuperQuery\":true,\"summaryField\":[],\"parentField\":\"\",\"treePropsLabel\":\"fullName\",\"treeDataSource\":\"dictionary\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{\"selectKey\":[\"supplierNo\",\"supplierName\"],\"dataType\":\"1\"},\"treeDictionary\":\"\",\"hasTreeQuery\":false,\"useFormPermission\":false,\"customBtnsList\":[],\"complexHeaderList\":[],\"useBtnPermission\":false,\"treeInterfaceName\":\"\",\"defaultSidx\":\"\"}"); + return sb.toString(); + } + + public static final String getAppColumnData() { + StringBuilder sb = new StringBuilder(); + sb.append("{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\"}],\"useDataPermission\":false,\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"clearable\":true,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"供应商编码\",\"label\":\"供应商编码\",\"sortable\":false,\"align\":\"left\",\"addonAfter\":\"\",\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商编码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000001,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"supplierNo\",\"showWordLimit\":false,\"width\":0,\"__vModel__\":\"supplierNo\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"fixed\":\"none\",\"placeholder\":\"请输入\",\"id\":\"supplierNo\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"供应商名称\",\"label\":\"供应商名称\",\"sortable\":false,\"align\":\"left\",\"addonAfter\":\"\",\"__config__\":{\"formId\":202,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"supplierName\",\"showWordLimit\":false,\"width\":0,\"__vModel__\":\"supplierName\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"fixed\":\"none\",\"placeholder\":\"请输入\",\"id\":\"supplierName\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"columnOptions\":[{\"clearable\":true,\"suffixIcon\":\"\",\"fullName\":\"供应商编码\",\"addonAfter\":\"\",\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商编码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000001,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"showWordLimit\":false,\"__vModel__\":\"supplierNo\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"id\":\"supplierNo\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"suffixIcon\":\"\",\"fullName\":\"供应商名称\",\"addonAfter\":\"\",\"__config__\":{\"formId\":202,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"showWordLimit\":false,\"__vModel__\":\"supplierName\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"id\":\"supplierName\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"sort\":\"desc\",\"thousands\":false,\"columnBtnsList\":[{\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"value\":\"edit\"},{\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"value\":\"remove\"},{\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"value\":\"detail\"}],\"loading\":false,\"hasSuperQuery\":false,\"thousandsField\":[],\"defaultColumnList\":[{\"clearable\":true,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"供应商编码\",\"label\":\"供应商编码\",\"sortable\":false,\"align\":\"left\",\"addonAfter\":\"\",\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商编码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000001,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"supplierNo\",\"showWordLimit\":false,\"__vModel__\":\"supplierNo\",\"showPassword\":false,\"checked\":true,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"id\":\"supplierNo\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"供应商名称\",\"label\":\"供应商名称\",\"sortable\":false,\"align\":\"left\",\"addonAfter\":\"\",\"__config__\":{\"formId\":202,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"tba_supplier\",\"renderKey\":1713000000002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"supplierName\",\"showWordLimit\":false,\"__vModel__\":\"supplierName\",\"showPassword\":false,\"checked\":true,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"id\":\"supplierName\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"sortList\":[],\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false,\"defaultSidx\":\"\"}"); + return sb.toString(); + } +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierEntity.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierEntity.java new file mode 100644 index 0000000..6270fd6 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierEntity.java @@ -0,0 +1,96 @@ +package jnpf.model.supplier; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; + +@Data +@TableName("tba_supplier") +public class SupplierEntity { + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @TableField("supplier_no") + private String supplierNo; + + @TableField("supplier_name") + private String supplierName; + + @TableField("supplier_sim_name") + private String supplierSimName; + + @TableField("supplier_type") + private String supplierType; + + @TableField("supplier_reg") + private String supplierReg; + + @TableField("contact1") + private String contact1; + + @TableField("con_phone1") + private String conPhone1; + + @TableField("con_address1") + private String conAddress1; + + @TableField("contact2") + private String contact2; + + @TableField("con_phone2") + private String conPhone2; + + @TableField("con_address2") + private String conAddress2; + + @TableField("com_tax_number") + private String comTaxNumber; + + @TableField("account_region") + private String accountRegion; + + @TableField("account_bank") + private String accountBank; + + @TableField("account_no") + private String accountNo; + + @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("f_flow_id") + private String flowId; + + @TableField("f_flow_task_id") + private String flowTaskId; + + @TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED) + private String remark; + + @TableField("enabled_status") + private String enabledStatus; + + @TableField("status") + private String status; + + @TableField("is_blacklist") + private String isBlacklist; +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierForm.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierForm.java new file mode 100644 index 0000000..f9517c7 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierForm.java @@ -0,0 +1,67 @@ +package jnpf.model.supplier; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +@Data +public class SupplierForm { + @JsonProperty("id") + private String id; + + @JsonProperty("supplierNo") + private String supplierNo; + + @JsonProperty("supplierName") + private String supplierName; + + @JsonProperty("supplierSimName") + private String supplierSimName; + + @JsonProperty("supplierType") + private String supplierType; + + @JsonProperty("supplierReg") + private String supplierReg; + + @JsonProperty("contact1") + private String contact1; + + @JsonProperty("conPhone1") + private String conPhone1; + + @JsonProperty("conAddress1") + private String conAddress1; + + @JsonProperty("contact2") + private String contact2; + + @JsonProperty("conPhone2") + private String conPhone2; + + @JsonProperty("conAddress2") + private String conAddress2; + + @JsonProperty("comTaxNumber") + private String comTaxNumber; + + @JsonProperty("accountRegion") + private String accountRegion; + + @JsonProperty("accountBank") + private String accountBank; + + @JsonProperty("accountNo") + private String accountNo; + + @JsonProperty("remark") + private String remark; + + @JsonProperty("enabledStatus") + private String enabledStatus; + + @JsonProperty("status") + private String status; + + @JsonProperty("isBlacklist") + private String isBlacklist; +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierPagination.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierPagination.java new file mode 100644 index 0000000..eb22e60 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/supplier/SupplierPagination.java @@ -0,0 +1,30 @@ +package jnpf.model.supplier; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jnpf.base.Pagination; +import lombok.Data; + +@Data +public class SupplierPagination extends Pagination { + private String[] selectKey; + private String json; + private String dataType; + private String superQueryJson; + private String moduleId; + private String menuId; + + @JsonProperty("supplierNo") + private String supplierNo; + + @JsonProperty("supplierName") + private String supplierName; + + @JsonProperty("supplierType") + private String supplierType; + + @JsonProperty("status") + private String status; + + private String enabledStatus; + +} diff --git a/jnpf-java-boot/jnpf-web/src/views/example/customer/options.js b/jnpf-java-boot/jnpf-web/src/views/example/customer/options.js index 518df83..09e8ba4 100644 --- a/jnpf-java-boot/jnpf-web/src/views/example/customer/options.js +++ b/jnpf-java-boot/jnpf-web/src/views/example/customer/options.js @@ -16,7 +16,7 @@ export const customerMaps = { export const customerOptions = {} for (const key in customerMaps) { const map = customerMaps[key] - customerOptions[key] = Object.entries(map).map(([id, fullName]) => ({ id: Number(id), fullName })) + customerOptions[key] = Object.entries(map).map(([id, fullName]) => ({ id: String(id), fullName })) } // 获取显示名称 diff --git a/jnpf-java-boot/jnpf-web/src/views/example/supplier/detail.vue b/jnpf-java-boot/jnpf-web/src/views/example/supplier/detail.vue new file mode 100644 index 0000000..e483619 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/src/views/example/supplier/detail.vue @@ -0,0 +1,185 @@ + + + diff --git a/jnpf-java-boot/jnpf-web/src/views/example/supplier/form.vue b/jnpf-java-boot/jnpf-web/src/views/example/supplier/form.vue new file mode 100644 index 0000000..35c3f62 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/src/views/example/supplier/form.vue @@ -0,0 +1,238 @@ + + + diff --git a/jnpf-java-boot/jnpf-web/src/views/example/supplier/index.vue b/jnpf-java-boot/jnpf-web/src/views/example/supplier/index.vue new file mode 100644 index 0000000..5e280e0 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/src/views/example/supplier/index.vue @@ -0,0 +1,277 @@ + + +