20220914-赵

zhc4dev
lenovo 2 years ago
parent 58aeaafc2e
commit 3c5ebe060f
  1. 59
      ant-design-vue-jeecg/src/views/erp/fabric/ZyFabricList.vue
  2. 90
      ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricForm.vue
  3. 28
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricController.java
  4. 2
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricTypeController.java
  5. 151
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/entity/ZyFabric.java

@ -11,7 +11,7 @@
<!-- </a-col>--> <!-- </a-col>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="类型"> <a-form-item label="类型">
<a-input placeholder="类型" v-model="queryParam.name"></a-input> <a-input placeholder="类型" v-model="queryParam.typeId"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
@ -31,12 +31,12 @@
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="花样"> <a-form-item label="花样">
<a-input placeholder="请输入花样" v-model="queryParam.pattern"></a-input> <j-search-select-tag placeholder="请选择花样" v-model="queryParam.pattern" dict="pattern"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="材质"> <a-form-item label="材质">
<a-input placeholder="请输入材质" v-model="queryParam.material"></a-input> <j-search-select-tag placeholder="请选择材质" v-model="queryParam.material" dict="material"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
@ -58,9 +58,9 @@
<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 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>-->
</a-upload> <!-- </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-dropdown v-if="selectedRowKeys.length > 0">
@ -114,21 +114,17 @@
<span slot="action" slot-scope="text,record"> <span slot="action" slot-scope="text,record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a @click="fuzhi(record)">复制</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">详情</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="openDetail(record.id)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span> </span>
</a-table> </a-table>
@ -171,7 +167,7 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
{ {
title:'类型', title:'类型',
align:"center", align:"center",
dataIndex: 'typeId' dataIndex: 'typeId_dictText'
}, },
{ {
title:'编号', title:'编号',
@ -218,11 +214,13 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
align:"center", align:"center",
dataIndex: 'brandId_dictText' dataIndex: 'brandId_dictText'
}, },
{ {
title:'计量单位', title:'计量单位',
align:"center", align:"center",
dataIndex: 'unit_dictText' dataIndex: 'unit_dictText'
}, },
{ {
title:'密度', title:'密度',
align:"center", align:"center",
@ -251,7 +249,7 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
}, },
{ {
title:'供货商', title:'供货商信息',
align:"center", align:"center",
dataIndex: 'supplierInfo_dictText' dataIndex: 'supplierInfo_dictText'
}, },
@ -274,7 +272,8 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
delete: "/fabric/zyFabric/delete", delete: "/fabric/zyFabric/delete",
deleteBatch: "/fabric/zyFabric/deleteBatch", deleteBatch: "/fabric/zyFabric/deleteBatch",
exportXlsUrl: "/fabric/zyFabric/exportXls", exportXlsUrl: "/fabric/zyFabric/exportXls",
importExcelUrl: "fabric/zyFabric/importExcel", importExcelUrl: "/fabric/zyFabric/importExcel",
}, },
dictOptions:{}, dictOptions:{},
superFieldList:[], superFieldList:[],
@ -294,33 +293,29 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
getSuperFieldList(){ getSuperFieldList(){
let fieldList=[]; let fieldList=[];
fieldList.push({type:'string',value:'color',text:'颜色',dictCode:''}) fieldList.push({type:'string',value:'color',text:'颜色',dictCode:''})
fieldList.push({type:'sel_search',value:'pattern',text:'花样',dictTable:'', dictText:'', dictCode:''}) fieldList.push({type:'sel_search',value:'pattern',text:'花样',dictTable:'', dictText:'', dictCode:'pattern'})
fieldList.push({type:'sel_search',value:'material',text:'材质',dictTable:'', dictText:'', dictCode:''}) fieldList.push({type:'sel_search',value:'material',text:'材质',dictTable:'', dictText:'', dictCode:'material'})
fieldList.push({type:'sel_search',value:'ply',text:'厚度',dictTable:'', dictText:'', dictCode:''}) fieldList.push({type:'sel_search',value:'ply',text:'厚度',dictTable:'ply', dictText:'', dictCode:''})
fieldList.push({type:'int',value:'money',text:'单价',dictCode:''}) fieldList.push({type:'int',value:'money',text:'单价',dictCode:''})
fieldList.push({type:'string',value:'imageUrl',text:'图片地址',dictCode:''}) fieldList.push({type:'string',value:'imageUrl',text:'图片地址',dictCode:''})
fieldList.push({type:'popup',value:'typeId',text:'面料类型id', popup:{code:'zy_fabric_type',field:'id',orgFields:'id',destFields:'content'}}) fieldList.push({type:'popup',value:'typeId',text:'面料类型id', popup:{code:'zy_fabric_type',field:'id',orgFields:'id',destFields:'content'}})
fieldList.push({type:'sel_search',value:'brandId',text:'材料品牌id',dictTable:'', dictText:'', dictCode:''}) fieldList.push({type:'sel_search',value:'brandId',text:'材料品牌id',dictTable:'brand', dictText:'', dictCode:''})
fieldList.push({type:'string',value:'fabricNumber',text:'材料编号',dictCode:''}) fieldList.push({type:'string',value:'fabricNumber',text:'材料编号',dictCode:''})
fieldList.push({type:'int',value:'unit',text:'1、为m。2:kg,等',dictCode:''}) fieldList.push({type:'int',value:'unit',text:'1、为m。2:kg,等',dictCode:'unit1,,'})
fieldList.push({type:'int',value:'retailPrice',text:'零售价',dictCode:''}) fieldList.push({type:'int',value:'retailPrice',text:'零售价',dictCode:''})
fieldList.push({type:'sel_search',value:'density',text:'密度',dictTable:'', dictText:'', dictCode:''}) fieldList.push({type:'sel_search',value:'density',text:'密度',dictTable:'density', dictText:'', dictCode:''})
fieldList.push({type:'string',value:'clothW',text:'幅宽',dictCode:''}) fieldList.push({type:'string',value:'clothW',text:'幅宽',dictCode:'clothW,,'})
fieldList.push({type:'string',value:'location',text:'所在地区',dictCode:''}) fieldList.push({type:'string',value:'location',text:'所在地区',dictCode:''})
fieldList.push({type:'int',value:'status',text:'状态 o 为下架 1为上架 ',dictCode:''}) fieldList.push({type:'int',value:'status',text:'状态 o 为下架 1为上架 ',dictCode:'fabric_status,,'})
fieldList.push({type:'string',value:'qRcode',text:'二维码',dictCode:''}) fieldList.push({type:'string',value:'qRcode',text:'二维码',dictCode:''})
fieldList.push({type:'string',value:'name',text:'名称',dictCode:''}) fieldList.push({type:'string',value:'name',text:'名称',dictCode:''})
fieldList.push({type:'sel_depart',value:'supplierInfo',text:'供货商信息'}) fieldList.push({type:'sel_depart',value:'supplierInfo',text:'供货商信息'})
fieldList.push({type:'string',value:'createTime',text:'创建时间',dictCode:''}) fieldList.push({type:'string',value:'createTime',text:'创建时间',dictCode:''})
this.superFieldList = fieldList this.superFieldList = fieldList
},
openDetail(id){
this.$refs.ZyFabricFormDetail.showModal(id)
// this.$children[0].showModal(id)
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>

@ -4,14 +4,14 @@
<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="typeId"> <a-form-model-item label="面料类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeId">
<j-popup <j-popup
v-model="model.typeId" v-model="model.typeId"
field="typeId" field="id"
org-fields="id" org-fields="id"
dest-fields="content" dest-fields="id"
code="zy_fabric_type" code="zy_fabric_type"
:multi="true" :multi="false"
@input="popupCallback" @input="popupCallback"
/> />
</a-form-model-item> </a-form-model-item>
@ -48,7 +48,7 @@
<!-- </a-col>--> <!-- </a-col>-->
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="厚度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ply"> <a-form-model-item label="厚度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ply">
<a-input v-model="model.ply" placeholder="请输入厚度" ></a-input> <j-search-select-tag v-model="model.ply" dict="ply" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -63,22 +63,22 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brandId"> <a-form-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brandId">
<a-input v-model="model.brandId" placeholder="请输入品牌" ></a-input> <j-search-select-tag v-model="model.brandId" dict="brand" />
</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="unit"> <a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit">
<a-input-number v-model="model.unit" placeholder="请输入单位" style="width: 100%" /> <j-search-select-tag v-model="model.unit" dict="unit1" />
</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="density"> <a-form-model-item label="密度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="density">
<a-input v-model="model.density" placeholder="请输入密度" ></a-input> <j-search-select-tag v-model="model.density" dict="density" />
</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="clothW"> <a-form-model-item label="幅宽" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothW">
<a-input v-model="model.clothW" placeholder="请输入幅宽" ></a-input> <j-search-select-tag v-model="model.clothW" dict="clothW" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -88,7 +88,7 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<a-input-number v-model="model.status" placeholder="请输入状态" style="width: 100%" /> <j-search-select-tag v-model="model.status" dict="fabric_status" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -117,61 +117,6 @@
<j-image-upload isMultiple v-model="model.qRcode" ></j-image-upload> <j-image-upload isMultiple v-model="model.qRcode" ></j-image-upload>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="面料组别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fabricGroupId">-->
<!-- <j-dict-select-tag type="list" v-model="model.fabricGroupId" dictCode="zy_fabric_group,name,id" placeholder="请选择面料组别" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="库存" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="store">-->
<!-- <a-input-number v-model="model.store" placeholder="请输入库存" style="width: 100%" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="一级面料表分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="category1Id">-->
<!-- <j-dict-select-tag type="list" v-model="model.category1Id" dictCode="zy_category,name,id" placeholder="请选择一级面料表分类" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="二级面料表分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="category2Id">-->
<!-- <j-dict-select-tag type="list" v-model="model.category2Id" dictCode="zy_category,name,id" placeholder="请选择二级面料表分类" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="三级面料表分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="category3Id">-->
<!-- <j-dict-select-tag type="list" v-model="model.category3Id" dictCode="zy_category,name,id" placeholder="请选择三级面料表分类" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">-->
<!-- <a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="0:无,1:特价,2:推荐等等" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fabricType">-->
<!-- <a-input-number v-model="model.fabricType" placeholder="请输入0:无,1:特价,2:推荐等等" style="width: 100%" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="物流运费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logisticsFreight">-->
<!-- <a-input-number v-model="model.logisticsFreight" placeholder="请输入物流运费" style="width: 100%" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="物流详情" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logisticsDetail">-->
<!-- <a-input v-model="model.logisticsDetail" placeholder="请输入物流详情" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24" >-->
<!-- <a-form-model-item label="二维码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img">-->
<!-- <j-image-upload isMultiple v-model="model.img" ></j-image-upload>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
</a-row> </a-row>
<online-camera ref="onlineCamera" v-on:changeOnlineVisible="changeOnlineVisible" /> <online-camera ref="onlineCamera" v-on:changeOnlineVisible="changeOnlineVisible" />
</a-form-model> </a-form-model>
@ -214,6 +159,9 @@
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
typeId: [
{ required: true, message: '请选择类型!'},
],
color: [ color: [
{ required: true, message: '请输入颜色!'}, { required: true, message: '请输入颜色!'},
], ],
@ -226,6 +174,18 @@
name: [ name: [
{ required: true, message: '请输入名称!'}, { required: true, message: '请输入名称!'},
], ],
money: [
{ required: false},
{ pattern: /^\d{0,11}$/, message: '长度不能超过11位数字'},
],
retailPrice: [
{ required: false},
{ pattern: /^\d{0,11}$/, message: '长度不能超过11位数字'},
],
location: [
{ required: false},
{ pattern: /^.{0,30}$/, message: '长度不能超过30位字符'},
],
}, },
url: { url: {
add: "/fabric/zyFabric/add", add: "/fabric/zyFabric/add",

@ -1,12 +1,10 @@
package org.jeecg.modules.demo.fabric.controller; package org.jeecg.modules.demo.fabric.controller;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.fabric.entity.ZyFabric; import org.jeecg.modules.demo.fabric.entity.ZyFabric;
import org.jeecg.modules.demo.fabric.entity.ZyFabricStock; import org.jeecg.modules.demo.fabric.entity.ZyFabricStock;
import org.jeecg.modules.demo.fabric.service.IZyFabricService; import org.jeecg.modules.demo.fabric.service.IZyFabricService;
@ -66,9 +64,9 @@ public class ZyFabricController extends JeecgController<ZyFabric, IZyFabricServi
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
//QueryWrapper<ZyFabric> queryWrapper = QueryGenerator.initQueryWrapper(zyFabric, req.getParameterMap()); QueryWrapper<ZyFabric> queryWrapper = QueryGenerator.initQueryWrapper(zyFabric, req.getParameterMap());
QueryWrapper queryWrapper = new QueryWrapper(); // QueryWrapper queryWrapper = new QueryWrapper();
Page<ZyFabric> page = new Page<ZyFabric>(pageNo, pageSize); Page<ZyFabric> page = new Page<>(pageNo, pageSize);
IPage<ZyFabric> pageList = zyFabricService.page(page, queryWrapper); IPage<ZyFabric> pageList = zyFabricService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
@ -201,6 +199,13 @@ public class ZyFabricController extends JeecgController<ZyFabric, IZyFabricServi
@ApiOperation(value="面料表-添加", notes="面料表-添加") @ApiOperation(value="面料表-添加", notes="面料表-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyFabric zyFabric) { public Result<?> add(@RequestBody ZyFabric zyFabric) {
zyFabric.setCreateTime(new Date().toLocaleString());
List<ZyFabric> list = zyFabricService.list();
for (ZyFabric zy : list){
if (zy.getName().equals(zyFabric.getName())){
return Result.error("名称重复,请重新输入");
}
}
zyFabricService.save(zyFabric); zyFabricService.save(zyFabric);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@ -215,6 +220,15 @@ public class ZyFabricController extends JeecgController<ZyFabric, IZyFabricServi
@ApiOperation(value="面料表-编辑", notes="面料表-编辑") @ApiOperation(value="面料表-编辑", notes="面料表-编辑")
@PutMapping(value = "/edit") @PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyFabric zyFabric) { public Result<?> edit(@RequestBody ZyFabric zyFabric) {
zyFabric.setUpdateTime(new Date().toLocaleString());
List<ZyFabric> list = zyFabricService.list();
ZyFabric zyFabric1 = zyFabricService.getById(zyFabric.getId());
list.remove(zyFabric1);
for (ZyFabric zy : list){
if (zy.getName().equals(zyFabric.getName())){
return Result.error("名称重复,请重新输入");
}
}
zyFabricService.updateById(zyFabric); zyFabricService.updateById(zyFabric);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }

@ -109,6 +109,8 @@ public class ZyFabricTypeController extends JeecgController<ZyFabricType, IZyFab
@PutMapping(value = "/edit") @PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyFabricType zyFabricType) { public Result<?> edit(@RequestBody ZyFabricType zyFabricType) {
List<ZyFabricType> list = zyFabricTypeService.list(); List<ZyFabricType> list = zyFabricTypeService.list();
ZyFabricType zyFabricType1 = zyFabricTypeService.getById(zyFabricType.getId());
list.remove(zyFabricType1); //移除被编辑行的数据,防止校验重复
for (ZyFabricType zy : list){ for (ZyFabricType zy : list){
if (zy.getNums().equals(zyFabricType.getNums())){ if (zy.getNums().equals(zyFabricType.getNums())){
return Result.error("编号重复,请重新输入"); return Result.error("编号重复,请重新输入");

@ -4,9 +4,8 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -34,118 +33,122 @@ public class ZyFabric implements Serializable {
/** 材料表*/ /** 材料表*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = " 材料表") @ApiModelProperty(value = " 材料表")
private String id; private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**颜色*/ /**颜色*/
@Excel(name = "颜色", width = 15) @Excel(name = "颜色", width = 15)
@ApiModelProperty(value = "颜色") @ApiModelProperty(value = "颜色")
private String color; private java.lang.String color;
/**花样*/ /**花样*/
@Excel(name = "花样", width = 15) @Excel(name = "花样", width = 15, dictTable = "", dicText = "", dicCode = "pattern")
@Dict(dictTable = "", dicText = "", dicCode = "pattern")
@ApiModelProperty(value = "花样") @ApiModelProperty(value = "花样")
private String pattern; private java.lang.String pattern;
/**材质*/ /**材质*/
@Excel(name = "材质", width = 15) @Excel(name = "材质", width = 15, dictTable = "", dicText = "", dicCode = "material")
@Dict(dictTable = "", dicText = "", dicCode = "material")
@ApiModelProperty(value = "材质") @ApiModelProperty(value = "材质")
private String material; private java.lang.String material;
/**描述*/ /**描述*/
@Excel(name = "描述", width = 15)
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "描述")
private String description; private java.lang.String description;
/**厚度*/ /**厚度*/
@Excel(name = "厚度", width = 15) @Excel(name = "厚度", width = 15, dictTable = "", dicText = "", dicCode = "ply")
@Dict(dictTable = "", dicText = "", dicCode = "ply")
@ApiModelProperty(value = "厚度") @ApiModelProperty(value = "厚度")
private String ply; private java.lang.String ply;
/**金额*/ /**单价*/
@Excel(name = "金额", width = 15) @Excel(name = "单价", width = 15)
@ApiModelProperty(value = "金额") @ApiModelProperty(value = "单价")
private Integer money; private java.lang.Integer money;
/**图片地址*/
// @Excel(name = "图片地址", width = 15)
@ApiModelProperty(value = "图片地址") @ApiModelProperty(value = "图片地址")
private String imageUrl; private java.lang.String imageUrl;
/**面料类型id*/ /**面料类型id*/
@ApiModelProperty(value = "面料类型id") @Excel(name = "类型", width = 15 , dictTable = "zy_fabric_type", dicText = "content", dicCode = "id")
private String typeId; @Dict(dictTable = "zy_fabric_type", dicText = "content", dicCode = "id")
@ApiModelProperty(value = "类型")
private java.lang.String typeId;
/**图片地址*/
@ApiModelProperty(value = "图片地址") @ApiModelProperty(value = "图片地址")
private String pictureUrl; private java.lang.String pictureUrl;
/**材料品牌id*/ /**材料品牌id*/
@Excel(name = "面料品牌id", width = 15) @Excel(name = "品牌", width = 15, dictTable = "", dicText = "", dicCode = "brand")
@Dict(dictTable = "", dicText = "", dicCode = "brand")
@ApiModelProperty(value = "材料品牌id") @ApiModelProperty(value = "材料品牌id")
private String brandId; private java.lang.String brandId;
/**材料编号*/ /**材料编号*/
@Excel(name = "面料编号", width = 15) @Excel(name = "材料编号", width = 15)
@ApiModelProperty(value = "面料编号") @ApiModelProperty(value = "材料编号")
private String fabricNumber; private java.lang.String fabricNumber;
/**1、为m。2:kg,等*/ /**单位 1、为m。2:kg,等*/
@Excel(name = "1、为m。2:kg,等", width = 15) @Excel(name = "计量单位", width = 15, dictTable = "", dicText = "", dicCode = "unit1")
@Dict(dictTable = "", dicText = "", dicCode = "unit1")
@ApiModelProperty(value = "1、为m。2:kg,等") @ApiModelProperty(value = "1、为m。2:kg,等")
private Integer unit; private java.lang.Integer unit;
/**零售价*/ /**零售价*/
@Excel(name = "零售价", width = 15) @Excel(name = "零售价", width = 15)
@ApiModelProperty(value = "零售价") @ApiModelProperty(value = "零售价")
private Integer retailPrice; private java.lang.Integer retailPrice;
/**密度*/ /**密度*/
@Excel(name = "密度", width = 15) @Excel(name = "密度", width = 15, dictTable = "", dicText = "", dicCode = "density")
@Dict(dictTable = "", dicText = "", dicCode = "density")
@ApiModelProperty(value = "密度") @ApiModelProperty(value = "密度")
private String density; private java.lang.String density;
/**幅宽*/ /**幅宽*/
@Excel(name = "幅宽", width = 15) @Excel(name = "幅宽", width = 15)
@ApiModelProperty(value = "幅宽") @ApiModelProperty(value = "幅宽")
private String clothW; private java.lang.String clothW;
/**所在地区*/ /**所在地区*/
@Excel(name = "所在地区", width = 15) @Excel(name = "所在地区", width = 15)
@ApiModelProperty(value = "所在地区") @ApiModelProperty(value = "所在地区")
private String location; private java.lang.String location;
/**状态 o 为下架 1为上架 */ /**状态 o 为下架 1为上架 */
@Excel(name = "状态 o 为下架 1为上架 ", width = 15) @Excel(name = "状态", width = 15, dictTable = "", dicText = "", dicCode = "fabric_status")
@Dict(dictTable = "", dicText = "", dicCode = "fabric_status")
@ApiModelProperty(value = "状态 o 为下架 1为上架 ") @ApiModelProperty(value = "状态 o 为下架 1为上架 ")
private Integer status; private java.lang.Integer status;
/**二维码*/ /**二维码*/
@Excel(name = "二维码", width = 15) @Excel(name = "二维码", width = 15)
@ApiModelProperty(value = "二维码") @ApiModelProperty(value = "二维码")
private String qRcode; private java.lang.String qRcode;
/**名称*/ /**名称*/
@Excel(name = "名称", width = 15) @Excel(name = "名称", width = 15)
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "名称")
private String name; private java.lang.String name;
/**克重*/ /**克重*/
@Excel(name = "克重", width = 15)
@ApiModelProperty(value = "克重") @ApiModelProperty(value = "克重")
private String gramW; private java.lang.String gramW;
/**面料打理方式*/ /**面料打理方式*/
@Excel(name = "面料打理方式", width = 15)
@ApiModelProperty(value = "面料打理方式") @ApiModelProperty(value = "面料打理方式")
private String fabricCare; private java.lang.String fabricCare;
/**供货商信息*/ /**供货商信息*/
@Excel(name = "供货商信息", width = 15) @Excel(name = "供货商", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "供货商信息") @ApiModelProperty(value = "供货商信息")
private String supplierInfo; private java.lang.String supplierInfo;
/**创建人*/
/**二维码*/ @ApiModelProperty(value = "创建人")
private java.lang.String createBy;
@ApiModelProperty(value = "二维码") /**创建时间*/
private java.lang.String img; // @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
// @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间")
private java.lang.String createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新时间*/
// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
// @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value = "更新时间")
private java.lang.String updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
} }

Loading…
Cancel
Save