喻忠伟 2 years ago
commit 904d6740e6
  1. 2
      ant-design-vue-jeecg/package.json
  2. 31
      ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue
  3. 52
      ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm.vue
  4. 139
      ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue
  5. 60
      ant-design-vue-jeecg/src/views/delivery/modules/DeliveryModal1.vue
  6. 10
      ant-design-vue-jeecg/src/views/device/ZyDeviceList.vue
  7. 16
      ant-design-vue-jeecg/src/views/device/modules/ZyDeviceForm.vue
  8. 4
      ant-design-vue-jeecg/src/views/hanger/HangerMakerList.vue
  9. 10
      ant-design-vue-jeecg/src/views/hanger/modules/HangerMakerForm.vue
  10. 40
      ant-design-vue-jeecg/src/views/zydevice/devicebrand/modules/ZyDevicebrandForm.vue
  11. 42
      ant-design-vue-jeecg/src/views/zydevice/devicemodel/modules/ZyDevicemodelForm.vue
  12. 4
      ant-design-vue-jeecg/src/views/zydevice/devicetype/modules/ZyDevicetypeForm.vue
  13. 29
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/controller/DeliveryController.java
  14. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/entity/Delivery.java
  15. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/mapper/DeliveryMapper.java
  16. 38
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/service/impl/DeliveryServiceImpl.java
  17. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/controller/ZyDeviceController.java
  18. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/mapper/ZyDeviceMapper.java
  19. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/IZyDeviceService.java
  20. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/impl/ZyDeviceServiceImpl.java
  21. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicebrand/controller/ZyDevicebrandController.java
  22. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicemodel/controller/ZyDevicemodelController.java
  23. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/controller/ZyDevicetypeController.java

@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"@antv/data-set": "^0.11.4", "@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", "@jiaminghi/data-view": "^2.10.0",
"@tinymce/tinymce-vue": "2.1.0", "@tinymce/tinymce-vue": "2.1.0",
"@toast-ui/editor": "^2.1.2", "@toast-ui/editor": "^2.1.2",

@ -95,6 +95,10 @@
</template> </template>
<span slot="action" slot-scope="text, record"> <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 @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
@ -115,7 +119,7 @@
</a-table> </a-table>
</div> </div>
<delivery-modal1 ref="modalFormqdck" @ok="modalFormOk"></delivery-modal1>
<delivery-modal ref="modalForm" @ok="modalFormOk"></delivery-modal> <delivery-modal ref="modalForm" @ok="modalFormOk"></delivery-modal>
</a-card> </a-card>
</template> </template>
@ -126,13 +130,16 @@
import { mixinDevice } from '@/utils/mixin' import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DeliveryModal from './modules/DeliveryModal' import DeliveryModal from './modules/DeliveryModal'
import DeliveryModal1 from './modules/DeliveryModal1'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { getAction } from '../../api/manage'
export default { export default {
name: 'DeliveryList', name: 'DeliveryList',
mixins:[JeecgListMixin, mixinDevice], mixins:[JeecgListMixin, mixinDevice],
components: { components: {
DeliveryModal DeliveryModal,
DeliveryModal1
}, },
data () { data () {
return { return {
@ -197,6 +204,11 @@
align:"center", align:"center",
dataIndex: 'adminId_dictText' dataIndex: 'adminId_dictText'
}, },
{
title:'出库状态',
align:"center",
dataIndex: 'status_dictText'
},
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
@ -207,6 +219,7 @@
} }
], ],
url: { url: {
cxck: "/delivery/delivery/cxck",
list: "/delivery/delivery/list", list: "/delivery/delivery/list",
delete: "/delivery/delivery/delete", delete: "/delivery/delivery/delete",
deleteBatch: "/delivery/delivery/deleteBatch", deleteBatch: "/delivery/delivery/deleteBatch",
@ -227,6 +240,20 @@
}, },
}, },
methods: { 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(){ initDictConfig(){
}, },
getSuperFieldList(){ getSuperFieldList(){

@ -3,19 +3,16 @@
<j-form-container :disabled="formDisabled"> <j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row> <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-col :span="24">
<a-form-model-item label="物品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemType"> <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-form-model-item>
</a-col> </a-col>
<a-col :span="24" v-if="this.model.itemType==1"> <a-col :span="24" v-if="this.model.itemType==1">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode"> <a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup <j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode" v-model="model.itemCode"
field="itemCode" field="itemCode"
org-fields="fabric_number" org-fields="fabric_number"
@ -31,6 +28,7 @@
<a-col :span="24" v-if="this.model.itemType==2"> <a-col :span="24" v-if="this.model.itemType==2">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode"> <a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup <j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode" v-model="model.itemCode"
field="itemCode" field="itemCode"
org-fields="nums" org-fields="nums"
@ -47,6 +45,7 @@
<a-col :span="24" v-if="this.model.itemType==3"> <a-col :span="24" v-if="this.model.itemType==3">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode"> <a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup <j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode" v-model="model.itemCode"
field="itemCode" field="itemCode"
org-fields="code" org-fields="code"
@ -62,6 +61,7 @@
<a-col :span="24" v-if="this.model.itemType==4"> <a-col :span="24" v-if="this.model.itemType==4">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode"> <a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup <j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode" v-model="model.itemCode"
field="itemCode" field="itemCode"
org-fields="nums" org-fields="nums"
@ -77,6 +77,7 @@
<a-col :span="24" v-if="this.model.itemType==5"> <a-col :span="24" v-if="this.model.itemType==5">
<a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode"> <a-form-model-item label="物品编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemCode">
<j-popup <j-popup
:disabled ="model.state !=='1' ? false:true"
v-model="model.itemCode" v-model="model.itemCode"
field="itemCode" field="itemCode"
org-fields="goods_code" org-fields="goods_code"
@ -89,42 +90,25 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="用量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount"> <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-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit"> <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-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="出库原因" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryReason"> <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-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="出库时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime"> <a-form-model-item label="出库时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
<j-date placeholder="请选择出库时间" v-model="model.deliveryTime" style="width: 100%" /> <j-date placeholder="请选择出库时间" :disabled ="model.state !=='1' ? false:true" 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"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
</a-form-model> </a-form-model>
</j-form-container> </j-form-container>
@ -167,9 +151,7 @@
amount: [ amount: [
{ required: true, message: '请输入用量!'}, { required: true, message: '请输入用量!'},
], ],
storehouseId: [
{ required: true, message: '请输入仓库!'},
],
itemType: [ itemType: [
{ required: true, message: '请输入物品类型!'}, { required: true, message: '请输入物品类型!'},
], ],
@ -179,12 +161,8 @@
deliveryTime: [ deliveryTime: [
{ required: true, message: '请输入出库时间!'}, { required: true, message: '请输入出库时间!'},
], ],
carrierId: [
{ required: true, message: '请输入取货人!'},
],
adminName: [
{ required: true, message: '请输入管理员!'},
],
}, },
url: { url: {
add: "/delivery/delivery/add", 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"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-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-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer"> <a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.name" placeholder="请输入名称" ></a-input> <a-input v-model="queryParam.name" placeholder="请输入名称" ></a-input>

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

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

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

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

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

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

@ -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删除 * 通过id删除
* *

@ -103,4 +103,10 @@ public class Delivery implements Serializable {
@Excel(name = "管理员", width = 15) @Excel(name = "管理员", width = 15)
@ApiModelProperty(value = "管理员") @ApiModelProperty(value = "管理员")
private String adminName; 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 java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.delivery.entity.Delivery; import org.jeecg.modules.demo.delivery.entity.Delivery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -15,4 +16,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface DeliveryMapper extends BaseMapper<Delivery> { 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.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@ -34,6 +35,10 @@ import java.util.Optional;
@Service @Service
public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> implements IDeliveryService { public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> implements IDeliveryService {
@Autowired
DeliveryMapper deliveryMapper;
@Autowired @Autowired
private IZyProductPlanService iZyProductPlanService; private IZyProductPlanService iZyProductPlanService;
@ -62,14 +67,28 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
delivery.setDeliveryReason("0"); delivery.setDeliveryReason("0");
delivery.setItemType("0"); delivery.setItemType("0");
delivery.setAmount(e.getAmount().doubleValue()); delivery.setAmount(e.getAmount().doubleValue());
// delivery.setDeliveryTime(new Date()); delivery.setDeliveryTime(new Date());
// delivery.setCarrierId("TODO");
// delivery.setAdminId("TODO");
// delivery.setStorehouseId("TODO");
ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId()); ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId());
if (!ObjectUtils.isEmpty(zyFabric)) { if (!ObjectUtils.isEmpty(zyFabric)) {
delivery.setItemCode(zyFabric.getFabricNumber()); 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); deliveryList4Fabric.add(delivery);
}); });
this.saveBatch(deliveryList4Fabric); this.saveBatch(deliveryList4Fabric);
@ -82,7 +101,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
delivery2.setDeliveryReason("0"); delivery2.setDeliveryReason("0");
delivery2.setItemType("1"); delivery2.setItemType("1");
delivery2.setAmount(e.getAmount().doubleValue()); delivery2.setAmount(e.getAmount().doubleValue());
// delivery2.setDeliveryTime(new Date()); delivery2.setDeliveryTime(new Date());
// delivery2.setCarrierId("TODO"); // delivery2.setCarrierId("TODO");
// delivery2.setAdminId("TODO"); // delivery2.setAdminId("TODO");
// delivery2.setStorehouseId("TODO"); // delivery2.setStorehouseId("TODO");
@ -90,6 +109,15 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
if (!ObjectUtils.isEmpty(zyAccessories)) { if (!ObjectUtils.isEmpty(zyAccessories)) {
delivery2.setItemCode(zyAccessories.getNums()); 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); deliveryList4accessories.add(delivery2);
}); });
this.saveBatch(deliveryList4accessories); this.saveBatch(deliveryList4accessories);

@ -75,7 +75,28 @@ public class ZyDeviceController extends JeecgController<ZyDevice, IZyDeviceServi
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) throws WriterException, IOException { 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); Page<ZyDevice> page = new Page<ZyDevice>(pageNo, pageSize);
IPage<ZyDevice> pageList = zyDeviceService.page(page, queryWrapper); IPage<ZyDevice> pageList = zyDeviceService.page(page, queryWrapper);
MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
@ -192,6 +213,10 @@ public class ZyDeviceController extends JeecgController<ZyDevice, IZyDeviceServi
@ApiOperation(value="设备信息-通过id删除", notes="设备信息-通过id删除") @ApiOperation(value="设备信息-通过id删除", notes="设备信息-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) { public Result<?> delete(@RequestParam(name="id",required=true) String id) {
int a=zyDeviceService.find(id);
if(a>=1){
return Result.error("有工序使用本设备,删除失败!!!");
}
zyDeviceService.removeById(id); zyDeviceService.removeById(id);
return Result.OK("删除成功!"); 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") @Select("select code from zy_device order by code desc limit 0,1")
String getCode(); 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 com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel; import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel;
import java.util.List;
/** /**
* @Description: 设备信息 * @Description: 设备信息
* @Author: jeecg-boot * @Author: jeecg-boot
@ -15,4 +17,10 @@ public interface IZyDeviceService extends IService<ZyDevice> {
ZyDevicemodel findByModelId(String modelId); ZyDevicemodel findByModelId(String modelId);
String getCode(); 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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/** /**
* @Description: 设备信息 * @Description: 设备信息
* @Author: jeecg-boot * @Author: jeecg-boot
@ -29,4 +31,19 @@ public class ZyDeviceServiceImpl extends ServiceImpl<ZyDeviceMapper, ZyDevice> i
public String getCode() { public String getCode() {
return zyDeviceMapper.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);
}
} }

@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.zydevice.devicebrand.entity.ZyDevicebrand; import org.jeecg.modules.zydevice.devicebrand.entity.ZyDevicebrand;
import org.jeecg.modules.zydevice.devicebrand.service.IZyDevicebrandService; 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.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@ -51,6 +52,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyDevicebrandController extends JeecgController<ZyDevicebrand, IZyDevicebrandService> { public class ZyDevicebrandController extends JeecgController<ZyDevicebrand, IZyDevicebrandService> {
@Autowired @Autowired
private IZyDevicebrandService zyDevicebrandService; private IZyDevicebrandService zyDevicebrandService;
@Autowired
private IZyDevicemodelService zyDevicemodelService;
/** /**
* 分页列表查询 * 分页列表查询
@ -127,6 +130,12 @@ public class ZyDevicebrandController extends JeecgController<ZyDevicebrand, IZyD
@ApiOperation(value="设备品牌管理-通过id删除", notes="设备品牌管理-通过id删除") @ApiOperation(value="设备品牌管理-通过id删除", notes="设备品牌管理-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) { 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); zyDevicebrandService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

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

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

Loading…
Cancel
Save