2022-12-16 修改产品管理部分问题

zhc4dev
赵玉瑞 2 years ago
parent 3c8f31099c
commit 0d0a20e058
  1. 6
      ant-design-vue-jeecg/src/views/zyclothsstyle/ZyClothsStyleList.vue
  2. 9
      ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue
  3. 228
      ant-design-vue-jeecg/src/views/zystyleaccessories/modules/ZyAccessoriesList.vue
  4. 130
      ant-design-vue-jeecg/src/views/zystyleaccessories/modules/ZyStyleAccessoriesModal.vue
  5. 5
      ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue
  6. 21
      ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyProcessList.vue
  7. 2
      ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyStyleModularModal.vue
  8. 4
      ant-design-vue-jeecg/src/views/zystylemodule/ZyStyleModuleList.vue
  9. 4
      ant-design-vue-jeecg/src/views/zystylemodule/modules/ZyClothsModularList.vue
  10. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/controller/ZyStyleAccessoriesController.java
  11. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/entity/ZyStyleAccessories.java
  12. 12
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java
  13. 347
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/controller/ZyStyleFabricController.java
  14. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/entity/NewZyStyleFabric.java
  15. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/mapper/ZyStyleFabricMapper.java
  16. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/service/impl/NewZyStyleFabricServiceImpl.java
  17. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java

@ -162,7 +162,11 @@ export default {
return parseInt(index) + 1; return parseInt(index) + 1;
} }
}, },
{
title: '服装类型名称',
align: "center",
dataIndex: 'typeName'
},
{ {
title: '款式名称', title: '款式名称',
align: "center", align: "center",

@ -17,8 +17,8 @@
</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="辅料名称">
<j-dict-select-tag placeholder="请选择辅料类型" dictCode="zy_accessories,contents,id" <j-dict-select-tag placeholder="请选择辅料名称" dictCode="zy_accessories,contents,id"
v-model="queryParam.accessoriesId"></j-dict-select-tag> v-model="queryParam.accessoriesId"></j-dict-select-tag>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -162,6 +162,11 @@ export default {
return parseInt(index) + 1; return parseInt(index) + 1;
} }
}, },
{
title: '服装类型名称',
align: "center",
dataIndex: 'typeName'
},
{ {
title: '款式名称', title: '款式名称',
align: "center", align: "center",

@ -4,19 +4,38 @@
<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 :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="辅料编号">
<a-input placeholder="请输入辅料编号" v-model="queryParam.nums"></a-input>
</a-form-item>
</a-col>
<a-col :xl="10" :lg="7" :md="8" :sm="24">
<a-form-item label="辅料名称">
<a-input placeholder="请输入辅料名称" v-model="queryParam.contents"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<!-- 查询区域-END --> <!-- 查询区域-END -->
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <!-- <div class="table-operator">-->
</div> <!-- </div>-->
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a> <a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div> </div>
@ -39,7 +58,8 @@
</template> </template>
<template slot="imgSlot" slot-scope="text"> <template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> <img v-else :src="getImgView(text)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template> </template>
<template slot="fileSlot" slot-scope="text"> <template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
@ -61,116 +81,114 @@
<script> <script>
import '@/assets/less/TableExpand.less' import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin' import {mixinDevice} from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
export default { export default {
name: 'ZyAccessoriesList', name: 'ZyAccessoriesList',
mixins:[JeecgListMixin, mixinDevice], mixins: [JeecgListMixin, mixinDevice],
components: { components: {},
data() {
return {
description: 'zy_accessories管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '类型',
align: "center",
dataIndex: 'typeId_dictText'
},
{
title: '编号',
align: "center",
dataIndex: 'nums'
},
{
title: '名称',
align: "center",
dataIndex: 'contents',
// width:10,
// colspan:2
},
{
title: '图片',
align: "center",
dataIndex: 'picture'
},
{
title: '材质',
align: "center",
dataIndex: 'material'
},
{
title: '规格',
align: "center",
dataIndex: 'specs'
},
],
url: {
list: "/accessories/zyAccessories/list",
delete: "/accessories/zyAccessories/delete",
deleteBatch: "/accessories/zyAccessories/deleteBatch",
exportXlsUrl: "/accessories/zyAccessories/exportXls",
importExcelUrl: "accessories/zyAccessories/importExcel",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}, },
data () { },
return { methods: {
description: 'zy_accessories管理页面', onSelectChange1(selectedRowKeys, selectionRows) {
// this.selectedRowKeys = selectedRowKeys;
columns: [ this.selectionRows = selectionRows;
{ let ids = "";
title: '#', for (var a = 0; a < this.selectedRowKeys.length; a++) {
dataIndex: '', ids += this.selectedRowKeys[a] + ",";
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'类型',
align:"center",
dataIndex: 'typeId_dictText'
},
{
title:'编号',
align:"center",
dataIndex: 'nums'
},
{
title:'名称',
align:"center",
dataIndex: 'contents',
width:10,
colspan:2
},
{
title:'图片',
align:"center",
dataIndex: 'picture'
},
{
title:'材质',
align:"center",
dataIndex: 'material'
},
{
title:'规格',
align:"center",
dataIndex: 'specs'
},
],
url: {
list: "/accessories/zyAccessories/list",
delete: "/accessories/zyAccessories/delete",
deleteBatch: "/accessories/zyAccessories/deleteBatch",
exportXlsUrl: "/accessories/zyAccessories/exportXls",
importExcelUrl: "accessories/zyAccessories/importExcel",
},
dictOptions:{},
superFieldList:[],
} }
this.$emit('onChangeRowKey', ids)
}, },
created() { add() {
this.getSuperFieldList();
}, },
computed: { initDictConfig() {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
}, },
methods: { getSuperFieldList() {
onSelectChange1(selectedRowKeys, selectionRows) { let fieldList = [];
this.selectedRowKeys = selectedRowKeys; fieldList.push({type: 'string', value: 'typeId', text: '类型id'})
this.selectionRows = selectionRows; fieldList.push({type: 'string', value: 'nums', text: '编号'})
let ids = ""; fieldList.push({type: 'string', value: 'contents', text: '名称'})
for (var a = 0; a < this.selectedRowKeys.length; a++) { fieldList.push({type: 'string', value: 'picture', text: '图片'})
ids += this.selectedRowKeys[a] + ","; fieldList.push({type: 'string', value: 'material', text: '材质'})
} fieldList.push({type: 'string', value: 'specs', text: '规格'})
this.$emit('onChangeRowKey',ids) fieldList.push({type: 'int', value: 'store', text: '库存量'})
}, fieldList.push({type: 'string', value: 'supplierInfo', text: '供货商信息'})
add () { this.superFieldList = fieldList
}, },
initDictConfig(){ handleDetail(id) {
}, this.$refs.ZyAccessoriesFormDetail.showModal(id)
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'typeId',text:'类型id'})
fieldList.push({type:'string',value:'nums',text:'编号'})
fieldList.push({type:'string',value:'contents',text:'名称'})
fieldList.push({type:'string',value:'picture',text:'图片'})
fieldList.push({type:'string',value:'material',text:'材质'})
fieldList.push({type:'string',value:'specs',text:'规格'})
fieldList.push({type:'int',value:'store',text:'库存量'})
fieldList.push({type:'string',value:'supplierInfo',text:'供货商信息'})
this.superFieldList = fieldList
},
handleDetail(id){
this.$refs.ZyAccessoriesFormDetail.showModal(id)
}
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>

@ -8,78 +8,80 @@
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel" @cancel="handleCancel"
cancelText="关闭"> cancelText="关闭">
<!-- <zy-style-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-style-accessories-form>--> <!-- <zy-style-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-style-accessories-form>-->
<zy-accessories-list ref="realForm" @onChangeRowKey="chuancan" @ok="submitCallback" :disabled="disableSubmit"></zy-accessories-list> <zy-accessories-list ref="realForm" @onChangeRowKey="chuancan" @ok="submitCallback"
:disabled="disableSubmit"></zy-accessories-list>
</j-modal> </j-modal>
</template> </template>
<script> <script>
// import ZyStyleAccessoriesForm from './ZyStyleAccessoriesForm' // import ZyStyleAccessoriesForm from './ZyStyleAccessoriesForm'
import ZyAccessoriesList from "./ZyAccessoriesList"; import ZyAccessoriesList from "./ZyAccessoriesList";
import {postAction} from "../../../api/manage"; import {postAction} from "../../../api/manage";
export default {
name: 'ZyStyleAccessoriesModal',
components: {
ZyAccessoriesList,
},
data () {
return {
model:{
styleId:'',
accessoriesId:''
},
title:'',
width:800,
visible: false,
disableSubmit: false,
url: {
add: "/zyaccessories/zyStyleAccessories/add",
edit: "/zyaccessories/zyStyleAccessories/edit",
queryById: "/zyaccessories/zyStyleAccessories/queryById"
}
}
},
methods: {
add () {
this.model.styleId=this.$route.query.id;
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
chuancan(res){
this.model.accessoriesId=res;
},
handleOk () {
postAction(this.url.add,this.model).then((res)=>{
if(res.success){
this.$message.success(res.message);
}else{
this.$message.warning(res.message);
}
this.$emit('valueChange',1)
this.close()
}) export default {
}, name: 'ZyStyleAccessoriesModal',
submitCallback(){ components: {
this.$emit('ok'); ZyAccessoriesList,
this.visible = false; },
data() {
return {
model: {
styleId: '',
accessoriesId: ''
}, },
handleCancel () { title: '',
this.close() width: 1500,
visible: false,
disableSubmit: false,
url: {
add: "/zyaccessories/zyStyleAccessories/add",
edit: "/zyaccessories/zyStyleAccessories/edit",
queryById: "/zyaccessories/zyStyleAccessories/queryById"
} }
} }
},
methods: {
add() {
this.model.styleId = this.$route.query.id;
this.visible = true
this.$nextTick(() => {
this.$refs.realForm.add();
})
},
edit(record) {
this.visible = true
this.$nextTick(() => {
this.$refs.realForm.edit(record);
})
},
close() {
this.$emit('close');
this.visible = false;
},
chuancan(res) {
this.model.accessoriesId = res;
},
handleOk() {
postAction(this.url.add, this.model).then((res) => {
if (res.success) {
this.$message.success(res.message);
} else {
this.$message.warning(res.message);
}
this.$emit('valueChange', 1)
this.close()
})
},
submitCallback() {
this.$emit('ok');
this.visible = false;
},
handleCancel() {
this.close()
}
} }
}
</script> </script>

@ -145,6 +145,11 @@ export default {
return parseInt(index) + 1; return parseInt(index) + 1;
} }
}, },
{
title: '服装类型',
align: "center",
dataIndex: 'typeName'
},
{ {
title: '款式编号', title: '款式编号',
align: "center", align: "center",

@ -3,7 +3,26 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<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>
<a-row :gutter="24">
<a-col :xl="8" :lg="7" :md="8" :sm="24">
<a-form-item label="工序代码">
<a-input placeholder="请输入工序代码" v-model="queryParam.processCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="10" :lg="7" :md="8" :sm="24">
<a-form-item label="工序名称">
<a-input placeholder="请输入工序名称" v-model="queryParam.processName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>

@ -27,7 +27,7 @@
processId:'' processId:''
}, },
title:'', title:'',
width:800, width:900,
visible: false, visible: false,
disableSubmit: false, disableSubmit: false,
url: { url: {

@ -18,8 +18,8 @@
<!-- </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="模块名称">
<j-dict-select-tag placeholder="请输入制衣模块" dictCode="zy_cloths_modular ,modular_name,id" <j-dict-select-tag placeholder="请选择模块名称" dictCode="zy_cloths_modular,modular_name,id"
v-model="queryParam.modularId"></j-dict-select-tag> v-model="queryParam.modularId"></j-dict-select-tag>
</a-form-item> </a-form-item>
</a-col> </a-col>

@ -4,12 +4,12 @@
<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 :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="7" :lg="7" :md="8" :sm="24">
<a-form-item label="编号"> <a-form-item label="编号">
<a-input placeholder="编号" v-model="queryParam.nums"></a-input> <a-input placeholder="编号" v-model="queryParam.nums"></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="10" :lg="7" :md="8" :sm="24">
<a-form-item label="模块名称"> <a-form-item label="模块名称">
<a-input placeholder="模块名称" v-model="queryParam.modularName"></a-input> <a-input placeholder="模块名称" v-model="queryParam.modularName"></a-input>
</a-form-item> </a-form-item>

@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -22,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@ -52,7 +54,11 @@ public class ZyStyleAccessoriesController extends JeecgController<ZyStyleAccesso
@Autowired @Autowired
private IZyStyleAccessoriesService zyStyleAccessoriesService; private IZyStyleAccessoriesService zyStyleAccessoriesService;
@Autowired @Autowired
ZyStyleAccessoriesMapper zyStyleAccessoriesMapper; private ZyStyleAccessoriesMapper zyStyleAccessoriesMapper;
@Resource
private ZyStyleFabricMapper zyStyleFabricMapper;
/** /**
* 分页列表查询 * 分页列表查询
@ -73,6 +79,11 @@ public class ZyStyleAccessoriesController extends JeecgController<ZyStyleAccesso
QueryWrapper<ZyStyleAccessories> queryWrapper = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap()); QueryWrapper<ZyStyleAccessories> queryWrapper = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap());
Page<ZyStyleAccessories> page = new Page<ZyStyleAccessories>(pageNo, pageSize); Page<ZyStyleAccessories> page = new Page<ZyStyleAccessories>(pageNo, pageSize);
IPage<ZyStyleAccessories> pageList = zyStyleAccessoriesService.page(page, queryWrapper); IPage<ZyStyleAccessories> pageList = zyStyleAccessoriesService.page(page, queryWrapper);
List<ZyStyleAccessories> listRecords = pageList.getRecords();
for (ZyStyleAccessories zy : listRecords) {
String typeName = zyStyleFabricMapper.getTypeName(zy.getStyleId());
zy.setTypeName(typeName);
}
return Result.OK(pageList); return Result.OK(pageList);
} }

@ -5,6 +5,7 @@ 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.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@ -55,7 +56,7 @@ public class ZyStyleAccessories implements Serializable {
@ApiModelProperty(value = "所属部门") @ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode; private java.lang.String sysOrgCode;
/**款式id*/ /**款式id*/
@Excel(name = "款式id", width = 15) @Excel(name = "服装款式id", width = 15)
@ApiModelProperty(value = "款式id") @ApiModelProperty(value = "款式id")
@Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") @Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id")
private java.lang.String styleId; private java.lang.String styleId;
@ -64,4 +65,10 @@ public class ZyStyleAccessories implements Serializable {
@ApiModelProperty(value = "面料id") @ApiModelProperty(value = "面料id")
@Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id") @Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id")
private java.lang.String accessoriesId; private java.lang.String accessoriesId;
/**服装类型名称*/
@Excel(name = "服装类型名称", width = 15)
@ApiModelProperty(value = "服装类型名称")
@TableField(exist = false)
private java.lang.String typeName;
} }

@ -60,16 +60,16 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
@Override @Override
public String sort(String id) { public String sort(String id) {
String nums = zyClothsStyleMapper.sort(id); String nums = zyClothsStyleMapper.sort(id);
System.out.println(nums + " nums"); // System.out.println(nums + " nums");
String format = String.format("%08d", orderNumber()); String format = String.format("%08d", orderNumber());
System.err.println(format + " format"); // System.err.println(format + " format");
return nums + format; return nums + format;
} }
private Long orderNumber() { private Long orderNumber() {
List<String> numsList = zyClothsStyleMapper.selectNumsList(); List<String> numsList = zyClothsStyleMapper.selectNumsList();
System.out.println(numsList); // System.out.println(numsList);
System.out.println(numsList.size()); // System.out.println(numsList.size());
List<Long> list = new ArrayList<>(); List<Long> list = new ArrayList<>();
for (String nums : numsList) { for (String nums : numsList) {
@ -86,8 +86,8 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
list.add(Long.valueOf(newNums)); list.add(Long.valueOf(newNums));
} }
System.out.println(list); // System.out.println(list);
System.out.println(list.size()); // System.out.println(list.size());
return Collections.max(list) + 1; return Collections.max(list) + 1;
} }
} }

@ -3,8 +3,10 @@ package org.jeecg.modules.zystylefabric.controller;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.annotation.Resource;
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;
@ -19,6 +21,7 @@ import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService;
import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric; import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric;
import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric; import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric;
import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper;
import org.jeecg.modules.zystylefabric.service.INewZyStyleFabricService; import org.jeecg.modules.zystylefabric.service.INewZyStyleFabricService;
import org.jeecg.modules.zystylefabric.service.IZyStyleFabricService; import org.jeecg.modules.zystylefabric.service.IZyStyleFabricService;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
@ -29,178 +32,186 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
/** /**
* @Description: 款式面料表 * @Description: 款式面料表
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2022-09-15 * @Date: 2022-09-15
* @Version: V1.0 * @Version: V1.0
*/ */
@Api(tags="款式面料表") @Api(tags = "款式面料表")
@RestController @RestController
@RequestMapping("/zystylefabric/zyStyleFabric") @RequestMapping("/zystylefabric/zyStyleFabric")
@Slf4j @Slf4j
public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyStyleFabricService> { public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyStyleFabricService> {
@Autowired @Autowired
private IZyStyleFabricService zyStyleFabricService; private IZyStyleFabricService zyStyleFabricService;
@Autowired @Autowired
private INewZyStyleFabricService NewZyStyleFabricService; private INewZyStyleFabricService NewZyStyleFabricService;
@Autowired @Autowired
private IZyClothsStyleService zyClothsStyleService; private IZyClothsStyleService zyClothsStyleService;
@Autowired @Autowired
private IZyFabricService zyFabricService; private IZyFabricService zyFabricService;
/** @Resource
* 分页列表查询 private ZyStyleFabricMapper zyStyleFabricMapper;
*
* @param zyStyleFabric /**
* @param pageNo * 分页列表查询
* @param pageSize *
* @param req * @param zyStyleFabric
* @return * @param pageNo
*/ * @param pageSize
//@AutoLog(value = "款式面料表-分页列表查询") * @param req
@ApiOperation(value="款式面料表-分页列表查询", notes="款式面料表-分页列表查询") * @return
@GetMapping(value = "/list") */
public Result<IPage<NewZyStyleFabric>> queryPageList(ZyStyleFabric zyStyleFabric,String id, //@AutoLog(value = "款式面料表-分页列表查询")
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @ApiOperation(value = "款式面料表-分页列表查询", notes = "款式面料表-分页列表查询")
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @GetMapping(value = "/list")
HttpServletRequest req) { public Result<IPage<NewZyStyleFabric>> queryPageList(ZyStyleFabric zyStyleFabric, String id,
QueryWrapper<ZyStyleFabric> queryWrapper = new QueryWrapper<>(); @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
if(id!=null){ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
queryWrapper.eq("style_id",id); HttpServletRequest req) {
} QueryWrapper<ZyStyleFabric> queryWrapper = new QueryWrapper<>();
if(zyStyleFabric.getStyleId()!=null || zyStyleFabric.getFabricId()!=null ){ if (id != null) {
if(zyStyleFabric.getStyleId()!=null){ queryWrapper.eq("style_id", id);
queryWrapper.eq("style_id",zyStyleFabric.getStyleId()); }
} if (zyStyleFabric.getStyleId() != null || zyStyleFabric.getFabricId() != null) {
if(zyStyleFabric.getFabricId()!=null){ if (zyStyleFabric.getStyleId() != null) {
queryWrapper.eq("fabric_id",zyStyleFabric.getFabricId()); queryWrapper.eq("style_id", zyStyleFabric.getStyleId());
} }
if (zyStyleFabric.getFabricId() != null) {
} queryWrapper.eq("fabric_id", zyStyleFabric.getFabricId());
List<ZyStyleFabric> list = zyStyleFabricService.list(queryWrapper); }
List<NewZyStyleFabric> newZyStyleFabrics = new ArrayList<>();
for (ZyStyleFabric zyStyleF : list){ }
System.out.println("****"+zyStyleF); List<ZyStyleFabric> list = zyStyleFabricService.list(queryWrapper);
NewZyStyleFabric newZySF = new NewZyStyleFabric(); List<NewZyStyleFabric> newZyStyleFabrics = new ArrayList<>();
//编辑回显 for (ZyStyleFabric zyStyleF : list) {
newZySF.setId(zyStyleF.getId()); System.out.println("****" + zyStyleF);
newZySF.setFabricId(zyStyleF.getFabricId()); NewZyStyleFabric newZySF = new NewZyStyleFabric();
newZySF.setStyleId(zyStyleF.getStyleId()); //编辑回显
//款式编号和名称 newZySF.setId(zyStyleF.getId());
String styleId = zyStyleF.getStyleId(); newZySF.setFabricId(zyStyleF.getFabricId());
ZyClothsStyle styleById = zyClothsStyleService.getById(styleId); newZySF.setStyleId(zyStyleF.getStyleId());
newZySF.setStyleNums(styleById.getNums());
newZySF.setStyleNames(styleById.getStyleNames()); //拿到服装类型名称
//模块编号和名称 String typeName = zyStyleFabricMapper.getTypeName(newZySF.getStyleId());
String fabricId = zyStyleF.getFabricId(); newZySF.setTypeName(typeName);
ZyFabric fabricById = zyFabricService.getById(fabricId); //款式编号和名称
String styleId = zyStyleF.getStyleId();
newZySF.setFabricNumber(fabricById.getFabricNumber()); ZyClothsStyle styleById = zyClothsStyleService.getById(styleId);
newZySF.setFabricName(fabricById.getName()); newZySF.setStyleNums(styleById.getNums());
newZySF.setCreateTime(zyStyleF.getCreateTime()); newZySF.setStyleNames(styleById.getStyleNames());
newZyStyleFabrics.add(newZySF); //模块编号和名称
} String fabricId = zyStyleF.getFabricId();
IPage<NewZyStyleFabric> pageList = new Page<>(pageNo, pageSize, list.size());
pageList.setRecords(newZyStyleFabrics); ZyFabric fabricById = zyFabricService.getById(fabricId);
return Result.OK(pageList);
} newZySF.setFabricNumber(fabricById.getFabricNumber());
newZySF.setFabricName(fabricById.getName());
/** newZySF.setCreateTime(zyStyleF.getCreateTime());
* 添加 newZyStyleFabrics.add(newZySF);
* }
* @param zyStyleFabric IPage<NewZyStyleFabric> pageList = new Page<>(pageNo, pageSize, list.size());
* @return pageList.setRecords(newZyStyleFabrics);
*/ return Result.OK(pageList);
@AutoLog(value = "款式面料表-添加") }
@ApiOperation(value="款式面料表-添加", notes="款式面料表-添加")
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:add") /**
@PostMapping(value = "/add") * 添加
public Result<Object> add(@RequestBody ZyStyleFabric zyStyleFabric) { *
String[] split = zyStyleFabric.getFabricId().split(","); * @param zyStyleFabric
QueryWrapper queryWrapper=new QueryWrapper(); * @return
queryWrapper.eq("style_id",zyStyleFabric.getStyleId()); */
for (String s : split) { @AutoLog(value = "款式面料表-添加")
zyStyleFabric.setFabricId(s); @ApiOperation(value = "款式面料表-添加", notes = "款式面料表-添加")
zyStyleFabric.setId(null); //@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:add")
queryWrapper.eq("fabric_id",zyStyleFabric.getFabricId()); @PostMapping(value = "/add")
int a=zyStyleFabricService.count(queryWrapper); public Result<Object> add(@RequestBody ZyStyleFabric zyStyleFabric) {
if(a>=1) String[] split = zyStyleFabric.getFabricId().split(",");
return Result.error("存在以添加过的数据!!!"); QueryWrapper queryWrapper = new QueryWrapper();
zyStyleFabricService.save(zyStyleFabric); queryWrapper.eq("style_id", zyStyleFabric.getStyleId());
} for (String s : split) {
return Result.OK("添加成功!"); zyStyleFabric.setFabricId(s);
} zyStyleFabric.setId(null);
queryWrapper.eq("fabric_id", zyStyleFabric.getFabricId());
/** int a = zyStyleFabricService.count(queryWrapper);
* 编辑 if (a >= 1)
* return Result.error("存在以添加过的数据!!!");
* @param zyStyleFabric zyStyleFabricService.save(zyStyleFabric);
* @return }
*/ return Result.OK("添加成功!");
@AutoLog(value = "款式面料表-编辑") }
@ApiOperation(value="款式面料表-编辑", notes="款式面料表-编辑")
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:edit") /**
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) * 编辑
public Result<String> edit(@RequestBody ZyStyleFabric zyStyleFabric) { *
zyStyleFabricService.updateById(zyStyleFabric); * @param zyStyleFabric
return Result.OK("编辑成功!"); * @return
} */
@AutoLog(value = "款式面料表-编辑")
/** @ApiOperation(value = "款式面料表-编辑", notes = "款式面料表-编辑")
* 通过id删除 //@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:edit")
* @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
* @param id public Result<String> edit(@RequestBody ZyStyleFabric zyStyleFabric) {
* @return zyStyleFabricService.updateById(zyStyleFabric);
*/ return Result.OK("编辑成功!");
@AutoLog(value = "款式面料表-通过id删除") }
@ApiOperation(value="款式面料表-通过id删除", notes="款式面料表-通过id删除")
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:delete") /**
@DeleteMapping(value = "/delete") * 通过id删除
public Result<String> delete(@RequestParam(name="id",required=true) String id) { *
zyStyleFabricService.removeById(id); * @param id
return Result.OK("删除成功!"); * @return
} */
@AutoLog(value = "款式面料表-通过id删除")
/** @ApiOperation(value = "款式面料表-通过id删除", notes = "款式面料表-通过id删除")
* 批量删除 //@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:delete")
* @DeleteMapping(value = "/delete")
* @param ids public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
* @return zyStyleFabricService.removeById(id);
*/ return Result.OK("删除成功!");
@AutoLog(value = "款式面料表-批量删除") }
@ApiOperation(value="款式面料表-批量删除", notes="款式面料表-批量删除")
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:deleteBatch") /**
@DeleteMapping(value = "/deleteBatch") * 批量删除
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { *
this.zyStyleFabricService.removeByIds(Arrays.asList(ids.split(","))); * @param ids
return Result.OK("批量删除成功!"); * @return
} */
@AutoLog(value = "款式面料表-批量删除")
/** @ApiOperation(value = "款式面料表-批量删除", notes = "款式面料表-批量删除")
* 通过id查询 //@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:deleteBatch")
* @DeleteMapping(value = "/deleteBatch")
* @param id public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
* @return this.zyStyleFabricService.removeByIds(Arrays.asList(ids.split(",")));
*/ return Result.OK("批量删除成功!");
//@AutoLog(value = "款式面料表-通过id查询") }
@ApiOperation(value="款式面料表-通过id查询", notes="款式面料表-通过id查询")
@GetMapping(value = "/queryById") /**
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { * 通过id查询
ZyStyleFabric zyStyleFabric = zyStyleFabricService.getById(id); *
if(zyStyleFabric==null) { * @param id
return Result.error("未找到对应数据"); * @return
} */
return Result.OK(zyStyleFabric); //@AutoLog(value = "款式面料表-通过id查询")
} @ApiOperation(value = "款式面料表-通过id查询", notes = "款式面料表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
ZyStyleFabric zyStyleFabric = zyStyleFabricService.getById(id);
if (zyStyleFabric == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyStyleFabric);
}
/** /**
* 导出excel * 导出excel
* *
* @param request * @param request
* @param zyStyleFabric * @param zyStyleFabric
*/ */
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:exportXls") //@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:exportXls")
@RequestMapping(value = "/exportXls") @RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyStyleFabric zyStyleFabric) { public ModelAndView exportXls(HttpServletRequest request, ZyStyleFabric zyStyleFabric) {
@ -208,12 +219,12 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
} }
/** /**
* 通过excel导入数据 * 通过excel导入数据
* *
* @param request * @param request
* @param response * @param response
* @return * @return
*/ */
//@RequiresPermissions("zy_style_fabric:importExcel") //@RequiresPermissions("zy_style_fabric:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {

@ -1,6 +1,7 @@
package org.jeecg.modules.zystylefabric.entity; package org.jeecg.modules.zystylefabric.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -15,6 +16,11 @@ public class NewZyStyleFabric {
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
private java.lang.String id; private java.lang.String id;
/**服装类型 名称*/
@ApiModelProperty(value = "服装类型 名称")
private java.lang.String typeName;
/**款式id*/ /**款式id*/
@Excel(name = "款式id", width = 15, dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") @Excel(name = "款式id", width = 15, dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id")
@ApiModelProperty(value = "款式id") @ApiModelProperty(value = "款式id")
@ -24,8 +30,8 @@ public class NewZyStyleFabric {
@ApiModelProperty(value = "面料id") @ApiModelProperty(value = "面料id")
private java.lang.String fabricId; private java.lang.String fabricId;
/**名称*/ /**名称*/
@Excel(name = "名称", width = 15) @Excel(name = "面料 名称", width = 15)
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "面料 名称")
private java.lang.String fabricName; private java.lang.String fabricName;
/**材料编号*/ /**材料编号*/
@Excel(name = "材料编号", width = 15) @Excel(name = "材料编号", width = 15)
@ -36,8 +42,8 @@ public class NewZyStyleFabric {
@ApiModelProperty(value = "编号") @ApiModelProperty(value = "编号")
private String styleNums; private String styleNums;
/**名称*/ /**名称*/
@Excel(name = "名称", width = 15) @Excel(name = "服装款式 名称", width = 15)
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "服装款式 名称")
private String styleNames; private String styleNames;
/**创建日期*/ /**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

@ -4,6 +4,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric; import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric;
/** /**
@ -14,4 +15,10 @@ import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric;
*/ */
public interface ZyStyleFabricMapper extends BaseMapper<ZyStyleFabric> { public interface ZyStyleFabricMapper extends BaseMapper<ZyStyleFabric> {
/**
* @param styleId zyClothsStyle 中的id 款式id
*/
@Select("select type_name from zy_cloths_style where id = #{styleId}")
String getTypeName(String styleId);
} }

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric; import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric;
import org.jeecg.modules.zystylefabric.service.INewZyStyleFabricService; import org.jeecg.modules.zystylefabric.service.INewZyStyleFabricService;
import org.jeecg.modules.zystylefabric.service.IZyStyleFabricService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection; import java.util.Collection;

@ -22,6 +22,7 @@ import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper; import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper;
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService;
import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper;
import org.jeecg.modules.zystylemodule.entity.NewStyleModule; import org.jeecg.modules.zystylemodule.entity.NewStyleModule;
import org.jeecg.modules.zystylemodule.entity.ZyStyleModule; import org.jeecg.modules.zystylemodule.entity.ZyStyleModule;
import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService; import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService;
@ -50,8 +51,9 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
private IZyClothsModularService zyClothsModularService; private IZyClothsModularService zyClothsModularService;
@Autowired @Autowired
private IZyClothsStyleService zyClothsStyleService; private IZyClothsStyleService zyClothsStyleService;
@Resource @Resource
private ZyClothsStyleMapper zyClothsStyleMapper; private ZyStyleFabricMapper zyStyleFabricMapper;
/** /**
@ -109,12 +111,13 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
newSeMo.setCreateTime(zyStyleModule.getCreateTime()); newSeMo.setCreateTime(zyStyleModule.getCreateTime());
//服装类型 服装类型的id 不知道什么情况 传的是zy_cloths_style中的type_id //服装类型 服装类型的id 不知道什么情况 传的是zy_cloths_style中的type_id
String typeId = zyStyleModule.getTypeId(); //String styleId1 = zyStyleModule.getStyleId();
System.out.println(typeId); String typeName = zyStyleFabricMapper.getTypeName(zyStyleModule.getStyleId());
String typeNameByTypeId = zyClothsStyleMapper.getTypeNameByTypeId(typeId); //System.out.println(typeId);
System.err.println(typeNameByTypeId); //String typeNameByTypeId = zyClothsStyleMapper.getTypeNameByTypeId(typeId);
if (typeNameByTypeId != null){ //System.err.println(typeNameByTypeId);
newSeMo.setTypeName(typeNameByTypeId); if (typeName != null){
newSeMo.setTypeName(typeName);
} else { } else {
newSeMo.setTypeName("typeName为空"); newSeMo.setTypeName("typeName为空");
} }

Loading…
Cancel
Save