Merge remote-tracking branch 'origin/master'

zhc4dev
lenovo 2 years ago
commit ad093b4ad1
  1. 10
      ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
  2. 2
      ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue
  3. 31
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
  4. 10
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue
  5. 16
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue
  6. 4
      ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue
  7. 12
      ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue
  8. 14
      ant-design-vue-jeecg/src/views/zystylemodular/ZyStyleModularList.vue
  9. 3
      ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyProcessList.vue
  10. 1
      ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyStyleModularModal.vue
  11. 2
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java
  12. 11
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java
  13. 8
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java
  14. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  15. 6
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsComponent.java
  16. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java
  17. 1
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
  18. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml
  19. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsTypeMapper.xml
  20. 3
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java
  21. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java
  22. 45
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
  23. 12
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java
  24. 47
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java
  25. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java
  26. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java
  27. 12
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java

@ -145,12 +145,16 @@
align:"center",
dataIndex: 'partsName'
},
// {
// title:'',
// align:"center",
// dataIndex: 'componentType'
// },
{
title:'部件类型',
title: '服装类型',
align: "center",
dataIndex: 'componentType'
dataIndex: 'clothsTypeId_dictText'
},
// {
// title:'',
// align:"center",

@ -173,7 +173,7 @@ export default {
// dataIndex: 'description'
// },
{
title: '服类型',
title: '服类型',
align: "center",
dataIndex: 'clothsTypeId_dictText'
},

@ -8,9 +8,14 @@
<j-select-depart v-model="model.enterpriseId" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">-->
<!-- <a-input v-model="model.nums" placeholder="请输入编号" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" ></a-input>
<a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择衣服类型" />
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -19,10 +24,15 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="部件类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="componentType">
<a-input v-model="model.componentType" placeholder="请输入部件类型" ></a-input>
<a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">
<j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="部件类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="componentType">-->
<!-- <a-input v-model="model.componentType" placeholder="请输入部件类型" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>
@ -33,11 +43,7 @@
<j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">
<j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="制衣模块类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularType">-->
<!-- <j-dict-select-tag type="list" v-model="model.modularType" dictCode="zyModularType" placeholder="请选择制衣模块类型" />-->
@ -86,8 +92,11 @@
},
confirmLoading: false,
validatorRules: {
nums: [
{ required: true, message: '请输入编号!'},
// nums: [
// { required: true, message: '!'},
// ],
clothsTypeId: [
{ required: true, message: '请选择服装类型!'},
],
partsName: [
{ required: true, message: '请输入部件名称!'},

@ -13,6 +13,7 @@
<!-- <a-input v-model="model.nums" placeholder="请输入编号" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="模块名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularName">
<a-input v-model="model.modularName" placeholder="请输入模块名称" ></a-input>
@ -23,14 +24,15 @@
<!-- <j-dict-select-tag type="list" v-model="model.modularType" dictCode="zyModularType" placeholder="请选择制衣模块类型" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>
<a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择服装类型" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="衣服类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择衣服类型" />
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->

@ -18,11 +18,11 @@
{{ typeId }}
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" ></a-input>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">-->
<!-- <a-input v-model="model.nums" placeholder="请输入编号" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeName">
<a-input v-model="model.typeName" placeholder="请输入类型名称" ></a-input>
@ -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: '文本长度过长'},

@ -34,8 +34,8 @@
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleNames">
<a-input v-model="model.styleNames" placeholder="请输入名称" ></a-input>
<a-form-model-item label="款式名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleNames">
<a-input v-model="model.styleNames" placeholder="请输入款式名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">

@ -38,13 +38,13 @@
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('款式辅料管理')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"-->
<!-- @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"-->
<!-- @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">

@ -5,7 +5,7 @@
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col>
<a-button type="primary">{{biaoTi}}款式工序管理</a-button>
<a-button type="primary">{{biaoTi}}</a-button>
</a-col>
</a-row>
</a-form>
@ -16,13 +16,13 @@
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('款式工序表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"-->
<!-- @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"-->
<!-- @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">

@ -3,6 +3,7 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row>
</a-row>
</a-form>
</div>
@ -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;

@ -19,7 +19,6 @@
name: 'ZyStyleModularModal',
components: {
ZyProcessList,
},
data () {
return {

@ -68,5 +68,5 @@ public class ZyStyleModular implements Serializable {
/**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号")
private Integer order;
private Integer serialnumber;
}

@ -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<ZyClothsCompone
@ApiOperation(value = "zy_cloths_component-添加", notes = "zy_cloths_component-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsComponent zyClothsComponent) {
//编码规则:服装类型(10)+序号(8)
zyClothsComponent.setNums(zyClothsComponentService.generateNumber(zyClothsComponent));
//部件名称不能重复
LambdaQueryWrapper<ZyClothsComponent> queryWrapper = new LambdaQueryWrapper<>();
List<ZyClothsComponent> zyClothsComponentList = zyClothsComponentService.list(queryWrapper);
for (ZyClothsComponent zy : zyClothsComponentList) {
if (zyClothsComponent.getPartsName().equals(zy.getPartsName())){
return Result.error("添加失败!数据已存在");
}
}
zyClothsComponentService.save(zyClothsComponent);
return Result.OK("添加成功!");
}

@ -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<ZyClothsModular,
public Result<?> add(@RequestBody ZyClothsModular zyClothsModular) {
//nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8)
zyClothsModular.setNums(zyClothsModularService.generateNumber(zyClothsModular));
//模块名称不能重复
List<ZyClothsModular> zyClothsModularList = zyClothsModularService.list();
for (ZyClothsModular zy : zyClothsModularList) {
if (zyClothsModular.getModularName().equals(zy.getModularName())){
return Result.error("添加失败!模块名称已存在");
}
}
zyClothsModularService.save(zyClothsModular);
return Result.OK("添加成功!");
}

@ -82,6 +82,8 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
@ApiOperation(value="zy_cloths_type-添加", notes="zy_cloths_type-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsType zyClothsType) {
//生成编号 nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)在service层处理
zyClothsType.setNums(zyClothsTypeService.generateNumber());
zyClothsTypeService.save(zyClothsType);
return Result.OK("添加成功!");
}

@ -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")

@ -22,4 +22,6 @@ public interface ZyClothsComponentMapper extends BaseMapper<ZyClothsComponent> {
public List<ZyClothsComponent> selectByModular(@Param("modular_id")String modular_id);
String getComponentNameById(String componentId);
List<String> selectNumsList2();
}

@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ZyClothsTypeMapper extends BaseMapper<ZyClothsType> {
List<String> selectNumsList();
}

@ -29,4 +29,8 @@
from zy_cloths_component
where id = #{componentId}
</select>
<select id="selectNumsList2" resultType="java.lang.String">
select nums
from zy_cloths_component
</select>
</mapper>

@ -2,4 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper">
<select id="selectNumsList" resultType="java.lang.String">
SELECT nums
FROM zy_cloths_type
</select>
</mapper>

@ -18,4 +18,7 @@ public interface IZyClothsComponentService extends IService<ZyClothsComponent> {
List<ZyProcessVo> selectList(String id);
public List<ZyClothsComponent> selectByModular(String modular_id);
/**编码规则:服装类型(10)+序号(8)*/
String generateNumber(ZyClothsComponent zyClothsComponent);
}

@ -11,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IZyClothsTypeService extends IService<ZyClothsType> {
/**nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)*/
String generateNumber();
}

@ -2,16 +2,23 @@ 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;
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,8 +28,10 @@ import java.util.List;
*/
@Service
public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentMapper, ZyClothsComponent> implements IZyClothsComponentService {
@Autowired
@Resource
private ZyClothsComponentMapper zyClothsComponentMapper;
@Resource
ZyClothsTypeMapper zyClothsTypeMapper;
@Override
public List<ZyProcessVo> selectList(String id) {
@ -35,4 +44,38 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentM
public List<ZyClothsComponent> selectByModular(String modular_id) {
return zyClothsComponentMapper.selectByModular(modular_id);
}
/**
* 编码规则服装类型10+序号8
*/
@Override
public String generateNumber(ZyClothsComponent zyClothsComponent) {
String nums = zyClothsComponent.getClothsTypeId();
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums();
//String substring = nums.substring(nums.length() - 10);
String format = String.format("%06d", orderNumber());
return nums1 + format;
}
private Long orderNumber() {
List<String> listString = zyClothsComponentMapper.selectNumsList2();
//System.err.println(listString);
List<Long> 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;
}
}

@ -1,7 +1,9 @@
package org.jeecg.modules.demo.base.service.impl;
import org.jeecg.modules.demo.base.entity.ZyClothsModular;
import org.jeecg.modules.demo.base.entity.ZyClothsType;
import org.jeecg.modules.demo.base.mapper.ZyClothsModularMapper;
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper;
import org.jeecg.modules.demo.base.service.IZyClothsModularService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -24,6 +26,8 @@ import java.util.regex.Pattern;
public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMapper, ZyClothsModular> implements IZyClothsModularService {
@Resource
private ZyClothsModularMapper zyClothsModularMapper;
@Resource
ZyClothsTypeMapper zyClothsTypeMapper;
@Override
public List<ZyClothsModular> selectByType(String cloths_type_id) {
@ -36,9 +40,11 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
@Override
public String generateNumber(ZyClothsModular zyClothsModular) {
String nums = zyClothsModular.getClothsTypeId();
String substring = nums.substring(nums.length() - 10);
String format = String.format("%08d", orderNumber());
return substring + format;
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums();
// String substring = nums.substring(nums.length() - 10);
String format = String.format("%06d", orderNumber());
return nums1 + format;
}

@ -6,6 +6,13 @@ import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
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_type
@ -16,4 +23,44 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyClothsType> implements IZyClothsTypeService {
@Resource
ZyClothsTypeMapper zyClothsTypeMapper;
/**
* nums编号varchar10非空不重复企业缩写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<String> listString = zyClothsTypeMapper.selectNumsList();
System.out.println(listString);
List<Long> 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;
}
}

@ -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")

@ -65,5 +65,5 @@ public class ZyProcessModular implements Serializable {
/**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号")
private Integer order;
private Integer serialnumber;
}

@ -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<ZyClothsStyleMapper, Z
@Resource
private ZyClothsStyleMapper zyClothsStyleMapper;
@Resource
ZyClothsTypeMapper zyClothsTypeMapper;
/**
* 生成编号 类型编号10位+顺序号8位
*
@ -39,12 +43,14 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
public String generateNumber(ZyClothsStyle zyClothsStyle) {
//先拿到类型编号
String nums = zyClothsStyle.getTypeId();
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums();
//截取后十位
String substring = nums.substring(nums.length() - 10);
//String substring = nums.substring(nums.length() - 10);
//再来一个顺序号
String format = String.format("%08d", orderNumber());
String format = String.format("%06d", orderNumber());
//生成编码
return substring + format;
return nums1 + format;
}
private Long orderNumber() {

Loading…
Cancel
Save