Merge remote-tracking branch 'origin/master'

zhc4dev
wangjiadong 2 years ago
commit 50f6ef8390
  1. 1
      ant-design-vue-jeecg/src/components/jeecg/JVxeTable/jvxeTypes.js
  2. 16
      ant-design-vue-jeecg/src/views/pdcomponentprocess/ProductComponentProcessList.vue
  3. 8
      ant-design-vue-jeecg/src/views/pdmodulecomponent/ProductModuleComponentList.vue
  4. 2
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
  5. 14
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue
  6. 207
      ant-design-vue-jeecg/src/views/zystylemodel/ZyStyleModelList.vue
  7. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java
  8. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java
  9. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java
  10. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/controller/ZyClothsStyleController.java
  11. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/controller/ZyStyleModelController.java
  12. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/IZyStyleModelService.java
  13. 32
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/impl/ZyStyleModelServiceImpl.java
  14. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java

@ -17,6 +17,7 @@ export const JVXETypes = {
rowDragSort: 'row-drag-sort', rowDragSort: 'row-drag-sort',
input: 'input', input: 'input',
//数字输入框 只能输入数字 小数也可以 其它类型的无法输入
inputNumber: 'inputNumber', inputNumber: 'inputNumber',
textarea: 'textarea', textarea: 'textarea',
select: 'select', select: 'select',

@ -1,5 +1,6 @@
<template> <template>
<a-card :bordered="false"> <a-card :bordered="false">
<p style="font-size: 30px;color:#333">{{biaoTi}}</p>
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
@ -33,6 +34,7 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button @click="fanhui" type="primary" icon="plus">返回</a-button>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('产品部件工序')">导出</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-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>--> <!-- <a-button type="primary" icon="import">导入</a-button>-->
@ -127,6 +129,8 @@
productId:'', productId:'',
processId:'', processId:'',
componentId:'', componentId:'',
biaoTi: '',
idt:'',
// //
columns: [ columns: [
{ {
@ -188,6 +192,7 @@
} }
}, },
created() { created() {
this.idt=this.$route.query.product;
this.getSuperFieldList(); this.getSuperFieldList();
}, },
computed: { computed: {
@ -214,6 +219,15 @@
this.$message.warning(res.message); this.$message.warning(res.message);
} }
})}, })},
fanhui(){
this.$router.push({
/*返回产品*/
path: '/pdmodulecomponent/ProductModuleComponentList',/*在引号中填写返回vue*/
query:{
id:this.idt,
}
});
},
initDictConfig(){ initDictConfig(){
}, },
valueChange(value){ valueChange(value){
@ -232,7 +246,7 @@
loadParameter() { loadParameter() {
if (this.loadRouteType === false) { if (this.loadRouteType === false) {
this.id = this.$route.query.id; this.id = this.$route.query.id;
console.log("***********") this.biaoTi = this.$route.query.styleNames+"部件工序管理";
this.loadRouteType = true; this.loadRouteType = true;
} }
}, },

@ -83,7 +83,7 @@
</a-button> </a-button>
</template> </template>
<span slot="action1" slot-scope="text, record"> <span slot="action1" slot-scope="text, record">
<a @click="bujian(record.id)">管理</a> <a @click="bujian(record.id,record.componentId_dictText,idt)">管理</a>
</span> </span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@ -122,6 +122,7 @@
description: '产品模块部件表管理页面', description: '产品模块部件表管理页面',
component:'', component:'',
productId:'', productId:'',
idt:'',
// //
columns: [ columns: [
{ {
@ -188,6 +189,7 @@
} }
}, },
created() { created() {
this.idt=this.$route.query.id;
this.getSuperFieldList(); this.getSuperFieldList();
}, },
computed: { computed: {
@ -214,11 +216,13 @@
this.$message.warning(res.message); this.$message.warning(res.message);
} }
})}, })},
bujian(id){ bujian(id,name,product){
this.$router.push({ this.$router.push({
path: '/pdcomponentprocess/ProductComponentProcessList', path: '/pdcomponentprocess/ProductComponentProcessList',
query: { // query: { //
'id': id, 'id': id,
name:name,
product:product
} }
}); });
}, },

@ -208,7 +208,7 @@
// this.data.push(res.result) // this.data.push(res.result)
// } // }
//console.log("List "+this.model.nums); console.log("制衣部件 编号: "+this.model.nums);
}, },
// bianHao() { // bianHao() {
// getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => { // getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {

@ -132,7 +132,9 @@ export default {
}, },
data() { data() {
return { return {
model: {}, model: {
nums: '',
},
labelCol: { labelCol: {
xs: {span: 24}, xs: {span: 24},
sm: {span: 4}, sm: {span: 4},
@ -174,17 +176,17 @@ export default {
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
}, },
methods: { methods: {
bianhao() { async bianhao() {
//var n=6 //var n=6
getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => { getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {
let num = res.result; //let num = res.result;
console.log("+6++++aaa" + num) console.log("+6++++aaa: " + res.result)
//num=num.toString() //num=num.toString()
//while(num.length<n){ //while(num.length<n){
//num="0"+num //num="0"+num
//} //}
console.log(num) //console.log(num)
this.model.nums = num; this.model.nums = res.result;
}) })
}, },
add() { add() {

@ -3,20 +3,20 @@
<a-card :bordered="false"> <a-card :bordered="false">
<p style="font-size: 30px;color:#333;padding-left: 40%">{{biaoTi}}</p> <p style="font-size: 30px;color:#333;padding-left: 40%">{{biaoTi}}</p>
<!-- 查询区域 --> <!-- 查询区域 -->
<!-- <div class="table-page-search-wrapper">--> <!-- <div class="table-page-search-wrapper">-->
<!-- <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>-->
<!-- <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>-->
<!-- 查询区域-END --> <!-- 查询区域-END -->
<!-- <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>--> <!-- <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>-->
<!-- table区域-begin --> <!-- table区域-begin -->
<div > <div>
<j-vxe-table <j-vxe-table
toolbar toolbar
:toolbarConfig="toolbarConfig" :toolbarConfig="toolbarConfig"
@ -37,19 +37,19 @@
> >
<template v-slot:toolbarSuffix> <template v-slot:toolbarSuffix>
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button> <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
<!-- <a-tooltip placement="top" title="获取值,忽略表单验证" :autoAdjustOverflow="true">--> <!-- <a-tooltip placement="top" title="获取值,忽略表单验证" :autoAdjustOverflow="true">-->
<!-- <a-button @click="handleTableGet">获取值</a-button>--> <!-- <a-button @click="handleTableGet">获取值</a-button>-->
<!-- </a-tooltip>--> <!-- </a-tooltip>-->
<!-- <a-tooltip placement="top" title="模拟加载1000条数据" :autoAdjustOverflow="true">--> <!-- <a-tooltip placement="top" title="模拟加载1000条数据" :autoAdjustOverflow="true">-->
<!-- <a-button @click="handleTableSet">设置值</a-button>--> <!-- <a-button @click="handleTableSet">设置值</a-button>-->
<!-- </a-tooltip>--> <!-- </a-tooltip>-->
</template> </template>
<template v-slot:action="props"> <template v-slot:action="props">
<!-- <a @click="submitForm(props)">保存</a>--> <!-- <a @click="submitForm(props)">保存</a>-->
<!-- <a-divider type="vertical"/>--> <!-- <a-divider type="vertical"/>-->
<a @click="viewDetail(props.rowId)">详情</a> <a @click="viewDetail(props.rowId)">详情</a>
<a-divider type="vertical" /> <a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="handleDelete(props.rowId)"> <a-popconfirm title="确定删除吗?" @confirm="handleDelete(props.rowId)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
@ -91,11 +91,11 @@ export default {
// add remove clearSelection // add remove clearSelection
btn: ['add'], btn: ['add'],
}, },
validatorRules: { // validatorRules: {
// styleId: [ // styleId: [
// {required: true, message: '!'}, // {required: true, message: '!'},
// ], // ],
}, // },
// //
loading: false, loading: false,
// //
@ -117,40 +117,140 @@ export default {
columns: [ columns: [
{ {
title: '服装款式', title: '服装款式', width: '100px', fixed: 'left', key: 'styleId',
width: '110px', type: JVXETypes.normal,
fixed: 'left',
key: 'styleId',
type: JVXETypes.select,
placeholder: '请输入${title}', placeholder: '请输入${title}',
//dictCode: 'zy_cloths_style,style_names,id', //dictCode: 'zy_cloths_style,style_names,id',
validateRules: [ // validateRules: [
{required: true, message: '${title}不能为空'}, // {required: true, message: '${title}'},
], // ],
disabled: true, disabled: true,
}, },
{ {
title: '是否默认尺码', title: '是否默认尺码', align: "center", width: '130px', key: 'isdefault',
align: "center",
width: '130px',
key: 'isdefault',
type: JVXETypes.select, type: JVXETypes.select,
dictCode: 'isdefault', dictCode: 'isdefault',
defaultValue: 0, defaultValue: 0,
}, },
{key: 'modelNumber', title: '型号编码', dictCode: 'modenumber', width: '100px', type: JVXETypes.select}, {
{key: 'size', title: '码数', width: '85px', dictCode: 'size', type: JVXETypes.select}, key: 'modelNumber', title: '型号编码', dictCode: 'modenumber', width: '100px',
{key: 'anumbers', title: '型', width: '85px', dictCode: 'hsize', type: JVXETypes.select}, type: JVXETypes.select
{key: 'bnumbers', title: '号', width: '85px', dictCode: 'xsize', type: JVXETypes.select}, },
{key: 'collarLarge', title: '领大', width: '70px', type: JVXETypes.input}, {
{key: 'bust', title: '胸围', width: '80px', type: JVXETypes.input}, key: 'size', title: '码数', width: '85px', dictCode: 'size',
{key: 'sleeveLength', title: '袖长', width: '80px', type: JVXETypes.input}, type: JVXETypes.select
{key: 'shslLength', title: '连肩袖长', width: '100px', type: JVXETypes.input}, },
{
key: 'anumbers', title: '型', width: '85px', dictCode: 'hsize',
type: JVXETypes.select
},
{
key: 'bnumbers', title: '号', width: '85px', dictCode: 'xsize',
type: JVXETypes.select
},
{
key: 'collarLarge',
title: '领大', width: '70px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{
key: 'bust', title: '胸围', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /\D/g, message: '${title}只能输入数字类型',
},
]
},
{
key: 'sleeveLength', title: '袖长', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
]
},
{
key: 'shslLength', title: '连肩袖长', width: '100px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{key: 'tsWidth', title: '总肩宽', width: '80px', type: JVXETypes.input}, {
{key: 'cuff', title: '袖口', width: '80px', type: JVXETypes.input}, key: 'tsWidth', title: '总肩宽', width: '80px',
{key: 'waistline', title: '腰围', width: '80px', type: JVXETypes.input}, type: JVXETypes.inputNumber,
{key: 'hem', title: '下摆', width: '80px', type: JVXETypes.input}, validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{
key: 'cuff', title: '袖口', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{
key: 'waistline', title: '腰围', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{pattern: /[^\d]/g, message: '${title}只能输入数字类型'},
],
},
{
key: 'hem', title: '下摆', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{ required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{key: 'createTime', title: '创建时间', width: '60px', type: JVXETypes.datetime}, {key: 'createTime', title: '创建时间', width: '60px', type: JVXETypes.datetime},
{ {
@ -195,14 +295,12 @@ export default {
methods: { methods: {
// //
added(event){ added(event) {
//this.styleId = this.$route.query.id; //this.styleId = this.$route.query.id;
event.row.styleId = this.$route.query.id; event.row.styleId = this.$route.query.id;
console.log("新增触发事件", event) console.log("新增触发事件", event)
let httpUrl = this.url.add; let httpUrl = this.url.add;
let method = 'post'; let method = 'post';
//httpUrl += this.url.add;
//method = 'post';
let that = this; let that = this;
httpAction(httpUrl, event.row, method).then((res) => { httpAction(httpUrl, event.row, method).then((res) => {
if (res.success) { if (res.success) {
@ -216,18 +314,13 @@ export default {
}) })
}, },
// //
handleValueChange(event) { async handleValueChange(event) {
//this.submitForm(event) //this.submitForm(event)
console.log("//数据发生变化时事件", event); console.log("//数据发生变化时事件", event);
//const str = event.row.id; //const str = event.row.id;
let httpUrl = ''; let httpUrl = this.url.edit;
let method = ''; let method = 'put';
await httpAction(httpUrl, event.row, method).then((res) => {
httpUrl += this.url.edit;
method = 'put';
httpAction(httpUrl, event.row, method).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.message); this.$message.success(res.message);
this.$emit('ok'); this.$emit('ok');

@ -112,7 +112,7 @@ public class ZyClothsComponentController extends JeecgController<ZyClothsCompone
@ApiOperation(value = "制衣部件详情", notes = "根据制衣部件详情id进行查询") @ApiOperation(value = "制衣部件详情", notes = "根据制衣部件详情id进行查询")
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
public Result<?> detail(@RequestParam(name = "id", required = true) String id) { public Result<?> detail(@RequestParam(name = "id", required = true) String id) {
System.out.println("controller层接受到的id:zy_cloths_component对象 Id: "+id); //System.out.println("controller层接受到的id:zy_cloths_component对象 Id: "+id);
ZyClothsComponentDetail detail = zyClothsComponentService.queryDetail(id); ZyClothsComponentDetail detail = zyClothsComponentService.queryDetail(id);
return Result.OK(detail); return Result.OK(detail);
} }
@ -154,7 +154,7 @@ public class ZyClothsComponentController extends JeecgController<ZyClothsCompone
public Result<?> sort(@RequestParam(name = "id", required = true) String id) { public Result<?> sort(@RequestParam(name = "id", required = true) String id) {
//编码规则:服装类型(10)+序号(8) //编码规则:服装类型(10)+序号(8)
String sort = zyClothsComponentService.sort(id); String sort = zyClothsComponentService.sort(id);
System.err.println(sort+ " 制衣部件 sort"); //System.err.println(sort+ " 制衣部件 sort");
if (StringUtils.isEmpty(sort)) { if (StringUtils.isEmpty(sort)) {
return Result.OK(0); return Result.OK(0);
} }

@ -107,7 +107,7 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
@ApiOperation(value = "制衣模块详情详情", notes = "根据制衣模块详情id进行查询") @ApiOperation(value = "制衣模块详情详情", notes = "根据制衣模块详情id进行查询")
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
public Result<?> detail(@RequestParam(name = "id", required = true) String id) { public Result<?> detail(@RequestParam(name = "id", required = true) String id) {
System.out.println("controller层接受到的id: zy_cloths_modularId: "+id); //System.out.println("controller层接受到的id: zy_cloths_modularId: "+id);
ZyClothsModularDetail detail = zyClothsModularService.queryDetail(id); ZyClothsModularDetail detail = zyClothsModularService.queryDetail(id);
return Result.OK(detail); return Result.OK(detail);
} }

@ -139,7 +139,7 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
listLong.add(Long.valueOf(newNums)); listLong.add(Long.valueOf(newNums));
} }
System.out.println(listLong); //System.out.println(listLong);
return Collections.max(listLong) + 1; return Collections.max(listLong) + 1;
} }

@ -163,15 +163,11 @@ public class ZyClothsStyleController extends JeecgController<ZyClothsStyle, IZyC
return Result.error("添加失败!编号不能为空"); return Result.error("添加失败!编号不能为空");
} }
LambdaQueryWrapper<ZyClothsStyle> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ZyClothsStyle> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ZyClothsStyle::getTypeName, zyClothsStyle.getTypeName()); queryWrapper.eq(ZyClothsStyle::getStyleNames, zyClothsStyle.getStyleNames());
int a = zyClothsStyleService.count(queryWrapper); int a = zyClothsStyleService.count(queryWrapper);
if (a >= 1) if (a >= 1) {
return Result.error("存在以添加过的数据!"); return Result.error("存在以添加过的数据!");
// for (ZyClothsStyle zy : zyClothsStyleList) { }
// if (zyClothsStyle.getStyleNames().equals(zy.getStyleNames())) {
// return Result.error("添加失败!数据已存在");
// }
// }
zyClothsStyleService.save(zyClothsStyle); zyClothsStyleService.save(zyClothsStyle);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }

@ -95,7 +95,12 @@ public class ZyStyleModelController extends JeecgController<ZyStyleModel, IZySty
@ApiOperation(value="zy_style_model-编辑", notes="zy_style_model-编辑") @ApiOperation(value="zy_style_model-编辑", notes="zy_style_model-编辑")
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:edit") //@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ZyStyleModel zyStyleModel) { public Result<?> edit(@RequestBody ZyStyleModel zyStyleModel) {
zyStyleModel.setStyleId(null);
//限制一些类型的数据只能为数字 否则无法保存
if(!zyStyleModelService.dataTypeProblem(zyStyleModel)){
return Result.error("只能输入数字类型");
}
//System.err.println("zyStyleModel edit: "+zyStyleModel+ LocalDateTime.now()); //System.err.println("zyStyleModel edit: "+zyStyleModel+ LocalDateTime.now());
zyStyleModelService.updateById(zyStyleModel); zyStyleModelService.updateById(zyStyleModel);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
@ -141,7 +146,7 @@ public class ZyStyleModelController extends JeecgController<ZyStyleModel, IZySty
List<String> idList = (List<String>) map.get("id"); List<String> idList = (List<String>) map.get("id");
// List<Integer> list = Arrays.asList(ids); // List<Integer> list = Arrays.asList(ids);
zyStyleModelService.removeByIds(idList); zyStyleModelService.removeByIds(idList);
System.out.println(map); //System.out.println(map);
//this.zyStyleModelService.removeByIds(Arrays.asList(map.get("deleteIds").split(","))); //this.zyStyleModelService.removeByIds(Arrays.asList(map.get("deleteIds").split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }

@ -18,4 +18,6 @@ public interface IZyStyleModelService extends IService<ZyStyleModel> {
List<ZyStyleModel> detail(String id); List<ZyStyleModel> detail(String id);
ZyStyleModelDetailsVO queryDetails(String id); ZyStyleModelDetailsVO queryDetails(String id);
boolean dataTypeProblem(ZyStyleModel zyStyleModel);
} }

@ -19,6 +19,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.regex.Pattern;
/** /**
@ -115,6 +116,37 @@ public class ZyStyleModelServiceImpl extends ServiceImpl<ZyStyleModelMapper, ZyS
return detailsVO; return detailsVO;
} }
@Override
public boolean dataTypeProblem(ZyStyleModel zyStyleModel) {
// Pattern pattern = Pattern.compile("/[^\\d]/g");
Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?");
//正则表达式判断是否是数字字符串(可判断正数,负数和小数)
if (!ObjectUtils.isEmpty(zyStyleModel.getCollarLarge())){
return pattern.matcher(zyStyleModel.getCollarLarge().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getBust())){
return pattern.matcher(zyStyleModel.getBust().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getSleeveLength())){
return pattern.matcher(zyStyleModel.getSleeveLength().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getShslLength())){
return pattern.matcher(zyStyleModel.getShslLength().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getTsWidth())){
return pattern.matcher(zyStyleModel.getTsWidth().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getCuff())){
return pattern.matcher(zyStyleModel.getCuff().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getWaistline())){
return pattern.matcher(zyStyleModel.getWaistline().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getHem())){
return pattern.matcher(zyStyleModel.getHem().toString()).matches();
}
return true;
}
@Contract(pure = true) @Contract(pure = true)

@ -31,6 +31,7 @@ import org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper;
import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService; import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
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.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -87,13 +88,18 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
Page<ZyStyleModule> page = new Page<>(pageNo, pageSize); Page<ZyStyleModule> page = new Page<>(pageNo, pageSize);
IPage<ZyStyleModule> pageList = zyStyleModuleService.page(page, queryWrapper); IPage<ZyStyleModule> pageList = zyStyleModuleService.page(page, queryWrapper);
//List<ZyStyleModule> zyStyleModules = zyStyleModuleMapper.getListByStyleId(id); //List<ZyStyleModule> zyStyleModules = zyStyleModuleMapper.getListByStyleId(id);
//改变list中的实体类 类型 //改变list中的实体类 类型
List<NewStyleModule> newStyleModuleList = zyStyleModuleService.changeList(pageList.getRecords()); List<NewStyleModule> newStyleModuleList = zyStyleModuleService.changeList(pageList.getRecords());
if (!ObjectUtils.isEmpty(newStyleModuleList)){
IPage<NewStyleModule> pageList2 = new Page<>(pageNo, pageSize, newStyleModuleList.size()); IPage<NewStyleModule> pageList2 = new Page<>(pageNo, pageSize, newStyleModuleList.size());
pageList2.setRecords(newStyleModuleList); pageList2.setRecords(newStyleModuleList);
return Result.OK(pageList2); return Result.OK(pageList2);
} else {
IPage<NewStyleModule> pageList2 = new Page<>(pageNo, pageSize, 0);
return Result.OK(pageList2);
}
} }

Loading…
Cancel
Save