2022-12-20产品

zhc4dev
lenovo 2 years ago
parent 05d5842c2f
commit b413bc444f
  1. 297
      ant-design-vue-jeecg/src/views/pdcomponentprocess/ProductComponentProcessList.vue
  2. 129
      ant-design-vue-jeecg/src/views/pdcomponentprocess/modules/ProductComponentProcessForm.vue
  3. 77
      ant-design-vue-jeecg/src/views/pdcomponentprocess/modules/ProductComponentProcessModal.vue
  4. 84
      ant-design-vue-jeecg/src/views/pdcomponentprocess/modules/ProductComponentProcessModal__Style#Drawer.vue
  5. 288
      ant-design-vue-jeecg/src/views/pdcomponentprocess/modules/ZyProcessList.vue
  6. 42
      ant-design-vue-jeecg/src/views/pdmodulecomponent/ProductModuleComponentList.vue
  7. 261
      ant-design-vue-jeecg/src/views/product/pdaccessories/ProductAccessoriesList.vue
  8. 114
      ant-design-vue-jeecg/src/views/product/pdaccessories/modules/ProductAccessoriesForm.vue
  9. 60
      ant-design-vue-jeecg/src/views/product/pdaccessories/modules/ProductAccessoriesModal.vue
  10. 84
      ant-design-vue-jeecg/src/views/product/pdaccessories/modules/ProductAccessoriesModal__Style#Drawer.vue
  11. 255
      ant-design-vue-jeecg/src/views/product/pdfabric/ProductFabricList.vue
  12. 118
      ant-design-vue-jeecg/src/views/product/pdfabric/modules/ProductFabricForm.vue
  13. 60
      ant-design-vue-jeecg/src/views/product/pdfabric/modules/ProductFabricModal.vue
  14. 84
      ant-design-vue-jeecg/src/views/product/pdfabric/modules/ProductFabricModal__Style#Drawer.vue
  15. 274
      ant-design-vue-jeecg/src/views/product/pdmachine/ProductMachineList.vue
  16. 119
      ant-design-vue-jeecg/src/views/product/pdmachine/modules/ProductMachineForm.vue
  17. 60
      ant-design-vue-jeecg/src/views/product/pdmachine/modules/ProductMachineModal.vue
  18. 84
      ant-design-vue-jeecg/src/views/product/pdmachine/modules/ProductMachineModal__Style#Drawer.vue
  19. 274
      ant-design-vue-jeecg/src/views/product/pdoperationtool/ProductOperationtoolList.vue
  20. 119
      ant-design-vue-jeecg/src/views/product/pdoperationtool/modules/ProductOperationtoolForm.vue
  21. 60
      ant-design-vue-jeecg/src/views/product/pdoperationtool/modules/ProductOperationtoolModal.vue
  22. 84
      ant-design-vue-jeecg/src/views/product/pdoperationtool/modules/ProductOperationtoolModal__Style#Drawer.vue
  23. 231
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/pdcomponentprocess/controller/ProductComponentProcessController.java
  24. 74
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/pdcomponentprocess/entity/ProductComponentProcess.java
  25. 24
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/pdcomponentprocess/mapper/ProductComponentProcessMapper.java
  26. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/pdcomponentprocess/mapper/xml/ProductComponentProcessMapper.xml
  27. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/pdcomponentprocess/service/IProductComponentProcessService.java
  28. 32
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/pdcomponentprocess/service/impl/ProductComponentProcessServiceImpl.java
  29. 179
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/controller/ProductAccessoriesController.java
  30. 71
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/entity/ProductAccessories.java
  31. 23
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/mapper/ProductAccessoriesMapper.java
  32. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/mapper/xml/ProductAccessoriesMapper.xml
  33. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/IProductAccessoriesService.java
  34. 29
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/impl/ProductAccessoriesServiceImpl.java
  35. 181
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/controller/ProductFabricController.java
  36. 71
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/entity/ProductFabric.java
  37. 23
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/mapper/ProductFabricMapper.java
  38. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/mapper/xml/ProductFabricMapper.xml
  39. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/IProductFabricService.java
  40. 29
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/impl/ProductFabricServiceImpl.java
  41. 194
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdmachine/controller/ProductMachineController.java
  42. 63
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdmachine/entity/ProductMachine.java
  43. 28
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdmachine/mapper/ProductMachineMapper.java
  44. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdmachine/mapper/xml/ProductMachineMapper.xml
  45. 22
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdmachine/service/IProductMachineService.java
  46. 39
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdmachine/service/impl/ProductMachineServiceImpl.java
  47. 195
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdoperationtool/controller/ProductOperationtoolController.java
  48. 64
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdoperationtool/entity/ProductOperationtool.java
  49. 28
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdoperationtool/mapper/ProductOperationtoolMapper.java
  50. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdoperationtool/mapper/xml/ProductOperationtoolMapper.xml
  51. 22
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdoperationtool/service/IProductOperationtoolService.java
  52. 37
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdoperationtool/service/impl/ProductOperationtoolServiceImpl.java
  53. 63
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/controller/ZyProductProcessController.java
  54. 12
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java
  55. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/IZyProductProcessService.java
  56. 20
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/impl/ZyProductProcessServiceImpl.java

@ -0,0 +1,297 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<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="productId"></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="componentId"></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="processId"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('产品部件工序')">导出</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>-->
<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!-- <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 -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
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="action" slot-scope="text, record">
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical" />
<a @click="up(record.id)">升序</a>
<a-divider type="vertical" />
<a @click="down(record.id)">降序</a>
</span>
</a-table>
</div>
<product-component-process-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></product-component-process-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ProductComponentProcessModal from './modules/ProductComponentProcessModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ProductComponentProcessList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ProductComponentProcessModal
},
data () {
return {
description: '产品部件工序管理页面',
productId:'',
processId:'',
componentId:'',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'产品编号',
align:"center",
dataIndex: 'productComponentId'
// dataIndex: 'productComponentId_dictText'
},
{
title:'模块',
align:"center",
dataIndex: 'moduleId_dictText'
},
{
title:'部件',
align:"center",
dataIndex: 'componentId_dictText'
},
{
title:'工序',
align:"center",
dataIndex: 'processId_dictText'
},
{
title:'序号',
align:"center",
dataIndex: 'number'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/pdcomponentprocess/productComponentProcess/list",
delete: "/pdcomponentprocess/productComponentProcess/delete",
deleteBatch: "/pdcomponentprocess/productComponentProcess/deleteBatch",
exportXlsUrl: "/pdcomponentprocess/productComponentProcess/exportXls",
importExcelUrl: "pdcomponentprocess/productComponentProcess/importExcel",
up: "/pdcomponentprocess/productComponentProcess/up",
down: "/pdcomponentprocess/productComponentProcess/down"
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
up(id){
getAction(this.url.up,{id:id}).then((res)=>{
if(res.success){
this.loadData();
this.$message.success(res.message);
}else{
this.$message.warning(res.message);
}
})},
down(id){
getAction(this.url.down,{id:id}).then((res)=>{
if(res.success){
this.loadData();
this.$message.success(res.message);
}else{
this.$message.warning(res.message);
}
})},
initDictConfig(){
},
valueChange(value){
if (value) this.loadData()
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'productComponentId',text:'产品id',dictCode:''})
fieldList.push({type:'string',value:'moduleComponentId',text:'产品模块部件id',dictCode:''})
fieldList.push({type:'string',value:'moduleId',text:'模块id',dictCode:''})
fieldList.push({type:'string',value:'componentId',text:'部件id',dictCode:''})
fieldList.push({type:'string',value:'processId',text:'工序id',dictCode:''})
fieldList.push({type:'int',value:'number',text:'序号',dictCode:''})
this.superFieldList = fieldList
},
loadParameter() {
if (this.loadRouteType === false) {
this.id = this.$route.query.id;
console.log("***********")
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!");
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for------------
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
//update-end---author:zhangyafei Date:20201118 for------------
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
//param.id=this.id;
param.moduleComponentId = this.$route.query.id;
param.componentId=this.component;
param.productId=this.productId;
param.processId=this.processId;
return filterObj(param);
},
searchReset() {
this.componentId = ''
this.productId = ''
this.processId = ''
this.loadData(1);
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,129 @@
<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="产品id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productComponentId">
<a-input v-model="model.productComponentId" placeholder="请输入产品id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产品模块部件id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleComponentId">
<a-input v-model="model.moduleComponentId" placeholder="请输入产品模块部件id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="模块id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleId">
<a-input v-model="model.moduleId" placeholder="请输入模块id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="部件id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="componentId">
<a-input v-model="model.componentId" placeholder="请输入部件id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工序id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processId">
<a-input v-model="model.processId" placeholder="请输入工序id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="序号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">
<a-input-number v-model="model.number" placeholder="请输入序号" style="width: 100%" />
</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: 'ProductComponentProcessForm',
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: "/pdcomponentprocess/productComponentProcess/add",
edit: "/pdcomponentprocess/productComponentProcess/edit",
queryById: "/pdcomponentprocess/productComponentProcess/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>

@ -0,0 +1,77 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-process-list ref="realForm" @onChangeRowKey="chuancan" @ok="submitCallback" :disabled="disableSubmit"></zy-process-list>
</j-modal>
</template>
<script>
import ZyProcessList from './ZyProcessList'
import {postAction} from "@api/manage";
export default {
name: 'ProductComponentProcessModal',
components: {
ZyProcessList
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false,
model:{
moduleComponentId:'',
processId:''
},
url:{
add: "/pdcomponentprocess/productComponentProcess/add",
},
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
})
},
edit (record) {
this.visible=true
},
close () {
this.$emit('close');
this.visible = false;
},
chuancan(res){
this.model.processId=res;
console.log(res)
},
handleOk () {
this.model.moduleComponentId = this.$route.query.id
postAction(this.url.add,this.model).then((res)=>{
if(res.success){
this.$message.success(res.message);
}else{
this.$message.warning(res.message);
}
this.$emit('valueChange',1)
this.close()
})},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<product-component-process-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></product-component-process-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 ProductComponentProcessForm from './ProductComponentProcessForm'
export default {
name: 'ProductComponentProcessModal',
components: {
ProductComponentProcessForm
},
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>

@ -0,0 +1,288 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<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="服装类型">-->
<!-- <j-dict-select-tag placeholder="请选择服装款式" dictCode="zy_cloths_type,type_name,nums"-->
<!-- v-model="styleId"></j-dict-select-tag>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工序代码">
<a-input placeholder="工序代码" v-model="processCode"></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="processName"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">-->
<!-- <j-select-depart v-model="enterpriseId" placeholder="请输入企业名称" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('zy_process')">导出</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>-->
<!-- 高级查询区域 -->
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange1}"
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="action1" slot-scope="text, record">-->
<!-- -->
<!-- </span>-->
</a-table>
</div>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ZyProcessList',
mixins: [JeecgListMixin, mixinDevice],
components: {
},
data() {
return {
description: 'zy_process管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '工序代码',
align: "center",
dataIndex: 'processCode'
},
{
title: '工序名称',
align: "center",
dataIndex: 'processName'
},
],
url: {
list: "/base/zyProcess/list",
delete: "/base/zyProcess/delete",
deleteBatch: "/base/zyProcess/deleteBatch",
exportXlsUrl: "/base/zyProcess/exportXls",
importExcelUrl: "base/zyProcess/importExcel",
},
//
loadRouteType: false,
styleId: "",
processCode:'',
processName:'',
enterpriseId:'',
dictOptions: {},
superFieldList: [],
}
},
created() {
// queryParam.styleId=this.styleId
// this.getSuperFieldList();
this.loadParameter();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig() {
},
onSelectChange1(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
let ids = "";
for (var a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
this.$emit('onChangeRowKey',ids)
},
//
loadParameter() {
if (this.loadRouteType == false) {
this.styleId = this.$route.query.styleId;
console.log(this.styleId)
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!")
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for------------
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
//update-end---author:zhangyafei Date:20201118 for------------
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
param.styleId = this.styleId;
param.enterpriseId=this.enterpriseId;
param.processCode=this.processCode;
param.processName=this.processName;
return filterObj(param);
},
searchReset() {
this.styleId = ''
this.processCode = ''
this.processName = ''
this.enterpriseId = ''
this.loadData(1);
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'processCode', text: '工序代码', dictCode: ''})
fieldList.push({type: 'string', value: 'processName', text: '工序名称', dictCode: ''})
fieldList.push({type: 'string', value: 'processDescribe', text: '工艺描述', dictCode: ''})
fieldList.push({type: 'string', value: 'mkExplain', text: '做工说明', dictCode: ''})
fieldList.push({type: 'string', value: 'qualityRequire', text: '品质要求', dictCode: ''})
fieldList.push({type: 'string', value: 'processTime', text: '工序时间', dictCode: ''})
fieldList.push({type: 'double', value: 'price', text: '工序单价', dictCode: ''})
fieldList.push({type: 'string', value: 'grade', text: '工序等级', dictCode: ''})
fieldList.push({type: 'string', value: 'fabricNum', text: '面料代码', dictCode: ''})
fieldList.push({type: 'string', value: 'fabricGrade', text: '面料等级', dictCode: ''})
fieldList.push({type: 'int', value: 'needlePitch', text: '针距(针/厘米)', dictCode: ''})
fieldList.push({type: 'string', value: 'machineId', text: '机器名', dictCode: 'zy_machine,name,id'})
fieldList.push({type: 'string', value: 'manualWide', text: '手工宽放', dictCode: ''})
fieldList.push({type: 'double', value: 'manualTime', text: '手工时间', dictCode: ''})
fieldList.push({type: 'int', value: 'machineSpeed', text: '机器转速', dictCode: ''})
fieldList.push({type: 'string', value: 'machineWide', text: '机器宽放', dictCode: ''})
fieldList.push({type: 'double', value: 'machineTime', text: '机器时间', dictCode: ''})
fieldList.push({type: 'string', value: 'machineFloat', text: '机器浮于', dictCode: ''})
fieldList.push({type: 'string', value: 'bundleWide', text: '绑包宽放', dictCode: ''})
fieldList.push({type: 'string', value: 'bundleTime', text: '绑包时间', dictCode: ''})
fieldList.push({type: 'string', value: 'componentId', text: '部件表', dictCode: 'zy_cloths_component,parts_name,id'})
fieldList.push({type: 'int', value: 'isBottleneck', text: '是否为瓶颈工序', dictCode: ''})
fieldList.push({type: 'string', value: 'enterpriseId', text: '企业名称', dictCode: ''})
fieldList.push({type: 'string', value: 'toolId', text: '工具名称', dictCode: 'zy_tool,name,id'})
fieldList.push({type: 'string', value: 'styleId', text: '款式名称', dictCode: ''})
fieldList.push({type: 'string', value: 'worksectionCode', text: '工段代码', dictCode: ''})
fieldList.push({type: 'string', value: 'contractNum', text: '合同号', dictCode: ''})
fieldList.push({type: 'int', value: 'totalManualTmu', text: '合计(手工TMU)', dictCode: ''})
fieldList.push({type: 'int', value: 'totalMachineTmu', text: '合计(机器TMU)', dictCode: ''})
fieldList.push({type: 'int', value: 'totalMaunal', text: '合计(手工秒)', dictCode: ''})
fieldList.push({type: 'int', value: 'totalMachine', text: '合计(机器秒)', dictCode: ''})
fieldList.push({type: 'string', value: 'image', text: '图片', dictCode: ''})
fieldList.push({type: 'string', value: 'vedio', text: '视频', dictCode: ''})
this.superFieldList = fieldList
},
openDetail(id) {
this.$refs.zyProcessDetail.showModal(id)
// this.$children[0].showModal(id)
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -28,18 +28,18 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('产品模块部件表')">导出</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>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('产品模块部件表')">导出</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>
<!-- <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 -->
@ -82,7 +82,9 @@
下载
</a-button>
</template>
<span slot="action1" slot-scope="text, record">
<a @click="bujian(record.id)">管理</a>
</span>
<span slot="action" slot-scope="text, record">
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
@ -155,6 +157,14 @@
align:"center",
dataIndex: 'number'
},
{
title: '部件工序管理',
dataIndex: 'action1',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action1' }
},
{
title: '操作',
dataIndex: 'action',
@ -204,6 +214,14 @@
this.$message.warning(res.message);
}
})},
bujian(id){
this.$router.push({
path: '/pdcomponentprocess/ProductComponentProcessList',
query: { //
'id': id,
}
});
},
initDictConfig(){
},
valueChange(value){

@ -0,0 +1,261 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<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="accessoriesId"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('产品辅料表')">导出</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>-->
<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!-- <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 -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
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="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<!-- <a-divider type="vertical" />-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
</span>
</a-table>
</div>
<product-accessories-modal ref="modalForm" @ok="modalFormOk"></product-accessories-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ProductAccessoriesModal from './modules/ProductAccessoriesModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ProductAccessoriesList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ProductAccessoriesModal
},
data () {
return {
description: '产品辅料表管理页面',
accessoriesId:'',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'产品编号',
align:"center",
dataIndex: 'productId'
},
// {
// title:'',
// align:"center",
// dataIndex: 'productId_dictText'
// },
{
title:'辅料',
align:"center",
dataIndex: 'accessoriesId_dictText'
},
{
title:'用量',
align:"center",
dataIndex: 'amount'
},
{
title:'准备情况',
align:"center",
dataIndex: 'preparation_dictText'
},
{
title:'差额',
align:"center",
dataIndex: 'difference'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/pdaccessories/productAccessories/list",
delete: "/pdaccessories/productAccessories/delete",
deleteBatch: "/pdaccessories/productAccessories/deleteBatch",
exportXlsUrl: "/pdaccessories/productAccessories/exportXls",
importExcelUrl: "pdaccessories/productAccessories/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'productId',text:'产品id',dictCode:''})
fieldList.push({type:'string',value:'accessoriesId',text:'辅料id',dictCode:''})
fieldList.push({type:'double',value:'amount',text:'用量',dictCode:''})
fieldList.push({type:'int',value:'preparation',text:'准备情况',dictCode:'ready,,'})
fieldList.push({type:'double',value:'difference',text:'差额',dictCode:''})
this.superFieldList = fieldList
},
loadParameter() {
if (this.loadRouteType === false) {
this.id = this.$route.query.id;
console.log("***********")
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!");
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for------------
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
//update-end---author:zhangyafei Date:20201118 for------------
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
//param.id=this.id;
param.productId = this.$route.query.id;
param.accessoriesId=this.accessoriesId;
return filterObj(param);
},
searchReset() {
this.accessoriesId = ''
this.loadData(1);
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,114 @@
<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="amount">
<a-input-number v-model="model.amount" placeholder="请输入用量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="准备情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="preparation">
<j-dict-select-tag type="radio" v-model="model.preparation" dictCode="ready" placeholder="请选择准备情况" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="差额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="difference">
<a-input-number v-model="model.difference" placeholder="请输入差额" style="width: 100%" />
</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: 'ProductAccessoriesForm',
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: "/pdaccessories/productAccessories/add",
edit: "/pdaccessories/productAccessories/edit",
queryById: "/pdaccessories/productAccessories/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>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<product-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></product-accessories-form>
</j-modal>
</template>
<script>
import ProductAccessoriesForm from './ProductAccessoriesForm'
export default {
name: 'ProductAccessoriesModal',
components: {
ProductAccessoriesForm
},
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>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<product-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></product-accessories-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 ProductAccessoriesForm from './ProductAccessoriesForm'
export default {
name: 'ProductAccessoriesModal',
components: {
ProductAccessoriesForm
},
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>

@ -0,0 +1,255 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<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="fabricId"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('产品面料表')">导出</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>-->
<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!-- <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 -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
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="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<!-- <a-divider type="vertical" />-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
</span>
</a-table>
</div>
<product-fabric-modal ref="modalForm" @ok="modalFormOk"></product-fabric-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ProductFabricModal from './modules/ProductFabricModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ProductFabricList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ProductFabricModal
},
data () {
return {
description: '产品面料表管理页面',
fabricId:'',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'产品编号',
align:"center",
dataIndex: 'productId'
},
{
title:'面料',
align:"center",
dataIndex: 'fabricId_dictText'
},
{
title:'用量',
align:"center",
dataIndex: 'amount'
},
{
title:'准备情况',
align:"center",
dataIndex: 'preparation_dictText'
},
{
title:'差额',
align:"center",
dataIndex: 'difference'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/pdfabric/productFabric/list",
delete: "/pdfabric/productFabric/delete",
deleteBatch: "/pdfabric/productFabric/deleteBatch",
exportXlsUrl: "/pdfabric/productFabric/exportXls",
importExcelUrl: "pdfabric/productFabric/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'productId',text:'产品id',dictCode:''})
fieldList.push({type:'string',value:'fabricId',text:'面料id',dictCode:''})
fieldList.push({type:'double',value:'amount',text:'用量',dictCode:''})
fieldList.push({type:'int',value:'preparation',text:'准备情况',dictCode:''})
fieldList.push({type:'double',value:'difference',text:'差额',dictCode:''})
this.superFieldList = fieldList
},
loadParameter() {
if (this.loadRouteType === false) {
this.id = this.$route.query.id;
console.log("***********")
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!");
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for------------
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
//update-end---author:zhangyafei Date:20201118 for------------
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
//param.id=this.id;
param.productId = this.$route.query.id;
param.fabricId=this.fabricId;
return filterObj(param);
},
searchReset() {
this.fabricId = ''
this.loadData(1);
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,118 @@
<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="amount">
<a-input-number v-model="model.amount" placeholder="请输入用量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="准备情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="preparation">
<j-dict-select-tag type="radio" v-model="model.preparation" dictCode="ready" placeholder="请选择准备情况" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="差额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="difference">
<a-input-number v-model="model.difference" placeholder="请输入差额" style="width: 100%" />
</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: 'ProductFabricForm',
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: {
difference: [
{ required: false},
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
],
},
url: {
add: "/pdfabric/productFabric/add",
edit: "/pdfabric/productFabric/edit",
queryById: "/pdfabric/productFabric/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>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<product-fabric-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></product-fabric-form>
</j-modal>
</template>
<script>
import ProductFabricForm from './ProductFabricForm'
export default {
name: 'ProductFabricModal',
components: {
ProductFabricForm
},
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>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<product-fabric-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></product-fabric-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 ProductFabricForm from './ProductFabricForm'
export default {
name: 'ProductFabricModal',
components: {
ProductFabricForm
},
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>

@ -0,0 +1,274 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<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="machineId"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('产品设备表')">导出</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>-->
<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!-- <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 -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
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="action" slot-scope="text, record">
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- <a-divider type="vertical" />-->
<a @click="up(record.id)">升序</a>
<a-divider type="vertical" />
<a @click="down(record.id)">降序</a>
</span>
</a-table>
</div>
<product-machine-modal ref="modalForm" @ok="modalFormOk"></product-machine-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ProductMachineModal from './modules/ProductMachineModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ProductMachineList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ProductMachineModal
},
data () {
return {
description: '产品设备表管理页面',
machineId:'',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'产品编号',
align:"center",
dataIndex: 'productId'
},
// {
// title:'',
// align:"center",
// dataIndex: 'productId_dictText'
// },
{
title:'设备',
align:"center",
dataIndex: 'machineId_dictText'
},
{
title:'序号',
align:"center",
dataIndex: 'sort'
},
{
title:'准备情况',
align:"center",
dataIndex: 'preparation_dictText'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/pdmachine/productMachine/list",
delete: "/pdmachine/productMachine/delete",
deleteBatch: "/pdmachine/productMachine/deleteBatch",
exportXlsUrl: "/pdmachine/productMachine/exportXls",
importExcelUrl: "pdmachine/productMachine/importExcel",
up: "/pdmachine/productMachine/up",
down: "/pdmachine/productMachine/down"
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
up(id){
getAction(this.url.up,{id:id}).then((res)=>{
if(res.success){
this.loadData();
this.$message.success(res.message);
}else{
this.$message.warning(res.message);
}
})},
down(id){
getAction(this.url.down,{id:id}).then((res)=>{
if(res.success){
this.loadData();
this.$message.success(res.message);
}else{
this.$message.warning(res.message);
}
})},
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'productId',text:'产品id',dictCode:''})
fieldList.push({type:'string',value:'machineId',text:'设备d',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'序号',dictCode:''})
fieldList.push({type:'int',value:'preparation',text:'准备情况',dictCode:''})
this.superFieldList = fieldList
},
loadParameter() {
if (this.loadRouteType === false) {
this.id = this.$route.query.id;
console.log("***********")
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!");
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for------------
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
//update-end---author:zhangyafei Date:20201118 for------------
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
//param.id=this.id;
param.productId = this.$route.query.id;
param.machineId=this.machineId;
return filterObj(param);
},
searchReset() {
this.machineId = ''
this.loadData(1);
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,119 @@
<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="产品id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productId">
<a-input v-model="model.productId" placeholder="请输入产品id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="设备d" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="machineId">
<a-input v-model="model.machineId" placeholder="请输入设备d" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="序号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">
<a-input-number v-model="model.sort" placeholder="请输入序号" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="准备情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="preparation">
<a-input-number v-model="model.preparation" placeholder="请输入准备情况" style="width: 100%" />
</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: 'ProductMachineForm',
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: "/pdmachine/productMachine/add",
edit: "/pdmachine/productMachine/edit",
queryById: "/pdmachine/productMachine/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>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<product-machine-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></product-machine-form>
</j-modal>
</template>
<script>
import ProductMachineForm from './ProductMachineForm'
export default {
name: 'ProductMachineModal',
components: {
ProductMachineForm
},
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>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<product-machine-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></product-machine-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 ProductMachineForm from './ProductMachineForm'
export default {
name: 'ProductMachineModal',
components: {
ProductMachineForm
},
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>

@ -0,0 +1,274 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<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="operationtoolId"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('产品工具表')">导出</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>-->
<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!-- <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 -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
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="action" slot-scope="text, record">
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- <a-divider type="vertical" />-->
<a @click="up(record.id)">升序</a>
<a-divider type="vertical" />
<a @click="down(record.id)">降序</a>
</span>
</a-table>
</div>
<product-operationtool-modal ref="modalForm" @ok="modalFormOk"></product-operationtool-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ProductOperationtoolModal from './modules/ProductOperationtoolModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ProductOperationtoolList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ProductOperationtoolModal
},
data () {
return {
description: '产品工具表管理页面',
operationtoolId:'',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'产品编号',
align:"center",
dataIndex: 'productId'
},
// {
// title:'',
// align:"center",
// dataIndex: 'productId_dictText'
// },
{
title:'工具',
align:"center",
dataIndex: 'operationtoolId_dictText'
},
{
title:'序号',
align:"center",
dataIndex: 'sort'
},
{
title:'准备情况',
align:"center",
dataIndex: 'preparation_dictText'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/pdoperationtool/productOperationtool/list",
delete: "/pdoperationtool/productOperationtool/delete",
deleteBatch: "/pdoperationtool/productOperationtool/deleteBatch",
exportXlsUrl: "/pdoperationtool/productOperationtool/exportXls",
importExcelUrl: "pdoperationtool/productOperationtool/importExcel",
up: "/pdoperationtool/productOperationtool/up",
down: "/pdoperationtool/productOperationtool/down"
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
up(id){
getAction(this.url.up,{id:id}).then((res)=>{
if(res.success){
this.loadData();
this.$message.success(res.message);
}else{
this.$message.warning(res.message);
}
})},
down(id){
getAction(this.url.down,{id:id}).then((res)=>{
if(res.success){
this.loadData();
this.$message.success(res.message);
}else{
this.$message.warning(res.message);
}
})},
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'productId',text:'产品id',dictCode:''})
fieldList.push({type:'string',value:'operationtoolId',text:'工具id',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'序号',dictCode:''})
fieldList.push({type:'int',value:'preparation',text:'准备情况',dictCode:''})
this.superFieldList = fieldList
},
loadParameter() {
if (this.loadRouteType === false) {
this.id = this.$route.query.id;
console.log("***********")
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!");
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for------------
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
//update-end---author:zhangyafei Date:20201118 for------------
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
//param.id=this.id;
param.productId = this.$route.query.id;
param.operationtoolId=this.operationtoolId;
return filterObj(param);
},
searchReset() {
this.operationtoolId = ''
this.loadData(1);
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,119 @@
<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="产品id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productId">
<a-input v-model="model.productId" placeholder="请输入产品id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工具id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationtoolId">
<a-input v-model="model.operationtoolId" placeholder="请输入工具id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="序号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">
<a-input-number v-model="model.sort" placeholder="请输入序号" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="准备情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="preparation">
<a-input-number v-model="model.preparation" placeholder="请输入准备情况" style="width: 100%" />
</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: 'ProductOperationtoolForm',
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: "/pdoperationtool/productOperationtool/add",
edit: "/pdoperationtool/productOperationtool/edit",
queryById: "/pdoperationtool/productOperationtool/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>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<product-operationtool-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></product-operationtool-form>
</j-modal>
</template>
<script>
import ProductOperationtoolForm from './ProductOperationtoolForm'
export default {
name: 'ProductOperationtoolModal',
components: {
ProductOperationtoolForm
},
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>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<product-operationtool-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></product-operationtool-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 ProductOperationtoolForm from './ProductOperationtoolForm'
export default {
name: 'ProductOperationtoolModal',
components: {
ProductOperationtoolForm
},
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>

@ -0,0 +1,231 @@
package org.jeecg.modules.pdcomponentprocess.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.pdcomponentprocess.entity.ProductComponentProcess;
import org.jeecg.modules.pdcomponentprocess.service.IProductComponentProcessService;
import org.jeecg.modules.pdmodulecomponent.entity.ProductModuleComponent;
import org.jeecg.modules.pdmodulecomponent.service.IProductModuleComponentService;
import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 产品部件工序
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Api(tags="产品部件工序")
@RestController
@RequestMapping("/pdcomponentprocess/productComponentProcess")
@Slf4j
public class ProductComponentProcessController extends JeecgController<ProductComponentProcess, IProductComponentProcessService> {
@Autowired
private IProductComponentProcessService productComponentProcessService;
@Autowired
private IProductModuleComponentService productModuleComponentService;
@Autowired
IZyProductProcessService zyProductProcessService;
/**
* 分页列表查询
*
* @param productComponentProcess
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "产品部件工序-分页列表查询")
@ApiOperation(value="产品部件工序-分页列表查询", notes="产品部件工序-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ProductComponentProcess productComponentProcess,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// QueryWrapper<ProductComponentProcess> queryWrapper = QueryGenerator.initQueryWrapper(productComponentProcess, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.orderByDesc("number");
//查询指定模块部件对应的工序
queryWrapper.eq("module_component_id",productComponentProcess.getModuleComponentId());
//根据产品编号查询
if(productComponentProcess.getProductComponentId()!=null&&!productComponentProcess.getProductComponentId().equals("")){
String s="%"+productComponentProcess.getProductComponentId()+"%";
List<String> list=zyProductProcessService.findProduct(s);
queryWrapper.in("product_component_id",list);
}
//根据部件查询
if(productComponentProcess.getComponentId()!=null&&!productComponentProcess.getComponentId().equals("")){
String s="%"+productComponentProcess.getComponentId()+"%";
List<String> list=productModuleComponentService.find(s);
queryWrapper.in("component_id",list);
}
//根据工序查询
if(productComponentProcess.getProcessId()!=null&&!productComponentProcess.getProcessId().equals("")){
String s="%"+productComponentProcess.getProcessId()+"%";
List<String> list=zyProductProcessService.find(s);
queryWrapper.in("process_id",list);
}
Page<ProductComponentProcess> page = new Page<ProductComponentProcess>(pageNo, pageSize);
IPage<ProductComponentProcess> pageList = productComponentProcessService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param productComponentProcess
* @return
*/
@AutoLog(value = "产品部件工序-添加")
@ApiOperation(value="产品部件工序-添加", notes="产品部件工序-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ProductComponentProcess productComponentProcess) {
ProductModuleComponent moduleComponent = productModuleComponentService.getById(productComponentProcess.getModuleComponentId());
if(moduleComponent!=null){
productComponentProcess.setProductComponentId(moduleComponent.getProductId());
productComponentProcess.setModuleId(moduleComponent.getModuleId());
productComponentProcess.setComponentId(moduleComponent.getComponentId());
}
String[] split = productComponentProcess.getProcessId().split(",");
for (String k : split) {
productComponentProcess.setProcessId(k);
QueryWrapper s=new QueryWrapper();
s.eq("module_component_id",productComponentProcess.getModuleComponentId());
s.eq("process_id",productComponentProcess.getComponentId());
int a=productComponentProcessService.count(s);
if(a==0)
productComponentProcessService.save(productComponentProcess);
productComponentProcess.setId(null);
}
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param productComponentProcess
* @return
*/
@AutoLog(value = "产品部件工序-编辑")
@ApiOperation(value="产品部件工序-编辑", notes="产品部件工序-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ProductComponentProcess productComponentProcess) {
productComponentProcessService.updateById(productComponentProcess);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "产品部件工序-通过id删除")
@ApiOperation(value="产品部件工序-通过id删除", notes="产品部件工序-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
productComponentProcessService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "产品部件工序-批量删除")
@ApiOperation(value="产品部件工序-批量删除", notes="产品部件工序-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.productComponentProcessService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "产品部件工序-通过id查询")
@ApiOperation(value="产品部件工序-通过id查询", notes="产品部件工序-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
ProductComponentProcess productComponentProcess = productComponentProcessService.getById(id);
if(productComponentProcess==null) {
return Result.error("未找到对应数据");
}
return Result.OK(productComponentProcess);
}
/**
* 导出excel
*
* @param request
* @param productComponentProcess
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ProductComponentProcess productComponentProcess) {
return super.exportXls(request, productComponentProcess, ProductComponentProcess.class, "产品部件工序");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ProductComponentProcess.class);
}
@GetMapping(value = "/up")
public Result<?> up(@RequestParam(name="id",required=true) String id) {
productComponentProcessService.up(id);
return Result.OK("升序成功");
}
@GetMapping(value = "/down")
public Result<?> down(@RequestParam(name="id",required=true) String id) {
ProductComponentProcess zyProductProcess = productComponentProcessService.getById(id);
if(zyProductProcess==null||zyProductProcess.getNumber()==0)
return Result.error("当前以是最低级别!!");
productComponentProcessService.down(id);
return Result.OK("降序成功");
}
}

@ -0,0 +1,74 @@
package org.jeecg.modules.pdcomponentprocess.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 产品部件工序
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Data
@TableName("product_component_process")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="product_component_process对象", description="产品部件工序")
public class ProductComponentProcess implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**产品id*/
@Excel(name = "产品id", width = 15)
@ApiModelProperty(value = "产品id")
//@Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id") 表暂未设计暂时不打开
private String productComponentId;
/**产品模块部件id*/
@Excel(name = "产品模块部件id", width = 15)
@ApiModelProperty(value = "产品模块部件id")
private String moduleComponentId;
/**模块id*/
@Excel(name = "模块id", width = 15)
@ApiModelProperty(value = "模块id")
@Dict(dictTable = "zy_cloths_modular",dicText = "modular_name",dicCode = "id")
private String moduleId;
/**部件id*/
@Excel(name = "部件id", width = 15)
@ApiModelProperty(value = "部件id")
@Dict(dictTable = "zy_cloths_component",dicText = "parts_name",dicCode = "id")
private String componentId;
/**工序id*/
@Excel(name = "工序id", width = 15)
@ApiModelProperty(value = "工序id")
@Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id")
private String processId;
/**序号*/
@Excel(name = "序号", width = 15)
@ApiModelProperty(value = "序号")
private Integer number;
}

@ -0,0 +1,24 @@
package org.jeecg.modules.pdcomponentprocess.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.pdcomponentprocess.entity.ProductComponentProcess;
/**
* @Description: 产品部件工序
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface ProductComponentProcessMapper extends BaseMapper<ProductComponentProcess> {
@Update("update product_component_process set number=number+1 where id=#{id}")
void up(String id);
@Update("update product_component_process set number=number-1 where id=#{id}")
void down(String id);
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.pdcomponentprocess.mapper.ProductComponentProcessMapper">
</mapper>

@ -0,0 +1,18 @@
package org.jeecg.modules.pdcomponentprocess.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.pdcomponentprocess.entity.ProductComponentProcess;
/**
* @Description: 产品部件工序
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface IProductComponentProcessService extends IService<ProductComponentProcess> {
void up(String id);
void down(String id);
}

@ -0,0 +1,32 @@
package org.jeecg.modules.pdcomponentprocess.service.impl;
import org.jeecg.modules.pdcomponentprocess.entity.ProductComponentProcess;
import org.jeecg.modules.pdcomponentprocess.mapper.ProductComponentProcessMapper;
import org.jeecg.modules.pdcomponentprocess.service.IProductComponentProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 产品部件工序
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Service
public class ProductComponentProcessServiceImpl extends ServiceImpl<ProductComponentProcessMapper, ProductComponentProcess> implements IProductComponentProcessService {
@Autowired
ProductComponentProcessMapper productComponentProcessMapper;
@Override
public void up(String id) {
productComponentProcessMapper.up(id);
}
@Override
public void down(String id) {
productComponentProcessMapper.down(id);
}
}

@ -0,0 +1,179 @@
package org.jeecg.modules.product.pdaccessories.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
import org.jeecg.modules.product.pdaccessories.service.IProductAccessoriesService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 产品辅料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Api(tags="产品辅料表")
@RestController
@RequestMapping("/pdaccessories/productAccessories")
@Slf4j
public class ProductAccessoriesController extends JeecgController<ProductAccessories, IProductAccessoriesService> {
@Autowired
private IProductAccessoriesService productAccessoriesService;
/**
* 分页列表查询
*
* @param productAccessories
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "产品辅料表-分页列表查询")
@ApiOperation(value="产品辅料表-分页列表查询", notes="产品辅料表-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ProductAccessories productAccessories,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// QueryWrapper<ProductAccessories> queryWrapper = QueryGenerator.initQueryWrapper(productAccessories, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("product_id",productAccessories.getProductId());
if(productAccessories.getAccessoriesId()!=null&&!productAccessories.getAccessoriesId().equals("")){
String s="%"+productAccessories.getAccessoriesId()+"%";
List<String> fabric = productAccessoriesService.findAll(s);
queryWrapper.in("accessories_id",fabric);
}
Page<ProductAccessories> page = new Page<ProductAccessories>(pageNo, pageSize);
IPage<ProductAccessories> pageList = productAccessoriesService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param productAccessories
* @return
*/
@AutoLog(value = "产品辅料表-添加")
@ApiOperation(value="产品辅料表-添加", notes="产品辅料表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ProductAccessories productAccessories) {
productAccessoriesService.save(productAccessories);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param productAccessories
* @return
*/
@AutoLog(value = "产品辅料表-编辑")
@ApiOperation(value="产品辅料表-编辑", notes="产品辅料表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ProductAccessories productAccessories) {
productAccessoriesService.updateById(productAccessories);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "产品辅料表-通过id删除")
@ApiOperation(value="产品辅料表-通过id删除", notes="产品辅料表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
productAccessoriesService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "产品辅料表-批量删除")
@ApiOperation(value="产品辅料表-批量删除", notes="产品辅料表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.productAccessoriesService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "产品辅料表-通过id查询")
@ApiOperation(value="产品辅料表-通过id查询", notes="产品辅料表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
ProductAccessories productAccessories = productAccessoriesService.getById(id);
if(productAccessories==null) {
return Result.error("未找到对应数据");
}
return Result.OK(productAccessories);
}
/**
* 导出excel
*
* @param request
* @param productAccessories
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ProductAccessories productAccessories) {
return super.exportXls(request, productAccessories, ProductAccessories.class, "产品辅料表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ProductAccessories.class);
}
}

@ -0,0 +1,71 @@
package org.jeecg.modules.product.pdaccessories.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 产品辅料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Data
@TableName("product_accessories")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="product_accessories对象", description="产品辅料表")
public class ProductAccessories implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**产品id*/
@Excel(name = "产品id", width = 15)
@ApiModelProperty(value = "产品id")
// @Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id") 由于当前产品还没有,需要后期打开
private String productId;
/**辅料id*/
@Excel(name = "辅料id", width = 15)
@ApiModelProperty(value = "辅料id")
@Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id")
private String accessoriesId;
/**用量*/
@Excel(name = "用量", width = 15)
@ApiModelProperty(value = "用量")
private Double amount;
/**准备情况*/
@Excel(name = "准备情况", width = 15, dictTable = "ready", dicText = "", dicCode = "")
@Dict( dicText = "", dicCode = "ready")
@ApiModelProperty(value = "准备情况")
private Integer preparation;
/**差额*/
@Excel(name = "差额", width = 15)
@ApiModelProperty(value = "差额")
private Double difference;
}

@ -0,0 +1,23 @@
package org.jeecg.modules.product.pdaccessories.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
/**
* @Description: 产品辅料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface ProductAccessoriesMapper extends BaseMapper<ProductAccessories> {
@Select("select id from zy_accessories where contents like #{s}")
List<String> find(String s);
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.pdaccessories.mapper.ProductAccessoriesMapper">
</mapper>

@ -0,0 +1,18 @@
package org.jeecg.modules.product.pdaccessories.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
import java.util.List;
/**
* @Description: 产品辅料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface IProductAccessoriesService extends IService<ProductAccessories> {
List<String> findAll(String s);
}

@ -0,0 +1,29 @@
package org.jeecg.modules.product.pdaccessories.service.impl;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
import org.jeecg.modules.product.pdaccessories.mapper.ProductAccessoriesMapper;
import org.jeecg.modules.product.pdaccessories.service.IProductAccessoriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: 产品辅料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Service
public class ProductAccessoriesServiceImpl extends ServiceImpl<ProductAccessoriesMapper, ProductAccessories> implements IProductAccessoriesService {
@Autowired
ProductAccessoriesMapper productAccessoriesMapper;
@Override
public List<String> findAll(String s) {
return productAccessoriesMapper.find(s);
}
}

@ -0,0 +1,181 @@
package org.jeecg.modules.product.pdfabric.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
import org.jeecg.modules.product.pdfabric.service.IProductFabricService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 产品面料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Api(tags="产品面料表")
@RestController
@RequestMapping("/pdfabric/productFabric")
@Slf4j
public class ProductFabricController extends JeecgController<ProductFabric, IProductFabricService> {
@Autowired
private IProductFabricService productFabricService;
/**
* 分页列表查询
*
* @param productFabric
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "产品面料表-分页列表查询")
@ApiOperation(value="产品面料表-分页列表查询", notes="产品面料表-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ProductFabric productFabric,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// QueryWrapper<ProductFabric> queryWrapper = QueryGenerator.initQueryWrapper(productFabric, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("product_id",productFabric.getProductId());
if(productFabric.getFabricId()!=null&&!productFabric.getFabricId().equals("")){
String s="%"+productFabric.getFabricId()+"%";
List<String> fabric = productFabricService.findAll(s);
queryWrapper.in("fabric_id",fabric);
}
Page<ProductFabric> page = new Page<ProductFabric>(pageNo, pageSize);
IPage<ProductFabric> pageList = productFabricService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param productFabric
* @return
*/
@AutoLog(value = "产品面料表-添加")
@ApiOperation(value="产品面料表-添加", notes="产品面料表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ProductFabric productFabric) {
productFabricService.save(productFabric);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param productFabric
* @return
*/
@AutoLog(value = "产品面料表-编辑")
@ApiOperation(value="产品面料表-编辑", notes="产品面料表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ProductFabric productFabric) {
productFabricService.updateById(productFabric);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "产品面料表-通过id删除")
@ApiOperation(value="产品面料表-通过id删除", notes="产品面料表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
productFabricService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "产品面料表-批量删除")
@ApiOperation(value="产品面料表-批量删除", notes="产品面料表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.productFabricService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "产品面料表-通过id查询")
@ApiOperation(value="产品面料表-通过id查询", notes="产品面料表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
ProductFabric productFabric = productFabricService.getById(id);
if(productFabric==null) {
return Result.error("未找到对应数据");
}
return Result.OK(productFabric);
}
/**
* 导出excel
*
* @param request
* @param productFabric
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ProductFabric productFabric) {
return super.exportXls(request, productFabric, ProductFabric.class, "产品面料表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ProductFabric.class);
}
}

@ -0,0 +1,71 @@
package org.jeecg.modules.product.pdfabric.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 产品面料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Data
@TableName("product_fabric")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="product_fabric对象", description="产品面料表")
public class ProductFabric implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**产品id*/
@Excel(name = "产品id", width = 15)
@ApiModelProperty(value = "产品id")
// @Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id") 由于当前产品还没有,需要后期打开
private String productId;
/**面料id*/
@Excel(name = "面料id", width = 15)
@ApiModelProperty(value = "面料id")
@Dict(dictTable = "zy_fabric", dicText = "name", dicCode = "id")
private String fabricId;
/**用量*/
@Excel(name = "用量", width = 15)
@ApiModelProperty(value = "用量")
private Double amount;
/**准备情况*/
@Excel(name = "准备情况", width = 15)
@ApiModelProperty(value = "准备情况")
@Dict( dicText = "", dicCode = "ready")
private Integer preparation;
/**差额*/
@Excel(name = "差额", width = 15)
@ApiModelProperty(value = "差额")
private Double difference;
}

@ -0,0 +1,23 @@
package org.jeecg.modules.product.pdfabric.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
/**
* @Description: 产品面料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface ProductFabricMapper extends BaseMapper<ProductFabric> {
@Select("select id from zy_fabric where name like #{s}")
List<String> find(String s);
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.pdfabric.mapper.ProductFabricMapper">
</mapper>

@ -0,0 +1,17 @@
package org.jeecg.modules.product.pdfabric.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
import java.util.List;
/**
* @Description: 产品面料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface IProductFabricService extends IService<ProductFabric> {
List<String> findAll(String s);
}

@ -0,0 +1,29 @@
package org.jeecg.modules.product.pdfabric.service.impl;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
import org.jeecg.modules.product.pdfabric.mapper.ProductFabricMapper;
import org.jeecg.modules.product.pdfabric.service.IProductFabricService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: 产品面料表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Service
public class ProductFabricServiceImpl extends ServiceImpl<ProductFabricMapper, ProductFabric> implements IProductFabricService {
@Autowired
ProductFabricMapper productFabricMapper;
@Override
public List<String> findAll(String s) {
return productFabricMapper.find(s);
}
}

@ -0,0 +1,194 @@
package org.jeecg.modules.product.pdmachine.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.product.pdmachine.entity.ProductMachine;
import org.jeecg.modules.product.pdmachine.service.IProductMachineService;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 产品设备表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Api(tags="产品设备表")
@RestController
@RequestMapping("/pdmachine/productMachine")
@Slf4j
public class ProductMachineController extends JeecgController<ProductMachine, IProductMachineService> {
@Autowired
private IProductMachineService productMachineService;
/**
* 分页列表查询
*
* @param productMachine
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "产品设备表-分页列表查询")
@ApiOperation(value="产品设备表-分页列表查询", notes="产品设备表-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ProductMachine productMachine,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// QueryWrapper<ProductMachine> queryWrapper = QueryGenerator.initQueryWrapper(productMachine, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.orderByDesc("sort");
queryWrapper.eq("product_id",productMachine.getProductId());
if(productMachine.getMachineId()!=null&&!productMachine.getMachineId().equals("")){
String s="%"+productMachine.getMachineId()+"%";
List<String> fabric = productMachineService.findAll(s);
queryWrapper.in("machine_id",fabric);
}
Page<ProductMachine> page = new Page<ProductMachine>(pageNo, pageSize);
IPage<ProductMachine> pageList = productMachineService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param productMachine
* @return
*/
@AutoLog(value = "产品设备表-添加")
@ApiOperation(value="产品设备表-添加", notes="产品设备表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ProductMachine productMachine) {
productMachineService.save(productMachine);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param productMachine
* @return
*/
@AutoLog(value = "产品设备表-编辑")
@ApiOperation(value="产品设备表-编辑", notes="产品设备表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ProductMachine productMachine) {
productMachineService.updateById(productMachine);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "产品设备表-通过id删除")
@ApiOperation(value="产品设备表-通过id删除", notes="产品设备表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
productMachineService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "产品设备表-批量删除")
@ApiOperation(value="产品设备表-批量删除", notes="产品设备表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.productMachineService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "产品设备表-通过id查询")
@ApiOperation(value="产品设备表-通过id查询", notes="产品设备表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
ProductMachine productMachine = productMachineService.getById(id);
if(productMachine==null) {
return Result.error("未找到对应数据");
}
return Result.OK(productMachine);
}
/**
* 导出excel
*
* @param request
* @param productMachine
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ProductMachine productMachine) {
return super.exportXls(request, productMachine, ProductMachine.class, "产品设备表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ProductMachine.class);
}
@GetMapping(value = "/up")
public Result<?> up(@RequestParam(name="id",required=true) String id) {
productMachineService.up(id);
return Result.OK("升序成功");
}
@GetMapping(value = "/down")
public Result<?> down(@RequestParam(name="id",required=true) String id) {
ProductMachine zyProductProcess = productMachineService.getById(id);
if(zyProductProcess==null||zyProductProcess.getSort()==0)
return Result.error("当前以是最低级别!!");
productMachineService.down(id);
return Result.OK("降序成功");
}
}

@ -0,0 +1,63 @@
package org.jeecg.modules.product.pdmachine.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 产品设备表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Data
@TableName("product_machine")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="product_machine对象", description="产品设备表")
public class ProductMachine implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**产品id*/
@Excel(name = "产品id", width = 15)
@ApiModelProperty(value = "产品id")
// @Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id") 由于当前产品还没有,需要后期打开
private String productId;
/**设备d*/
@Excel(name = "设备d", width = 15)
@ApiModelProperty(value = "设备d")
@Dict(dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
private String machineId;
/**序号*/
@Excel(name = "序号", width = 15)
@ApiModelProperty(value = "序号")
private Integer sort;
/**准备情况*/
@Excel(name = "准备情况", width = 15)
@ApiModelProperty(value = "准备情况")
@Dict( dicText = "", dicCode = "ready")
private Integer preparation;
}

@ -0,0 +1,28 @@
package org.jeecg.modules.product.pdmachine.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.product.pdmachine.entity.ProductMachine;
/**
* @Description: 产品设备表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface ProductMachineMapper extends BaseMapper<ProductMachine> {
@Select("select id from zy_devicetype where name like #{s}")
List<String> find(String s);
@Update("update product_machine set sort=sort+1 where id=#{id}")
void up(String id);
@Update("update product_machine set sort=sort-1 where id=#{id}")
void down(String id);
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.pdmachine.mapper.ProductMachineMapper">
</mapper>

@ -0,0 +1,22 @@
package org.jeecg.modules.product.pdmachine.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.product.pdmachine.entity.ProductMachine;
import java.util.List;
/**
* @Description: 产品设备表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface IProductMachineService extends IService<ProductMachine> {
List<String> findAll(String s);
void up(String id);
void down(String id);
}

@ -0,0 +1,39 @@
package org.jeecg.modules.product.pdmachine.service.impl;
import org.jeecg.modules.product.pdmachine.entity.ProductMachine;
import org.jeecg.modules.product.pdmachine.mapper.ProductMachineMapper;
import org.jeecg.modules.product.pdmachine.service.IProductMachineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: 产品设备表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Service
public class ProductMachineServiceImpl extends ServiceImpl<ProductMachineMapper, ProductMachine> implements IProductMachineService {
@Autowired
ProductMachineMapper productMachineMapper;
@Override
public List<String> findAll(String s) {
return productMachineMapper.find(s);
}
@Override
public void up(String id) {
productMachineMapper.up(id);
}
@Override
public void down(String id) {
productMachineMapper.down(id);
}
}

@ -0,0 +1,195 @@
package org.jeecg.modules.product.pdoperationtool.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.product.pdmachine.entity.ProductMachine;
import org.jeecg.modules.product.pdoperationtool.entity.ProductOperationtool;
import org.jeecg.modules.product.pdoperationtool.service.IProductOperationtoolService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 产品工具表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Api(tags="产品工具表")
@RestController
@RequestMapping("/pdoperationtool/productOperationtool")
@Slf4j
public class ProductOperationtoolController extends JeecgController<ProductOperationtool, IProductOperationtoolService> {
@Autowired
private IProductOperationtoolService productOperationtoolService;
/**
* 分页列表查询
*
* @param productOperationtool
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "产品工具表-分页列表查询")
@ApiOperation(value="产品工具表-分页列表查询", notes="产品工具表-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ProductOperationtool productOperationtool,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// QueryWrapper<ProductOperationtool> queryWrapper = QueryGenerator.initQueryWrapper(productOperationtool, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("product_id",productOperationtool.getProductId());
queryWrapper.orderByDesc("sort");
if(productOperationtool.getOperationtoolId()!=null&&!productOperationtool.getOperationtoolId().equals("")){
String s="%"+productOperationtool.getOperationtoolId()+"%";
List<String> fabric = productOperationtoolService.findAll(s);
queryWrapper.in("machine_id",fabric);
}
Page<ProductOperationtool> page = new Page<ProductOperationtool>(pageNo, pageSize);
IPage<ProductOperationtool> pageList = productOperationtoolService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param productOperationtool
* @return
*/
@AutoLog(value = "产品工具表-添加")
@ApiOperation(value="产品工具表-添加", notes="产品工具表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ProductOperationtool productOperationtool) {
productOperationtoolService.save(productOperationtool);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param productOperationtool
* @return
*/
@AutoLog(value = "产品工具表-编辑")
@ApiOperation(value="产品工具表-编辑", notes="产品工具表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ProductOperationtool productOperationtool) {
productOperationtoolService.updateById(productOperationtool);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "产品工具表-通过id删除")
@ApiOperation(value="产品工具表-通过id删除", notes="产品工具表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
productOperationtoolService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "产品工具表-批量删除")
@ApiOperation(value="产品工具表-批量删除", notes="产品工具表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.productOperationtoolService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "产品工具表-通过id查询")
@ApiOperation(value="产品工具表-通过id查询", notes="产品工具表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
ProductOperationtool productOperationtool = productOperationtoolService.getById(id);
if(productOperationtool==null) {
return Result.error("未找到对应数据");
}
return Result.OK(productOperationtool);
}
/**
* 导出excel
*
* @param request
* @param productOperationtool
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ProductOperationtool productOperationtool) {
return super.exportXls(request, productOperationtool, ProductOperationtool.class, "产品工具表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ProductOperationtool.class);
}
@GetMapping(value = "/up")
public Result<?> up(@RequestParam(name="id",required=true) String id) {
productOperationtoolService.up(id);
return Result.OK("升序成功");
}
@GetMapping(value = "/down")
public Result<?> down(@RequestParam(name="id",required=true) String id) {
ProductOperationtool zyProductProcess = productOperationtoolService.getById(id);
if(zyProductProcess==null||zyProductProcess.getSort()==0)
return Result.error("当前以是最低级别!!");
productOperationtoolService.down(id);
return Result.OK("降序成功");
}
}

@ -0,0 +1,64 @@
package org.jeecg.modules.product.pdoperationtool.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 产品工具表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Data
@TableName("product_operationtool")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="product_operationtool对象", description="产品工具表")
public class ProductOperationtool implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**产品id*/
@Excel(name = "产品id", width = 15)
@ApiModelProperty(value = "产品id")
// @Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id") 由于当前产品还没有,需要后期打开
private String productId;
/**工具id*/
@Excel(name = "工具id", width = 15)
@ApiModelProperty(value = "工具id")
@Dict(dictTable = "zy_tool", dicText = "name", dicCode = "id")
private String operationtoolId;
/**序号*/
@Excel(name = "序号", width = 15)
@ApiModelProperty(value = "序号")
private Integer sort;
/**准备情况*/
@Excel(name = "准备情况", width = 15)
@ApiModelProperty(value = "准备情况")
@Dict(dicCode = "ready")
private Integer preparation;
}

@ -0,0 +1,28 @@
package org.jeecg.modules.product.pdoperationtool.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.product.pdoperationtool.entity.ProductOperationtool;
/**
* @Description: 产品工具表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface ProductOperationtoolMapper extends BaseMapper<ProductOperationtool> {
@Select("select id from zy_tool where name like #{s}")
List<String> find(String s);
@Update("update product_operationtool set sort=sort+1 where id=#{id}")
void up(String id);
@Update("update product_operationtool set sort=sort-1 where id=#{id}")
void down(String id);
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.pdoperationtool.mapper.ProductOperationtoolMapper">
</mapper>

@ -0,0 +1,22 @@
package org.jeecg.modules.product.pdoperationtool.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.product.pdoperationtool.entity.ProductOperationtool;
import java.util.List;
/**
* @Description: 产品工具表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
public interface IProductOperationtoolService extends IService<ProductOperationtool> {
List<String> findAll(String s);
void up(String id);
void down(String id);
}

@ -0,0 +1,37 @@
package org.jeecg.modules.product.pdoperationtool.service.impl;
import org.jeecg.modules.product.pdoperationtool.entity.ProductOperationtool;
import org.jeecg.modules.product.pdoperationtool.mapper.ProductOperationtoolMapper;
import org.jeecg.modules.product.pdoperationtool.service.IProductOperationtoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: 产品工具表
* @Author: jeecg-boot
* @Date: 2022-12-20
* @Version: V1.0
*/
@Service
public class ProductOperationtoolServiceImpl extends ServiceImpl<ProductOperationtoolMapper, ProductOperationtool> implements IProductOperationtoolService {
@Autowired
ProductOperationtoolMapper productOperationtoolMapper;
@Override
public List<String> findAll(String s) {
return productOperationtoolMapper.find(s);
}
@Override
public void up(String s) {
productOperationtoolMapper.up(s);
}
@Override
public void down(String s) {
productOperationtoolMapper.down(s);
}
}

@ -17,6 +17,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
import org.jeecg.modules.product.pdaccessories.service.IProductAccessoriesService;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
import org.jeecg.modules.product.pdfabric.service.IProductFabricService;
import org.jeecg.modules.product.pdmachine.entity.ProductMachine;
import org.jeecg.modules.product.pdmachine.service.IProductMachineService;
import org.jeecg.modules.product.pdoperationtool.entity.ProductOperationtool;
import org.jeecg.modules.product.pdoperationtool.service.IProductOperationtoolService;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
@ -48,8 +56,16 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyProductProcessController extends JeecgController<ZyProductProcess, IZyProductProcessService> {
@Autowired
private IZyProductProcessService zyProductProcessService;
/**
@Autowired
private IProductFabricService productFabricService;
@Autowired
private IProductAccessoriesService productAccessoriesService;
@Autowired
private IProductMachineService productMachineService;
@Autowired
private IProductOperationtoolService productOperationtoolService;
/**
* 分页列表查询
*
* @param zyProductProcess
@ -97,8 +113,49 @@ public class ZyProductProcessController extends JeecgController<ZyProductProcess
s.eq("product_id",zyProductProcess.getProductId());
s.eq("process_id",zyProductProcess.getProcessId());
int a=zyProductProcessService.count(s);
if(a==0)
if(a==0){
zyProductProcessService.save(zyProductProcess);
//面料
List<String> listfabric =zyProductProcessService.findAllFabric(zyProductProcess.getProcessId());
if(listfabric!=null&&listfabric.size()>0)
for (String s1 : listfabric) {
ProductFabric productFabric=new ProductFabric();
productFabric.setFabricId(s1);
productFabric.setProductId(zyProductProcess.getProductId());
productFabric.setId(null);
productFabricService.save(productFabric);
}
//辅料
List<String> listAccessories =zyProductProcessService.findAllAccessories(zyProductProcess.getProcessId());
if(listAccessories!=null&&listAccessories.size()>0)
for (String listAccessory : listAccessories) {
ProductAccessories productAccessories=new ProductAccessories();
productAccessories.setAccessoriesId(listAccessory);
productAccessories.setProductId(zyProductProcess.getProductId());
productAccessories.setId(null);
productAccessoriesService.save(productAccessories);
}
//工具
List<String> listOperationtool =zyProductProcessService.findAllOperationtool(zyProductProcess.getProcessId());
if(listOperationtool!=null&&listOperationtool.size()>0)
for (String s1 : listOperationtool) {
ProductOperationtool productOperationtool=new ProductOperationtool();
productOperationtool.setOperationtoolId(s1);
productOperationtool.setProductId(zyProductProcess.getProductId());
productOperationtool.setId(null);
productOperationtoolService.save(productOperationtool);
}
//设备
List<String> listMachine =zyProductProcessService.findAllMachine(zyProductProcess.getProcessId());
if(listMachine!=null&&listMachine.size()>0)
for (String s1 : listMachine) {
ProductMachine productMachine=new ProductMachine();
productMachine.setMachineId(s1);
productMachine.setProductId(zyProductProcess.getProductId());
productMachine.setId(null);
productMachineService.save(productMachine);
}
}
zyProductProcess.setId(null);
}
return Result.OK("添加成功!");

@ -27,4 +27,16 @@ public interface ZyProductProcessMapper extends BaseMapper<ZyProductProcess> {
@Select("select id from zy_product where product_code like #{s}")
List<String> findProduct(String s);
//面料
@Select("select fabric_id from zy_process_fabric where process_id =#{processId}")
List<String> findAllFabric(String processId);
//辅料
@Select("select accessories_id from zy_process_accessories where process_id =#{processId}")
List<String> findAllAccessories(String processId);
//工具
@Select("select toolid from zy_operationtool where operationid =#{processId}")
List<String> findAllOperationtool(String processId);
//设备
@Select("select machine_id from zy_process_machine where process_id =#{processId}")
List<String> findAllMachine(String processId);
}

@ -21,4 +21,12 @@ public interface IZyProductProcessService extends IService<ZyProductProcess> {
List<String> find(String s);
List<String> findProduct(String s);
List<String> findAllFabric(String processId);
List<String> findAllAccessories(String processId);
List<String> findAllOperationtool(String processId);
List<String> findAllMachine(String processId);
}

@ -41,4 +41,24 @@ public class ZyProductProcessServiceImpl extends ServiceImpl<ZyProductProcessMap
public List<String> findProduct(String s) {
return zyProductProcessMapper.findProduct(s);
}
@Override
public List<String> findAllFabric(String processId) {
return zyProductProcessMapper.findAllFabric(processId);
}
@Override
public List<String> findAllAccessories(String processId) {
return zyProductProcessMapper.findAllAccessories(processId);
}
@Override
public List<String> findAllOperationtool(String processId) {
return zyProductProcessMapper.findAllOperationtool(processId);
}
@Override
public List<String> findAllMachine(String processId) {
return zyProductProcessMapper.findAllMachine(processId);
}
}

Loading…
Cancel
Save