2022-12-05 赵玉瑞 修改产品管理部分问题

zhc4dev
赵玉瑞 2 years ago
parent 7e03e1e92a
commit b66926ca3c
  1. 16
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue
  2. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  3. 1
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
  4. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsTypeMapper.xml
  5. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java
  6. 12
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
  7. 12
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java
  8. 47
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java
  9. 12
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java

@ -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: '文本长度过长'},

@ -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("添加成功!");
}

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

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

@ -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,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<ZyClothsComponentMapper, ZyClothsComponent> implements IZyClothsComponentService {
@Resource
private ZyClothsComponentMapper zyClothsComponentMapper;
@Resource
ZyClothsTypeMapper zyClothsTypeMapper;
@Override
public List<ZyProcessVo> selectList(String id) {
@ -47,9 +51,11 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentM
@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;
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() {

@ -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;
}
}

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