制衣模块相关问题

zhc4dev
赵玉瑞 2 years ago
parent a0bc5dcac6
commit 51e8bf0863
  1. 139
      ant-design-vue-jeecg/src/views/process/ZyProcessComponentList.vue
  2. 6
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue
  3. 18
      ant-design-vue-jeecg/src/views/zyProcessModular/ZyProcessModularList.vue
  4. 6
      ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue
  5. 12
      ant-design-vue-jeecg/src/views/zystylemodular/ZyStyleModularList.vue
  6. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularCompentController.java
  7. 7
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  8. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
  9. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsTypeMapper.xml
  10. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java
  11. 10
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java
  12. 69
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
  13. 54
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java
  14. 43
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java
  15. 63
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java
  16. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/controller/ZyStyleModelController.java
  17. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModelDetailsVo.java
  18. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/IZyStyleModelService.java
  19. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/impl/ZyStyleModelServiceImpl.java
  20. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java
  21. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/entity/ZyStyleModuleDetailVo.java
  22. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/ZyStyleModuleMapper.java
  23. 12
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/xml/ZyStyleModuleMapper.xml
  24. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/IZyStyleModuleService.java
  25. 24
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/impl/ZyStyleModuleServiceImpl.java

@ -1,5 +1,5 @@
<template> <template>
<!-- <a-card :bordered="false">--> <!-- <a-card :bordered="false">-->
<a-modal <a-modal
width="70%" width="70%"
title="" title=""
@ -22,8 +22,9 @@
</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 v-model="queryParam.processId" dictCode="zy_process,process_name,id" placeholder="请选择工序" /> <j-dict-select-tag v-model="queryParam.processId" dictCode="zy_process,process_name,id"
placeholder="请选择工序"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -41,24 +42,30 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd1(componentId1)" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd1(componentId1)" type="primary" icon="plus">新增</a-button>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('zy_process_component')">导出</a-button>--> <!-- <a-button type="primary" icon="download" @click="handleExportXls('zy_process_component')">导出</a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>--> <!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>--> <!-- </a-upload>-->
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> <a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu> </a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> <a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown> </a-dropdown>
</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>
@ -81,7 +88,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>
@ -98,9 +106,9 @@
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)">编辑</a>--> <!-- <a @click="handleEdit(record)">编辑</a>-->
<!-- <a-divider type="vertical" />-->
<!-- <a-divider type="vertical" />--> <!-- <a @click="handleDetail(record.id)">详情</a>-->
<a @click="handleDetail(record.id)">详情</a> <a @click="openDetail(record.processId)">详情</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
@ -110,60 +118,64 @@
</a-table> </a-table>
</div> </div>
<zy-process-component-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-process-component-modal> <zy-process-component-modal @valueChange="valueChange" ref="modalForm"
@ok="modalFormOk"></zy-process-component-modal>
<ZyProcessComponentFormDetail ref="ZyProcessComponentFormDetail"></ZyProcessComponentFormDetail> <ZyProcessComponentFormDetail ref="ZyProcessComponentFormDetail"></ZyProcessComponentFormDetail>
<ZyProcessDetail ref="zyProcessDetail"></ZyProcessDetail>
</a-modal> </a-modal>
</template> </template>
<script> <script>
import '@/assets/less/TableExpand.less' import ZyProcessDetail from '@views/process/modules/ZyProcessDetail'
import { mixinDevice } from '@/utils/mixin' import '@/assets/less/TableExpand.less'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import {mixinDevice} from '@/utils/mixin'
import ZyProcessComponentModal from './modules/ZyProcessComponentModal' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyProcessComponentFormDetail from './modules/ZyProcessComponentFormDetail' import ZyProcessComponentModal from './modules/ZyProcessComponentModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import ZyProcessComponentFormDetail from './modules/ZyProcessComponentFormDetail'
import {filterObj} from "@/utils/util"; import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import {getAction} from "@api/manage"; import {filterObj} from "@/utils/util";
import {getAction} from "@api/manage";
export default { export default {
name: 'ZyProcessComponentList', name: 'ZyProcessComponentList',
mixins:[JeecgListMixin, mixinDevice], mixins: [JeecgListMixin, mixinDevice],
components: { components: {
ZyProcessDetail,
ZyProcessComponentModal, ZyProcessComponentModal,
ZyProcessComponentFormDetail ZyProcessComponentFormDetail
}, },
data () { data() {
return { return {
description: 'zy_process_component管理页面', description: 'zy_process_component管理页面',
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
componentId1:'', componentId1: '',
// //
columns: [ columns: [
{ {
title: '#', title: '#',
dataIndex: '', dataIndex: '',
key:'rowIndex', key: 'rowIndex',
width:60, width: 60,
align:"center", align: "center",
customRender:function (t,r,index) { customRender: function (t, r, index) {
return parseInt(index)+1; return parseInt(index) + 1;
} }
}, },
{ {
title:'部件名称', title: '部件名称',
align:"center", align: "center",
dataIndex: 'componentId_dictText' dataIndex: 'componentId_dictText'
}, },
{ {
title:'工序代码', title: '工序代码',
align:"center", align: "center",
dataIndex: 'processCode' dataIndex: 'processCode'
}, },
{ {
title:'工序', title: '工序',
align:"center", align: "center",
dataIndex: 'processId_dictText' dataIndex: 'processId_dictText'
}, },
// { // {
@ -172,17 +184,17 @@
// dataIndex: 'bottleneck_dictText' // dataIndex: 'bottleneck_dictText'
// }, // },
{ {
title:'创建时间', title: '创建时间',
align:"center", align: "center",
dataIndex: 'createTime' dataIndex: 'createTime'
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
align:"center", align: "center",
fixed:"right", fixed: "right",
width:147, width: 147,
scopedSlots: { customRender: 'action' } scopedSlots: {customRender: 'action'}
} }
], ],
url: { url: {
@ -196,15 +208,15 @@
// //
loadRouteType: false, loadRouteType: false,
biaoTi: '', biaoTi: '',
dictOptions:{}, dictOptions: {},
superFieldList:[], superFieldList: [],
} }
}, },
created() { created() {
this.getSuperFieldList(); this.getSuperFieldList();
}, },
computed: { computed: {
importExcelUrl: function(){ importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}, },
}, },
@ -287,22 +299,31 @@
console.log('Clicked cancel button'); console.log('Clicked cancel button');
this.visible = false; this.visible = false;
}, },
initDictConfig(){ initDictConfig() {
}, },
getSuperFieldList(){ getSuperFieldList() {
let fieldList=[]; let fieldList = [];
fieldList.push({type:'string',value:'componentId',text:'部件',dictCode:'zy_cloths_component,parts_name,nums'}) fieldList.push({
fieldList.push({type:'string',value:'processId',text:'工艺',dictCode:'zy_process,process_name,id'}) type: 'string',
value: 'componentId',
text: '部件',
dictCode: 'zy_cloths_component,parts_name,nums'
})
fieldList.push({type: 'string', value: 'processId', text: '工艺', dictCode: 'zy_process,process_name,id'})
this.superFieldList = fieldList this.superFieldList = fieldList
}, },
handleDetail(id){ // handleDetail(id) {
//id = this.model.id; // //id = this.model.id;
console.log("this。model.id +++++"+id); // console.log("thismodel.id +++++" + id);
this.$refs.ZyProcessComponentFormDetail.showModal(id); // this.$refs.ZyProcessComponentFormDetail.showModal(id);
} // }
openDetail(id) {
this.$refs.zyProcessDetail.showModal(id)
// this.$children[0].showModal(id)
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>

@ -78,9 +78,9 @@ export default {
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
// nums: [ nums: [
// { required: true, message: '!'}, {required: true, message: '请输入编号!'},
// ], ],
typeName: [ typeName: [
{required: true, message: '请输入类型名称!'}, {required: true, message: '请输入类型名称!'},
{pattern: /^[0-9A-Za-z\u4e00-\u9fa5.,;,。;、!()?]{0,50}$/, message: '文本长度过长'}, {pattern: /^[0-9A-Za-z\u4e00-\u9fa5.,;,。;、!()?]{0,50}$/, message: '文本长度过长'},

@ -110,12 +110,11 @@
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <!-- <a @click="handleEdit(record)">编辑</a>-->
<!-- <a-divider type="vertical"/>-->
<a-divider type="vertical"/> <a @click="openDetail(record.id)">详情</a>
<a @click="handleDetail(record)">详情</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.processId)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</span> </span>
@ -124,11 +123,13 @@
</div> </div>
<zy-process-modular-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-process-modular-modal> <zy-process-modular-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-process-modular-modal>
<ZyProcessDetail ref="zyProcessDetail"></ZyProcessDetail>
</a-modal> </a-modal>
</template> </template>
<script> <script>
import ZyProcessDetail from '@views/process/modules/ZyProcessDetail'
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'
@ -140,7 +141,8 @@ export default {
name: 'ZyProcessModularList', name: 'ZyProcessModularList',
mixins: [JeecgListMixin, mixinDevice], mixins: [JeecgListMixin, mixinDevice],
components: { components: {
ZyProcessModularModal ZyProcessModularModal,
ZyProcessDetail,
}, },
data() { data() {
return { return {
@ -307,6 +309,10 @@ export default {
fieldList.push({type: 'string', value: 'modularId', text: '模块ID', dictCode: ''}) fieldList.push({type: 'string', value: 'modularId', text: '模块ID', dictCode: ''})
fieldList.push({type: 'string', value: 'processId', text: '工序ID', dictCode: ''}) fieldList.push({type: 'string', value: 'processId', text: '工序ID', dictCode: ''})
this.superFieldList = fieldList this.superFieldList = fieldList
},
openDetail(id) {
this.$refs.zyProcessDetail.showModal(id)
// this.$children[0].showModal(id)
} }
} }
} }

@ -366,9 +366,9 @@ export default {
// typeId: [ // typeId: [
// {required: true, message: '!'}, // {required: true, message: '!'},
// ], // ],
// nums: [ nums: [
// { required: true, message: '!'}, { required: true, message: '请输入编号!'},
// ], ],
styleNames: [ styleNames: [
{required: true, message: '请输入款式名称!'}, {required: true, message: '请输入款式名称!'},
], ],

@ -106,7 +106,8 @@
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="viewDetail(record.id)">详情</a> <!-- <a @click="viewDetail(record.id)">详情</a>-->
<a @click="openDetail(record.processId)">详情</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
@ -118,11 +119,13 @@
<zy-style-modular-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-style-modular-modal> <zy-style-modular-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-style-modular-modal>
<ZyStyleModularListDetails ref="ZyStyleModularListDetails"></ZyStyleModularListDetails> <ZyStyleModularListDetails ref="ZyStyleModularListDetails"></ZyStyleModularListDetails>
<ZyProcessDetail ref="zyProcessDetail"></ZyProcessDetail>
</a-card> </a-card>
</template> </template>
<script> <script>
import ZyProcessDetail from '@views/process/modules/ZyProcessDetail'
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'
@ -135,6 +138,7 @@ export default {
name: 'ZyStyleModularList', name: 'ZyStyleModularList',
mixins: [JeecgListMixin, mixinDevice], mixins: [JeecgListMixin, mixinDevice],
components: { components: {
ZyProcessDetail,
ZyStyleModularListDetails, ZyStyleModularListDetails,
ZyStyleModularModal ZyStyleModularModal
}, },
@ -164,7 +168,7 @@ export default {
{ {
title:'工序代码', title:'工序代码',
align:"center", align:"center",
dataIndex: 'processCode' dataIndex: 'processCode'//
}, },
{ {
title: '工序', title: '工序',
@ -285,6 +289,10 @@ export default {
fieldList.push({type: 'string', value: 'styleId', text: '款式id', dictCode: ''}) fieldList.push({type: 'string', value: 'styleId', text: '款式id', dictCode: ''})
fieldList.push({type: 'string', value: 'processId', text: '工序id', dictCode: ''}) fieldList.push({type: 'string', value: 'processId', text: '工序id', dictCode: ''})
this.superFieldList = fieldList this.superFieldList = fieldList
},
openDetail(id) {
this.$refs.zyProcessDetail.showModal(id)
// this.$children[0].showModal(id)
} }
} }
} }

@ -71,8 +71,6 @@ public class ZyClothsModularCompentController extends JeecgController<ZyClothsMo
//queryWrapper.eq("modular_id", modularId); //queryWrapper.eq("modular_id", modularId);
Page<ZyClothsModularCompent> page = new Page<ZyClothsModularCompent>(pageNo, pageSize); Page<ZyClothsModularCompent> page = new Page<ZyClothsModularCompent>(pageNo, pageSize);
IPage<ZyClothsModularCompent> pageList = zyClothsModularCompentService.page(page, queryWrapper); IPage<ZyClothsModularCompent> pageList = zyClothsModularCompentService.page(page, queryWrapper);
//List<ZyClothsModularCompent> recordList = zyClothsModularCompentMapper.queryList(modularId);
//pageList.setRecords(recordList);
List<ZyClothsModularCompent> records = pageList.getRecords(); List<ZyClothsModularCompent> records = pageList.getRecords();
//Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?"); //Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?");
//只要数字 如果是纯数字 就把它替换了 //只要数字 如果是纯数字 就把它替换了

@ -18,7 +18,6 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
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 java.util.Arrays; import java.util.Arrays;
@ -57,8 +56,6 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
//zyClothsTypeService.chuliBianHaoWenti();
//System.err.println(zyClothsType);
QueryWrapper<ZyClothsType> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap()); QueryWrapper<ZyClothsType> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap());
Page<ZyClothsType> page = new Page<ZyClothsType>(pageNo, pageSize); Page<ZyClothsType> page = new Page<ZyClothsType>(pageNo, pageSize);
IPage<ZyClothsType> pageList = zyClothsTypeService.page(page, queryWrapper); IPage<ZyClothsType> pageList = zyClothsTypeService.page(page, queryWrapper);
@ -118,9 +115,6 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
/** /**
* 编辑 * 编辑
*
* @param zyClothsType
* @return
*/ */
@AutoLog(value = "zy_cloths_type-编辑") @AutoLog(value = "zy_cloths_type-编辑")
@ApiOperation(value = "zy_cloths_type-编辑", notes = "zy_cloths_type-编辑") @ApiOperation(value = "zy_cloths_type-编辑", notes = "zy_cloths_type-编辑")
@ -203,6 +197,7 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
if (StringUtils.isEmpty(enterpriseId)) { if (StringUtils.isEmpty(enterpriseId)) {
return Result.error("请先选择一个企业"); return Result.error("请先选择一个企业");
} }
//nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)
String a = zyClothsTypeService.sort(enterpriseId); String a = zyClothsTypeService.sort(enterpriseId);
if (a == null) { if (a == null) {
return Result.OK("0"); return Result.OK("0");

@ -16,8 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@Mapper @Mapper
public interface ZyClothsTypeMapper extends BaseMapper<ZyClothsType> { public interface ZyClothsTypeMapper extends BaseMapper<ZyClothsType> {
List<String> selectNumsList();
List<String> listByTypeId(String typeId); List<String> listByTypeId(String typeId);
@Select("select nums from zy_cloths_type where nums like 'QIYE%' order by nums desc limit 0,1 ") @Select("select nums from zy_cloths_type where nums like 'QIYE%' order by nums desc limit 0,1 ")

@ -5,10 +5,6 @@
UPDATE `zy_cloths_type` SET enterprise_id= #{id} UPDATE `zy_cloths_type` SET enterprise_id= #{id}
</update> </update>
<select id="selectNumsList" resultType="java.lang.String">
SELECT nums
FROM zy_cloths_type
</select>
<select id="listByTypeId" resultType="java.lang.String"> <select id="listByTypeId" resultType="java.lang.String">
SELECT type_name SELECT type_name
FROM zy_cloths_type FROM zy_cloths_type

@ -21,7 +21,7 @@ public interface IZyClothsComponentService extends IService<ZyClothsComponent> {
public List<ZyClothsComponent> selectByModular(String modular_id); public List<ZyClothsComponent> selectByModular(String modular_id);
/**编码规则:服装类型(10)+序号(8)*/ /**编码规则:服装类型(10)+序号(8)*/
String generateNumber(ZyClothsComponent zyClothsComponent); //String generateNumber(ZyClothsComponent zyClothsComponent);
ZyClothsComponentDetail queryDetail(String id); ZyClothsComponentDetail queryDetail(String id);

@ -23,13 +23,11 @@ public interface IZyClothsTypeService extends IService<ZyClothsType> {
Long orderNumber(); Long orderNumber();
/** /**
* 拿到集合中的最大值 * 拿到集合中的最大值 digits: 位数
* @param listString 传进来一个String类型的集合 * @param stringList 传进来一个String类型的集合
* @param i 返回数字的位数 例如一般6位或8位 * @param digits 返回数字的位数 例如一般6位或8位
* @return 返回一个long类型的i位数最大值 * @return 返回一个long类型的i位数最大值
*/ */
Long getListMax(List<String> listString, int i); Long getListMax(List<String> stringList, int digits);
} }

@ -9,6 +9,7 @@ import org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper;
import org.jeecg.modules.demo.base.mapper.ZyClothsModularMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsModularMapper;
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper;
import org.jeecg.modules.demo.base.service.IZyClothsComponentService; import org.jeecg.modules.demo.base.service.IZyClothsComponentService;
import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
import org.jeecg.modules.demo.pro.entity.ZyProcessComponent; import org.jeecg.modules.demo.pro.entity.ZyProcessComponent;
import org.jeecg.modules.demo.pro.service.IZyProcessComponentService; import org.jeecg.modules.demo.pro.service.IZyProcessComponentService;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -21,6 +22,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* @Description: zy_cloths_component * @Description: zy_cloths_component
@ -33,6 +35,8 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentM
@Autowired @Autowired
private IZyProcessComponentService zyProcessComponentService; private IZyProcessComponentService zyProcessComponentService;
@Autowired
private IZyClothsTypeService zyClothsTypeService;
@Resource @Resource
private ZyClothsComponentMapper zyClothsComponentMapper; private ZyClothsComponentMapper zyClothsComponentMapper;
@ -57,15 +61,15 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentM
/** /**
* 编码规则服装类型10+序号8 * 编码规则服装类型10+序号8
*/ */
@Override // @Override
public String generateNumber(ZyClothsComponent zyClothsComponent) { // public String generateNumber(ZyClothsComponent zyClothsComponent) {
String nums = zyClothsComponent.getClothsTypeId(); // String nums = zyClothsComponent.getClothsTypeId();
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums); // ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums(); // String nums1 = zyClothsType.getNums();
//String substring = nums.substring(nums.length() - 10); // //String substring = nums.substring(nums.length() - 10);
String format = String.format("%08d", orderNumber()); // String format = String.format("%08d", orderNumber());
return nums1 + format; // return nums1 + format;
} // }
@Override @Override
public ZyClothsComponentDetail queryDetail(String id) { public ZyClothsComponentDetail queryDetail(String id) {
@ -81,10 +85,15 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentM
return detail; return detail;
} }
/**
* 编码规则服装类型10+序号8
*/
@Override @Override
public String sort(String id) { public String sort(String id) {
String nums = zyClothsTypeMapper.selectNumOne(id); String nums = zyClothsTypeMapper.selectNumOne(id);
String format = String.format("%08d", orderNumber()); List<ZyClothsComponent> components = this.list();
List<String> collect = components.stream().map(ZyClothsComponent::getNums).collect(Collectors.toList());
String format = String.format("%08d", zyClothsTypeService.getListMax(collect, 8));
return nums + format; return nums + format;
} }
@ -125,24 +134,24 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentM
} }
public Long orderNumber() { // public Long orderNumber() {
List<String> listString = zyClothsComponentMapper.selectNumsList2(); // List<String> listString = zyClothsComponentMapper.selectNumsList2();
//System.err.println(listString); // //System.err.println(listString);
List<Long> listLong = new ArrayList<>(); // List<Long> listLong = new ArrayList<>();
for (String nums : listString) { // for (String nums : listString) {
String REGEX = "[^0-9]"; // String REGEX = "[^0-9]";
String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim(); // String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
if (!StringUtils.hasText(newNums)) { // if (!StringUtils.hasText(newNums)) {
newNums = "0"; // newNums = "0";
} // }
if (newNums.length() > 8) { // if (newNums.length() > 8) {
String substring = nums.substring(nums.length() - 8); // String substring = nums.substring(nums.length() - 8);
listLong.add(Long.valueOf(substring)); // listLong.add(Long.valueOf(substring));
} else { // } else {
listLong.add(Long.valueOf(newNums)); // listLong.add(Long.valueOf(newNums));
} // }
} // }
//System.out.println(listLong); // //System.out.println(listLong);
return Collections.max(listLong) + 1; // return Collections.max(listLong) + 1;
} // }
} }

@ -9,6 +9,8 @@ import org.jeecg.modules.demo.base.mapper.ZyClothsModularMapper;
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper;
import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService; import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService;
import org.jeecg.modules.demo.base.service.IZyClothsModularService; import org.jeecg.modules.demo.base.service.IZyClothsModularService;
import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -20,6 +22,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* @Description: zy_cloths_modular * @Description: zy_cloths_modular
@ -32,6 +35,8 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
@Autowired @Autowired
private IZyClothsModularCompentService zyClothsModularComponentService; private IZyClothsModularCompentService zyClothsModularComponentService;
@Autowired
private IZyClothsTypeService zyClothsTypeService;
@Resource @Resource
private ZyClothsModularMapper zyClothsModularMapper; private ZyClothsModularMapper zyClothsModularMapper;
@ -50,7 +55,9 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
public String generateNumber(String id) { public String generateNumber(String id) {
String numOne = zyClothsTypeMapper.selectNumOne(id); String numOne = zyClothsTypeMapper.selectNumOne(id);
// String substring = nums.substring(nums.length() - 10); // String substring = nums.substring(nums.length() - 10);
String format = String.format("%08d", orderNumber()); List<ZyClothsModular> zyClothsModularList = this.list();
List<String> collect = zyClothsModularList.stream().map(ZyClothsModular::getNums).collect(Collectors.toList());
String format = String.format("%08d", zyClothsTypeService.getListMax(collect, 8));
return numOne + format; return numOne + format;
} }
@ -97,6 +104,7 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
return zyProcessModularVos; return zyProcessModularVos;
} }
@NotNull
private ZyClothsModular detail(String id) { private ZyClothsModular detail(String id) {
ZyClothsModular zyClothsModular = zyClothsModularMapper.selectById(id); ZyClothsModular zyClothsModular = zyClothsModularMapper.selectById(id);
//翻译服装类型名称 和企业 //翻译服装类型名称 和企业
@ -117,30 +125,30 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
}else { }else {
zyClothsModular.setEnterpriseId("null"); zyClothsModular.setEnterpriseId("null");
} }
System.out.println("zyClothsModular 服装款式详情"+zyClothsModular); //System.out.println("zyClothsModular 服装款式详情"+zyClothsModular);
return zyClothsModular; return zyClothsModular;
} }
private Long orderNumber() { // private Long orderNumber() {
List<String> listString = zyClothsModularMapper.selectNumsList1(); // List<String> listString = zyClothsModularMapper.selectNumsList1();
List<Long> listLong = new ArrayList<>(); // List<Long> listLong = new ArrayList<>();
for (String nums : listString) { // for (String nums : listString) {
String REGEX = "[^0-9]"; // String REGEX = "[^0-9]";
String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim(); // String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
if (newNums.length() > 8) { // if (newNums.length() > 8) {
String substring = nums.substring(nums.length() - 8); // String substring = nums.substring(nums.length() - 8);
listLong.add(Long.valueOf(substring)); // listLong.add(Long.valueOf(substring));
continue; // continue;
} // }
if (StringUtils.isEmpty(newNums)) { // if (StringUtils.isEmpty(newNums)) {
newNums = "0"; // newNums = "0";
} // }
listLong.add(Long.valueOf(newNums)); // listLong.add(Long.valueOf(newNums));
//
} // }
//System.out.println(listLong); // //System.out.println(listLong);
return Collections.max(listLong) + 1; // return Collections.max(listLong) + 1;
//
} // }
} }

@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* @Description: zy_cloths_type * @Description: zy_cloths_type
@ -30,6 +31,7 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
/** /**
* 顺序号 * 顺序号
* nums编号非空不重复企业缩写4+顺序号6
*/ */
@Override @Override
public String sort(String enterpriseId) { public String sort(String enterpriseId) {
@ -78,32 +80,37 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
@Override @Override
public Long orderNumber() { public Long orderNumber() {
List<String> listString = zyClothsTypeMapper.selectNumsList(); //List<String> listString = zyClothsTypeMapper.selectNumsList();
return this.getListMax(listString,6); List<ZyClothsType> zyClothsTypeList = this.list();
List<String> stringList = zyClothsTypeList.stream().map(ZyClothsType::getNums).collect(Collectors.toList());
return this.getListMax(stringList,6);
} }
/**
* 拿到集合中的最大值 digits: 位数
* @param stringList 传进来一个String类型的集合
* @param digits 返回数字的位数 例如一般6位或8位
* @return 返回一个long类型的digits位数最大值
*/
@Override @Override
public Long getListMax(@NotNull List<String> listString, int i) { public Long getListMax(@NotNull List<String> stringList, int digits) {
List<Long> listLong = new ArrayList<>(); List<Long> longList = new ArrayList<>();
for (String nums : listString) {
String REGEX = "[^0-9]"; String REGEX = "[^0-9]";
//只要数字 for (String nums : stringList) {
//只要数字.trim()去空格
String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim(); String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
if (StringUtils.isEmpty(newNums)) { if (StringUtils.isEmpty(newNums)) continue;
continue; if (newNums.length() <= digits) longList.add(Long.valueOf(newNums));
} else {
if (newNums.length() > i) { //拿到后6位 substring(4) 截掉前4位
//拿到后6位 String substring = newNums.substring(newNums.length() - digits);
String substring = newNums.substring(newNums.length() - i); longList.add(Long.valueOf(substring));
listLong.add(Long.valueOf(substring));
} else {
listLong.add(Long.valueOf(newNums));
} }
} }
long max = Collections.max(listLong) + 1; long max = Collections.max(longList) + 1;
if (Long.toString(max).length() > i) { if (Long.toString(max).length() > digits) {
String toString = Long.toString(max); String toString = Long.toString(max);
String substring = toString.substring(toString.length() - i); String substring = toString.substring(toString.length() - digits);
return Long.valueOf(substring); return Long.valueOf(substring);
} }
return max; return max;

@ -23,9 +23,8 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.stream.Collectors;
/** /**
* @Description: 服装款式表 * @Description: 服装款式表
@ -58,27 +57,27 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
*/ */
@Override @Override
public AllClothStyle queryDetail(String id) { public AllClothStyle queryDetail(String id) {
AllClothStyle zyAllClothStyle = new AllClothStyle(); AllClothStyle zyAll = new AllClothStyle();
//服装款式详情 //服装款式详情
List<ZyClothsStyle> zyClothsStyles = detail(id); List<ZyClothsStyle> zyClothsStyles = detail(id);
zyAllClothStyle.setZyClothsStyles(zyClothsStyles); zyAll.setZyClothsStyles(zyClothsStyles);
//服装 款式 模块详情 //服装 款式 模块详情
List<NewStyleModule> zyStyleModuleList = zyStyleModuleService.detail(id); List<NewStyleModule> zyStyleModuleList = zyStyleModuleService.detail(id);
zyAllClothStyle.setZyStyleModuleList(zyStyleModuleList); zyAll.setZyStyleModuleList(zyStyleModuleList);
//服装 面料详情 //服装 面料详情
List<NewZyStyleFabric> zyStyleFabricList = zyStyleFabricService.detail(id); List<NewZyStyleFabric> zyStyleFabricList = zyStyleFabricService.detail(id);
zyAllClothStyle.setZyStyleFabricList(zyStyleFabricList); zyAll.setZyStyleFabricList(zyStyleFabricList);
//服装 辅料详情 //服装 辅料详情
List<ZyStyleAccessories> zyStyleAccessoriesList = zyStyleAccessoriesService.detail(id); List<ZyStyleAccessories> zyStyleAccessoriesList = zyStyleAccessoriesService.detail(id);
zyAllClothStyle.setZyStyleAccessoriesList(zyStyleAccessoriesList); zyAll.setZyStyleAccessoriesList(zyStyleAccessoriesList);
//服装 款式型号 //服装 款式型号
List<ZyStyleModel> zyStyleModels = zyStyleModelService.detail(id); List<ZyStyleModel> zyStyleModels = zyStyleModelService.detail(id);
zyAllClothStyle.setZyStyleModels(zyStyleModels); zyAll.setZyStyleModels(zyStyleModels);
//服装 工序详情 //服装 工序详情
List<ZyStyleModular> zyStyleModularList = zyStyleModularService.detail(id); List<ZyStyleModular> zyStyleModularList = zyStyleModularService.detail(id);
zyAllClothStyle.setZyStyleModularList(zyStyleModularList); zyAll.setZyStyleModularList(zyStyleModularList);
return zyAllClothStyle; return zyAll;
} }
@Override @Override
@ -116,30 +115,32 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
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()); List<ZyClothsStyle> styleList = this.list();
List<String> collect = styleList.stream().map(ZyClothsStyle::getNums).collect(Collectors.toList());
String format = String.format("%08d", zyClothsTypeService.getListMax(collect, 8));
//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();
List<Long> list = new ArrayList<>(); // List<Long> list = new ArrayList<>();
//
for (String nums : numsList) { // for (String nums : numsList) {
String REGEX = "[^0-9]"; // String REGEX = "[^0-9]";
String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim(); // String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
if (newNums.length() > 8) { // if (newNums.length() > 8) {
String substring = newNums.substring(newNums.length() - 8); // String substring = newNums.substring(newNums.length() - 8);
list.add(Long.valueOf(substring)); // list.add(Long.valueOf(substring));
continue; // continue;
} // }
if (StringUtils.isEmpty(newNums)) { // if (StringUtils.isEmpty(newNums)) {
newNums = "0"; // newNums = "0";
} // }
list.add(Long.valueOf(newNums)); // list.add(Long.valueOf(newNums));
//
} // }
return Collections.max(list) + 1; // return Collections.max(list) + 1;
} // }
} }

@ -12,16 +12,14 @@ import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper; import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper;
import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; import org.jeecg.modules.zystylemodel.entity.ZyStyleModel;
import org.jeecg.modules.zystylemodel.entity.ZyStyleModelDetailsVO; import org.jeecg.modules.zystylemodel.entity.ZyStyleModelDetailsVo;
import org.jeecg.modules.zystylemodel.service.IZyStyleModelService; import org.jeecg.modules.zystylemodel.service.IZyStyleModelService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
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 java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -128,8 +126,8 @@ public class ZyStyleModelController extends JeecgController<ZyStyleModel, IZySty
@ApiOperation(value = "zy_style_model-详情", notes = "zy_style_model-详情") @ApiOperation(value = "zy_style_model-详情", notes = "zy_style_model-详情")
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
public Result<?> detail(@RequestParam(name = "id", required = true) String id) { public Result<?> detail(@RequestParam(name = "id", required = true) String id) {
ZyStyleModelDetailsVO detailVO = zyStyleModelService.queryDetails(id); ZyStyleModelDetailsVo detailVo = zyStyleModelService.queryDetails(id);
return Result.OK(detailVO); return Result.OK(detailVo);
} }
/** /**

@ -5,7 +5,7 @@ import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import java.util.List; import java.util.List;
@Data @Data
public class ZyStyleModelDetailsVO { public class ZyStyleModelDetailsVo {
/**服装款式*/ /**服装款式*/
private List<ZyClothsStyle> zyClothsStyles; private List<ZyClothsStyle> zyClothsStyles;
/**子模块 款式型号 */ /**子模块 款式型号 */

@ -3,7 +3,7 @@ package org.jeecg.modules.zystylemodel.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; import org.jeecg.modules.zystylemodel.entity.ZyStyleModel;
import org.jeecg.modules.zystylemodel.entity.ZyStyleModelDetailsVO; import org.jeecg.modules.zystylemodel.entity.ZyStyleModelDetailsVo;
import java.util.List; import java.util.List;
@ -17,7 +17,7 @@ public interface IZyStyleModelService extends IService<ZyStyleModel> {
List<ZyStyleModel> detail(String id); List<ZyStyleModel> detail(String id);
ZyStyleModelDetailsVO queryDetails(String id); ZyStyleModelDetailsVo queryDetails(String id);
boolean dataTypeProblem(ZyStyleModel zyStyleModel); boolean dataTypeProblem(ZyStyleModel zyStyleModel);
} }

@ -7,7 +7,7 @@ import org.jeecg.modules.zyclothsstyle.entity.vo.AllClothStyle;
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.zystylefabric.mapper.ZyStyleFabricMapper;
import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; import org.jeecg.modules.zystylemodel.entity.ZyStyleModel;
import org.jeecg.modules.zystylemodel.entity.ZyStyleModelDetailsVO; import org.jeecg.modules.zystylemodel.entity.ZyStyleModelDetailsVo;
import org.jeecg.modules.zystylemodel.mapper.ZyStyleModelMapper; import org.jeecg.modules.zystylemodel.mapper.ZyStyleModelMapper;
import org.jeecg.modules.zystylemodel.service.IZyStyleModelService; import org.jeecg.modules.zystylemodel.service.IZyStyleModelService;
import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.Contract;
@ -17,7 +17,6 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -107,19 +106,21 @@ public class ZyStyleModelServiceImpl extends ServiceImpl<ZyStyleModelMapper, ZyS
} }
@Override @Override
public ZyStyleModelDetailsVO queryDetails(String id) { public ZyStyleModelDetailsVo queryDetails(String id) {
ZyStyleModel model = getById(id); ZyStyleModel model = getById(id);
AllClothStyle detail = zyClothsStyleService.queryDetail(model.getStyleId()); AllClothStyle detail = zyClothsStyleService.queryDetail(model.getStyleId());
ZyStyleModelDetailsVO detailsVO = new ZyStyleModelDetailsVO(); ZyStyleModelDetailsVo detailsVo = new ZyStyleModelDetailsVo();
detailsVO.setZyClothsStyles(detail.getZyClothsStyles()); detailsVo.setZyClothsStyles(detail.getZyClothsStyles());
detailsVO.setZyStyleModels(detail.getZyStyleModels()); detailsVo.setZyStyleModels(detail.getZyStyleModels());
return detailsVO; return detailsVo;
} }
@Override @Override
public boolean dataTypeProblem(ZyStyleModel zyStyleModel) { public boolean dataTypeProblem(@NotNull ZyStyleModel zyStyleModel) {
// Pattern pattern = Pattern.compile("/[^\\d]/g"); // Pattern pattern = Pattern.compile("/[^\\d]/g");
Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?"); //Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?");
Pattern pattern = Pattern.compile("[0-9]+(\\.[0-9]+)?");
// /^\d+(\.{0,1}\d+){0,1}$/
//正则表达式判断是否是数字字符串(可判断正数,负数和小数) //正则表达式判断是否是数字字符串(可判断正数,负数和小数)
if (!ObjectUtils.isEmpty(zyStyleModel.getCollarLarge())){ if (!ObjectUtils.isEmpty(zyStyleModel.getCollarLarge())){
return pattern.matcher(zyStyleModel.getCollarLarge().toString()).matches(); return pattern.matcher(zyStyleModel.getCollarLarge().toString()).matches();

@ -4,12 +4,10 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Example;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
@ -19,17 +17,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.base.entity.ZyClothsModular; import org.jeecg.modules.demo.base.entity.ZyClothsModular;
import org.jeecg.modules.demo.base.entity.ZyClothsType;
import org.jeecg.modules.demo.base.service.IZyClothsModularService; import org.jeecg.modules.demo.base.service.IZyClothsModularService;
import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.entity.vo.AllClothStyle;
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.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.entity.ZyStyleModuleDetailVO; import org.jeecg.modules.zystylemodule.entity.ZyStyleModuleDetailVo;
import org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper; import org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper;
import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService; import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
@ -85,7 +78,6 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
//System.err.println("ZyStyleModule 款式模块表 传来的 " + id); //System.err.println("ZyStyleModule 款式模块表 传来的 " + id);
QueryWrapper<ZyStyleModule> queryWrapper = new QueryWrapper<>(); QueryWrapper<ZyStyleModule> queryWrapper = new QueryWrapper<>();
//从服装款式进去款式模块时 根据style_id进行筛选 所以一般都会有id即style_id //从服装款式进去款式模块时 根据style_id进行筛选 所以一般都会有id即style_id
queryWrapper.eq(StringUtils.hasText(id), "style_id", id); queryWrapper.eq(StringUtils.hasText(id), "style_id", id);
@ -106,8 +98,8 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
zyStyleModules.addAll(zyStyleModulesList); zyStyleModules.addAll(zyStyleModulesList);
} }
//将新查出来的集合在根据styleid 筛选一下 //将新查出来的集合在根据styleid 筛选一下
zyStyleModules = zyStyleModules.stream().filter(ZyStyleModule -> ZyStyleModule.getStyleId().equals(id)).collect(Collectors.toList()); List<ZyStyleModule> collect = zyStyleModules.stream().filter(ZyStyleModule -> ZyStyleModule.getStyleId().equals(id)).collect(Collectors.toList());
pageList.setRecords(zyStyleModules); pageList.setRecords(collect);
} }
//List<ZyStyleModule> zyStyleModules = zyStyleModuleMapper.getListByStyleId(id); //List<ZyStyleModule> zyStyleModules = zyStyleModuleMapper.getListByStyleId(id);
//改变list中的实体类 类型 //改变list中的实体类 类型
@ -178,8 +170,8 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
public Result<?> detail(@RequestParam(name = "id", required = true) String id) { public Result<?> detail(@RequestParam(name = "id", required = true) String id) {
//System.out.println("款式模块表 /detail controller层接受到的id: : " + id); //System.out.println("款式模块表 /detail controller层接受到的id: : " + id);
ZyStyleModuleDetailVO detailVO = zyStyleModuleService.queryDetail(id); ZyStyleModuleDetailVo detailVo = zyStyleModuleService.queryDetail(id);
return Result.OK(detailVO); return Result.OK(detailVo);
} }
/** /**

@ -5,7 +5,7 @@ import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import java.util.List; import java.util.List;
@Data @Data
public class ZyStyleModuleDetailVO { public class ZyStyleModuleDetailVo {
/**服装款式*/ /**服装款式*/
private List<ZyClothsStyle> zyClothsStyles; private List<ZyClothsStyle> zyClothsStyles;
/**子模块 款式模块*/ /**子模块 款式模块*/

@ -19,7 +19,7 @@ import org.jeecg.modules.zystylemodule.entity.ZyStyleModule;
public interface ZyStyleModuleMapper extends BaseMapper<ZyStyleModule> { public interface ZyStyleModuleMapper extends BaseMapper<ZyStyleModule> {
/**根据服装款式的id style_id 查询所有*/ /**根据服装款式的id style_id 查询所有*/
List<ZyStyleModule> handWritingList(String id); //List<ZyStyleModule> handWritingList(String id);
@Select("SELECT * FROM zy_style_module WHERE style_id = #{id}") @Select("SELECT * FROM zy_style_module WHERE style_id = #{id}")
List<ZyStyleModule> getListByStyleId(String id); List<ZyStyleModule> getListByStyleId(String id);

@ -2,10 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper"> <mapper namespace="org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper">
<select id="handWritingList" resultType="org.jeecg.modules.zystylemodule.entity.ZyStyleModule" <!-- <select id="handWritingList" resultType="org.jeecg.modules.zystylemodule.entity.ZyStyleModule"-->
parameterType="string"> <!-- parameterType="string">-->
SELECT * <!-- SELECT *-->
FROM zy_style_module <!-- FROM zy_style_module-->
WHERE style_id = #{id} <!-- WHERE style_id = #{id}-->
</select> <!-- </select>-->
</mapper> </mapper>

@ -1,10 +1,9 @@
package org.jeecg.modules.zystylemodule.service; package org.jeecg.modules.zystylemodule.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
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.entity.ZyStyleModuleDetailVO; import org.jeecg.modules.zystylemodule.entity.ZyStyleModuleDetailVo;
import java.util.List; import java.util.List;
@ -24,5 +23,5 @@ public interface IZyStyleModuleService extends IService<ZyStyleModule> {
*/ */
List<NewStyleModule> changeList(List<ZyStyleModule> zyStyleModules); List<NewStyleModule> changeList(List<ZyStyleModule> zyStyleModules);
ZyStyleModuleDetailVO queryDetail(String id); ZyStyleModuleDetailVo queryDetail(String id);
} }

@ -1,15 +1,18 @@
package org.jeecg.modules.zystylemodule.service.impl; package org.jeecg.modules.zystylemodule.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.demo.base.entity.ZyClothsModular; import org.jeecg.modules.demo.base.entity.ZyClothsModular;
import org.jeecg.modules.demo.base.service.IZyClothsModularService; import org.jeecg.modules.demo.base.service.IZyClothsModularService;
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.entity.vo.AllClothStyle; import org.jeecg.modules.zyclothsstyle.entity.vo.AllClothStyle;
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.zystylefabric.mapper.ZyStyleFabricMapper;
import org.jeecg.modules.zystylemodel.entity.ZyStyleModelDetailsVo;
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.entity.ZyStyleModuleDetailVO;
import org.jeecg.modules.zystylemodule.entity.ZyStyleModuleDetailVo;
import org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper; import org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper;
import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService; import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -19,7 +22,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -40,13 +42,13 @@ public class ZyStyleModuleServiceImpl extends ServiceImpl<ZyStyleModuleMapper, Z
@Autowired @Autowired
private ZyStyleFabricMapper zyStyleFabricMapper; private ZyStyleFabricMapper zyStyleFabricMapper;
@Autowired
private ZyStyleModuleMapper zyStyleModuleMapper;
@Override @Override
public List<NewStyleModule> detail(String id) { public List<NewStyleModule> detail(String id) {
List<ZyStyleModule> list = zyStyleModuleMapper.handWritingList(id); //List<ZyStyleModule> list = zyStyleModuleMapper.handWritingList(id);
return changeList(list); List<ZyStyleModule> moduleList = this.list(new LambdaQueryWrapper<ZyStyleModule>().eq(ZyStyleModule::getStyleId, id));
return changeList(moduleList);
} }
@Override @Override
@ -86,14 +88,14 @@ public class ZyStyleModuleServiceImpl extends ServiceImpl<ZyStyleModuleMapper, Z
} }
@Override @Override
public ZyStyleModuleDetailVO queryDetail(String id) { public ZyStyleModuleDetailVo queryDetail(String id) {
ZyStyleModuleDetailVO detailVO = new ZyStyleModuleDetailVO(); ZyStyleModuleDetailVo detailVo = new ZyStyleModuleDetailVo();
ZyStyleModule zyStyleModule = getById(id); ZyStyleModule zyStyleModule = getById(id);
String styleId = zyStyleModule.getStyleId(); String styleId = zyStyleModule.getStyleId();
AllClothStyle allClothStyle = zyClothsStyleService.queryDetail(styleId); AllClothStyle allClothStyle = zyClothsStyleService.queryDetail(styleId);
detailVO.setZyClothsStyles(allClothStyle.getZyClothsStyles()); detailVo.setZyClothsStyles(allClothStyle.getZyClothsStyles());
detailVO.setZyStyleModuleList(allClothStyle.getZyStyleModuleList()); detailVo.setZyStyleModuleList(allClothStyle.getZyStyleModuleList());
return detailVO; return detailVo;
} }
} }

Loading…
Cancel
Save