diff --git a/ant-design-vue-jeecg/src/components/procedure/processFabric.vue b/ant-design-vue-jeecg/src/components/procedure/processFabric.vue index ed6c6367..3718bbda 100644 --- a/ant-design-vue-jeecg/src/components/procedure/processFabric.vue +++ b/ant-design-vue-jeecg/src/components/procedure/processFabric.vue @@ -1,38 +1,40 @@ - + // TODO: 跳转到模块样板 + + 模块样板 + + + 编辑 - + - - + + + 详情 - + 删除 - + - + @@ -188,23 +193,27 @@ export default { { title: '款式', align: "center", - dataIndex: 'styleId' + dataIndex: 'styleId', }, { title: '型号', align: "center", - dataIndex: 'stylemodelId' - }, - /*{ - title: '模块样板', - align: "center", - dataIndex: 'modelSample' - },*/ - { - title: '模块样板', - align: "center", - dataIndex: 'modelSample_dictText' + dataIndex: 'stylemodelId_dictText', + //dictCode: 'modenumber', }, + // { + // title: '模块样板', + // align: "center", + // dataIndex: 'modelSample_dictText' + // }, + // { + // title: '管理模块', + // dataIndex: 'action1', + // align: "center", + // fixed: "right", + // width: 110, + // scopedSlots: {customRender: 'action1'} + // }, { title: '用户名', align: "center", @@ -216,27 +225,21 @@ export default { dataIndex: 'createTime' }, - /*{ - title: '成衣名称', - align: "center", - dataIndex: 'clothName' - },*/ - /*{ - title: '描述', - align: "center", - dataIndex: 'descr' - },*/ /*{ title: '图片', align: "center", dataIndex: 'url', scopedSlots: {customRender: 'imgSlot'} },*/ - /*{ - title: '用户类型', + + { + title: '管理模块', + dataIndex: 'action1', align: "center", - dataIndex: 'type' - },*/ + fixed: "right", + width: 110, + scopedSlots: {customRender: 'action1'} + }, { title: '操作', @@ -249,6 +252,7 @@ export default { ], url: { list: "/zyclothsample/zyClothSample/list", + edit: "/zyclothsample/zyClothSample/edit", delete: "/zyclothsample/zyClothSample/delete", deleteBatch: "/zyclothsample/zyClothSample/deleteBatch", exportXlsUrl: "/zyclothsample/zyClothSample/exportXls", @@ -261,7 +265,8 @@ export default { }, created() { this.getSuperFieldList(); - }, + } + , computed: { importExcelUrl: function () { return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; @@ -270,27 +275,42 @@ export default { methods: { initDictConfig() { }, + jumpPage(record) { + this.$router.push({ + path: '/src/views/sample/ZyModuleSampleList', + // query: { //路由携带参数 + // 'id': record.id, + // } + }); + }, + lookFile(fileUrl) { let file = window._CONFIG['domianURL'] + "/sys/common/static/" + fileUrl let Base64 = require('js-base64').Base64; let url = window._CONFIG['onlinePreviewDomainURL'] + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(file)) window.open(url); - }, + } + , getSuperFieldList() { let fieldList = []; - fieldList.push({type: 'string', value: 'nums', text: '编号', dictCode: ''}) - fieldList.push({type: 'string', value: 'styleId', text: '款式', dictCode: ''}) - fieldList.push({type: 'string', value: 'stylemodelId', text: '型号', dictCode: ''}) + fieldList.push({type: 'string', value: 'nums', text: '编号', dictCode:''}) + fieldList.push({type: 'string', value: 'styleId', text: '款式', dictCode:''}) + fieldList.push({type: 'string', value: 'stylemodelId', text: '型号', dictCode: 'modenumber'}) fieldList.push({type: 'string', value: 'modelSample', text: '模块样板', dictCode: ''}) fieldList.push({type: 'string', value: 'userId', text: '用户名', dictCode: ''}) fieldList.push({type: 'string', value: 'createTime', text: '创建时间', dictCode: ''}) this.superFieldList = fieldList - }, + } + , openDetail(id) { this.$refs.ZyClothSampleDetail.showModal(id) // this.$children[0].showModal(id) } + , + // handleDetail(id){ + // this.$refs.ZyClothSampleDetail.showModal(id) + // } } } diff --git a/ant-design-vue-jeecg/src/views/zyclothsample/modules/ZyClothSampleForm.vue b/ant-design-vue-jeecg/src/views/zyclothsample/modules/ZyClothSampleForm.vue index f35082f8..9a619203 100644 --- a/ant-design-vue-jeecg/src/views/zyclothsample/modules/ZyClothSampleForm.vue +++ b/ant-design-vue-jeecg/src/views/zyclothsample/modules/ZyClothSampleForm.vue @@ -5,53 +5,53 @@ - + + - + - + - + - - + + + + + - + + + + + + - - - - - + + + + - - + + - + + @@ -60,90 +60,131 @@ \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zyclothsstyle/ZyClothsStyleList.vue b/ant-design-vue-jeecg/src/views/zyclothsstyle/ZyClothsStyleList.vue index 336ffb4d..aee5e989 100644 --- a/ant-design-vue-jeecg/src/views/zyclothsstyle/ZyClothsStyleList.vue +++ b/ant-design-vue-jeecg/src/views/zyclothsstyle/ZyClothsStyleList.vue @@ -99,15 +99,15 @@ - 管理模块 + 管理模块 - 管理面料 + 管理面料 - 管理辅料 + 管理辅料 - 管理型号 + 管理型号 - 管理工序 + 管理工序 编辑 @@ -229,15 +229,38 @@ methods: { initDictConfig(){ }, - jumpPage(record) - { + jumpPage1(record) { this.$router.push({ - path: '/xxx/xxx', + path: '/src/views/zystylemodule/ZyStyleModuleList', query: { // 路由携带参数 'id': record.id, } }); }, + jumpPage2(record) { + this.$router.push({ + path: '/src/views/zystylefabric/ZyStyleFabricList', + query: { // 路由携带参数 + 'id': record.id, + } + }); + }, + jumpPage4(record) { + this.$router.push({ + path: '/src/views/zystylemodel/ZyStyleModelList', + query: { // 路由携带参数 + 'id': record.id, + } + }); + }, + jumpPage5(record) { + this.$router.push({ + path: '/process/ZyProcessList', + query: { // 路由携带参数 + 'styleId': record.id, + } + }); + }, getSuperFieldList(){ let fieldList=[]; fieldList.push({type:'popup',value:'typeId',text:'类型id', popup:{code:'zy_cloths_type',field:'type_name',orgFields:'type_name',destFields:'id'}}) diff --git a/ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue b/ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue index 0f1e3e56..6e0bb26b 100644 --- a/ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue +++ b/ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue @@ -106,6 +106,8 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import ZyStyleFabricModal from './modules/ZyStyleFabricModal' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' + import {getAction} from "@api/manage"; + import {filterObj} from "@/utils/util"; export default { name: 'ZyStyleFabricList', @@ -165,12 +167,16 @@ importExcelUrl: "zystylefabric/zyStyleFabric/importExcel", }, + //参数 + loadRouteType:false, + id:"", dictOptions:{}, superFieldList:[], } }, created() { - this.getSuperFieldList(); + //this.getSuperFieldList(); + this.loadParameter() ; }, computed: { importExcelUrl: function(){ @@ -180,6 +186,58 @@ methods: { initDictConfig(){ }, + //加载传递参数 + loadParameter() { + if (this.loadRouteType == false) { + this.id = this.$route.query.id; + console.log(this.id) + this.loadRouteType = true; + } + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("请设置url.list属性!") + return + } + //加载数据 若传入参数1则加载第一页的内容 + if (arg === 1) { + this.ipagination.current = 1; + } + this.loadParameter(); + var params = this.getQueryParams();//查询条件 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + }else{ + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + getQueryParams() { + //获取查询条件 + let sqp = {} + if(this.superQueryParams){ + sqp['superQueryParams']=encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters); + param.field = this.getQueryField(); + param.pageNo = this.ipagination.current; + param.pageSize = this.ipagination.pageSize; + param.id=this.id; + return filterObj(param); + }, getSuperFieldList(){ let fieldList=[]; fieldList.push({type:'string',value:'styleId',text:'款式id',dictCode:"zy_cloths_style,id,style_names"}) diff --git a/ant-design-vue-jeecg/src/views/zystylemodel/ZyStyleModelList.vue b/ant-design-vue-jeecg/src/views/zystylemodel/ZyStyleModelList.vue new file mode 100644 index 00000000..182018c5 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zystylemodel/ZyStyleModelList.vue @@ -0,0 +1,293 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zystylemodel/modules/ZyStyleModelForm.vue b/ant-design-vue-jeecg/src/views/zystylemodel/modules/ZyStyleModelForm.vue new file mode 100644 index 00000000..2022565c --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zystylemodel/modules/ZyStyleModelForm.vue @@ -0,0 +1,168 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zystylemodel/modules/ZyStyleModelModal.Style#Drawer.vue b/ant-design-vue-jeecg/src/views/zystylemodel/modules/ZyStyleModelModal.Style#Drawer.vue new file mode 100644 index 00000000..a5c0a441 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zystylemodel/modules/ZyStyleModelModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zystylemodel/modules/ZyStyleModelModal.vue b/ant-design-vue-jeecg/src/views/zystylemodel/modules/ZyStyleModelModal.vue new file mode 100644 index 00000000..0d4f7ac4 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zystylemodel/modules/ZyStyleModelModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zystylemodule/ZyStyleModuleList.vue b/ant-design-vue-jeecg/src/views/zystylemodule/ZyStyleModuleList.vue index 1c46f298..ab5c0db0 100644 --- a/ant-design-vue-jeecg/src/views/zystylemodule/ZyStyleModuleList.vue +++ b/ant-design-vue-jeecg/src/views/zystylemodule/ZyStyleModuleList.vue @@ -122,6 +122,8 @@ import {mixinDevice} from '@/utils/mixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin' import ZyStyleModuleModal from './modules/ZyStyleModuleModal' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' +import {getAction} from "@api/manage"; +import {filterObj} from "@/utils/util"; export default { name: 'ZyStyleModuleList', @@ -186,12 +188,16 @@ export default { importExcelUrl: "zystylemodule/zyStyleModule/importExcel", }, + //参数 + loadRouteType:false, + id:"", dictOptions: {}, superFieldList: [], } }, created() { - this.getSuperFieldList(); + //this.getSuperFieldList(); + this.loadParameter() ; }, computed: { importExcelUrl: function () { @@ -201,6 +207,58 @@ export default { methods: { initDictConfig() { }, + //加载传递参数 + loadParameter() { + if (this.loadRouteType == false) { + this.id = this.$route.query.id; + console.log(this.id) + this.loadRouteType = true; + } + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("请设置url.list属性!") + return + } + //加载数据 若传入参数1则加载第一页的内容 + if (arg === 1) { + this.ipagination.current = 1; + } + this.loadParameter(); + var params = this.getQueryParams();//查询条件 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + }else{ + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + getQueryParams() { + //获取查询条件 + let sqp = {} + if(this.superQueryParams){ + sqp['superQueryParams']=encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters); + param.field = this.getQueryField(); + param.pageNo = this.ipagination.current; + param.pageSize = this.ipagination.pageSize; + param.id=this.id; + return filterObj(param); + }, getSuperFieldList() { let fieldList = []; fieldList.push({type: 'string', value: 'typeId', text: '类型id', dictCode: "zy_cloths_type,id,type_name"}) diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java index 30db338c..2e1840b6 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java @@ -5,6 +5,7 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.demo.accessories.entity.ZyAccessories; import org.jeecg.modules.demo.base.entity.ZyAllProcess; import org.jeecg.modules.demo.base.entity.ZyClothAction; @@ -71,8 +72,8 @@ public class ZyProcessController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(zyProcess, req.getParameterMap()); - QueryWrapper queryWrapper = new QueryWrapper(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyProcess, req.getParameterMap()); + //QueryWrapper queryWrapper = new QueryWrapper(); Page page = new Page(pageNo, pageSize); IPage pageList = zyProcessService.page(page, queryWrapper); return Result.OK(pageList); diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java index 2e54253d..61ddf1a5 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java @@ -141,6 +141,7 @@ public class ZyProcess implements Serializable { /**款式名称*/ @Excel(name = "款式名称", width = 15) @ApiModelProperty(value = "款式名称") + @Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") private java.lang.String styleId; /**工段代码*/ @Excel(name = "工段代码", width = 15) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/controller/ZyClothSampleController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/controller/ZyClothSampleController.java index 129a38b5..bfd4998a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/controller/ZyClothSampleController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/controller/ZyClothSampleController.java @@ -82,6 +82,11 @@ public class ZyClothSampleController extends JeecgController add(@RequestBody ZyClothSample zyClothSample) { + /*if (zyClothSample.getStyleId()==null){ + return Result.error("款式不能为空"); + } + if (zyClothSample.getModelSample()==null) + return Result.error("模块样板不能为空");*/ zyClothSampleService.save(zyClothSample); return Result.OK("添加成功!"); } @@ -96,8 +101,20 @@ public class ZyClothSampleController extends JeecgController edit(@RequestBody ZyClothSample zyClothSample) { + //查询所有 + List zyClothSampleList = zyClothSampleService.list(); + //查询编辑行的数据 + ZyClothSample clothSample = zyClothSampleService.getById(zyClothSample.getId()); + //移除编辑行数据 + zyClothSampleList.remove(clothSample); + //将编辑行数据与其它数据比较 如果重复 报错 + for (ZyClothSample cloth: zyClothSampleList) { + if (cloth.getNums().equals(zyClothSample.getNums())){ + return Result.error("编号重复,请重新输入"); + } + } zyClothSampleService.updateById(zyClothSample); - return Result.OK("编辑成功!"); + return Result.OK("编辑成功"); } /** diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/entity/ZyClothSample.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/entity/ZyClothSample.java index d4281786..778b5474 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/entity/ZyClothSample.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/entity/ZyClothSample.java @@ -13,6 +13,7 @@ import org.jeecg.common.aspect.annotation.Dict; import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; +import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; @@ -38,13 +39,20 @@ public class ZyClothSample implements Serializable { @Excel(name = "编号", width = 15) @ApiModelProperty(value = "编号") private String nums; - /**款式*/ + + /** + * 款式 + * 关联服装款式表 zy_cloths_style + * 把数据id转换成style_names 因为前端一些问题 这里已不在需要 + */ @Excel(name = "款式", width = 15) @ApiModelProperty(value = "款式") + //@Dict(dicCode = "id",dictTable = "zy_cloths_style",dicText = "style_names") private String styleId; /**型号*/ @Excel(name = "型号", width = 15) @ApiModelProperty(value = "型号") + @Dict(dicCode = "modenumber", dictTable = "", dicText = "") private String stylemodelId; /**管理模块样板*/ @@ -56,6 +64,7 @@ public class ZyClothSample implements Serializable { @Excel(name = "模块样板", width = 15) @ApiModelProperty(value = "模块样板") @Dict(dicCode = "id",dictTable = "zy_module_sample",dicText = "module_name") + //@NotBlank(message = "模块样板不能为空") private String modelSample; /**用户*/ @Excel(name = "用户", width = 15) @@ -66,7 +75,14 @@ public class ZyClothSample implements Serializable { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建日期") private 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; /**成衣名称*/ @Excel(name = "成衣名称", width = 15) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/controller/ZyStyleFabricController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/controller/ZyStyleFabricController.java index a67d262f..c5438e22 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/controller/ZyStyleFabricController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/controller/ZyStyleFabricController.java @@ -81,11 +81,14 @@ public class ZyStyleFabricController extends JeecgController> queryPageList(ZyStyleFabric zyStyleFabric, + public Result> queryPageList(ZyStyleFabric zyStyleFabric,String id, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { QueryWrapper queryWrapper = new QueryWrapper<>(); + if(id!=null){ + queryWrapper.eq("style_id",id); + } if(zyStyleFabric.getStyleId()!=null || zyStyleFabric.getFabricId()!=null ){ if(zyStyleFabric.getStyleId()!=null){ queryWrapper.eq("style_id",zyStyleFabric.getStyleId()); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/controller/ZyStyleModelController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/controller/ZyStyleModelController.java new file mode 100644 index 00000000..43638e63 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/controller/ZyStyleModelController.java @@ -0,0 +1,189 @@ +package org.jeecg.modules.zystylemodel.controller; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson.JSONObject; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; +import org.jeecg.modules.zystylemodel.service.IZyStyleModelService; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: zy_style_model + * @Author: jeecg-boot + * @Date: 2022-09-17 + * @Version: V1.0 + */ +@Api(tags="zy_style_model") +@RestController +@RequestMapping("/zystylemodel/zyStyleModel") +@Slf4j +public class ZyStyleModelController extends JeecgController { + @Autowired + private IZyStyleModelService zyStyleModelService; + + /** + * 分页列表查询 + * + * @param zyStyleModel + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "zy_style_model-分页列表查询") + @ApiOperation(value="zy_style_model-分页列表查询", notes="zy_style_model-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(ZyStyleModel zyStyleModel,String id, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyStyleModel, req.getParameterMap()); + System.out.println(zyStyleModel.getStyleId()); + //queryWrapper.eq("style_id", id); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyStyleModelService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param zyStyleModel + * @return + */ + @AutoLog(value = "zy_style_model-添加") + @ApiOperation(value="zy_style_model-添加", notes="zy_style_model-添加") + //@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:add") + @PostMapping(value = "/add") + public Result add(@RequestBody ZyStyleModel zyStyleModel) { + zyStyleModel.setId(null); + System.out.println(zyStyleModel); + zyStyleModelService.save(zyStyleModel); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param zyStyleModel + * @return + */ + @AutoLog(value = "zy_style_model-编辑") + @ApiOperation(value="zy_style_model-编辑", notes="zy_style_model-编辑") + //@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody ZyStyleModel zyStyleModel) { + zyStyleModelService.updateById(zyStyleModel); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "zy_style_model-通过id删除") + @ApiOperation(value="zy_style_model-通过id删除", notes="zy_style_model-通过id删除") + //@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:delete") + @RequestMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + zyStyleModelService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param + * @return + */ + @AutoLog(value = "zy_style_model-批量删除") + @ApiOperation(value="zy_style_model-批量删除", notes="zy_style_model-批量删除") + //@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:deleteBatch") + @DeleteMapping(value = "/deleteBatch" ) + public Result deleteBatch(@RequestBody Map map) { + List idList = (List) map.get("id"); + // List list = Arrays.asList(ids); + zyStyleModelService.removeByIds(idList); + System.out.println(map); + //this.zyStyleModelService.removeByIds(Arrays.asList(map.get("deleteIds").split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "zy_style_model-通过id查询") + @ApiOperation(value="zy_style_model-通过id查询", notes="zy_style_model-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + ZyStyleModel zyStyleModel = zyStyleModelService.getById(id); + if(zyStyleModel==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyStyleModel); + } + + /** + * 导出excel + * + * @param request + * @param zyStyleModel + */ + //@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ZyStyleModel zyStyleModel) { + return super.exportXls(request, zyStyleModel, ZyStyleModel.class, "zy_style_model"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + //@RequiresPermissions("zy_style_model:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ZyStyleModel.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModel.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModel.java new file mode 100644 index 00000000..6b4f6b36 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModel.java @@ -0,0 +1,100 @@ +package org.jeecg.modules.zystylemodel.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: zy_style_model + * @Author: jeecg-boot + * @Date: 2022-09-17 + * @Version: V1.0 + */ +@Data +@TableName("zy_style_model") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="zy_style_model对象", description="zy_style_model") +public class ZyStyleModel implements Serializable { + private static final long serialVersionUID = 1L; + + /**内部编号*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "内部编号") + private java.lang.String id; + /**款式id*/ + @Excel(name = "款式id", width = 15) + @Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") + @ApiModelProperty(value = "款式id") + private java.lang.String styleId; + /**是否默认尺码*/ + @Excel(name = "是否默认尺码", width = 15) + @ApiModelProperty(value = "是否默认尺码") + private java.lang.Integer isdefault; + /**型号编码*/ + @Excel(name = "型号编码", width = 15) + @ApiModelProperty(value = "型号编码") + private java.lang.Integer modelNumber; + /**码数*/ + @Excel(name = "码数", width = 15) + @ApiModelProperty(value = "码数") + private java.lang.Integer size; + /**型*/ + @Excel(name = "型", width = 15) + @ApiModelProperty(value = "型") + private java.lang.String anumbers; + /**号*/ + @Excel(name = "号", width = 15) + @ApiModelProperty(value = "号") + private java.lang.String bnumbers; + /**领大*/ + @Excel(name = "领大", width = 15) + @ApiModelProperty(value = "领大") + private java.lang.Float collarLarge; + /**胸围*/ + @Excel(name = "胸围", width = 15) + @ApiModelProperty(value = "胸围") + private java.lang.Float bust; + /**袖长*/ + @Excel(name = "袖长", width = 15) + @ApiModelProperty(value = "袖长") + private java.lang.Float sleeveLength; + /**连肩袖长*/ + @Excel(name = "连肩袖长", width = 15) + @ApiModelProperty(value = "连肩袖长") + private java.lang.Float shslLength; + /**总肩宽*/ + @Excel(name = "总肩宽", width = 15) + @ApiModelProperty(value = "总肩宽") + private java.lang.Float tsWidth; + /**袖口*/ + @Excel(name = "袖口", width = 15) + @ApiModelProperty(value = "袖口") + private java.lang.Float cuff; + /**腰围*/ + @Excel(name = "腰围", width = 15) + @ApiModelProperty(value = "腰围") + private java.lang.Float waistline; + /**下摆*/ + @Excel(name = "下摆", width = 15) + @ApiModelProperty(value = "下摆") + private java.lang.Float hem; + /**创建时间*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "创建时间") + private java.util.Date createTime; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/mapper/ZyStyleModelMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/mapper/ZyStyleModelMapper.java new file mode 100644 index 00000000..e5b31c76 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/mapper/ZyStyleModelMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.zystylemodel.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; + +/** + * @Description: zy_style_model + * @Author: jeecg-boot + * @Date: 2022-09-17 + * @Version: V1.0 + */ +public interface ZyStyleModelMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/mapper/xml/ZyStyleModelMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/mapper/xml/ZyStyleModelMapper.xml new file mode 100644 index 00000000..0d3c33a1 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/mapper/xml/ZyStyleModelMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/IZyStyleModelService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/IZyStyleModelService.java new file mode 100644 index 00000000..1db06253 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/IZyStyleModelService.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.zystylemodel.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; + +/** + * @Description: zy_style_model + * @Author: jeecg-boot + * @Date: 2022-09-17 + * @Version: V1.0 + */ +public interface IZyStyleModelService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/impl/ZyStyleModelServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/impl/ZyStyleModelServiceImpl.java new file mode 100644 index 00000000..8f45e86e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/impl/ZyStyleModelServiceImpl.java @@ -0,0 +1,20 @@ +package org.jeecg.modules.zystylemodel.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; +import org.jeecg.modules.zystylemodel.mapper.ZyStyleModelMapper; +import org.jeecg.modules.zystylemodel.service.IZyStyleModelService; +import org.springframework.stereotype.Service; + + +/** + * @Description: zy_style_model + * @Author: jeecg-boot + * @Date: 2022-09-17 + * @Version: V1.0 + */ +@Service +public class ZyStyleModelServiceImpl extends ServiceImpl implements IZyStyleModelService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java index 4e116232..60bfc656 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java @@ -77,13 +77,15 @@ public class ZyStyleModuleController extends JeecgController queryPageList(ZyStyleModule zyStyleModule2, + public Result queryPageList(ZyStyleModule zyStyleModule2,String id, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { - List listNewStyleModules = new ArrayList<>(); QueryWrapper queryWrapper = new QueryWrapper<>(); + if(id!=null){ + queryWrapper.eq("style_id",id); + } if(zyStyleModule2.getStyleId()!=null || zyStyleModule2.getModularId()!=null || zyStyleModule2.getTypeId()!=null){ if(zyStyleModule2.getStyleId()!=null){ queryWrapper.eq("style_id",zyStyleModule2.getStyleId());