Merge remote-tracking branch 'origin/master'

zhc4dev
暖暖 2 years ago
commit 473549a60d
  1. 2
      ant-design-vue-jeecg/package.json
  2. 2
      ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
  3. 31
      ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue
  4. 52
      ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm.vue
  5. 139
      ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue
  6. 60
      ant-design-vue-jeecg/src/views/delivery/modules/DeliveryModal1.vue
  7. 10
      ant-design-vue-jeecg/src/views/device/ZyDeviceList.vue
  8. 18
      ant-design-vue-jeecg/src/views/device/modules/ZyDeviceForm.vue
  9. 4
      ant-design-vue-jeecg/src/views/hanger/HangerMakerList.vue
  10. 285
      ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue
  11. 183
      ant-design-vue-jeecg/src/views/hanger/ZyHangPointList.vue
  12. 10
      ant-design-vue-jeecg/src/views/hanger/modules/HangerMakerForm.vue
  13. 225
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue
  14. 60
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal.vue
  15. 84
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal__Style#Drawer.vue
  16. 118
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointForm.vue
  17. 60
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal.vue
  18. 84
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal__Style#Drawer.vue
  19. 278
      ant-design-vue-jeecg/src/views/maker/ZyMakerList.vue
  20. 97
      ant-design-vue-jeecg/src/views/maker/modules/ZyMakerFormDetail.vue
  21. 1
      ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue
  22. 42
      ant-design-vue-jeecg/src/views/zydevice/devicebrand/modules/ZyDevicebrandForm.vue
  23. 42
      ant-design-vue-jeecg/src/views/zydevice/devicemodel/modules/ZyDevicemodelForm.vue
  24. 4
      ant-design-vue-jeecg/src/views/zydevice/devicetype/modules/ZyDevicetypeForm.vue
  25. 1
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  26. 29
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/controller/DeliveryController.java
  27. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/entity/Delivery.java
  28. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/mapper/DeliveryMapper.java
  29. 38
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/service/impl/DeliveryServiceImpl.java
  30. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/controller/ZyDeviceController.java
  31. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/mapper/ZyDeviceMapper.java
  32. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/IZyDeviceService.java
  33. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/impl/ZyDeviceServiceImpl.java
  34. 214
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java
  35. 156
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangPointController.java
  36. 156
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHang.java
  37. 81
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHangPoint.java
  38. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangMapper.java
  39. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangPointMapper.java
  40. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangPointService.java
  41. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangService.java
  42. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangPointServiceImpl.java
  43. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangServiceImpl.java
  44. 238
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/controller/ZyMakerController.java
  45. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/entity/ZyMaker.java
  46. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/mapper/ZyMakerMapper.java
  47. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/IZyMakerService.java
  48. 92
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/impl/ZyMakerServiceImpl.java
  49. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicebrand/controller/ZyDevicebrandController.java
  50. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicemodel/controller/ZyDevicemodelController.java
  51. 23
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/controller/ZyDevicetypeController.java

@ -11,7 +11,7 @@
},
"dependencies": {
"@antv/data-set": "^0.11.4",
"@jeecg/antd-online-mini": "^3.4.3-beta2",
"@jeecg/antd-online-mini": "2.4.5-RC",
"@jiaminghi/data-view": "^2.10.0",
"@tinymce/tinymce-vue": "2.1.0",
"@toast-ui/editor": "^2.1.2",

@ -322,7 +322,7 @@ export const JeecgListMixin = {
zyStyleFabricHandleAdd: function (id) {
this.$refs.modalForm.add(id);
this.$refs.modalForm.title = "新增";
console.log("js层id的传递"+id);
//console.log("js层id的传递"+id);
this.$refs.modalForm.disableSubmit = false;
},
styleModuleHandleAdd: function (id,typeId,styleNames) {

@ -95,6 +95,10 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="qdck(record)">确定出库</a>
<a-divider type="vertical" />
<a @click="cxck(record)">撤销出库</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
@ -115,7 +119,7 @@
</a-table>
</div>
<delivery-modal1 ref="modalFormqdck" @ok="modalFormOk"></delivery-modal1>
<delivery-modal ref="modalForm" @ok="modalFormOk"></delivery-modal>
</a-card>
</template>
@ -126,13 +130,16 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DeliveryModal from './modules/DeliveryModal'
import DeliveryModal1 from './modules/DeliveryModal1'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { getAction } from '../../api/manage'
export default {
name: 'DeliveryList',
mixins:[JeecgListMixin, mixinDevice],
components: {
DeliveryModal
DeliveryModal,
DeliveryModal1
},
data () {
return {
@ -197,6 +204,11 @@
align:"center",
dataIndex: 'adminId_dictText'
},
{
title:'出库状态',
align:"center",
dataIndex: 'status_dictText'
},
{
title: '操作',
dataIndex: 'action',
@ -207,6 +219,7 @@
}
],
url: {
cxck: "/delivery/delivery/cxck",
list: "/delivery/delivery/list",
delete: "/delivery/delivery/delete",
deleteBatch: "/delivery/delivery/deleteBatch",
@ -227,6 +240,20 @@
},
},
methods: {
cxck(record){
getAction(this.url.cxck,{ id: record.id}).then((res)=>{
if(res.success){
this.loadData(1);
}else{
that.$message.warning(res.message);
}
})
},
qdck: function (record) {
this.$refs.modalFormqdck.edit(record);
this.$refs.modalFormqdck.title = "确定出库";
this.$refs.modalFormqdck.disableSubmit = false;
},
initDictConfig(){
},
getSuperFieldList(){

@ -3,19 +3,16 @@
<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="storehouseId">
<j-search-select-tag v-model="model.storehouseId" dict="starehouse,name,id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="物品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemType">
<j-dict-select-tag type="list" v-model="model.itemType" dictCode="goods_category" placeholder="请选择物品类型" />
<j-dict-select-tag type="list" :disabled ="model.state !=='1' ? false:true" v-model="model.itemType" dictCode="goods_category" placeholder="请选择物品类型" />
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="this.model.itemType==1">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode"
field="itemCode"
org-fields="fabric_number"
@ -31,6 +28,7 @@
<a-col :span="24" v-if="this.model.itemType==2">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode"
field="itemCode"
org-fields="nums"
@ -47,6 +45,7 @@
<a-col :span="24" v-if="this.model.itemType==3">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode"
field="itemCode"
org-fields="code"
@ -62,6 +61,7 @@
<a-col :span="24" v-if="this.model.itemType==4">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode"
field="itemCode"
org-fields="nums"
@ -77,6 +77,7 @@
<a-col :span="24" v-if="this.model.itemType==5">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode"
field="itemCode"
org-fields="goods_code"
@ -89,42 +90,25 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="用量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
<a-input v-model="model.amount" placeholder="请输入用量" ></a-input>
<a-input :disabled ="model.state !=='1' ? false:true" v-model="model.amount" placeholder="请输入用量" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit">
<a-input v-model="model.unit" placeholder="请输入单位" ></a-input>
<a-input :disabled ="model.state !=='1' ? false:true" v-model="model.unit" placeholder="请输入单位" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="出库原因" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryReason">
<j-dict-select-tag type="radio" v-model="model.deliveryReason" dictCode="scjc" placeholder="请选择出库原因" />
<j-dict-select-tag type="radio" :disabled ="model.state !=='1' ? false:true" v-model="model.deliveryReason" dictCode="scjc" placeholder="请选择出库原因" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="出库时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
<j-date placeholder="请选择出库时间" v-model="model.deliveryTime" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="取货人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="carrierId">
<j-select-user-by-dep v-model="model.carrierId" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="管理员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adminName">
<j-popup
v-model="model.adminName"
field="adminName"
org-fields="id,realname"
dest-fields="adminId,adminName"
code="findck"
:multi="true"
@input="popupCallback"
/>
<j-date placeholder="请选择出库时间" :disabled ="model.state !=='1' ? false:true" v-model="model.deliveryTime" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
@ -167,9 +151,7 @@
amount: [
{ required: true, message: '请输入用量!'},
],
storehouseId: [
{ required: true, message: '请输入仓库!'},
],
itemType: [
{ required: true, message: '请输入物品类型!'},
],
@ -179,12 +161,8 @@
deliveryTime: [
{ required: true, message: '请输入出库时间!'},
],
carrierId: [
{ required: true, message: '请输入取货人!'},
],
adminName: [
{ required: true, message: '请输入管理员!'},
],
},
url: {
add: "/delivery/delivery/add",

@ -0,0 +1,139 @@
<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="storehouseId">
<j-search-select-tag :disabled ="model.state !=='1' ? false:true" v-model="model.storehouseId" dict="starehouse,name,id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="取货人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="carrierId">
<j-select-user-by-dep :disabled ="model.state !=='1' ? false:true" v-model="model.carrierId" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="管理员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adminName">
<j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.adminName"
field="adminName"
org-fields="id,realname"
dest-fields="adminId,adminName"
code="findck"
:multi="true"
@input="popupCallback"
/>
</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: 'DeliveryForm1',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
state :"0",
itemType :"1",
deliveryReason : "0"
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
storehouseId: [
{ required: true, message: '请输入仓库!'},
],
carrierId: [
{ required: true, message: '请输入取货人!'},
],
adminName: [
{ required: true, message: '请输入管理员!'},
],
},
url: {
add: "/delivery/delivery/add",
edit: "/delivery/delivery/edit1",
queryById: "/delivery/delivery/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;
})
}
})
},
popupCallback(value,row){
this.model = Object.assign(this.model, row);
},
}
}
</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="关闭">
<delivery-form1 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></delivery-form1>
</j-modal>
</template>
<script>
import DeliveryForm1 from './DeliveryForm1'
export default {
name: 'DeliveryModal1',
components: {
DeliveryForm1
},
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>

@ -4,6 +4,16 @@
<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-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.brandId" placeholder="请输入品牌名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.modelId" placeholder="请输入品牌名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.name" placeholder="请输入名称" ></a-input>

@ -40,7 +40,7 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="经办人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="agent">
<j-select-user-by-dep v-model="model.agent" />
<j-select-user-by-dep v-model="model.agent" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
@ -53,8 +53,6 @@
<j-dict-select-tag v-model="model.status" dictCode="devicestatus1"
placeholder="设备状态"></j-dict-select-tag>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="维护周期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancecycle">
@ -77,6 +75,12 @@
<a-input v-model="model.img3d" placeholder="请输入模型地址" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="设备品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag v-model="model.canshu" dictCode="zy_devicebrand,brand,id"
placeholder="设备品牌" @change="canshu"></j-dict-select-tag>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="类型编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="devicetypeCode ">
<j-popup
@ -86,6 +90,7 @@
dest-fields="code1,modelId"
code="zy_devicemodel"
:multi="false"
:param="parm1"
@input="popupCallback"
/>
</a-form-model-item>
@ -116,6 +121,9 @@
},
data () {
return {
parm1:{
brand_id:''
},
model:{
status:1,
},
@ -147,6 +155,10 @@
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
canshu(){
this.parm1.brand_id=this.model.canshu
console.log(this.parm1)
},
add () {
this.edit(this.modelDefault);
},

@ -157,11 +157,11 @@ export default {
align: "center",
dataIndex: 'orderCode'
},
{
/*{
title: '制单编号',
align: "center",
dataIndex: 'makerCode'
},
},*/
{
title: '操作',
dataIndex: 'action',

@ -0,0 +1,285 @@
<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-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.brand" placeholder="请输入品牌"></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.model" placeholder="请输入型号"></a-input>
</a-form-model-item>
</a-col>
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">-->
<!-- <a-input v-model="queryParam.name" placeholder="请输入名称" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.code" placeholder="请输入编号"></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag v-model="queryParam.status" dictCode="devicestatus1"
placeholder="设备状态"></j-dict-select-tag>
</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('吊挂表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<!-- <a-button type="primary" icon="import">导入</a-button>-->
</a-upload>
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<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="imgeSlot" slot-scope="text">
<img :src="text" height="" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="img3dSlot" slot-scope="text">
<a :href="text" target="_blank">显示3d模型</a>
</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>
<zy-hang-modal ref="modalForm" @ok="modalFormOk"></zy-hang-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyHangModal from './modules/ZyHangModal'
export default {
name: 'ZyHangList',
mixins: [JeecgListMixin, mixinDevice],
components: {
ZyHangModal
},
data() {
return {
description: '吊挂表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '车间',
align: "center",
dataIndex: 'workshopId_dictText'
},
{
title: '品牌',
align: "center",
dataIndex: 'brand'
},
{
title: '型号',
align: "center",
dataIndex: 'model'
},
{
title: '编号',
align: "center",
dataIndex: 'code'
},
{
title: '工站数',
align: "center",
dataIndex: 'pointnumber'
},
{
title: '经办人',
align: "center",
dataIndex: 'agent_dictText'
},
{
title: '状态',
align: "center",
dataIndex: 'status_dictText'
},
{
title: '维护周期(天)',
align: "center",
dataIndex: 'maintenancecycle'
},
{
title: '管理人',
align: "center",
dataIndex: 'administrator_dictText'
},
{
title: '上次维护时间',
align: "center",
dataIndex: 'maintenancedate',
customRender: function (text) {
return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
}
},
{
title: '图片',
align: "center",
dataIndex: 'img',
scopedSlots: {customRender: 'imgSlot'}
},
{
title: '二维码',
align: "center",
dataIndex: 'qrcode',
scopedSlots: {customRender: 'imgeSlot'}
},
{
title: '3d模型',
align: "center",
dataIndex: 'img3d',
scopedSlots: {customRender: 'img3dSlot'}
},
{
title: '操作',
dataIndex: 'action',
align: "center",
// fixed:"right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/org.jeecg.modules.hanger/zyHang/list",
delete: "/org.jeecg.modules.hanger/zyHang/delete",
deleteBatch: "/org.jeecg.modules.hanger/zyHang/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.hanger/zyHang/exportXls",
importExcelUrl: "org.jeecg.modules.hanger/zyHang/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: 'brand', text: '品牌', dictCode: ''})
fieldList.push({type: 'string', value: 'model', text: '型号', dictCode: ''})
fieldList.push({type: 'string', value: 'code', text: '编号', dictCode: ''})
fieldList.push({type: 'int', value: 'pointnumber', text: '工站数', dictCode: ''})
fieldList.push({type: 'string', value: 'buydate', text: '购买时间', dictCode: ''})
fieldList.push({type: 'string', value: 'agent', text: '经办人', dictCode: ''})
fieldList.push({type: 'string', value: 'status', text: '状态', dictCode: ''})
fieldList.push({type: 'string', value: 'qrcode', text: '二维码', dictCode: ''})
fieldList.push({type: 'int', value: 'maintenancecycle', text: '维护周期', dictCode: ''})
fieldList.push({type: 'string', value: 'administrator', text: '管理 人', dictCode: ''})
fieldList.push({type: 'string', value: 'maintenancedate', text: '上次维护时间', dictCode: ''})
fieldList.push({type: 'string', value: 'img', text: '图片', dictCode: ''})
fieldList.push({type: 'string', value: 'img3d', text: '3d模型', dictCode: ''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,183 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</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>
<!-- 高级查询区域 -->
<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-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<zy-hang-point-modal ref="modalForm" @ok="modalFormOk"></zy-hang-point-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ZyHangPointModal from './modules/ZyHangPointModal'
export default {
name: 'ZyHangPointList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ZyHangPointModal
},
data () {
return {
description: '吊挂工位表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'吊挂编号',
align:"center",
dataIndex: 'code_dictText'
},
{
title:'工站编号',
align:"center",
dataIndex: 'point'
},
{
title:'工位id',
align:"center",
dataIndex: 'stationId_dictText'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/org.jeecg.modules.hanger/zyHangPoint/list",
delete: "/org.jeecg.modules.hanger/zyHangPoint/delete",
deleteBatch: "/org.jeecg.modules.hanger/zyHangPoint/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.hanger/zyHangPoint/exportXls",
importExcelUrl: "org.jeecg.modules.hanger/zyHangPoint/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:'code',text:'吊挂编号',dictCode:''})
fieldList.push({type:'string',value:'point',text:'工站编号',dictCode:''})
fieldList.push({type:'string',value:'stationId',text:'工位id',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -29,7 +29,7 @@
</a-col>
<a-col :span="24" v-show="false">
<a-form-model-item label="工单ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">
<a-input v-model="model.orderId" placeholder="请输入工单ID"></a-input>
<a-input v-model="model.orderId" placeholder="请选择工单"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -45,7 +45,7 @@
/>
</a-form-model-item>
</a-col>
<a-col :span="24" v-show="false">
<!-- <a-col :span="24" v-show="false">
<a-form-model-item label="制单ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="makerId">
<a-input v-model="model.makerId" placeholder="请输入制单ID"></a-input>
</a-form-model-item>
@ -62,7 +62,7 @@
@input="popupCallback"
/>
</a-form-model-item>
</a-col>
</a-col>-->
</a-row>
</a-form-model>
</j-form-container>
@ -87,7 +87,9 @@ export default {
},
data() {
return {
model: {},
model: {
ismaker: 0,
},
labelCol: {
xs: {span: 24},
sm: {span: 5},

@ -0,0 +1,225 @@
<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="workshopId">
<j-select-depart placeholder="请选择车间" v-model="model.workshopId" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brand">
<a-input v-model="model.brand" placeholder="请输入品牌" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="model">
<a-input v-model="model.model" placeholder="请输入型号" ></a-input>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code">-->
<!-- <a-input v-model="model.code" placeholder="请输入编号" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="工站数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pointnumber">
<a-input-number v-model="model.pointnumber" placeholder="请输入工站数" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="购买时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buydate">
<!-- <a-input v-model="model.buydate" placeholder="请输入购买时间" ></a-input>-->
<j-date placeholder="请选择购买时间" v-model="model.buydate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="经办人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="agent">
<!-- <a-input v-model="model.agent" placeholder="请输入经办人" ></a-input>-->
<j-select-user-by-dep v-model="model.agent" :multi="false"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<!-- <a-input v-model="model.status" placeholder="请输入状态"></a-input>-->
<j-dict-select-tag v-model="model.status" dictCode="devicestatus1"
placeholder="设备状态"></j-dict-select-tag>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="二维码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qrcode">-->
<!-- <a-input v-model="model.qrcode" placeholder="请输入二维码"></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="维护周期(天)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancecycle">
<a-input-number v-model="model.maintenancecycle" placeholder="请输入维护周期" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="管理人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="administrator">
<!-- <a-input v-model="model.administrator" placeholder="请输入管理人"></a-input>-->
<j-select-user-by-dep v-model="model.administrator" :multi="false"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="上次维护时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancedate">
<!-- <a-input v-model="model.maintenancedate" placeholder="请输入上次维护时间" ></a-input>-->
<j-date placeholder="请选择上次维护时间" v-model="model.maintenancedate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img">
<!-- <a-input v-model="model.img" placeholder="请输入图片" ></a-input>-->
<j-image-upload isMultiple v-model="model.img" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="3d模型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img3d">
<a-input v-model="model.img3d" placeholder="请输入3d模型" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'ZyHangForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
status:1,
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
brand: [
{ required: false},
{ pattern: /^.{0,36}$/, message: '长度过长!'},
],
model: [
{ required: false},
{ pattern: /^.{0,36}$/, message: '长度过长!'},
],
// code: [
// { required: true, message: '!'},
// // { pattern: /^.{6,6}$/, message: '!'},
// { pattern: /^(?=DG)[0-9]{6}$/, message: '!'},
// // /^[0-9A-Za-z]{6}$/
//
// ],
pointnumber: [
{ required: true, message: '请输入工站数!'},
// { pattern: /^-?\d+$/, message: '!'},
{pattern: /^[1-9]{0,100}$/, message: '请输入正整数'}
],
agent: [
{ required: false},
{ pattern: /^.{0,36}$/, message: '长度过长!'},
],
status: [
{ required: false},
{ pattern: /^.{1}$/, message: '长度过长!'},
],
qrcode: [
{ required: false},
// { pattern: /^[A-Z|a-z]+$/, message: '!'},
{ pattern: /^.{0,256}$/, message: '长度过长!'},
],
maintenancecycle: [
{ required: false},
// { pattern: /^-?\d+$/, message: '!'},
{pattern: /^[1-9]{0,100}$/, message: '请输入正整数'}
],
img: [
{ required: false},
{ pattern: /^.{0,300}$/, message: '长度过长!'},
],
img3d: [
{ required: false},
{ pattern: /^.{0,300}$/, message: '长度过长!'},
],
},
url: {
add: "/org.jeecg.modules.hanger/zyHang/add",
edit: "/org.jeecg.modules.hanger/zyHang/edit",
queryById: "/org.jeecg.modules.hanger/zyHang/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="关闭">
<zy-hang-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-hang-form>
</j-modal>
</template>
<script>
import ZyHangForm from './ZyHangForm'
export default {
name: 'ZyHangModal',
components: {
ZyHangForm
},
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">
<zy-hang-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-hang-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 ZyHangForm from './ZyHangForm'
export default {
name: 'ZyHangModal',
components: {
ZyHangForm
},
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,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="code">
<j-dict-select-tag type="list" v-model="model.code" dictCode="" placeholder="请选择吊挂编号" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工站编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="point">
<a-input v-model="model.point" placeholder="请输入工站编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工位id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId">
<j-dict-select-tag type="list" v-model="model.stationId" dictCode="" placeholder="请选择工位id" />
</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: 'ZyHangPointForm',
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: {
stationId: [
{ required: false},
{ pattern: /^\d{6,16}$/, message: '请输入6到16位数字!'},
],
},
url: {
add: "/org.jeecg.modules.hanger/zyHangPoint/add",
edit: "/org.jeecg.modules.hanger/zyHangPoint/edit",
queryById: "/org.jeecg.modules.hanger/zyHangPoint/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="关闭">
<zy-hang-point-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-hang-point-form>
</j-modal>
</template>
<script>
import ZyHangPointForm from './ZyHangPointForm'
export default {
name: 'ZyHangPointModal',
components: {
ZyHangPointForm
},
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">
<zy-hang-point-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-hang-point-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 ZyHangPointForm from './ZyHangPointForm'
export default {
name: 'ZyHangPointModal',
components: {
ZyHangPointForm
},
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>

@ -11,25 +11,34 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<a-button @click="makerAdd" 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-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>
<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-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-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>
<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>
@ -52,7 +61,8 @@
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
<img v-else :src="getImgView(text)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
@ -68,27 +78,31 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<!-- <a @click="handleEdit(record)">编辑</a>-->
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record.id)">详情</a>
</a-menu-item>
<a-menu-item>
<a @click="qrPrint(record)">二维码</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
<a @click="handleDetail(record.id)">详情</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<!-- <a-divider type="vertical"/>-->
<!-- <a-dropdown>-->
<!-- <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item>-->
<!-- <a @click="handleDetail(record.id)">详情</a>-->
<!-- </a-menu-item>-->
<!-- <a-menu-item>-->
<!-- <a @click="qrPrint(record)">二维码</a>-->
<!-- </a-menu-item>-->
<!-- <a-menu-item>-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </a-dropdown>-->
</span>
</a-table>
</div>
<ZyMakerFormDetail ref="ZyMakerFormDetail"></ZyMakerFormDetail>
@ -99,106 +113,132 @@
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ZyMakerModal from './modules/ZyMakerModal'
import QRCode from "./modules/QRCode";
import ZyMakerFormDetail from './modules/ZyMakerFormDetail'
export default {
name: 'ZyMakerList',
mixins:[JeecgListMixin, mixinDevice],
components: {
QRCode,
ZyMakerModal,
ZyMakerFormDetail
},
data () {
return {
description: '制单管理管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'制单编号',
align:"center",
dataIndex: 'code'
},
{
title:'工单编号',
align:"center",
dataIndex: 'workerCode'
},
{
title:'模块名称',
align:"center",
dataIndex: 'modelName'
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/maker/zyMaker/list",
delete: "/maker/zyMaker/delete",
deleteBatch: "/maker/zyMaker/deleteBatch",
exportXlsUrl: "/maker/zyMaker/exportXls",
importExcelUrl: "maker/zyMaker/importExcel",
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyMakerModal from './modules/ZyMakerModal'
import QRCode from "./modules/QRCode";
import ZyMakerFormDetail from './modules/ZyMakerFormDetail'
import {getAction, postAction} from "@api/manage";
export default {
name: 'ZyMakerList',
mixins: [JeecgListMixin, mixinDevice],
components: {
QRCode,
ZyMakerModal,
ZyMakerFormDetail
},
data() {
return {
description: '制单管理管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
dictOptions:{},
superFieldList:[],
}
},
created() {
{
title: '制单编号',
align: "center",
dataIndex: 'code'
},
{
title: '工单编号',
align: "center",
dataIndex: 'workerCode'
},
{
title: '产品编号',
align: "center",
dataIndex: 'productCode'
},
{
title: '产品名称',
align: "center",
dataIndex: 'productName'
},
{
title: '模块名称',
align: "center",
dataIndex: 'modelName'
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime'
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/maker/zyMaker/list",
listMakerAdd: "/maker/zyMaker/listMakerAdd",
delete: "/maker/zyMaker/delete",
deleteBatch: "/maker/zyMaker/deleteBatch",
exportXlsUrl: "/maker/zyMaker/exportXls",
importExcelUrl: "maker/zyMaker/importExcel",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
makerAdd() {
//this.url.listMakerAdd = '/maker/zyMaker/listMakerAdd';
postAction(this.url.listMakerAdd, null).then((res) => {
if(res.success){
this.$message.success(res.message);
this.loadData();
}else{
this.$message.warning(res.message);
}
// this.$emit('valueChange',1)
// this.close()
})
},
methods: {
initDictConfig(){
},
qrPrint(record) {
this.$refs.qrForm.edit(record);
this.$refs.qrForm.title = "二维码";
this.$refs.qrForm.disableSubmit = true;
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'code',text:'制单编号',dictCode:''})
fieldList.push({type:'string',value:'workerCode',text:'工单编号',dictCode:''})
fieldList.push({type:'string',value:'modelName',text:'模块名称',dictCode:''})
this.superFieldList = fieldList
},
handleDetail(id){
this.$refs.ZyMakerFormDetail.showModal(id)
// this.$children[0].showModal(id)
}
initDictConfig() {
},
qrPrint(record) {
this.$refs.qrForm.edit(record);
this.$refs.qrForm.title = "二维码";
this.$refs.qrForm.disableSubmit = true;
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'code', text: '制单编号', dictCode: ''})
fieldList.push({type: 'string', value: 'workerCode', text: '工单编号', dictCode: ''})
fieldList.push({type: 'string', value: 'modelName', text: '模块名称', dictCode: ''})
this.superFieldList = fieldList
},
handleDetail(id) {
this.$refs.ZyMakerFormDetail.showModal(id)
// this.$children[0].showModal(id)
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
@import '~@assets/less/common.less';
</style>

@ -11,17 +11,17 @@
>
<a-descriptions bordered size="small">
<a-descriptions-item label="制单编号" >
{{model.code}}
</a-descriptions-item>
<a-descriptions-item label="工单编号" >
{{model.workerCode}}
</a-descriptions-item>
<a-descriptions-item label="模块名称">
{{model.modelName}}
</a-descriptions-item>
</a-descriptions>
<a-descriptions bordered size="small">
<a-descriptions-item label="制单编号">
{{model.code}}
</a-descriptions-item>
<a-descriptions-item label="工单编号">
{{model.workerCode}}
</a-descriptions-item>
<a-descriptions-item label="模块名称">
{{model.modelName}}
</a-descriptions-item>
</a-descriptions>
</a-modal>
@ -29,44 +29,43 @@
</template>
<script>
export default {
name: 'ZyMakerFormDetail',
data () {
return {
visible: false,
confirmLoading: false,
model:{
},
}
export default {
name: 'ZyMakerFormDetail',
data() {
return {
visible: false,
confirmLoading: false,
model: {},
}
},
created() {
//model
// this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
showModal(id) {
// console.log(this.selectId)
this.visible = true;
this.$http.get('/maker/zyMaker/queryById?id=' + id).then(
res => {
this.model = res.result
console.log(this.data)
}
)
},
created () {
//model
// this.modelDefault = JSON.parse(JSON.stringify(this.model));
handleOk(e) {
this.ModalText = 'The modal will be closed after two seconds';
this.confirmLoading = true;
console.log(this.data)
setTimeout(() => {
this.visible = false;
this.confirmLoading = false;
}, 1);
},
methods: {
showModal(id) {
// console.log(this.selectId)
this.visible = true;
this.$http.get('/maker/zyMaker/queryById?id='+id).then(
res=>{
this.model = res.result
console.log(this.data)
}
)
},
handleOk(e) {
this.ModalText = 'The modal will be closed after two seconds';
this.confirmLoading = true;
console.log(this.data)
setTimeout(() => {
this.visible = false;
this.confirmLoading = false;
}, 1);
},
handleCancel(e) {
console.log('Clicked cancel button');
this.visible = false;
},
},
}
handleCancel(e) {
console.log('Clicked cancel button');
this.visible = false;
},
},
}
</script>

@ -313,7 +313,6 @@ export default {
getPaiWeiTu(record) {
// alert(JSON.stringify(record));
alert("请稍等,正在开发中。。。")
getAction(this.url.paiweitu, record).then((res) => {
if (res.success) {
console.log("the paiweitu----------" + JSON.stringify(res.result))

@ -3,33 +3,36 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-col :span="12">
<a-form-model-item label="品牌图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img">
<j-image-upload isMultiple v-model="model.img" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="12">
<a-form-model-item label="品牌名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brand">
<a-input v-model="model.brand" placeholder="请输入品牌名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产厂商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufacturer">
<j-select-depart v-model="model.manufacturer" />
<a-col :span="12">
<a-form-model-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplier">
<j-select-depart v-model="model.supplier" @change="shengchan" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplier">
<j-select-depart v-model="model.supplier" />
<a-col :span="12">
<a-form-model-item label="生产厂商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufacturer">
<j-select-depart v-model="model.manufacturer" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="12">
<a-form-model-item label="联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contact">
<a-input v-model="model.contact" placeholder="请输入联系人" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产地" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="place">
</a-row>
<a-row>
<a-col :span="48">
<a-form-model-item label="产地" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="place" >
<a-input v-model="model.place" placeholder="请输入产地" ></a-input>
</a-form-model-item>
</a-col>
@ -68,8 +71,20 @@
xs: { span: 24 },
sm: { span: 16 },
},
labelCol1: {
xs: { span: 24 },
sm: { span: 3 },
},
wrapperCol1: {
xs: { span: 24 },
sm: { span: 21 },
},
confirmLoading: false,
validatorRules: {
brand:[
{ required: true, message: '请输入品牌名称!'},
{min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'},
],
},
url: {
add: "/devicebrand/zyDevicebrand/add",
@ -88,6 +103,9 @@
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
shengchan(){
this.model.manufacturer=this.model.supplier
},
add () {
this.edit(this.modelDefault);
},
@ -126,4 +144,4 @@
},
}
}
</script>
</script>

@ -16,7 +16,7 @@
<!-- />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-col :span="12">
<a-form-model-item label="设备品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brandId ">
<j-popup
v-model="model.brand"
@ -43,7 +43,7 @@
<!-- />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-col :span="12">
<a-form-model-item label="类型编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="devicetypeCode ">
<j-popup
v-model="model.code"
@ -57,7 +57,7 @@
</a-form-model-item>
<a-input v-model="model.devicetypeCode" hidden/>
</a-col>
<a-col :span="24">
<a-col :span="12">
<a-form-model-item label="型号图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img">
<j-image-upload v-model="model.img" ></j-image-upload>
</a-form-model-item>
@ -67,24 +67,24 @@
<!-- <a-input v-model="model.qrcode" placeholder="请输入二维码" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-col :span="12">
<a-form-model-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="model">
<a-input v-model="model.model" placeholder="请输入型号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="型号参数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameters">
<a-input v-model="model.parameters" placeholder="请输入型号参数" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="型号描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-input v-model="model.description" placeholder="请输入型号描述" ></a-input>
</a-row>
<a-row>
<a-col :span="48">
<a-form-model-item label="型号参数" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="parameters">
<a-textarea v-model="model.parameters" rows="2" placeholder="请输入型号参数"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contact">
<a-input v-model="model.contact" placeholder="请输入联系人" ></a-input>
</a-row>
<a-row>
<a-col :span="48">
<a-form-model-item label="型号描述" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="description">
<!-- <a-input v-model="model.description" placeholder="请输入型号描述" ></a-input>-->
<a-textarea v-model="model.description" rows="2" placeholder="请输入型号描述"/>
</a-form-model-item>
</a-col>
</a-row>
@ -122,8 +122,20 @@
xs: { span: 24 },
sm: { span: 16 },
},
labelCol1: {
xs: { span: 24 },
sm: { span: 3 },
},
wrapperCol1: {
xs: { span: 24 },
sm: { span: 21 },
},
confirmLoading: false,
validatorRules: {
model:[
{ required: true, message: '请输入型号名称!'},
{min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'},
],
},
url: {
add: "/devicemodel/zyDevicemodel/add",

@ -56,6 +56,10 @@
},
confirmLoading: false,
validatorRules: {
name:[
{ required: true, message: '请输入设备类型!'},
{min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'},
],
},
url: {
add: "/devicetype/zyDevicetype/add",

@ -237,6 +237,7 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
return Result.error("只能选择一个企业");
} else {
//String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(id);
//根据企业id 直接在数据库里面拿到企业缩写 然后处理一下空值问题
String enterpriseName = zyClothsTypeMapper.getEnterpriseNum(id);
//根据企业名称拿到企业编号 //two 是直接编号 然后做一个判断
return Result.OK(zyClothsTypeService.getEnterpriseNumsTwo(enterpriseName));

@ -137,6 +137,35 @@ public class DeliveryController extends JeecgController<Delivery, IDeliveryServi
}
/**
* 编辑
*
* @param delivery
* @return
*/
@AutoLog(value = "出库表-编辑")
@ApiOperation(value="出库表-编辑", notes="出库表-编辑")
@PutMapping(value = "/edit1")
public Result<?> edit1(@RequestBody Delivery delivery) {
delivery.setStatus("1");
deliveryService.updateById(delivery);
return Result.OK("编辑成功!");
}
//重新上线cxsx
@AutoLog(value = "专利列表-重新上线")
@ApiOperation(value="专利列表-重新上线", notes="专利列表-重新上线")
@RequestMapping(value = "/cxck")
public Result<?> cxck(@RequestParam(name="id",required=true) String id) {
Delivery delivery = new Delivery();
delivery.setId(id);
delivery.setStatus("2");
deliveryService.updateById(delivery);
return Result.OK("ok!");
}
/**
* 通过id删除
*

@ -103,4 +103,10 @@ public class Delivery implements Serializable {
@Excel(name = "管理员", width = 15)
@ApiModelProperty(value = "管理员")
private String adminName;
/**出库状态*/
@Excel(name = "出库状态", width = 15, dicCode = "ckzt")
@Dict(dicCode = "ckzt")
@ApiModelProperty(value = "出库状态")
private java.lang.String status;
}

@ -4,6 +4,7 @@ package org.jeecg.modules.demo.delivery.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.delivery.entity.Delivery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -15,4 +16,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface DeliveryMapper extends BaseMapper<Delivery> {
@Select("select storehouse_id from storage where item_type=#{s} and item_code=#{fabricNumber} and amount > #{doubleValue}")
String findStorehouseId(String s, double doubleValue, String fabricNumber);
@Select("select user_id from storehouse where id =#{storehouseId}")
String getadminid(String storehouseId);
@Select("select storehouse_id from storage where item_type=#{s} and item_code=#{fabricNumber} and amount > #{doubleValue}")
String findStorehouseId2(String s, double doubleValue, String fabricNumber);
}

@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
@ -34,6 +35,10 @@ import java.util.Optional;
@Service
public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> implements IDeliveryService {
@Autowired
DeliveryMapper deliveryMapper;
@Autowired
private IZyProductPlanService iZyProductPlanService;
@ -62,14 +67,28 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
delivery.setDeliveryReason("0");
delivery.setItemType("0");
delivery.setAmount(e.getAmount().doubleValue());
// delivery.setDeliveryTime(new Date());
// delivery.setCarrierId("TODO");
// delivery.setAdminId("TODO");
// delivery.setStorehouseId("TODO");
delivery.setDeliveryTime(new Date());
ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId());
if (!ObjectUtils.isEmpty(zyFabric)) {
delivery.setItemCode(zyFabric.getFabricNumber());
}
//取货人
// delivery.setCarrierId("TODO");
//管理员
// delivery.setAdminId("TODO");
//仓库id
// delivery.setStorehouseId("TODO");
/*=====================开始=============================王家东添加*/
/* String StorehouseId = deliveryMapper.findStorehouseId("0",e.getAmount().doubleValue(),zyFabric.getFabricNumber());
if (StorehouseId!=""){
delivery.setStorehouseId(StorehouseId);
String adminid =deliveryMapper.getadminid(StorehouseId);
delivery.setStorehouseId(adminid);
}*/
/*=====================结束=============================王家东添加*/
deliveryList4Fabric.add(delivery);
});
this.saveBatch(deliveryList4Fabric);
@ -82,7 +101,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
delivery2.setDeliveryReason("0");
delivery2.setItemType("1");
delivery2.setAmount(e.getAmount().doubleValue());
// delivery2.setDeliveryTime(new Date());
delivery2.setDeliveryTime(new Date());
// delivery2.setCarrierId("TODO");
// delivery2.setAdminId("TODO");
// delivery2.setStorehouseId("TODO");
@ -90,6 +109,15 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
if (!ObjectUtils.isEmpty(zyAccessories)) {
delivery2.setItemCode(zyAccessories.getNums());
}
/* String StorehouseId = deliveryMapper.findStorehouseId2("0",e.getAmount().doubleValue(),zyFabric.getFabricNumber());
if (StorehouseId!=""){
delivery2.setStorehouseId(StorehouseId);
String adminid =deliveryMapper.getadminid(StorehouseId);
delivery2.setStorehouseId(adminid);
}*/
deliveryList4accessories.add(delivery2);
});
this.saveBatch(deliveryList4accessories);

@ -75,7 +75,28 @@ public class ZyDeviceController extends JeecgController<ZyDevice, IZyDeviceServi
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) throws WriterException, IOException {
QueryWrapper<ZyDevice> queryWrapper = QueryGenerator.initQueryWrapper(zyDevice, req.getParameterMap());
// QueryWrapper<ZyDevice> queryWrapper = QueryGenerator.initQueryWrapper(zyDevice, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
if(zyDevice.getName()!=null){
queryWrapper.like("name",zyDevice.getName());
}
if(zyDevice.getCode()!=null){
queryWrapper.like("code",zyDevice.getCode());
}
if(zyDevice.getStatus()!=null){
queryWrapper.eq("status",zyDevice.getStatus());
}
if(zyDevice.getBrandId()!=null){
String s="%"+zyDevice.getBrandId()+"%";
List<String> brand=zyDeviceService.findAllBrand(s);
queryWrapper.in("brand_id",brand);
}
if(zyDevice.getModelId()!=null){
String s="%"+zyDevice.getModelId()+"%";
List<String> model=zyDeviceService.findAllModel(s);
queryWrapper.in("model_id",model);
}
Page<ZyDevice> page = new Page<ZyDevice>(pageNo, pageSize);
IPage<ZyDevice> pageList = zyDeviceService.page(page, queryWrapper);
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
@ -192,6 +213,10 @@ public class ZyDeviceController extends JeecgController<ZyDevice, IZyDeviceServi
@ApiOperation(value="设备信息-通过id删除", notes="设备信息-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
int a=zyDeviceService.find(id);
if(a>=1){
return Result.error("有工序使用本设备,删除失败!!!");
}
zyDeviceService.removeById(id);
return Result.OK("删除成功!");
}

@ -21,4 +21,12 @@ public interface ZyDeviceMapper extends BaseMapper<ZyDevice> {
@Select("select code from zy_device order by code desc limit 0,1")
String getCode();
@Select("select id from zy_devicebrand where brand like #{s}")
List<String> findAllBrand(String s);
@Select("select id from zy_devicemodel where model like #{s}")
List<String> findAllModel(String s);
@Select("select count(1) from zy_process_machine where machineId=#{id}")
int find(String id);
}

@ -4,6 +4,8 @@ import org.jeecg.modules.device.entity.ZyDevice;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel;
import java.util.List;
/**
* @Description: 设备信息
* @Author: jeecg-boot
@ -15,4 +17,10 @@ public interface IZyDeviceService extends IService<ZyDevice> {
ZyDevicemodel findByModelId(String modelId);
String getCode();
List<String> findAllBrand(String s);
List<String> findAllModel(String s);
int find(String id);
}

@ -9,6 +9,8 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: 设备信息
* @Author: jeecg-boot
@ -29,4 +31,19 @@ public class ZyDeviceServiceImpl extends ServiceImpl<ZyDeviceMapper, ZyDevice> i
public String getCode() {
return zyDeviceMapper.getCode();
}
@Override
public List<String> findAllBrand(String s) {
return zyDeviceMapper.findAllBrand(s);
}
@Override
public List<String> findAllModel(String s) {
return zyDeviceMapper.findAllModel(s);
}
@Override
public int find(String id) {
return zyDeviceMapper.find(id);
}
}

@ -0,0 +1,214 @@
package org.jeecg.modules.hanger.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.hanger.entity.ZyHang;
import org.jeecg.modules.hanger.service.IZyHangService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.*;
/**
* @Description: 吊挂表
* @Author: jeecg-boot
* @Date: 2023-02-02
* @Version: V1.0
*/
@Api(tags = "吊挂表")
@RestController
@RequestMapping("/org.jeecg.modules.hanger/zyHang")
@Slf4j
public class ZyHangController extends JeecgController<ZyHang, IZyHangService> {
@Autowired
private IZyHangService zyHangService;
/**
* 分页列表查询
*
* @param zyHang
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "吊挂表-分页列表查询")
@ApiOperation(value = "吊挂表-分页列表查询", notes = "吊挂表-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyHang zyHang,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyHang> queryWrapper = QueryGenerator.initQueryWrapper(zyHang, req.getParameterMap());
Page<ZyHang> page = new Page<ZyHang>(pageNo, pageSize);
IPage<ZyHang> pageList = zyHangService.page(page, queryWrapper);
if (!ObjectUtils.isEmpty(pageList)) {
Map hints = new HashMap();
//设置UTF-8, 防止中文乱码
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
//设置二维码四周白色区域的大小
hints.put(EncodeHintType.MARGIN, 1);
//设置二维码的容错性
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
//width:图片完整的宽;height:图片完整的高
//因为要在二维码下方附上文字,所以把图片设置为长方形(高大于宽)
int width = 150;
int height = 150;
//画二维码,记得调用multiFormatWriter.encode()时最后要带上hints参数,不然上面设置无效
QRCodeWriter qrCodeWriter = new QRCodeWriter();
// List<Object> img = new ArrayList<>();
String content = "";
//批量生成二维码
try {
for (int i = 0; i < pageList.getRecords().size(); i++) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
content = pageList.getRecords().get(i).getCode();
BitMatrix bitMatrix = qrCodeWriter.encode(content, BarcodeFormat.QR_CODE, width, height, hints);
MatrixToImageWriter.writeToStream(bitMatrix, "PNG", outputStream);
Base64.Encoder encoder = Base64.getEncoder();
String text = encoder.encodeToString(outputStream.toByteArray());
pageList.getRecords().get(i).setQrcode("data:image/png;base64," + text);
}
} catch (Exception e) {
log.error("获取吊挂信息-异常-{},{}", e, e.getMessage());
Result.error("获取数据失败");
}
}
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyHang
* @return
*/
@AutoLog(value = "吊挂表-添加")
@ApiOperation(value = "吊挂表-添加", notes = "吊挂表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyHang zyHang) {
List<ZyHang> list = zyHangService.list(new LambdaQueryWrapper<ZyHang>()
.eq(ZyHang::getStatus, "0")
.orderByDesc(ZyHang::getCode));
String code = "";
if (ObjectUtils.isEmpty(list)) {
code = "DG1000";
} else {
String[] dgs = list.get(0).getCode().split("DG");
int val = new Integer(dgs[1]).intValue() + 1;
code = "DG" + val + "";
}
zyHang.setCode(code);
zyHang.setStatus("0");
zyHangService.save(zyHang);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyHang
* @return
*/
@AutoLog(value = "吊挂表-编辑")
@ApiOperation(value = "吊挂表-编辑", notes = "吊挂表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyHang zyHang) {
zyHang.setQrcode("");
zyHangService.updateById(zyHang);
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) {
zyHangService.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.zyHangService.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) {
ZyHang zyHang = zyHangService.getById(id);
if (zyHang == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyHang);
}
/**
* 导出excel
*
* @param request
* @param zyHang
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyHang zyHang) {
return super.exportXls(request, zyHang, ZyHang.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, ZyHang.class);
}
}

@ -0,0 +1,156 @@
package org.jeecg.modules.hanger.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.hanger.entity.ZyHangPoint;
import org.jeecg.modules.hanger.service.IZyHangPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: 吊挂工位表
* @Author: jeecg-boot
* @Date: 2023-02-03
* @Version: V1.0
*/
@Api(tags = "吊挂工位表")
@RestController
@RequestMapping("/org.jeecg.modules.hanger/zyHangPoint")
@Slf4j
public class ZyHangPointController extends JeecgController<ZyHangPoint, IZyHangPointService> {
@Autowired
private IZyHangPointService zyHangPointService;
/**
* 分页列表查询
*
* @param zyHangPoint
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "吊挂工位表-分页列表查询")
@ApiOperation(value = "吊挂工位表-分页列表查询", notes = "吊挂工位表-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyHangPoint zyHangPoint,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyHangPoint> queryWrapper = QueryGenerator.initQueryWrapper(zyHangPoint, req.getParameterMap());
Page<ZyHangPoint> page = new Page<ZyHangPoint>(pageNo, pageSize);
IPage<ZyHangPoint> pageList = zyHangPointService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyHangPoint
* @return
*/
@AutoLog(value = "吊挂工位表-添加")
@ApiOperation(value = "吊挂工位表-添加", notes = "吊挂工位表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyHangPoint zyHangPoint) {
zyHangPointService.save(zyHangPoint);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyHangPoint
* @return
*/
@AutoLog(value = "吊挂工位表-编辑")
@ApiOperation(value = "吊挂工位表-编辑", notes = "吊挂工位表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyHangPoint zyHangPoint) {
zyHangPointService.updateById(zyHangPoint);
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) {
zyHangPointService.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.zyHangPointService.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) {
ZyHangPoint zyHangPoint = zyHangPointService.getById(id);
if (zyHangPoint == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyHangPoint);
}
/**
* 导出excel
*
* @param request
* @param zyHangPoint
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyHangPoint zyHangPoint) {
return super.exportXls(request, zyHangPoint, ZyHangPoint.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, ZyHangPoint.class);
}
}

@ -0,0 +1,156 @@
package org.jeecg.modules.hanger.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 吊挂表
* @Author: jeecg-boot
* @Date: 2023-02-02
* @Version: V1.0
*/
@Data
@TableName("zy_hang")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "zy_hang对象", description = "吊挂表")
public class ZyHang 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;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**
* 车间
*/
@Excel(name = "车间", width = 15)
@ApiModelProperty(value = "车间")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
private String workshopId;
/**
* 品牌
*/
@Excel(name = "品牌", width = 15)
@ApiModelProperty(value = "品牌")
private String brand;
/**
* 型号
*/
@Excel(name = "型号", width = 15)
@ApiModelProperty(value = "型号")
private String model;
/**
* 编号
*/
@Excel(name = "编号", width = 15)
@ApiModelProperty(value = "编号")
private String code;
/**
* 工站数
*/
@Excel(name = "工站数", width = 15)
@ApiModelProperty(value = "工站数")
private Integer pointnumber;
/**
* 购买时间
*/
@Excel(name = "购买时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "购买时间")
private Date buydate;
/**
* 经办人
*/
@Excel(name = "经办人", width = 15)
@ApiModelProperty(value = "经办人")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
private String agent;
/**
* 状态
*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
@Dict(dicCode = "devicestatus1")
private String status;
/**
* 二维码
*/
@Excel(name = "二维码", width = 15)
@ApiModelProperty(value = "二维码")
private String qrcode;
/**
* 维护周期
*/
@Excel(name = "维护周期", width = 15)
@ApiModelProperty(value = "维护周期")
private Integer maintenancecycle;
/**
* 管理
*/
@Excel(name = "管理人", width = 15)
@ApiModelProperty(value = "管理人")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
private String administrator;
/**
* 上次维护时间
*/
@Excel(name = "上次维护时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "上次维护时间")
private Date maintenancedate;
/**
* 图片
*/
@Excel(name = "图片", width = 15)
@ApiModelProperty(value = "图片")
private String img;
/**
* 3d模型
*/
@Excel(name = "3d模型", width = 15)
@ApiModelProperty(value = "3d模型")
private String img3d;
}

@ -0,0 +1,81 @@
package org.jeecg.modules.hanger.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 吊挂工位表
* @Author: jeecg-boot
* @Date: 2023-02-03
* @Version: V1.0
*/
@Data
@TableName("zy_hang_point")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "zy_hang_point对象", description = "吊挂工位表")
public class ZyHangPoint 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;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**
* 吊挂编号
*/
@Excel(name = "吊挂编号", width = 15)
@ApiModelProperty(value = "吊挂编号")
private String code;
/**
* 工站编号
*/
@Excel(name = "工站编号", width = 15)
@ApiModelProperty(value = "工站编号")
private String point;
/**
* 工位id
*/
@Excel(name = "工位id", width = 15)
@ApiModelProperty(value = "工位id")
private String stationId;
}

@ -0,0 +1,15 @@
package org.jeecg.modules.hanger.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.hanger.entity.ZyHang;
/**
* @Description: 吊挂表
* @Author: jeecg-boot
* @Date: 2023-02-02
* @Version: V1.0
*/
public interface ZyHangMapper extends BaseMapper<ZyHang> {
}

@ -0,0 +1,15 @@
package org.jeecg.modules.hanger.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.hanger.entity.ZyHangPoint;
/**
* @Description: 吊挂工位表
* @Author: jeecg-boot
* @Date: 2023-02-03
* @Version: V1.0
*/
public interface ZyHangPointMapper extends BaseMapper<ZyHangPoint> {
}

@ -0,0 +1,15 @@
package org.jeecg.modules.hanger.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.hanger.entity.ZyHangPoint;
/**
* @Description: 吊挂工位表
* @Author: jeecg-boot
* @Date: 2023-02-03
* @Version: V1.0
*/
public interface IZyHangPointService extends IService<ZyHangPoint> {
}

@ -0,0 +1,15 @@
package org.jeecg.modules.hanger.service;
import org.jeecg.modules.hanger.entity.ZyHang;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 吊挂表
* @Author: jeecg-boot
* @Date: 2023-02-02
* @Version: V1.0
*/
public interface IZyHangService extends IService<ZyHang> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.hanger.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.hanger.entity.ZyHangPoint;
import org.jeecg.modules.hanger.mapper.ZyHangPointMapper;
import org.jeecg.modules.hanger.service.IZyHangPointService;
import org.springframework.stereotype.Service;
/**
* @Description: 吊挂工位表
* @Author: jeecg-boot
* @Date: 2023-02-03
* @Version: V1.0
*/
@Service
public class ZyHangPointServiceImpl extends ServiceImpl<ZyHangPointMapper, ZyHangPoint> implements IZyHangPointService {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.hanger.service.impl;
import org.jeecg.modules.hanger.entity.ZyHang;
import org.jeecg.modules.hanger.mapper.ZyHangMapper;
import org.jeecg.modules.hanger.service.IZyHangService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 吊挂表
* @Author: jeecg-boot
* @Date: 2023-02-02
* @Version: V1.0
*/
@Service
public class ZyHangServiceImpl extends ServiceImpl<ZyHangMapper, ZyHang> implements IZyHangService {
}

@ -9,6 +9,7 @@ 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;
@ -36,133 +37,148 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
/**
* @Description: 制单管理
* @Author: jeecg-boot
* @Date: 2021-11-27
* @Date: 2021-11-27
* @Version: V1.0
*/
@Api(tags="制单管理")
@Api(tags = "制单管理")
@RestController
@RequestMapping("/maker/zyMaker")
@Slf4j
public class ZyMakerController extends JeecgController<ZyMaker, IZyMakerService> {
@Autowired
private IZyMakerService zyMakerService;
/**
* 分页列表查询
*
* @param zyMaker
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "制单管理-分页列表查询")
@ApiOperation(value="制单管理-分页列表查询", notes="制单管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyMaker zyMaker,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyMaker> queryWrapper = QueryGenerator.initQueryWrapper(zyMaker, req.getParameterMap());
Page<ZyMaker> page = new Page<ZyMaker>(pageNo, pageSize);
IPage<ZyMaker> pageList = zyMakerService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyMaker
* @return
*/
@AutoLog(value = "制单管理-添加")
@ApiOperation(value="制单管理-添加", notes="制单管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyMaker zyMaker) {
zyMakerService.save(zyMaker);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyMaker
* @return
*/
@AutoLog(value = "制单管理-编辑")
@ApiOperation(value="制单管理-编辑", notes="制单管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyMaker zyMaker) {
zyMakerService.updateById(zyMaker);
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) {
zyMakerService.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.zyMakerService.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) {
ZyMaker zyMaker = zyMakerService.getById(id);
if(zyMaker==null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyMaker);
}
@Autowired
private IZyMakerService zyMakerService;
/**
* 分页列表查询
*
* @param zyMaker
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "制单管理-分页列表查询")
@ApiOperation(value = "制单管理-分页列表查询", notes = "制单管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyMaker zyMaker,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyMaker> queryWrapper = QueryGenerator.initQueryWrapper(zyMaker, req.getParameterMap());
Page<ZyMaker> page = new Page<ZyMaker>(pageNo, pageSize);
IPage<ZyMaker> pageList = zyMakerService.page(page, queryWrapper);
List<ZyMaker> zyMakerList = zyMakerService.ZyMakerVo(pageList.getRecords());
pageList.setRecords(zyMakerList);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyMaker
* @return
*/
@AutoLog(value = "制单管理-添加")
@ApiOperation(value = "制单管理-添加", notes = "制单管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyMaker zyMaker) {
zyMakerService.save(zyMaker);
return Result.OK("添加成功!");
}
/**
* 制单
*/
@AutoLog(value = "制单管理-制单")
@ApiOperation(value = "制单管理-制单", notes = "制单管理-制单")
@PostMapping(value = "/listMakerAdd")
public Result<?> listMakerAdd() {
//点击制单 点击后按产品模块分解成制单写入制单表
zyMakerService.listMakerAdd();
//zyMakerService.save(zyMaker);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyMaker
* @return
*/
@AutoLog(value = "制单管理-编辑")
@ApiOperation(value = "制单管理-编辑", notes = "制单管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyMaker zyMaker) {
zyMakerService.updateById(zyMaker);
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) {
zyMakerService.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.zyMakerService.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) {
ZyMaker zyMaker = zyMakerService.getById(id);
if (zyMaker == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyMaker);
}
/**
* 导出excel
*
* @param request
* @param zyMaker
*/
* 导出excel
*
* @param request
* @param zyMaker
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyMaker zyMaker) {
return super.exportXls(request, zyMaker, ZyMaker.class, "制单管理");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyMaker.class);

@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@ -66,6 +67,12 @@ public class ZyMaker implements Serializable {
@Excel(name = "工单编号", width = 15)
@ApiModelProperty(value = "工单编号")
private String workerCode;
/**产品编号*/
@TableField(exist = false)
private String productCode;
/**产品名称*/
@TableField(exist = false)
private String productName;
/**模块id*/
@Excel(name = "模块id", width = 15)
@ApiModelProperty(value = "模块id")

@ -3,8 +3,10 @@ package org.jeecg.modules.maker.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.maker.entity.ZyMaker;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.workproduct.entity.ZyProduct;
/**
* @Description: 制单管理
@ -14,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ZyMakerMapper extends BaseMapper<ZyMaker> {
@Select("select * from zy_product where work_order_id=#{workerCode}")
ZyProduct getProduct(String workerCode);
}

@ -3,6 +3,8 @@ package org.jeecg.modules.maker.service;
import org.jeecg.modules.maker.entity.ZyMaker;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 制单管理
* @Author: jeecg-boot
@ -11,4 +13,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IZyMakerService extends IService<ZyMaker> {
//点击制单 点击后按产品模块分解成制单写入制单表
void listMakerAdd();
List<ZyMaker> ZyMakerVo(List<ZyMaker> records);
}

@ -1,19 +1,109 @@
package org.jeecg.modules.maker.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.maker.entity.ZyMaker;
import org.jeecg.modules.maker.mapper.ZyMakerMapper;
import org.jeecg.modules.maker.service.IZyMakerService;
import org.jeecg.modules.workorder.entity.WorkOrder;
import org.jeecg.modules.workorder.service.IWorkOrderService;
import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.service.IZyProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
* @Description: 制单管理
* @Author: jeecg-boot
* @Date: 2021-11-27
* @Date: 2021-11-27
* @Version: V1.0
*/
@Service
public class ZyMakerServiceImpl extends ServiceImpl<ZyMakerMapper, ZyMaker> implements IZyMakerService {
@Autowired
private IWorkOrderService workOrderService;
@Autowired
private IZyProductService productService;
@Resource
private ZyMakerMapper zyMakerMapper;
////点击制单 点击后按产品模块分解成制单写入制单表
@Override
public void listMakerAdd() {
//先拿到所有产品 产品暂定为服装款式里面的数据
List<WorkOrder> workOrderList = workOrderService.list();
for (WorkOrder workOrder : workOrderList) {
ZyMaker maker = new ZyMaker();
//制单编号 工单编号(22)+顺序号(2)
maker.setCode(getMakerCode(workOrder.getProductCode()));
//工单编号
maker.setWorkerCode(workOrder.getProductCode());
this.save(maker);
}
}
@Override
public List<ZyMaker> ZyMakerVo(List<ZyMaker> records) {
if (ObjectUtils.isEmpty(records)) {
return null;
}
//根据工单编号找到产品编号 产品名称
for (ZyMaker maker : records) {
ZyProduct zyProductMapper = zyMakerMapper.getProduct(maker.getWorkerCode());
// LambdaQueryWrapper<ZyProduct> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(ZyProduct::getWorkOrderId, maker.getWorkerCode());
// ZyProduct zyProduct = productService.getOne(queryWrapper);
//产品编号
if (!ObjectUtils.isEmpty(zyProductMapper)){
if (StringUtils.hasText(zyProductMapper.getProductCode())) {
maker.setProductCode(zyProductMapper.getProductCode());
}
if (StringUtils.hasText(zyProductMapper.getProductName())) {
maker.setProductName(zyProductMapper.getProductName());
}
}
//产品名称
}
return records;
}
private String getMakerCode(String productCode) {
if (StringUtils.isEmpty(productCode)) {
return "null";
}
List<ZyMaker> zyMakerList = this.list();
List<String> collect = zyMakerList.stream().map(ZyMaker::getCode).collect(Collectors.toList());
List<Long> longList = new ArrayList<>();
for (String makerCode : collect) {
String newNums = makerCode.trim();
if (StringUtils.isEmpty(newNums)) continue;
if (newNums.length() <= 2) longList.add(Long.valueOf(newNums));
else {
//拿到后6位 substring(4) 截掉前4位
String substring = newNums.substring(newNums.length() - 2);
longList.add(Long.valueOf(substring));
}
}
long max = Collections.max(longList) + 1;
if (Long.toString(max).length() > 2) {
String toString = Long.toString(max);
return toString.substring(toString.length() - 2);
}
return String.format("%02d", max);
}
}

@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.zydevice.devicebrand.entity.ZyDevicebrand;
import org.jeecg.modules.zydevice.devicebrand.service.IZyDevicebrandService;
import org.jeecg.modules.zydevice.devicemodel.service.IZyDevicemodelService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -51,8 +52,10 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyDevicebrandController extends JeecgController<ZyDevicebrand, IZyDevicebrandService> {
@Autowired
private IZyDevicebrandService zyDevicebrandService;
/**
@Autowired
private IZyDevicemodelService zyDevicemodelService;
/**
* 分页列表查询
*
* @param zyDevicebrand
@ -127,6 +130,12 @@ public class ZyDevicebrandController extends JeecgController<ZyDevicebrand, IZyD
@ApiOperation(value="设备品牌管理-通过id删除", notes="设备品牌管理-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("brand_id",id);
int a=zyDevicemodelService.count(queryWrapper);
if(a>=0){
return Result.error("本型号已被使用,删除失败!!");
}
zyDevicebrandService.removeById(id);
return Result.OK("删除成功!");
}

@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.device.service.IZyDeviceService;
import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel;
import org.jeecg.modules.zydevice.devicemodel.service.IZyDevicemodelService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
@ -59,7 +60,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyDevicemodelController extends JeecgController<ZyDevicemodel, IZyDevicemodelService> {
@Autowired
private IZyDevicemodelService zyDevicemodelService;
@Autowired
private IZyDeviceService zyDeviceService;
/**
* 分页列表查询
*
@ -162,6 +164,12 @@ public class ZyDevicemodelController extends JeecgController<ZyDevicemodel, IZyD
@ApiOperation(value="设备型号表-通过id删除", notes="设备型号表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("model_id",id);
int a=zyDeviceService.count(queryWrapper);
if(a>=1){
return Result.error("设备型号有使用,删除失败!!!");
}
zyDevicemodelService.removeById(id);
return Result.OK("删除成功!");
}

@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.zydevice.devicemodel.service.IZyDevicemodelService;
import org.jeecg.modules.zydevice.devicetype.entity.ZyDevicetype;
import org.jeecg.modules.zydevice.devicetype.service.IZyDevicetypeService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
@ -49,8 +50,10 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyDevicetypeController extends JeecgController<ZyDevicetype, IZyDevicetypeService> {
@Autowired
private IZyDevicetypeService zyDevicetypeService;
/**
@Autowired
private IZyDevicemodelService zyDevicemodelService;
/**
* 分页列表查询
*
* @param zyDevicetype
@ -83,6 +86,9 @@ public class ZyDevicetypeController extends JeecgController<ZyDevicetype, IZyDev
@ApiOperation(value="设备类型-添加", notes="设备类型-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyDevicetype zyDevicetype) {
if(zyDevicetype.getName().length()>200){
return Result.error("添加失败,设备类型名称太长!");
}
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("name",zyDevicetype.getName());
int a=zyDevicetypeService.count(queryWrapper);
@ -90,7 +96,7 @@ public class ZyDevicetypeController extends JeecgController<ZyDevicetype, IZyDev
zyDevicetypeService.save(zyDevicetype);
return Result.OK("添加成功!");}
else{
return Result.error("添加失败,该设备名称已存在!");
return Result.error("添加失败,该设备类型名称已存在!");
}
}
@ -104,6 +110,9 @@ public class ZyDevicetypeController extends JeecgController<ZyDevicetype, IZyDev
@ApiOperation(value="设备类型-编辑", notes="设备类型-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyDevicetype zyDevicetype) {
if(zyDevicetype.getName().length()>200){
return Result.error("添加失败,设备类型名称太长!");
}
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("name",zyDevicetype.getName());
int a=zyDevicetypeService.count(queryWrapper);
@ -125,6 +134,14 @@ public class ZyDevicetypeController extends JeecgController<ZyDevicetype, IZyDev
@ApiOperation(value="设备类型-通过id删除", notes="设备类型-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
ZyDevicetype zyDevicetype = zyDevicetypeService.getById(id);
//判断型号中是否被使用
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("devicetype_code",zyDevicetype.getCode());
int a=zyDevicemodelService.count(queryWrapper);
if(a>=1){
return Result.error("本类型已被使用,请先删除对应型号!!!");
}
zyDevicetypeService.removeById(id);
return Result.OK("删除成功!");
}

Loading…
Cancel
Save