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

zhc4dev
赵玉瑞 2 years ago
parent 25f8a3e7de
commit f8adb529b2
  1. 186
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularCompentForm.vue
  2. 2
      ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue
  3. 2
      ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue
  4. 4
      ant-design-vue-jeecg/src/views/zystylemodular/ZyStyleModularList.vue
  5. 2
      ant-design-vue-jeecg/src/views/zystylemodule/ZyStyleModuleList.vue
  6. 57
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  7. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
  8. 5
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsTypeMapper.xml
  9. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
  10. 16
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java
  11. 8
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java
  12. 12
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java

@ -4,11 +4,11 @@
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<!-- <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="请选择制衣模块类型" />-->
<!-- </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="请选择制衣模块类型" />-->
<!-- </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"
@ -23,21 +23,22 @@
org-fields="nums,parts_name"
dest-fields="nums,partsName"
code="parts_name"
@input="popupCallback"
/>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName">-->
<!-- <a-input v-model="model.partsName" placeholder="请输入部件名称" ></a-input>-->
<!-- <j-dict-select-tag type="list" v-model="model.partsName"-->
<!-- dictCode="zy_cloths_component,parts_name,id" placeholder="请选择制衣模块类型" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName">-->
<!-- <a-input v-model="model.partsName" placeholder="请输入部件名称" ></a-input>-->
<!-- <j-dict-select-tag type="list" v-model="model.partsName"-->
<!-- dictCode="zy_cloths_component,parts_name,id" placeholder="请选择制衣模块类型" />-->
<!-- </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-input v-model="model.nums" placeholder="请输入编码"></a-input>
</a-form-model-item>
</a-col>
</a-row>
@ -48,91 +49,92 @@
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import {httpAction, getAction} from '@/api/manage'
import {validateDuplicateValue} from '@/utils/util'
export default {
name: 'ZyClothsModularCompentForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
modularId:'',
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/base/zyClothsModularCompent/add",
edit: "/base/zyClothsModularCompent/edit",
queryById: "/base/zyClothsModularCompent/queryById"
}
export default {
name: 'ZyClothsModularCompentForm',
components: {},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data() {
return {
model: {
modularId: '',
},
labelCol: {
xs: {span: 24},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {},
url: {
add: "/base/zyClothsModularCompent/add",
edit: "/base/zyClothsModularCompent/edit",
queryById: "/base/zyClothsModularCompent/queryById"
}
}
},
computed: {
formDisabled() {
return this.disabled
},
computed: {
formDisabled(){
return this.disabled
},
},
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add1(id) {
this.edit(this.modelDefault);
this.model.modularId = id;
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
edit(record) {
this.model = Object.assign({}, record);
this.visible = true;
},
methods: {
add1 (id) {
this.edit(this.modelDefault);
this.model.modularId = id;
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
submitForm() {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if (!this.model.id) {
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
})
},
popupCallback(value, row) {
this.model = Object.assign(this.model, row);
},
}
}
</script>

@ -56,7 +56,7 @@
<a-icon type="down"/>
</a-button>
</a-dropdown>
<a-button type="primary" @click="fanHui()">返回</a-button>
<a-button type="primary" style="left: 80%" @click="fanHui()">返回</a-button>
</div>
<!-- table区域-begin -->

@ -48,7 +48,7 @@
<a-icon type="down"/>
</a-button>
</a-dropdown>
<a-button type="primary" @click="fanHui()">返回</a-button>
<a-button type="primary" style="left: 80%" @click="fanHui()">返回</a-button>
</div>
<!-- table区域-begin -->

@ -5,11 +5,13 @@
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a-button type="primary">{{biaoTi}}</a-button>-->
<a-button type="primary">{{biaoTi}}</a-button>
</a-col>
</a-row>
</a-form>
</div>
<br/>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
@ -34,7 +36,7 @@
<a-icon type="down"/>
</a-button>
</a-dropdown>
<a-button type="primary" @click="fanHui()">返回</a-button>
<a-button type="primary" style="left: 80%" @click="fanHui()">返回</a-button>
</div>
<!-- table区域-begin -->

@ -57,7 +57,7 @@
<a-icon type="down"/>
</a-button>
</a-dropdown>
<a-button type="primary" @click="fanHui()">返回</a-button>
<a-button type="primary" style="left: 80%" @click="fanHui()">返回</a-button>
</div>
<!-- table区域-begin -->
<div>

@ -1,42 +1,29 @@
package org.jeecg.modules.demo.base.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
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.ZyClothsType;
import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.base.entity.ZyClothsType;
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper;
import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
/**
* @Description: zy_cloths_type
@ -51,6 +38,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClothsTypeService> {
@Autowired
private IZyClothsTypeService zyClothsTypeService;
@Resource
private ZyClothsTypeMapper zyClothsTypeMapper;
/**
* 分页列表查询
@ -84,15 +73,25 @@ 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) {
//类型名称输入时没有最大长度限制,提交时才提示。前端校验、后台校验
//type_name,类型名称,varchar,50,非空,同类型下不重复
String typeName = zyClothsType.getTypeName();
if (!StringUtils.hasText(typeName)) {
return Result.error("类型名称 不能为空");
}
//类型名称输入时没有最大长度限制,提交时才提示。前端校验、后台校验
if (typeName.length() > 10) {
return Result.error("类型名称长度不能超过10");
}
//类型名称 同类型下不重复
if (!StringUtils.isEmpty(zyClothsType.getTypeId())) {
String typeId = zyClothsType.getTypeId();
List<String> zyClothsTypeList = zyClothsTypeMapper.listByTypeId(typeId);
zyClothsTypeList.add(zyClothsType.getTypeName());
HashSet<String> set = new HashSet<>(zyClothsTypeList);
if (set.size() != zyClothsTypeList.size()){
return Result.error("同类型下 类型名称不能重复");
}
}
//生成编号 nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)在service层处理
zyClothsType.setNums(zyClothsTypeService.generateNumber());
zyClothsTypeService.save(zyClothsType);

@ -15,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface ZyClothsTypeMapper extends BaseMapper<ZyClothsType> {
List<String> selectNumsList();
List<String> listByTypeId(String typeId);
}

@ -6,4 +6,9 @@
SELECT nums
FROM zy_cloths_type
</select>
<select id="listByTypeId" resultType="java.lang.String">
SELECT type_name
FROM zy_cloths_type
WHERE type_id = #{typeId}
</select>
</mapper>

@ -54,7 +54,7 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentM
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums();
//String substring = nums.substring(nums.length() - 10);
String format = String.format("%06d", orderNumber());
String format = String.format("%08d", orderNumber());
return nums1 + format;
}

@ -9,6 +9,7 @@ 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;
@ -19,7 +20,7 @@ import java.util.regex.Pattern;
/**
* @Description: zy_cloths_modular
* @Author: jeecg-boot
* @Date: 2021-11-10
* @Date: 2021-11-10
* @Version: V1.0
*/
@Service
@ -42,8 +43,8 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
String nums = zyClothsModular.getClothsTypeId();
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums();
// String substring = nums.substring(nums.length() - 10);
String format = String.format("%06d", orderNumber());
// String substring = nums.substring(nums.length() - 10);
String format = String.format("%08d", orderNumber());
return nums1 + format;
}
@ -57,12 +58,15 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
if (newNums.length() > 8) {
String substring = nums.substring(nums.length() - 8);
listLong.add(Long.valueOf(substring));
}else {
listLong.add(Long.valueOf(newNums));
}
if (StringUtils.isEmpty(newNums)) {
newNums = "0";
}
listLong.add(Long.valueOf(newNums));
}
System.out.println(listLong);
return Collections.max(listLong)+1;
return Collections.max(listLong) + 1;
}
}

@ -36,20 +36,20 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
String format = String.format("%06d", orderNumber());
//生成编码
String result = nums + format;
System.err.println(result);
//System.err.println(result);
return nums + format;
}
private Long orderNumber() {
List<String> listString = zyClothsTypeMapper.selectNumsList();
System.out.println(listString);
//System.out.println(listString);
List<Long> listLong = new ArrayList<>();
for (String nums : listString) {
System.err.println(nums);
//System.err.println(nums);
String REGEX = "[^0-9]";
//只要数字
String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
System.err.println(newNums);
//System.err.println(newNums);
if (!StringUtils.hasText(newNums)){
newNums = "0";
}

@ -13,6 +13,7 @@ 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;
@ -34,6 +35,7 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
@Resource
ZyClothsTypeMapper zyClothsTypeMapper;
/**
* 生成编号 类型编号10位+顺序号8位
*
@ -48,7 +50,7 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
//截取后十位
//String substring = nums.substring(nums.length() - 10);
//再来一个顺序号
String format = String.format("%06d", orderNumber());
String format = String.format("%08d", orderNumber());
//生成编码
return nums1 + format;
}
@ -60,10 +62,12 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
if (nums.length() > 8) {
String substring = nums.substring(nums.length() - 8);
list.add(Long.valueOf(substring));
}else {
list.add(Long.valueOf(nums));
}
if (StringUtils.isEmpty(nums)) {
nums = "0";
}
list.add(Long.valueOf(nums));
}
return Collections.max(list)+1;
return Collections.max(list) + 1;
}
}

Loading…
Cancel
Save