制衣部件相关问题

zhc4dev
赵玉瑞 2 years ago
parent 9ddd168757
commit 53ac72043c
  1. 9
      ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
  2. 31
      ant-design-vue-jeecg/src/views/process/ZyProcessComponentList.vue
  3. 10
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
  4. 47
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue
  5. 67
      ant-design-vue-jeecg/src/views/process/modules/list/ZyClothsComponentList.vue
  6. 20
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java
  7. 10
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  8. 8
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyProcessMapper.java
  9. 20
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java
  10. 69
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java
  11. 129
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsComponentForm.vue
  12. 60
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsComponentModal.vue
  13. 84
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsComponentModal__Style#Drawer.vue
  14. 129
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsModularForm.vue
  15. 60
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsModularModal.vue
  16. 84
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsModularModal__Style#Drawer.vue
  17. 114
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsTypeForm.vue
  18. 60
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsTypeModal.vue
  19. 84
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/vue/modules/ZyClothsTypeModal__Style#Drawer.vue
  20. 14
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/controller/ZyProcessComponentController.java
  21. 9
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java
  22. 5
      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"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="部件编号">
<a-input placeholder="请输入部件编号" v-model="queryParam.nums"></a-input>
</a-form-item>
</a-col>
<a-col :xl="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="部件名称">
<a-input placeholder="请输入部件名称" v-model="queryParam.partsName"></a-input> <a-input placeholder="请输入部件名称" v-model="queryParam.partsName"></a-input>
@ -159,6 +165,7 @@ export default {
}, },
data() { data() {
return { return {
//
description: 'zy_cloths_component管理页面', description: 'zy_cloths_component管理页面',
// //
columns: [ columns: [
@ -173,7 +180,7 @@ export default {
} }
}, },
{ {
title: '编号', title: '部件编号',
align: "center", align: "center",
dataIndex: 'nums' dataIndex: 'nums'
}, },

@ -8,12 +8,19 @@
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @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"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工序代码">
<a-input v-model="queryParam.processCode"
placeholder="请输入工序代码"/>
</a-form-item>
</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="请选择工序" />
@ -90,27 +97,14 @@
</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="handleDetail(record.id)">详情</a> <a @click="handleDetail(record.id)">详情</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>
</a-popconfirm> </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> </span>
</a-table> </a-table>
@ -162,6 +156,11 @@
align:"center", align:"center",
dataIndex: 'componentId_dictText' dataIndex: 'componentId_dictText'
}, },
{
title:'工序代码',
align:"center",
dataIndex: 'processCode'
},
{ {
title:'工序', title:'工序',
align:"center", align:"center",

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

@ -48,6 +48,7 @@
import {validateDuplicateValue} from '@/utils/util'; import {validateDuplicateValue} from '@/utils/util';
import {Message} from "element-ui"; import {Message} from "element-ui";
import JTreeSelect from '@/components/jeecg/JTreeSelect'; import JTreeSelect from '@/components/jeecg/JTreeSelect';
export default { export default {
name: 'ZyClothsTypeForm', name: 'ZyClothsTypeForm',
components: { components: {
@ -92,7 +93,9 @@
add: "/base/zyClothsType/add", add: "/base/zyClothsType/add",
edit: "/base/zyClothsType/edit", edit: "/base/zyClothsType/edit",
queryById: "/base/zyClothsType/queryById", queryById: "/base/zyClothsType/queryById",
weiyi:"/base/zyClothsType/weiyi" weiyi: "/base/zyClothsType/weiyi",
//
enterpriseNum: "/zyclothsstyle/zyClothsStyle/enterpriseNum"
} }
} }
}, },
@ -107,22 +110,18 @@
}, },
methods: { methods: {
bianHao() { bianHao() {
// const {data: res} = await this.$axios.get('/jeecg-boot/base/zyClothsType/weiyi?id=' + this.model.enterpriseId) if (this.model.id) {
// if (res.code !== 200) { getAction(this.url.enterpriseNum, {id: this.model.enterpriseId}).then((res) => {
// this.$message({ if (res.code !== 200) {
// type: 'error', this.$message({
// message: '' type: 'error',
// }); message: '未查询到数据!'
// } });
// this.model.nums = res.result }
// console.log('res.result') this.model.nums = res.result + this.model.nums.substring(4);
// console.log(res.result) console.log('res.result ' + this.model.nums);
//this.confirmLoading = false })
// if (this.data.length === 0) { } else {
// this.data.push(res.result)
// }
//console.log("List "+this.model.nums);
// var n=6
getAction(this.url.weiyi, {id: this.model.enterpriseId}).then((res) => { getAction(this.url.weiyi, {id: this.model.enterpriseId}).then((res) => {
if (res.code !== 200) { if (res.code !== 200) {
this.$message({ this.$message({
@ -133,19 +132,11 @@
let num = res.result; let num = res.result;
console.log("res.result: " + num) console.log("res.result: " + num)
//num=num.toString() //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() { add() {
this.edit(this.modelDefault); this.edit(this.modelDefault);

@ -13,17 +13,6 @@
<!-- <div class="table-operator">--> <!-- <div class="table-operator">-->
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('zy_cloths_component')">导出</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>--> <!-- </div>-->
<!-- table区域-begin --> <!-- table区域-begin -->
@ -47,47 +36,14 @@
class="j-table-force-nowrap" class="j-table-force-nowrap"
@change="handleTableChange"> @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"> <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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</span> </span>
</a-table> </a-table>
</div> </div>
<!-- <zy-cloths-component-modal ref="modalForm" @ok="modalFormOk"></zy-cloths-component-modal>-->
<!-- <ZyProcessComponentList ref="ZyProcessComponentList"></ZyProcessComponentList>-->
<!-- <ZyClothsComponentListDetail ref="ZyClothsComponentListDetail"></ZyClothsComponentListDetail>-->
</a-card> </a-card>
</template> </template>
@ -99,13 +55,14 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'; import {filterMultiDictText} from '@/components/dict/JDictSelectUtil';
export default { export default {
//
//
name: 'ZyClothsComponentList', name: 'ZyClothsComponentList',
mixins:[JeecgListMixin, mixinDevice], mixins:[JeecgListMixin, mixinDevice],
components: {}, components: {},
data () { data () {
return { return {
model:{ model:{
fuId: '',
clothsId: '', clothsId: '',
}, },
description: 'zy_cloths_component管理页面', description: 'zy_cloths_component管理页面',
@ -147,11 +104,6 @@ export default {
dataIndex: 'clothsTypeId_dictText' dataIndex: 'clothsTypeId_dictText'
}, },
// { // {
// title:'',
// align:"center",
// dataIndex: 'description'
// },
// {
// title:'', // title:'',
// align:"center", // align:"center",
// dataIndex: 'pictureUrl', // dataIndex: 'pictureUrl',
@ -177,12 +129,6 @@ export default {
align:"center", align:"center",
dataIndex: 'createTime' dataIndex: 'createTime'
}, },
// {
// title: '',
// dataIndex: 'action2',
// align:"center",
// scopedSlots: { customRender: 'action2' }
// },
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
@ -213,11 +159,6 @@ export default {
}, },
}, },
methods: { methods: {
// viewVid2(record){
// this.$refs.ZyProcessComponentList.showModal2();
// this.$refs.ZyProcessComponentList.edit2(record);
// this.$refs.ZyProcessComponentList.disableSubmit = false;
// },
onSelectChange1(selectedRowKeys, selectionRows) { onSelectChange1(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys; this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows; this.selectionRows = selectionRows;
@ -228,9 +169,9 @@ export default {
this.$emit('onChangeRowKey', ids) this.$emit('onChangeRowKey', ids)
}, },
add1(id) { add1(id) {
this.queryParam.fuId = id; this.queryParam.modularId = id;
//this.queryParam.clothsId = this.model.id; //this.queryParam.clothsId = this.model.id;
this.url.list = '/base/zyClothsComponent/listTwo'; //this.url.list = '/base/zyClothsComponent/listTwo';
this.loadData(); this.loadData();
//this.model.fuId = id; //this.model.fuId = id;
// this.loadData() // this.loadData()

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

@ -82,6 +82,9 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
@ApiOperation(value = "zy_cloths_type-添加", notes = "zy_cloths_type-添加") @ApiOperation(value = "zy_cloths_type-添加", notes = "zy_cloths_type-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsType zyClothsType) { public Result<?> add(@RequestBody ZyClothsType zyClothsType) {
if (StringUtils.isEmpty(zyClothsType.getNums())) {
return Result.error("服装类型编号 不能为空");
}
//type_name,类型名称,varchar,50,非空,同类型下不重复 //type_name,类型名称,varchar,50,非空,同类型下不重复
String typeName = zyClothsType.getTypeName(); String typeName = zyClothsType.getTypeName();
if (!StringUtils.hasText(typeName)) { if (!StringUtils.hasText(typeName)) {
@ -109,13 +112,6 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
String nameByTypeId = zyClothsTypeMapper.getNameByTypeId(zyClothsType.getTypeId()); String nameByTypeId = zyClothsTypeMapper.getNameByTypeId(zyClothsType.getTypeId());
zyClothsType.setTypeIdName(nameByTypeId); 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); zyClothsTypeService.save(zyClothsType);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }

@ -22,13 +22,17 @@ public interface ZyProcessMapper extends BaseMapper<ZyProcess> {
ZyClothActionVo selectListZyClothActionVo(@Param("id") String id); 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); String getProcessNameById(String processId);
@Select("select process_code from zy_process where style_id=#{id} order by process_code DESC limit 0,1") @Select("select process_code from zy_process where style_id=#{id} order by process_code DESC limit 0,1")
String sort(String id); 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}") @Select("select type_id from zy_cloths_style where id=#{clothStyleId}")
String getTypeId(String 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}") @Select("select cloths_type_id from zy_cloths_component where id=#{clothsComponentId}")
String getClothsComponentId(String 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 org.jeecg.modules.demo.base.entity.ZyClothsType;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/** /**
* @Description: zy_cloths_type * @Description: zy_cloths_type
* @Author: jeecg-boot * @Author: jeecg-boot
@ -11,13 +13,23 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IZyClothsTypeService extends IService<ZyClothsType> { public interface IZyClothsTypeService extends IService<ZyClothsType> {
/**nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)*/
String generateNumber();
String sort(String enterpriseId); String sort(String enterpriseId);
/**根据企业名称拿到企业编号*/ /**根据企业名称拿到企业编号*/
String getEnterpriseNums(String enterpriseName); 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; 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.entity.ZyClothsType;
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper;
import org.jeecg.modules.demo.base.service.IZyClothsTypeService; import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -12,7 +12,6 @@ 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.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -27,33 +26,18 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
@Resource @Resource
ZyClothsTypeMapper zyClothsTypeMapper; 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 @Override
public String sort(String enterpriseId) { public String sort(String enterpriseId) {
//String sort = zyClothsTypeMapper.sort(); String format = String.format("%06d", orderNumber());
String sort = String.format("%06d", orderNumber());
String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(enterpriseId); String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(enterpriseId);
//System.out.println("enterpriseName 企业名称: "+enterpriseName);
//根据企业名称拿到企业编号 //根据企业名称拿到企业编号
String enterpriseNums = getEnterpriseNums(enterpriseName); String enterpriseNums = getEnterpriseNums(enterpriseName);
return enterpriseNums+sort; return enterpriseNums + format;
} }
@Override @Override
@ -93,43 +77,36 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
} }
@Override @Override
public void chuliBianHaoWenti() { public Long orderNumber() {
//先拿到所有编号 List<String> listString = zyClothsTypeMapper.selectNumsList();
//再 return this.getListMax(listString,6);
//先处理企业问题
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);
}
}
} }
private Long orderNumber() { @Override
List<String> listString = zyClothsTypeMapper.selectNumsList(); public Long getListMax(@NotNull List<String> listString, int i) {
//System.out.println(listString);
List<Long> listLong = new ArrayList<>(); List<Long> listLong = new ArrayList<>();
for (String nums : listString) { for (String nums : listString) {
//System.err.println(nums);
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();
//System.err.println(newNums); if (StringUtils.isEmpty(newNums)) {
if (!StringUtils.hasText(newNums)){ continue;
newNums = "0";
} }
if (newNums.length() > 6) { if (newNums.length() > i) {
//拿到后6位 //拿到后6位
String substring = newNums.substring(newNums.length() - 6); String substring = newNums.substring(newNums.length() - i);
listLong.add(Long.valueOf(substring)); listLong.add(Long.valueOf(substring));
} else { } else {
listLong.add(Long.valueOf(newNums)); 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.mapper.ZyProcessComponentMapper;
import org.jeecg.modules.demo.pro.service.IZyProcessComponentService; import org.jeecg.modules.demo.pro.service.IZyProcessComponentService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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;
@ -32,6 +33,7 @@ import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @Description: zy_process_component * @Description: zy_process_component
@ -71,9 +73,21 @@ public class ZyProcessComponentController extends JeecgController<ZyProcessCompo
@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) {
//从制衣部件进入部件工序的时候 会传一个componentId参数
//在部件工序页面通过 工序 进行查询的时候 会有一个processId参数
QueryWrapper<ZyProcessComponent> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessComponent, req.getParameterMap()); QueryWrapper<ZyProcessComponent> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessComponent, req.getParameterMap());
Page<ZyProcessComponent> page = new Page<ZyProcessComponent>(pageNo, pageSize); Page<ZyProcessComponent> page = new Page<ZyProcessComponent>(pageNo, pageSize);
IPage<ZyProcessComponent> pageList = zyProcessComponentService.page(page, queryWrapper); 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); return Result.OK(pageList);
} }

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

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

Loading…
Cancel
Save