制衣部件相关问题

zhc4dev
赵玉瑞 2 years ago
parent 9ddd168757
commit 53ac72043c
  1. 9
      ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
  2. 2
      ant-design-vue-jeecg/src/views/process/ZyClothsTypeList.vue
  3. 31
      ant-design-vue-jeecg/src/views/process/ZyProcessComponentList.vue
  4. 10
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
  5. 271
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue
  6. 67
      ant-design-vue-jeecg/src/views/process/modules/list/ZyClothsComponentList.vue
  7. 30
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java
  8. 22
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  9. 8
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyProcessMapper.java
  10. 20
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java
  11. 75
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java
  12. 129
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsComponentForm.vue
  13. 60
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsComponentModal.vue
  14. 84
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsComponentModal__Style#Drawer.vue
  15. 129
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsModularForm.vue
  16. 60
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsModularModal.vue
  17. 84
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsModularModal__Style#Drawer.vue
  18. 114
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsTypeForm.vue
  19. 60
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsTypeModal.vue
  20. 84
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsTypeModal__Style#Drawer.vue
  21. 14
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/controller/ZyProcessComponentController.java
  22. 9
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java
  23. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/controller/ZyProcessModularController.java

@ -4,6 +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-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-form-item label="部件名称">
<a-input placeholder="请输入部件名称" v-model="queryParam.partsName"></a-input>
@ -159,6 +165,7 @@ export default {
},
data() {
return {
//
description: 'zy_cloths_component管理页面',
//
columns: [
@ -173,7 +180,7 @@ export default {
}
},
{
title: '编号',
title: '部件编号',
align: "center",
dataIndex: 'nums'
},

@ -202,7 +202,7 @@
}
},
created() {
this.getSuperFieldList();
this.getSuperFieldList();
// this.loadParameter();
},
computed: {

@ -8,12 +8,19 @@
@ok="handleOk"
@cancel="handleCancel"
>
<p style="font-size: 25px;color:#333; padding-left: 40% ">{{biaoTi}} 模块工序管理</p>
<p style="font-size: 25px;color:#333; padding-left: 40% ">{{biaoTi}} 部件工序管理</p>
<!-- 查询区域 -->
<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 v-model="queryParam.processCode"
placeholder="请输入工序代码"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工序" >
<j-dict-select-tag v-model="queryParam.processId" dictCode="zy_process,process_name,id" placeholder="请选择工序" />
@ -90,27 +97,14 @@
</template>
<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-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<!-- <a-dropdown>-->
<!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item>-->
<!-- <a @click="handleDetail(record.id)">详情</a>-->
<!-- </a-menu-item>-->
<!-- <a-menu-item>-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </a-dropdown>-->
</span>
</a-table>
@ -162,6 +156,11 @@
align:"center",
dataIndex: 'componentId_dictText'
},
{
title:'工序代码',
align:"center",
dataIndex: 'processCode'
},
{
title:'工序',
align:"center",

@ -27,8 +27,8 @@
<a-row>
<a-col :span="478">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" disabled=""></a-input>
<a-form-model-item label="部件编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入部件编号" disabled=""></a-input>
</a-form-model-item>
</a-col>
</a-row>
@ -145,9 +145,9 @@ export default {
},
confirmLoading: false,
validatorRules: {
// nums: [
// { required: true, message: '!'},
// ],
nums: [
{required: true, message: '部件编号不能为空!'},
],
clothsTypeId: [
{required: true, message: '请选择服装类型!'},
],

@ -5,12 +5,12 @@
<a-row>
<a-col :span="24">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<j-select-depart v-model="model.enterpriseId" @change="bianHao" />
<j-select-depart v-model="model.enterpriseId" @change="bianHao"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" disabled ></a-input>
<a-input v-model="model.nums" placeholder="请输入编号" disabled></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -18,7 +18,7 @@
<j-tree-select v-model="model.typeId"
dict="zy_cloths_type,type_name,id"
pidField="type_id"
placeholder="请选择上级类型" >
placeholder="请选择上级类型">
</j-tree-select>
{{ typeId }}
</a-form-item>
@ -26,15 +26,15 @@
<a-col :span="24">
<a-form-model-item label="类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeName">
<a-input v-model="model.typeName" placeholder="请输入类型名称" ></a-input>
<a-input v-model="model.typeName" placeholder="请输入类型名称"></a-input>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>
&lt;!&ndash; <j-dict-select-tag v-model="model.enterpriseId" placeholder="请输入企业" dictCode="sc_competitioninf,compname,compid" ></j-dict-select-tag>&ndash;&gt;
</a-form-model-item>
</a-col>-->
<!-- <a-col :span="24">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>
&lt;!&ndash; <j-dict-select-tag v-model="model.enterpriseId" placeholder="请输入企业" dictCode="sc_competitioninf,compname,compid" ></j-dict-select-tag>&ndash;&gt;
</a-form-model-item>
</a-col>-->
</a-row>
</a-form-model>
@ -44,86 +44,85 @@
<script>
import { httpAction, getAction } from '@/api/manage';
import { validateDuplicateValue } from '@/utils/util';
import {Message} from "element-ui";
import JTreeSelect from '@/components/jeecg/JTreeSelect';
export default {
name: 'ZyClothsTypeForm',
components: {
JTreeSelect
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
nums:''
},
typeId:"",
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
// nums: [
// { required: true, message: '!'},
// ],
typeName: [
{ required: true, message: '请输入类型名称!'},
{ pattern: /^[0-9A-Za-z\u4e00-\u9fa5.,;,。;、!()?]{0,50}$/, message: '文本长度过长'},
],
enterpriseId: [
{ required: true, message: '请选择一个企业!'},
],
},
url: {
add: "/base/zyClothsType/add",
edit: "/base/zyClothsType/edit",
queryById: "/base/zyClothsType/queryById",
weiyi:"/base/zyClothsType/weiyi"
}
}
},
computed: {
formDisabled(){
return this.disabled
import {httpAction, getAction} from '@/api/manage';
import {validateDuplicateValue} from '@/utils/util';
import {Message} from "element-ui";
import JTreeSelect from '@/components/jeecg/JTreeSelect';
export default {
name: 'ZyClothsTypeForm',
components: {
JTreeSelect
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data() {
return {
model: {
nums: ''
},
typeId: "",
labelCol: {
xs: {span: 24},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {
// nums: [
// { required: true, message: '!'},
// ],
typeName: [
{required: true, message: '请输入类型名称!'},
{pattern: /^[0-9A-Za-z\u4e00-\u9fa5.,;,。;、!()?]{0,50}$/, message: '文本长度过长'},
],
enterpriseId: [
{required: true, message: '请选择一个企业!'},
],
},
url: {
add: "/base/zyClothsType/add",
edit: "/base/zyClothsType/edit",
queryById: "/base/zyClothsType/queryById",
weiyi: "/base/zyClothsType/weiyi",
//
enterpriseNum: "/zyclothsstyle/zyClothsStyle/enterpriseNum"
}
}
},
computed: {
formDisabled() {
return this.disabled
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
bianHao(){
// const {data: res} = await this.$axios.get('/jeecg-boot/base/zyClothsType/weiyi?id=' + this.model.enterpriseId)
// if (res.code !== 200) {
// this.$message({
// type: 'error',
// message: ''
// });
// }
// this.model.nums = res.result
// console.log('res.result')
// console.log(res.result)
//this.confirmLoading = false
// if (this.data.length === 0) {
// this.data.push(res.result)
// }
//console.log("List "+this.model.nums);
// var n=6
getAction(this.url.weiyi,{id: this.model.enterpriseId}).then((res)=>{
},
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
bianHao() {
if (this.model.id) {
getAction(this.url.enterpriseNum, {id: this.model.enterpriseId}).then((res) => {
if (res.code !== 200) {
this.$message({
type: 'error',
message: '未查询到数据!'
});
}
this.model.nums = res.result + this.model.nums.substring(4);
console.log('res.result ' + this.model.nums);
})
} else {
getAction(this.url.weiyi, {id: this.model.enterpriseId}).then((res) => {
if (res.code !== 200) {
this.$message({
type: 'error',
@ -131,61 +130,53 @@
});
}
let num = res.result;
console.log("res.result: "+num)
console.log("res.result: " + num)
//num=num.toString()
this.model.nums=res.result;
this.model.nums = res.result;
})
// getAction(this.url.weiyi,null).then((res)=>{
// let num = parseInt(res.result, 10) + 1;
// console.log(num)
// num=num.toString()
// while(num.length<n){
// num="0"+num
// }
// console.log(num)
// this.model.nums="QIYE"+num;
// })
},
add () {
this.edit(this.modelDefault);
},
getTreeFieldValue(){
return this.form.getFieldValue("demoTree")
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
},
add() {
this.edit(this.modelDefault);
},
getTreeFieldValue() {
return this.form.getFieldValue("demoTree")
},
edit(record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm() {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if (!this.model.id) {
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
})
},
}
}
</script>

@ -13,17 +13,6 @@
<!-- <div class="table-operator">-->
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('zy_cloths_component')">导出</a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
<!-- </a-menu>-->
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
<!-- </a-dropdown>-->
<!-- </div>-->
<!-- table区域-begin -->
@ -47,47 +36,14 @@
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</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;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<!-- <span slot="action2" slot-scope="text, record" >-->
<!-- <a @click="viewVid2(record)" >管理</a>-->
<!-- </span>-->
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)">编辑</a>-->
<!-- <a-divider type="vertical" />-->
<!-- <a @click="handleDetail(record)">详情</a>-->
<!-- <a-divider type="vertical" />-->
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- <zy-cloths-component-modal ref="modalForm" @ok="modalFormOk"></zy-cloths-component-modal>-->
<!-- <ZyProcessComponentList ref="ZyProcessComponentList"></ZyProcessComponentList>-->
<!-- <ZyClothsComponentListDetail ref="ZyClothsComponentListDetail"></ZyClothsComponentListDetail>-->
</a-card>
</template>
@ -99,13 +55,14 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil';
export default {
//
//
name: 'ZyClothsComponentList',
mixins:[JeecgListMixin, mixinDevice],
components: {},
data () {
return {
model:{
fuId: '',
clothsId: '',
},
description: 'zy_cloths_component管理页面',
@ -147,11 +104,6 @@ export default {
dataIndex: 'clothsTypeId_dictText'
},
// {
// title:'',
// align:"center",
// dataIndex: 'description'
// },
// {
// title:'',
// align:"center",
// dataIndex: 'pictureUrl',
@ -177,12 +129,6 @@ export default {
align:"center",
dataIndex: 'createTime'
},
// {
// title: '',
// dataIndex: 'action2',
// align:"center",
// scopedSlots: { customRender: 'action2' }
// },
{
title: '操作',
dataIndex: 'action',
@ -213,11 +159,6 @@ export default {
},
},
methods: {
// viewVid2(record){
// this.$refs.ZyProcessComponentList.showModal2();
// this.$refs.ZyProcessComponentList.edit2(record);
// this.$refs.ZyProcessComponentList.disableSubmit = false;
// },
onSelectChange1(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
@ -228,9 +169,9 @@ export default {
this.$emit('onChangeRowKey', ids)
},
add1(id) {
this.queryParam.fuId = id;
this.queryParam.modularId = id;
//this.queryParam.clothsId = this.model.id;
this.url.list = '/base/zyClothsComponent/listTwo';
//this.url.list = '/base/zyClothsComponent/listTwo';
this.loadData();
//this.model.fuId = id;
// this.loadData()

@ -67,24 +67,29 @@ public class ZyClothsComponentController extends JeecgController<ZyClothsCompone
}
/**
* 模块部件中的部件列表 分页查询
* 制衣模块中模块部件新增的时候 弹出的部件列表
* 弹出的数据 是根据制衣模块的模块类型 服装类型进行筛选
* 分页查询
*/
@AutoLog(value = "zy_cloths_component-分页列表查询")
@ApiOperation(value = "zy_cloths_component-分页列表查询", notes = "zy_cloths_component-分页列表查询")
@GetMapping(value = "/listTwo")
public Result<?> queryPageListTwo(ZyClothsComponent zyClothsComponent,
@RequestParam(name = "fuId", required = true) String fuId,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
//fuId为制衣模块 zy cloths Modular中的id
ZyClothsModular clothsModular = zyClothsModularService.getById(fuId);
QueryWrapper<ZyClothsComponent> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsComponent, req.getParameterMap());
queryWrapper.eq(StringUtils.hasText(clothsModular.getClothsTypeId()), "cloths_type_id", clothsModular.getClothsTypeId());
queryWrapper.eq(StringUtils.hasText(clothsModular.getModularType()), "modular_type",clothsModular.getModularType());
Page<ZyClothsComponent> page = new Page<>(pageNo, pageSize);
IPage<ZyClothsComponent> pageList = zyClothsComponentService.page(page, queryWrapper);
return Result.OK(pageList);
// modularId为制衣模块 zy cloths Modular中的id
if (StringUtils.hasText(zyClothsComponent.getModularId())){
//System.err.println("modularId为制衣模块 zy cloths Modular中的id: "+zyClothsComponent.getModularId());
ZyClothsModular clothsModular = zyClothsModularService.getById(zyClothsComponent.getModularId());
QueryWrapper<ZyClothsComponent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(StringUtils.hasText(clothsModular.getClothsTypeId()), "cloths_type_id", clothsModular.getClothsTypeId());
queryWrapper.eq(StringUtils.hasText(clothsModular.getModularType()), "modular_type",clothsModular.getModularType());
Page<ZyClothsComponent> page = new Page<>(pageNo, pageSize);
IPage<ZyClothsComponent> pageList = zyClothsComponentService.page(page, queryWrapper);
return Result.OK(pageList);
}
return Result.error("查询失败!制衣模块的id不能为空");
}
// @AutoLog(value = "zy_cloths_component-查询所有")
@ -133,12 +138,15 @@ public class ZyClothsComponentController extends JeecgController<ZyClothsCompone
if (StringUtils.isEmpty(zyClothsComponent.getClothsTypeId())) {
return Result.error("添加失败!服装类型不能为空");
}
if (StringUtils.isEmpty(zyClothsComponent.getNums())) {
return Result.error("添加失败!部件编号不能为空");
}
//部件名称不能重复
LambdaQueryWrapper<ZyClothsComponent> queryWrapper = new LambdaQueryWrapper<>();
List<ZyClothsComponent> zyClothsComponentList = zyClothsComponentService.list(queryWrapper);
for (ZyClothsComponent zy : zyClothsComponentList) {
if (zyClothsComponent.getPartsName().equals(zy.getPartsName())){
return Result.error("添加失败!数据已存在");
return Result.error("添加失败!部件名称已存在");
}
}
zyClothsComponentService.save(zyClothsComponent);

@ -65,7 +65,7 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
List<ZyClothsType> records = pageList.getRecords();
for (ZyClothsType zy : records) {
String typeId = zy.getTypeId();
if (StringUtils.isEmpty(typeId)){
if (StringUtils.isEmpty(typeId)) {
zy.setTypeId("1455487094925819901");
}
}
@ -82,6 +82,9 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
@ApiOperation(value = "zy_cloths_type-添加", notes = "zy_cloths_type-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsType zyClothsType) {
if (StringUtils.isEmpty(zyClothsType.getNums())) {
return Result.error("服装类型编号 不能为空");
}
//type_name,类型名称,varchar,50,非空,同类型下不重复
String typeName = zyClothsType.getTypeName();
if (!StringUtils.hasText(typeName)) {
@ -97,7 +100,7 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
List<String> zyClothsTypeList = zyClothsTypeMapper.listByTypeId(typeId);
zyClothsTypeList.add(zyClothsType.getTypeName());
HashSet<String> set = new HashSet<>(zyClothsTypeList);
if (set.size() != zyClothsTypeList.size()){
if (set.size() != zyClothsTypeList.size()) {
return Result.error("同类型下 类型名称不能重复");
}
}
@ -105,17 +108,10 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
zyClothsType.setTypeId(null);
}
//根据type_id拿到类型名称
if (StringUtils.hasText(zyClothsType.getTypeId())){
if (StringUtils.hasText(zyClothsType.getTypeId())) {
String nameByTypeId = zyClothsTypeMapper.getNameByTypeId(zyClothsType.getTypeId());
zyClothsType.setTypeIdName(nameByTypeId);
}
//生成编号 nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)在service层处理
//zyClothsType.setNums(zyClothsTypeService.generateNumber());
//将企业id转化成企业名称 否则在其它form里面的服装类型里面的企业查出来的为id
//@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
//String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(zyClothsType.getEnterpriseId());
//zyClothsType.setEnterpriseId(enterpriseName);
zyClothsTypeService.save(zyClothsType);
return Result.OK("添加成功!");
}
@ -204,11 +200,11 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
@GetMapping(value = "/weiyi")
public Result<?> weiyi(@RequestParam(name = "id", required = true) String enterpriseId) {
if(StringUtils.isEmpty(enterpriseId)){
if (StringUtils.isEmpty(enterpriseId)) {
return Result.error("请先选择一个企业");
}
String a=zyClothsTypeService.sort(enterpriseId);
if(a==null){
String a = zyClothsTypeService.sort(enterpriseId);
if (a == null) {
return Result.OK("0");
}
//a.substring(4)截掉前4位

@ -22,13 +22,17 @@ public interface ZyProcessMapper extends BaseMapper<ZyProcess> {
ZyClothActionVo selectListZyClothActionVo(@Param("id") String id);
public List<ZyProcess> selectByComponentId(@Param("component_id") String component_id);
List<ZyProcess> selectByComponentId(@Param("component_id") String component_id);
String getProcessNameById(String processId);
@Select("select process_code from zy_process where style_id=#{id} order by process_code DESC limit 0,1")
String sort(String id);
@Select("select process_code from zy_process where id=#{processId}")
String getCodeByProcessId(String processId);
@Select("select type_id from zy_cloths_style where id=#{clothStyleId}")
String getTypeId(String clothStyleId);
@ -40,4 +44,6 @@ public interface ZyProcessMapper extends BaseMapper<ZyProcess> {
@Select("select cloths_type_id from zy_cloths_component where id=#{clothsComponentId}")
String getClothsComponentId(String clothsComponentId);
}

@ -3,6 +3,8 @@ package org.jeecg.modules.demo.base.service;
import org.jeecg.modules.demo.base.entity.ZyClothsType;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: zy_cloths_type
* @Author: jeecg-boot
@ -11,13 +13,23 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IZyClothsTypeService extends IService<ZyClothsType> {
/**nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)*/
String generateNumber();
String sort(String enterpriseId);
/**根据企业名称拿到企业编号*/
String getEnterpriseNums(String enterpriseName);
void chuliBianHaoWenti();
Long orderNumber();
/**
* 拿到集合中的最大值
* @param listString 传进来一个String类型的集合
* @param i 返回数字的位数 例如一般6位或8位
* @return 返回一个long类型的i位数最大值
*/
Long getListMax(List<String> listString, int i);
}

@ -1,9 +1,9 @@
package org.jeecg.modules.demo.base.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.demo.base.entity.ZyClothsType;
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper;
import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -12,14 +12,13 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.regex.Pattern;
/**
* @Description: zy_cloths_type
* @Author: jeecg-boot
* @Date: 2021-11-10
* @Date: 2021-11-10
* @Version: V1.0
*/
@Service
@ -27,38 +26,23 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
@Resource
ZyClothsTypeMapper zyClothsTypeMapper;
/**
* nums编号varchar10非空不重复企业缩写4+顺序号6
* 顺序号
*/
@Override
public String generateNumber() {
//先拿到类型编号
String nums = "QIYE";
//再来一个顺序号
String format = String.format("%06d", orderNumber());
//生成编码
String result = nums + format;
//System.err.println(result);
return nums + format;
}
/*
* 顺序号
* */
@Override
public String sort(String enterpriseId) {
//String sort = zyClothsTypeMapper.sort();
String sort = String.format("%06d", orderNumber());
String format = String.format("%06d", orderNumber());
String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(enterpriseId);
//System.out.println("enterpriseName 企业名称: "+enterpriseName);
//根据企业名称拿到企业编号
String enterpriseNums = getEnterpriseNums(enterpriseName);
return enterpriseNums+sort;
return enterpriseNums + format;
}
@Override
public String getEnterpriseNums(String enterpriseName) {
if (StringUtils.isEmpty(enterpriseName)){
if (StringUtils.isEmpty(enterpriseName)) {
return "NULL";
}
switch (enterpriseName) {
@ -93,43 +77,36 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
}
@Override
public void chuliBianHaoWenti() {
//先拿到所有编号
//再
//先处理企业问题
LambdaQueryWrapper<ZyClothsType> queryWrapper = new LambdaQueryWrapper<>();
List<ZyClothsType> zyClothsTypeList = list(queryWrapper);
System.err.println(new Date());
for (ZyClothsType enterId : zyClothsTypeList) {
String enterpriseName = enterId.getEnterpriseId();
String id = zyClothsTypeMapper.getEnterpriseName(enterpriseName);
if (StringUtils.hasText(id)){
zyClothsTypeMapper.setEnterpriseId(id);
}
}
public Long orderNumber() {
List<String> listString = zyClothsTypeMapper.selectNumsList();
return this.getListMax(listString,6);
}
private Long orderNumber() {
List<String> listString = zyClothsTypeMapper.selectNumsList();
//System.out.println(listString);
@Override
public Long getListMax(@NotNull List<String> listString, int i) {
List<Long> listLong = new ArrayList<>();
for (String nums : listString) {
//System.err.println(nums);
String REGEX = "[^0-9]";
//只要数字
String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
//System.err.println(newNums);
if (!StringUtils.hasText(newNums)){
newNums = "0";
if (StringUtils.isEmpty(newNums)) {
continue;
}
if (newNums.length() > 6) {
if (newNums.length() > i) {
//拿到后6位
String substring = newNums.substring(newNums.length() - 6);
String substring = newNums.substring(newNums.length() - i);
listLong.add(Long.valueOf(substring));
}else {
} else {
listLong.add(Long.valueOf(newNums));
}
}
return Collections.max(listLong)+1;
long max = Collections.max(listLong) + 1;
if (Long.toString(max).length() > i) {
String toString = Long.toString(max);
String substring = toString.substring(toString.length() - i);
return Long.valueOf(substring);
}
return max;
}
}

@ -1,129 +0,0 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName">
<a-input v-model="model.partsName" placeholder="请输入部件名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-input v-model="model.description" placeholder="请输入描述" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="图片地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl">
<j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">
<j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,nums" placeholder="请选择模块" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'ZyClothsComponentForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/base/zyClothsComponent/add",
edit: "/base/zyClothsComponent/edit",
queryById: "/base/zyClothsComponent/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -1,60 +0,0 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-cloths-component-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-cloths-component-form>
</j-modal>
</template>
<script>
import ZyClothsComponentForm from './ZyClothsComponentForm'
export default {
name: 'ZyClothsComponentModal',
components: {
ZyClothsComponentForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -1,84 +0,0 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<zy-cloths-component-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-cloths-component-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import ZyClothsComponentForm from './ZyClothsComponentForm'
export default {
name: 'ZyClothsComponentModal',
components: {
ZyClothsComponentForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -1,129 +0,0 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="模块名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularName">
<a-input v-model="model.modularName" placeholder="请输入模块名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-input v-model="model.description" placeholder="请输入描述" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="衣服类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,nums" placeholder="请选择衣服类型" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="图片地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl">
<j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'ZyClothsModularForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/base/zyClothsModular/add",
edit: "/base/zyClothsModular/edit",
queryById: "/base/zyClothsModular/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -1,60 +0,0 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-cloths-modular-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-cloths-modular-form>
</j-modal>
</template>
<script>
import ZyClothsModularForm from './ZyClothsModularForm'
export default {
name: 'ZyClothsModularModal',
components: {
ZyClothsModularForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -1,84 +0,0 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<zy-cloths-modular-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-cloths-modular-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import ZyClothsModularForm from './ZyClothsModularForm'
export default {
name: 'ZyClothsModularModal',
components: {
ZyClothsModularForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -1,114 +0,0 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeName">
<a-input v-model="model.typeName" placeholder="请输入类型名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'ZyClothsTypeForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/base/zyClothsType/add",
edit: "/base/zyClothsType/edit",
queryById: "/base/zyClothsType/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -1,60 +0,0 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-cloths-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-cloths-type-form>
</j-modal>
</template>
<script>
import ZyClothsTypeForm from './ZyClothsTypeForm'
export default {
name: 'ZyClothsTypeModal',
components: {
ZyClothsTypeForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -1,84 +0,0 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<zy-cloths-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-cloths-type-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import ZyClothsTypeForm from './ZyClothsTypeForm'
export default {
name: 'ZyClothsTypeModal',
components: {
ZyClothsTypeForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -22,6 +22,7 @@ import org.jeecg.modules.demo.pro.entity.ZyProcessComponent;
import org.jeecg.modules.demo.pro.mapper.ZyProcessComponentMapper;
import org.jeecg.modules.demo.pro.service.IZyProcessComponentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@ -32,6 +33,7 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description: zy_process_component
@ -71,9 +73,21 @@ public class ZyProcessComponentController extends JeecgController<ZyProcessCompo
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
//从制衣部件进入部件工序的时候 会传一个componentId参数
//在部件工序页面通过 工序 进行查询的时候 会有一个processId参数
QueryWrapper<ZyProcessComponent> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessComponent, req.getParameterMap());
Page<ZyProcessComponent> page = new Page<ZyProcessComponent>(pageNo, pageSize);
IPage<ZyProcessComponent> pageList = zyProcessComponentService.page(page, queryWrapper);
//在部件工序页面通过 工序代码 进行查询的时候 会有一个processCode参数
if (StringUtils.hasText(zyProcessComponent.getProcessCode())){
//System.err.println("processCode参数: " + zyProcessComponent.getProcessCode());
List<ZyProcess> zyProcessList = zyProcessService.list(new LambdaQueryWrapper<ZyProcess>().like(ZyProcess::getProcessCode, zyProcessComponent.getProcessCode()));
List<ZyProcessComponent> list = new ArrayList<>();
zyProcessList.forEach(zyProcess -> list.addAll(zyProcessComponentService.list(new LambdaQueryWrapper<ZyProcessComponent>().eq(ZyProcessComponent::getProcessId,zyProcess.getId()))));
List<ZyProcessComponent> collect = list.stream().filter(zyProComponent -> zyProComponent.getComponentId().equals(zyProcessComponent.getComponentId())).collect(Collectors.toList());
pageList.setRecords(collect);
}
pageList.getRecords().forEach(zy -> zy.setProcessCode(zyProcessMapper.getCodeByProcessId(zy.getProcessId())));
return Result.OK(pageList);
}

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.pro.entity;
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 com.fasterxml.jackson.annotation.JsonFormat;
@ -40,10 +41,14 @@ public class ZyProcessComponent implements Serializable {
@ApiModelProperty(value = "部件")
private String componentId;
/**工艺*/
@Excel(name = "工", width = 15, dictTable = "zy_process", dicText = "process_name", dicCode = "id")
@Excel(name = "工", width = 15)
@Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id")
@ApiModelProperty(value = "工")
@ApiModelProperty(value = "工")
private String processId;
/**工序代码*/
@TableField(exist = false)
private String processCode;
// /**是否瓶颈工序*/
// @Excel(name = "是否瓶颈工序", width = 15,dicCode = "pingjing")
// @Dict(dicCode = "pingjing")

@ -65,6 +65,7 @@ public class ZyProcessModularController extends JeecgController<ZyProcessModular
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
//从制衣模块进入模块工序的时候 会有一个modularId 根据模块id 进行筛选
QueryWrapper<ZyProcessModular> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessModular, req.getParameterMap());
Page<ZyProcessModular> page = new Page<ZyProcessModular>(pageNo, pageSize);
IPage<ZyProcessModular> pageList = zyProcessModularService.page(page, queryWrapper);
@ -73,11 +74,9 @@ public class ZyProcessModularController extends JeecgController<ZyProcessModular
//System.err.println(LocalDateTime.now() + " +++ " +zyProcessModular.getProcessCode());
List<ZyProcess> zyProcessList = zyProcessService.list(new LambdaQueryWrapper<ZyProcess>().like(ZyProcess::getProcessCode,zyProcessModular.getProcessCode()));
List<ZyProcessModular> modularList = new ArrayList<>();
zyProcessList.forEach(zyProcess -> {
modularList.addAll(zyProcessModularService.list(new LambdaQueryWrapper<ZyProcessModular>().eq(ZyProcessModular::getProcessId, zyProcess.getId())));
List<ZyProcessModular> collect = modularList.stream().filter(zyPModular -> zyPModular.getModularId().equals(zyProcessModular.getModularId())).collect(Collectors.toList());
pageList.setRecords(collect);
});
zyProcessList.forEach(zyProcess -> modularList.addAll(zyProcessModularService.list(new LambdaQueryWrapper<ZyProcessModular>().eq(ZyProcessModular::getProcessId, zyProcess.getId()))));
List<ZyProcessModular> collect = modularList.stream().filter(zyPModular -> zyPModular.getModularId().equals(zyProcessModular.getModularId())).collect(Collectors.toList());
pageList.setRecords(collect);
}
//不怕空值
pageList.getRecords().forEach(zyProModular -> {

Loading…
Cancel
Save