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

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

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

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

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

@ -1,42 +1,29 @@
package org.jeecg.modules.demo.base.controller; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecg.common.aspect.annotation.AutoLog;
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.system.base.controller.JeecgController; 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.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; 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 org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api; import javax.annotation.Resource;
import io.swagger.annotations.ApiOperation; import javax.servlet.http.HttpServletRequest;
import org.jeecg.common.aspect.annotation.AutoLog; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
/** /**
* @Description: zy_cloths_type * @Description: zy_cloths_type
@ -51,6 +38,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClothsTypeService> { public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClothsTypeService> {
@Autowired @Autowired
private IZyClothsTypeService zyClothsTypeService; 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-添加") @ApiOperation(value = "zy_cloths_type-添加", notes = "zy_cloths_type-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsType zyClothsType) { public Result<?> add(@RequestBody ZyClothsType zyClothsType) {
//类型名称输入时没有最大长度限制,提交时才提示。前端校验、后台校验
//type_name,类型名称,varchar,50,非空,同类型下不重复 //type_name,类型名称,varchar,50,非空,同类型下不重复
String typeName = zyClothsType.getTypeName(); String typeName = zyClothsType.getTypeName();
if (!StringUtils.hasText(typeName)) { if (!StringUtils.hasText(typeName)) {
return Result.error("类型名称 不能为空"); return Result.error("类型名称 不能为空");
} }
//类型名称输入时没有最大长度限制,提交时才提示。前端校验、后台校验
if (typeName.length() > 10) { if (typeName.length() > 10) {
return Result.error("类型名称长度不能超过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层处理 //生成编号 nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)在service层处理
zyClothsType.setNums(zyClothsTypeService.generateNumber()); zyClothsType.setNums(zyClothsTypeService.generateNumber());
zyClothsTypeService.save(zyClothsType); zyClothsTypeService.save(zyClothsType);

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

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

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

@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
@ -19,7 +20,7 @@ import java.util.regex.Pattern;
/** /**
* @Description: zy_cloths_modular * @Description: zy_cloths_modular
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2021-11-10 * @Date: 2021-11-10
* @Version: V1.0 * @Version: V1.0
*/ */
@Service @Service
@ -42,8 +43,8 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
String nums = zyClothsModular.getClothsTypeId(); String nums = zyClothsModular.getClothsTypeId();
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums); ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums(); String nums1 = zyClothsType.getNums();
// String substring = nums.substring(nums.length() - 10); // String substring = nums.substring(nums.length() - 10);
String format = String.format("%06d", orderNumber()); String format = String.format("%08d", orderNumber());
return nums1 + format; return nums1 + format;
} }
@ -57,12 +58,15 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
if (newNums.length() > 8) { if (newNums.length() > 8) {
String substring = nums.substring(nums.length() - 8); String substring = nums.substring(nums.length() - 8);
listLong.add(Long.valueOf(substring)); 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); 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 format = String.format("%06d", orderNumber());
//生成编码 //生成编码
String result = nums + format; String result = nums + format;
System.err.println(result); //System.err.println(result);
return nums + format; return nums + format;
} }
private Long orderNumber() { private Long orderNumber() {
List<String> listString = zyClothsTypeMapper.selectNumsList(); List<String> listString = zyClothsTypeMapper.selectNumsList();
System.out.println(listString); //System.out.println(listString);
List<Long> listLong = new ArrayList<>(); List<Long> listLong = new ArrayList<>();
for (String nums : listString) { for (String nums : listString) {
System.err.println(nums); //System.err.println(nums);
String REGEX = "[^0-9]"; String REGEX = "[^0-9]";
//只要数字 //只要数字
String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim(); String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
System.err.println(newNums); //System.err.println(newNums);
if (!StringUtils.hasText(newNums)){ if (!StringUtils.hasText(newNums)){
newNums = "0"; newNums = "0";
} }

@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
@ -34,6 +35,7 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
@Resource @Resource
ZyClothsTypeMapper zyClothsTypeMapper; ZyClothsTypeMapper zyClothsTypeMapper;
/** /**
* 生成编号 类型编号10位+顺序号8位 * 生成编号 类型编号10位+顺序号8位
* *
@ -48,7 +50,7 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
//截取后十位 //截取后十位
//String substring = nums.substring(nums.length() - 10); //String substring = nums.substring(nums.length() - 10);
//再来一个顺序号 //再来一个顺序号
String format = String.format("%06d", orderNumber()); String format = String.format("%08d", orderNumber());
//生成编码 //生成编码
return nums1 + format; return nums1 + format;
} }
@ -60,10 +62,12 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
if (nums.length() > 8) { if (nums.length() > 8) {
String substring = nums.substring(nums.length() - 8); String substring = nums.substring(nums.length() - 8);
list.add(Long.valueOf(substring)); 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