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. 126
      ant-design-vue-jeecg/src/views/zystyleaccessories/modules/ZyAccessoriesList.vue
  4. 62
      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. 71
      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;
}
},
{
title: '服装类型名称',
align: "center",
dataIndex: 'typeName'
},
{
title: '款式名称',
align: "center",

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

@ -4,19 +4,38 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<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-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
</div>
<!-- <div class="table-operator">-->
<!-- </div>-->
<!-- table区域-begin -->
<div>
<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>
</div>
@ -39,7 +58,8 @@
</template>
<template slot="imgSlot" slot-scope="text">
<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 slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
@ -61,17 +81,15 @@
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
export default {
export default {
name: 'ZyAccessoriesList',
mixins:[JeecgListMixin, mixinDevice],
components: {
},
data () {
mixins: [JeecgListMixin, mixinDevice],
components: {},
data() {
return {
description: 'zy_accessories管理页面',
//
@ -79,43 +97,43 @@
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title:'类型',
align:"center",
title: '类型',
align: "center",
dataIndex: 'typeId_dictText'
},
{
title:'编号',
align:"center",
title: '编号',
align: "center",
dataIndex: 'nums'
},
{
title:'名称',
align:"center",
title: '名称',
align: "center",
dataIndex: 'contents',
width:10,
colspan:2
// width:10,
// colspan:2
},
{
title:'图片',
align:"center",
title: '图片',
align: "center",
dataIndex: 'picture'
},
{
title:'材质',
align:"center",
title: '材质',
align: "center",
dataIndex: 'material'
},
{
title:'规格',
align:"center",
title: '规格',
align: "center",
dataIndex: 'specs'
},
],
@ -127,15 +145,15 @@
importExcelUrl: "accessories/zyAccessories/importExcel",
},
dictOptions:{},
superFieldList:[],
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
@ -147,30 +165,30 @@
for (var a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
this.$emit('onChangeRowKey',ids)
},
add () {
},
initDictConfig(){
},
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.$emit('onChangeRowKey', ids)
},
add() {
},
initDictConfig() {
},
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){
handleDetail(id) {
this.$refs.ZyAccessoriesFormDetail.showModal(id)
}
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
@import '~@assets/less/common.less';
</style>

@ -8,29 +8,31 @@
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<!-- <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-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>
</j-modal>
</template>
<script>
// import ZyStyleAccessoriesForm from './ZyStyleAccessoriesForm'
import ZyAccessoriesList from "./ZyAccessoriesList";
import {postAction} from "../../../api/manage";
export default {
// import ZyStyleAccessoriesForm from './ZyStyleAccessoriesForm'
import ZyAccessoriesList from "./ZyAccessoriesList";
import {postAction} from "../../../api/manage";
export default {
name: 'ZyStyleAccessoriesModal',
components: {
ZyAccessoriesList,
},
data () {
data() {
return {
model:{
styleId:'',
accessoriesId:''
model: {
styleId: '',
accessoriesId: ''
},
title:'',
width:800,
title: '',
width: 1500,
visible: false,
disableSubmit: false,
url: {
@ -41,45 +43,45 @@
}
},
methods: {
add () {
this.model.styleId=this.$route.query.id;
this.visible=true
this.$nextTick(()=>{
add() {
this.model.styleId = this.$route.query.id;
this.visible = true
this.$nextTick(() => {
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
edit(record) {
this.visible = true
this.$nextTick(() => {
this.$refs.realForm.edit(record);
})
},
close () {
close() {
this.$emit('close');
this.visible = false;
},
chuancan(res){
this.model.accessoriesId=res;
chuancan(res) {
this.model.accessoriesId = res;
},
handleOk () {
postAction(this.url.add,this.model).then((res)=>{
if(res.success){
handleOk() {
postAction(this.url.add, this.model).then((res) => {
if (res.success) {
this.$message.success(res.message);
}else{
} else {
this.$message.warning(res.message);
}
this.$emit('valueChange',1)
this.$emit('valueChange', 1)
this.close()
})
},
submitCallback(){
submitCallback() {
this.$emit('ok');
this.visible = false;
},
handleCancel () {
handleCancel() {
this.close()
}
}
}
}
</script>

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

@ -3,7 +3,26 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<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-form>
</div>

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

@ -18,8 +18,8 @@
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="制衣模块">
<j-dict-select-tag placeholder="请输入制衣模块" dictCode="zy_cloths_modular ,modular_name,id"
<a-form-item label="模块名称">
<j-dict-select-tag placeholder="请选择模块名称" dictCode="zy_cloths_modular,modular_name,id"
v-model="queryParam.modularId"></j-dict-select-tag>
</a-form-item>
</a-col>

@ -4,12 +4,12 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<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-input placeholder="编号" v-model="queryParam.nums"></a-input>
</a-form-item>
</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-input placeholder="模块名称" v-model="queryParam.modularName"></a-input>
</a-form-item>

@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
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 lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -52,7 +54,11 @@ public class ZyStyleAccessoriesController extends JeecgController<ZyStyleAccesso
@Autowired
private IZyStyleAccessoriesService zyStyleAccessoriesService;
@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());
Page<ZyStyleAccessories> page = new Page<ZyStyleAccessories>(pageNo, pageSize);
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);
}

@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@ -55,7 +56,7 @@ public class ZyStyleAccessories implements Serializable {
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**款式id*/
@Excel(name = "款式id", width = 15)
@Excel(name = "服装款式id", width = 15)
@ApiModelProperty(value = "款式id")
@Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id")
private java.lang.String styleId;
@ -64,4 +65,10 @@ public class ZyStyleAccessories implements Serializable {
@ApiModelProperty(value = "面料id")
@Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id")
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
public String sort(String id) {
String nums = zyClothsStyleMapper.sort(id);
System.out.println(nums + " nums");
// System.out.println(nums + " nums");
String format = String.format("%08d", orderNumber());
System.err.println(format + " format");
// System.err.println(format + " format");
return nums + format;
}
private Long orderNumber() {
List<String> numsList = zyClothsStyleMapper.selectNumsList();
System.out.println(numsList);
System.out.println(numsList.size());
// System.out.println(numsList);
// System.out.println(numsList.size());
List<Long> list = new ArrayList<>();
for (String nums : numsList) {
@ -86,8 +86,8 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
list.add(Long.valueOf(newNums));
}
System.out.println(list);
System.out.println(list.size());
// System.out.println(list);
// System.out.println(list.size());
return Collections.max(list) + 1;
}
}

@ -3,8 +3,10 @@ package org.jeecg.modules.zystylefabric.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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.zystylefabric.entity.NewZyStyleFabric;
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.IZyStyleFabricService;
import org.jeecg.common.system.base.controller.JeecgController;
@ -29,13 +32,13 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
/**
* @Description: 款式面料表
* @Author: jeecg-boot
* @Date: 2022-09-15
* @Version: V1.0
*/
@Api(tags="款式面料表")
@Api(tags = "款式面料表")
@RestController
@RequestMapping("/zystylefabric/zyStyleFabric")
@Slf4j
@ -49,6 +52,9 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
@Autowired
private IZyFabricService zyFabricService;
@Resource
private ZyStyleFabricMapper zyStyleFabricMapper;
/**
* 分页列表查询
*
@ -59,34 +65,39 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
* @return
*/
//@AutoLog(value = "款式面料表-分页列表查询")
@ApiOperation(value="款式面料表-分页列表查询", notes="款式面料表-分页列表查询")
@ApiOperation(value = "款式面料表-分页列表查询", notes = "款式面料表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<NewZyStyleFabric>> queryPageList(ZyStyleFabric zyStyleFabric,String id,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
public Result<IPage<NewZyStyleFabric>> queryPageList(ZyStyleFabric zyStyleFabric, String id,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyStyleFabric> queryWrapper = new QueryWrapper<>();
if(id!=null){
queryWrapper.eq("style_id",id);
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());
if (zyStyleFabric.getStyleId() != null || zyStyleFabric.getFabricId() != null) {
if (zyStyleFabric.getStyleId() != null) {
queryWrapper.eq("style_id", zyStyleFabric.getStyleId());
}
if(zyStyleFabric.getFabricId()!=null){
queryWrapper.eq("fabric_id",zyStyleFabric.getFabricId());
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);
for (ZyStyleFabric zyStyleF : list) {
System.out.println("****" + zyStyleF);
NewZyStyleFabric newZySF = new NewZyStyleFabric();
//编辑回显
newZySF.setId(zyStyleF.getId());
newZySF.setFabricId(zyStyleF.getFabricId());
newZySF.setStyleId(zyStyleF.getStyleId());
//拿到服装类型名称
String typeName = zyStyleFabricMapper.getTypeName(newZySF.getStyleId());
newZySF.setTypeName(typeName);
//款式编号和名称
String styleId = zyStyleF.getStyleId();
ZyClothsStyle styleById = zyClothsStyleService.getById(styleId);
@ -114,19 +125,19 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
* @return
*/
@AutoLog(value = "款式面料表-添加")
@ApiOperation(value="款式面料表-添加", notes="款式面料表-添加")
@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(",");
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("style_id",zyStyleFabric.getStyleId());
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("style_id", zyStyleFabric.getStyleId());
for (String s : split) {
zyStyleFabric.setFabricId(s);
zyStyleFabric.setId(null);
queryWrapper.eq("fabric_id",zyStyleFabric.getFabricId());
int a=zyStyleFabricService.count(queryWrapper);
if(a>=1)
queryWrapper.eq("fabric_id", zyStyleFabric.getFabricId());
int a = zyStyleFabricService.count(queryWrapper);
if (a >= 1)
return Result.error("存在以添加过的数据!!!");
zyStyleFabricService.save(zyStyleFabric);
}
@ -140,9 +151,9 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
* @return
*/
@AutoLog(value = "款式面料表-编辑")
@ApiOperation(value="款式面料表-编辑", notes="款式面料表-编辑")
@ApiOperation(value = "款式面料表-编辑", notes = "款式面料表-编辑")
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody ZyStyleFabric zyStyleFabric) {
zyStyleFabricService.updateById(zyStyleFabric);
return Result.OK("编辑成功!");
@ -155,10 +166,10 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
* @return
*/
@AutoLog(value = "款式面料表-通过id删除")
@ApiOperation(value="款式面料表-通过id删除", notes="款式面料表-通过id删除")
@ApiOperation(value = "款式面料表-通过id删除", notes = "款式面料表-通过id删除")
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_fabric:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
zyStyleFabricService.removeById(id);
return Result.OK("删除成功!");
}
@ -170,10 +181,10 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
* @return
*/
@AutoLog(value = "款式面料表-批量删除")
@ApiOperation(value="款式面料表-批量删除", notes="款式面料表-批量删除")
@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) {
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.zyStyleFabricService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@ -185,11 +196,11 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
* @return
*/
//@AutoLog(value = "款式面料表-通过id查询")
@ApiOperation(value="款式面料表-通过id查询", notes="款式面料表-通过id查询")
@ApiOperation(value = "款式面料表-通过id查询", notes = "款式面料表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
ZyStyleFabric zyStyleFabric = zyStyleFabricService.getById(id);
if(zyStyleFabric==null) {
if (zyStyleFabric == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyStyleFabric);

@ -1,6 +1,7 @@
package org.jeecg.modules.zystylefabric.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
@ -15,6 +16,11 @@ public class NewZyStyleFabric {
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**服装类型 名称*/
@ApiModelProperty(value = "服装类型 名称")
private java.lang.String typeName;
/**款式id*/
@Excel(name = "款式id", width = 15, dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id")
@ApiModelProperty(value = "款式id")
@ -24,8 +30,8 @@ public class NewZyStyleFabric {
@ApiModelProperty(value = "面料id")
private java.lang.String fabricId;
/**名称*/
@Excel(name = "名称", width = 15)
@ApiModelProperty(value = "名称")
@Excel(name = "面料 名称", width = 15)
@ApiModelProperty(value = "面料 名称")
private java.lang.String fabricName;
/**材料编号*/
@Excel(name = "材料编号", width = 15)
@ -36,8 +42,8 @@ public class NewZyStyleFabric {
@ApiModelProperty(value = "编号")
private String styleNums;
/**名称*/
@Excel(name = "名称", width = 15)
@ApiModelProperty(value = "名称")
@Excel(name = "服装款式 名称", width = 15)
@ApiModelProperty(value = "服装款式 名称")
private String styleNames;
/**创建日期*/
@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 com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric;
/**
@ -14,4 +15,10 @@ import org.jeecg.modules.zystylefabric.entity.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 org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric;
import org.jeecg.modules.zystylefabric.service.INewZyStyleFabricService;
import org.jeecg.modules.zystylefabric.service.IZyStyleFabricService;
import org.springframework.stereotype.Service;
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.mapper.ZyClothsStyleMapper;
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.ZyStyleModule;
import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService;
@ -50,8 +51,9 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
private IZyClothsModularService zyClothsModularService;
@Autowired
private IZyClothsStyleService zyClothsStyleService;
@Resource
private ZyClothsStyleMapper zyClothsStyleMapper;
private ZyStyleFabricMapper zyStyleFabricMapper;
/**
@ -109,12 +111,13 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
newSeMo.setCreateTime(zyStyleModule.getCreateTime());
//服装类型 服装类型的id 不知道什么情况 传的是zy_cloths_style中的type_id
String typeId = zyStyleModule.getTypeId();
System.out.println(typeId);
String typeNameByTypeId = zyClothsStyleMapper.getTypeNameByTypeId(typeId);
System.err.println(typeNameByTypeId);
if (typeNameByTypeId != null){
newSeMo.setTypeName(typeNameByTypeId);
//String styleId1 = zyStyleModule.getStyleId();
String typeName = zyStyleFabricMapper.getTypeName(zyStyleModule.getStyleId());
//System.out.println(typeId);
//String typeNameByTypeId = zyClothsStyleMapper.getTypeNameByTypeId(typeId);
//System.err.println(typeNameByTypeId);
if (typeName != null){
newSeMo.setTypeName(typeName);
} else {
newSeMo.setTypeName("typeName为空");
}

Loading…
Cancel
Save