From f40a4112c4698855e25ceb51207f39221a42bd1a Mon Sep 17 00:00:00 2001
From: mors <3067699729@qq.com>
Date: Sat, 3 Dec 2022 17:26:06 +0800
Subject: [PATCH 1/3] =?UTF-8?q?2022-12-03=20=E8=B5=B5=E7=8E=89=E7=91=9E=20?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86=E9=83=A8?=
=?UTF-8?q?=E5=88=86=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../views/process/ZyClothsComponentList.vue | 12 ++++--
.../src/views/process/ZyClothsModularList.vue | 2 +-
.../process/modules/ZyClothsComponentForm.vue | 35 ++++++++++------
.../process/modules/ZyClothsModularForm.vue | 10 +++--
.../modules/ZyClothsStyleForm.vue | 4 +-
.../zystylemodular/modules/ZyProcessList.vue | 3 +-
.../modules/ZyStyleModularModal.vue | 3 +-
.../zyStyleModular/entity/ZyStyleModular.java | 2 +-
.../ZyClothsComponentController.java | 11 +++++
.../controller/ZyClothsModularController.java | 8 ++++
.../demo/base/entity/ZyClothsComponent.java | 6 +++
.../modules/demo/base/entity/ZyProcess.java | 2 +-
.../base/mapper/ZyClothsComponentMapper.java | 2 +
.../mapper/xml/ZyClothsComponentMapper.xml | 4 ++
.../service/IZyClothsComponentService.java | 3 ++
.../impl/ZyClothsComponentServiceImpl.java | 41 ++++++++++++++++++-
.../demo/pro/entity/ZyProcessComponent.java | 2 +-
.../entity/ZyProcessModular.java | 2 +-
18 files changed, 119 insertions(+), 33 deletions(-)
diff --git a/ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue b/ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
index b4af96cb..61d22267 100644
--- a/ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
+++ b/ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
@@ -145,12 +145,16 @@
align:"center",
dataIndex: 'partsName'
},
+ // {
+ // title:'部件类型',
+ // align:"center",
+ // dataIndex: 'componentType'
+ // },
{
- title:'部件类型',
- align:"center",
- dataIndex: 'componentType'
+ title: '服装类型',
+ align: "center",
+ dataIndex: 'clothsTypeId_dictText'
},
-
// {
// title:'描述',
// align:"center",
diff --git a/ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue b/ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue
index c086a43e..9c5815bc 100644
--- a/ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue
+++ b/ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue
@@ -173,7 +173,7 @@ export default {
// dataIndex: 'description'
// },
{
- title: '衣服类型',
+ title: '服装类型',
align: "center",
dataIndex: 'clothsTypeId_dictText'
},
diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
index 7d61698f..75dee5ff 100644
--- a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
+++ b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
@@ -8,21 +8,31 @@
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
@@ -33,11 +43,7 @@
-
-
-
-
-
+
@@ -86,8 +92,11 @@
},
confirmLoading: false,
validatorRules: {
- nums: [
- { required: true, message: '请输入编号!'},
+ // nums: [
+ // { required: true, message: '请输入编号!'},
+ // ],
+ clothsTypeId: [
+ { required: true, message: '请选择服装类型!'},
],
partsName: [
{ required: true, message: '请输入部件名称!'},
diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue
index 09468606..05ec500c 100644
--- a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue
+++ b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue
@@ -13,6 +13,7 @@
+
@@ -23,14 +24,15 @@
+
-
-
+
+
-
-
+
+
diff --git a/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue b/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue
index 06fa526c..9863cc3b 100644
--- a/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue
+++ b/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue
@@ -34,8 +34,8 @@
-
-
+
+
diff --git a/ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyProcessList.vue b/ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyProcessList.vue
index 535e9ec7..b702ae1d 100644
--- a/ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyProcessList.vue
+++ b/ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyProcessList.vue
@@ -3,6 +3,7 @@
@@ -160,7 +161,7 @@ export default {
},
//加载传递参数
loadParameter() {
- if (this.loadRouteType == false) {
+ if (this.loadRouteType === false) {
this.styleId = this.$route.query.styleId;
console.log(this.styleId)
this.loadRouteType = true;
diff --git a/ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyStyleModularModal.vue b/ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyStyleModularModal.vue
index bee39186..a7ec8596 100644
--- a/ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyStyleModularModal.vue
+++ b/ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyStyleModularModal.vue
@@ -19,7 +19,6 @@
name: 'ZyStyleModularModal',
components: {
ZyProcessList,
-
},
data () {
return {
@@ -40,7 +39,7 @@
},
methods: {
add () {
- this.model.styleId=this.$route.query.id;
+ this.model.styleId=this.$route.query.id;
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java
index 0444a4d0..f697df02 100644
--- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java
+++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java
@@ -68,5 +68,5 @@ public class ZyStyleModular implements Serializable {
/**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号")
- private Integer order;
+ private Integer serialnumber;
}
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java
index b6a5890e..8b9950ba 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java
@@ -1,5 +1,6 @@
package org.jeecg.modules.demo.base.controller;
+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;
@@ -88,6 +89,16 @@ public class ZyClothsComponentController extends JeecgController add(@RequestBody ZyClothsComponent zyClothsComponent) {
+ //编码规则:服装类型(10)+序号(8)
+ zyClothsComponent.setNums(zyClothsComponentService.generateNumber(zyClothsComponent));
+ //部件名称不能重复
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
+ List zyClothsComponentList = zyClothsComponentService.list(queryWrapper);
+ for (ZyClothsComponent zy : zyClothsComponentList) {
+ if (zyClothsComponent.getPartsName().equals(zy.getPartsName())){
+ return Result.error("添加失败!数据已存在");
+ }
+ }
zyClothsComponentService.save(zyClothsComponent);
return Result.OK("添加成功!");
}
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java
index 51098213..bcec6b5d 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java
@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.demo.base.entity.ZyClothsComponent;
import org.jeecg.modules.demo.base.entity.ZyClothsModular;
import org.jeecg.modules.demo.base.entity.ZyClothsType;
import org.jeecg.modules.demo.base.service.IZyClothsModularService;
@@ -105,6 +106,13 @@ public class ZyClothsModularController extends JeecgController add(@RequestBody ZyClothsModular zyClothsModular) {
//nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8)
zyClothsModular.setNums(zyClothsModularService.generateNumber(zyClothsModular));
+ //模块名称不能重复
+ List zyClothsModularList = zyClothsModularService.list();
+ for (ZyClothsModular zy : zyClothsModularList) {
+ if (zyClothsModular.getModularName().equals(zy.getModularName())){
+ return Result.error("添加失败!模块名称已存在");
+ }
+ }
zyClothsModularService.save(zyClothsModular);
return Result.OK("添加成功!");
}
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsComponent.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsComponent.java
index 7448ca16..64c98d96 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsComponent.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsComponent.java
@@ -52,6 +52,12 @@ public class ZyClothsComponent implements Serializable {
@Excel(name = "图片地址", width = 15)
@ApiModelProperty(value = "图片地址")
private java.lang.String pictureUrl;
+ /**服装类型id*/
+ @Excel(name = "服装类型id", width = 15, dictTable = "zy_cloths_type", dicText = "type_name", dicCode = "id")
+ @Dict(dictTable = "zy_cloths_type", dicText = "type_name", dicCode = "id")
+ @ApiModelProperty(value = "服装类型id")
+ private java.lang.String clothsTypeId;
+
/**模块*/
@Excel(name = "模块", width = 15, dictTable = "zy_cloths_modular", dicText = "modular_name", dicCode = "id")
@Dict(dictTable = "zy_cloths_modular", dicText = "modular_name", dicCode = "id")
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java
index 4595a4d8..96c3b8fe 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java
@@ -179,7 +179,7 @@ public class ZyProcess implements Serializable {
*/
@Excel(name = "类型名称", width = 15)
@ApiModelProperty(value = "类型名称")
- @Dict(dictTable = "zy_cloths_type", dicText = "zy_cloths_type", dicCode = "nums")
+ @Dict(dictTable = "zy_cloths_type", dicText = "type_name", dicCode = "nums")
private java.lang.String styleId;
/**
* 工段代码
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java
index febcf394..c65c3a5d 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java
@@ -22,4 +22,6 @@ public interface ZyClothsComponentMapper extends BaseMapper {
public List selectByModular(@Param("modular_id")String modular_id);
String getComponentNameById(String componentId);
+
+ List selectNumsList2();
}
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml
index 00fd10ba..bf05980e 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml
@@ -29,4 +29,8 @@
from zy_cloths_component
where id = #{componentId}
+
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java
index 7f30145b..d5a0ea36 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java
@@ -18,4 +18,7 @@ public interface IZyClothsComponentService extends IService {
List selectList(String id);
public List selectByModular(String modular_id);
+
+ /**编码规则:服装类型(10)+序号(8)*/
+ String generateNumber(ZyClothsComponent zyClothsComponent);
}
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
index 8b16bb79..ada0a13d 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
@@ -10,8 +10,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.util.StringUtils;
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import java.util.regex.Pattern;
/**
* @Description: zy_cloths_component
@@ -21,7 +26,7 @@ import java.util.List;
*/
@Service
public class ZyClothsComponentServiceImpl extends ServiceImpl implements IZyClothsComponentService {
- @Autowired
+ @Resource
private ZyClothsComponentMapper zyClothsComponentMapper;
@Override
@@ -30,9 +35,41 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl zyProcessVoList=baseMapper.selectProcessVo(list);
return zyProcessVoList;
}
-
+
@Override
public List selectByModular(String modular_id) {
return zyClothsComponentMapper.selectByModular(modular_id);
}
+
+ /**
+ * 编码规则:服装类型(10)+序号(8)
+ */
+ @Override
+ public String generateNumber(ZyClothsComponent zyClothsComponent) {
+ String nums = zyClothsComponent.getClothsTypeId();
+ String substring = nums.substring(nums.length() - 10);
+ String format = String.format("%08d", orderNumber());
+ return substring + format;
+ }
+
+ private Long orderNumber() {
+ List listString = zyClothsComponentMapper.selectNumsList2();
+ //System.err.println(listString);
+ List listLong = new ArrayList<>();
+ for (String nums : listString) {
+ String REGEX = "[^0-9]";
+ String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
+ if (!StringUtils.hasText(newNums)){
+ newNums = "0";
+ }
+ if (newNums.length() > 8) {
+ String substring = nums.substring(nums.length() - 8);
+ listLong.add(Long.valueOf(substring));
+ }else {
+ listLong.add(Long.valueOf(newNums));
+ }
+ }
+ System.out.println(listLong);
+ return Collections.max(listLong)+1;
+ }
}
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java
index 370dd852..32b73cd5 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java
@@ -52,7 +52,7 @@ public class ZyProcessComponent implements Serializable {
/**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号")
- private Integer order;
+ private Integer serialnumber;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java
index 57e83acc..c24f3d21 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java
@@ -65,5 +65,5 @@ public class ZyProcessModular implements Serializable {
/**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号")
- private Integer order;
+ private Integer serialnumber;
}
From 7e03e1e92a573ababfb64b7bfdb9081b00839975 Mon Sep 17 00:00:00 2001
From: mors <3067699729@qq.com>
Date: Mon, 5 Dec 2022 20:18:02 +0800
Subject: [PATCH 2/3] =?UTF-8?q?2022-12-05=20=E8=B5=B5=E7=8E=89=E7=91=9E=20?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86=E9=83=A8?=
=?UTF-8?q?=E5=88=86=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../process/modules/ZyClothsComponentForm.vue | 8 ++++----
.../zystyleaccessories/ZyStyleAccessoriesList.vue | 12 ++++++------
.../views/zystylemodular/ZyStyleModularList.vue | 14 +++++++-------
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
index 75dee5ff..5ae1cd1a 100644
--- a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
+++ b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
@@ -14,13 +14,13 @@
-
-
+
+
-
-
+
+
diff --git a/ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue b/ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue
index c9a96b1f..8e551899 100644
--- a/ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue
+++ b/ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue
@@ -38,13 +38,13 @@
新增
导出
-
- 导入
-
+
+
+
+
-
+
+
diff --git a/ant-design-vue-jeecg/src/views/zystylemodular/ZyStyleModularList.vue b/ant-design-vue-jeecg/src/views/zystylemodular/ZyStyleModularList.vue
index f95fda33..1b201efd 100644
--- a/ant-design-vue-jeecg/src/views/zystylemodular/ZyStyleModularList.vue
+++ b/ant-design-vue-jeecg/src/views/zystylemodular/ZyStyleModularList.vue
@@ -5,7 +5,7 @@
- {{biaoTi}}款式工序管理
+ {{biaoTi}}
@@ -16,13 +16,13 @@
新增
导出
-
- 导入
-
+
+
+
+
-
+
+
From b66926ca3ce98112d3df24112daab936482c1af3 Mon Sep 17 00:00:00 2001
From: mors <3067699729@qq.com>
Date: Mon, 5 Dec 2022 21:14:03 +0800
Subject: [PATCH 3/3] =?UTF-8?q?2022-12-05=20=E8=B5=B5=E7=8E=89=E7=91=9E=20?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86=E9=83=A8?=
=?UTF-8?q?=E5=88=86=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../process/modules/ZyClothsTypeForm.vue | 16 +++----
.../controller/ZyClothsTypeController.java | 2 +
.../demo/base/mapper/ZyClothsTypeMapper.java | 1 +
.../base/mapper/xml/ZyClothsTypeMapper.xml | 4 ++
.../base/service/IZyClothsTypeService.java | 2 +
.../impl/ZyClothsComponentServiceImpl.java | 12 +++--
.../impl/ZyClothsModularServiceImpl.java | 12 +++--
.../service/impl/ZyClothsTypeServiceImpl.java | 47 +++++++++++++++++++
.../impl/ZyClothsStyleServiceImpl.java | 12 +++--
9 files changed, 91 insertions(+), 17 deletions(-)
diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue
index 2fefb067..03512483 100644
--- a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue
+++ b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue
@@ -18,11 +18,11 @@
{{ typeId }}
-
-
-
-
-
+
+
+
+
+
@@ -74,9 +74,9 @@
},
confirmLoading: false,
validatorRules: {
- nums: [
- { required: true, message: '请输入编号!'},
- ],
+ // nums: [
+ // { required: true, message: '请输入编号!'},
+ // ],
typeName: [
{ required: true, message: '请输入类型名称!'},
{ pattern: /^[0-9A-Za-z\u4e00-\u9fa5.,;,。;、!?]{0,5}$/, message: '文本长度过长'},
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
index 8688b0da..aa81015e 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
@@ -82,6 +82,8 @@ public class ZyClothsTypeController extends JeecgController add(@RequestBody ZyClothsType zyClothsType) {
+ //生成编号 nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)在service层处理
+ zyClothsType.setNums(zyClothsTypeService.generateNumber());
zyClothsTypeService.save(zyClothsType);
return Result.OK("添加成功!");
}
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
index 9d63f5bb..ebe37d59 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
@@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ZyClothsTypeMapper extends BaseMapper {
+ List selectNumsList();
}
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsTypeMapper.xml b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsTypeMapper.xml
index 5111558b..3651d8fe 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsTypeMapper.xml
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsTypeMapper.xml
@@ -2,4 +2,8 @@
+
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java
index 0c926d2b..0f1b4359 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java
@@ -11,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IZyClothsTypeService extends IService {
+ /**nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)*/
+ String generateNumber();
}
diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
index ada0a13d..ceb26aac 100644
--- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
+++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
@@ -2,9 +2,11 @@ package org.jeecg.modules.demo.base.service.impl;
import org.jeecg.modules.demo.base.entity.ZyClothsComponent;
import org.jeecg.modules.demo.base.entity.ZyClothsModular;
+import org.jeecg.modules.demo.base.entity.ZyClothsType;
import org.jeecg.modules.demo.base.entity.vo.ZyProcessVo;
import org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper;
import org.jeecg.modules.demo.base.mapper.ZyClothsModularMapper;
+import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper;
import org.jeecg.modules.demo.base.service.IZyClothsComponentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -28,6 +30,8 @@ import java.util.regex.Pattern;
public class ZyClothsComponentServiceImpl extends ServiceImpl implements IZyClothsComponentService {
@Resource
private ZyClothsComponentMapper zyClothsComponentMapper;
+ @Resource
+ ZyClothsTypeMapper zyClothsTypeMapper;
@Override
public List selectList(String id) {
@@ -47,9 +51,11 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl implements IZyClothsModularService {
@Resource
private ZyClothsModularMapper zyClothsModularMapper;
+ @Resource
+ ZyClothsTypeMapper zyClothsTypeMapper;
@Override
public List selectByType(String cloths_type_id) {
@@ -36,9 +40,11 @@ public class ZyClothsModularServiceImpl extends ServiceImpl implements IZyClothsTypeService {
+ @Resource
+ ZyClothsTypeMapper zyClothsTypeMapper;
+ /**
+ * nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)
+ */
+ @Override
+ public String generateNumber() {
+ //先拿到类型编号
+ String nums = "QIYE";
+ //再来一个顺序号
+ String format = String.format("%06d", orderNumber());
+ //生成编码
+ String result = nums + format;
+ System.err.println(result);
+ return nums + format;
+ }
+
+ private Long orderNumber() {
+ List listString = zyClothsTypeMapper.selectNumsList();
+ System.out.println(listString);
+ List listLong = new ArrayList<>();
+ for (String nums : listString) {
+ System.err.println(nums);
+ String REGEX = "[^0-9]";
+ //只要数字
+ String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
+ System.err.println(newNums);
+ if (!StringUtils.hasText(newNums)){
+ newNums = "0";
+ }
+ if (newNums.length() > 6) {
+ //拿到后6位
+ String substring = newNums.substring(newNums.length() - 6);
+ listLong.add(Long.valueOf(substring));
+ }else {
+ listLong.add(Long.valueOf(newNums));
+ }
+ }
+ return Collections.max(listLong)+1;
+ }
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java
index 2d9c44ed..9b6ce4ef 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java
@@ -3,6 +3,8 @@ package org.jeecg.modules.zyclothsstyle.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.bytedeco.javacpp.freenect;
+import org.jeecg.modules.demo.base.entity.ZyClothsType;
+import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper;
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper;
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService;
@@ -30,6 +32,8 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl