2023-2-8工具

zhc4dev
lenovo 2 years ago
parent 65bf57078e
commit 4db6a3b68e
  1. 2
      ant-design-vue-jeecg/src/views/device/ZyDeviceList.vue
  2. 6
      ant-design-vue-jeecg/src/views/device/modules/ZyDeviceForm.vue
  3. 20
      ant-design-vue-jeecg/src/views/tool/brand/modules/ZyToolBrandForm.vue
  4. 2
      ant-design-vue-jeecg/src/views/tool/model/ZyToolModelList.vue
  5. 45
      ant-design-vue-jeecg/src/views/tool/model/modules/ZyToolModelForm.vue
  6. 12
      ant-design-vue-jeecg/src/views/tool/tool/ZyToolList.vue
  7. 41
      ant-design-vue-jeecg/src/views/tool/tool/modules/ZyToolForm.vue
  8. 4
      ant-design-vue-jeecg/src/views/tool/type/modules/ZyToolTypeForm.vue
  9. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicebrand/controller/ZyDevicebrandController.java
  10. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/toolbrand/controller/ZyToolBrandController.java
  11. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/toolmodel/controller/ZyToolModelController.java
  12. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/tooltype/controller/ZyToolTypeController.java
  13. 26
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/zytool/controller/ZyToolController.java
  14. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/zytool/mapper/ZyToolMapper.java
  15. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/zytool/service/IZyToolService.java
  16. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/zytool/service/impl/ZyToolServiceImpl.java

@ -26,7 +26,7 @@
</a-col> </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="status"> <a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag v-model="queryParam.status" dictCode="devicestatus1" <j-dict-select-tag type="radio" v-model="queryParam.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>

@ -50,7 +50,7 @@
<!-- </a-col>--> <!-- </a-col>-->
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> <a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag v-model="model.status" dictCode="devicestatus1" <j-dict-select-tag type="radio" 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>
@ -137,6 +137,10 @@
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
name:[
{ required: true, message: '请输入设备名称!'},
{min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'},
],
}, },
url: { url: {
add: "/device/zyDevice/add", add: "/device/zyDevice/add",

@ -9,20 +9,21 @@
</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="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="24">
<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="24">
<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="24">
<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>
@ -70,6 +71,10 @@
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
brand:[
{ required: true, message: '请输入品牌名称!'},
{min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'},
],
}, },
url: { url: {
add: "/toolbrand/zyToolBrand/add", add: "/toolbrand/zyToolBrand/add",
@ -88,6 +93,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);
}, },

@ -185,7 +185,7 @@
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
align:"center", align:"center",
fixed:"right",
width:147, width:147,
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }
} }

@ -8,7 +8,7 @@
<!-- <a-input v-model="model.brandId" placeholder="请输入品牌名称" ></a-input>--> <!-- <a-input v-model="model.brandId" 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="brandId "> <a-form-model-item label="工具品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brandId ">
<j-popup <j-popup
v-model="model.brand" v-model="model.brand"
@ -27,7 +27,7 @@
<!-- <a-input v-model="model.tooltypeCode" placeholder="请输入类型编号" ></a-input>--> <!-- <a-input v-model="model.tooltypeCode" 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="tooltypeCode "> <a-form-model-item label="类型编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tooltypeCode ">
<j-popup <j-popup
v-model="model.code" v-model="model.code"
@ -41,36 +41,41 @@
</a-form-model-item> </a-form-model-item>
<a-input v-model="model.tooltypeCode" hidden/> <a-input v-model="model.tooltypeCode" 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>
</a-col> </a-col>
<!-- <a-col :span="24">--> <!-- <a-col :span="24">-->
<!-- <a-form-model-item label="二维码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qrcode">--> <!-- <a-form-model-item label="二维码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qrcode">-->
<!-- <j-image-upload isMultiple v-model="model.qrcode" ></j-image-upload>--> <!-- <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-col :span="24">-->
<!-- <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-row> </a-row>
</a-form-model> </a-form-model>
</j-form-container> </j-form-container>
@ -106,6 +111,14 @@
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: {
}, },

@ -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>
@ -16,7 +26,7 @@
</a-col> </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="status"> <a-form-model-item label="工具状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag v-model="queryParam.status" dictCode="devicestatus1" <j-dict-select-tag type="radio" v-model="queryParam.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>

@ -24,14 +24,19 @@
<!-- </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="code"v-if="bianhao==1">-->
<!-- <a-input v-model="model.code" placeholder="请输入工具编号" disabled></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="工具编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code"v-if="bianhao==1"> <a-form-model-item label="工具名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.code" placeholder="请输入工具编号" disabled></a-input> <a-input v-model="model.name" 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="name"> <a-form-model-item label="工具图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img">
<a-input v-model="model.name" placeholder="请输入工具名称" ></a-input> <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="24">
@ -46,7 +51,7 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="工具状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> <a-form-model-item label="工具状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag v-model="model.status" dictCode="devicestatus1" <j-dict-select-tag type="radio" 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>
@ -70,11 +75,7 @@
<j-date placeholder="请选择上次维护时间" v-model="model.maintenancedate" style="width: 100%" /> <j-date placeholder="请选择上次维护时间" v-model="model.maintenancedate" style="width: 100%" />
</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="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="24">
<a-form-model-item label="3d模型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img3d"> <a-form-model-item label="3d模型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img3d">
<!-- <j-upload v-model="model.img3d" ></j-upload>--> <!-- <j-upload v-model="model.img3d" ></j-upload>-->
@ -82,7 +83,13 @@
</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="tooltypeCode "> <a-form-model-item label="工具品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag v-model="model.canshu" dictCode="zy_tool_brand,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="tooltypeCode ">
<j-popup <j-popup
v-model="model.code1" v-model="model.code1"
field="code1" field="code1"
@ -90,6 +97,7 @@
dest-fields="code1,modelId" dest-fields="code1,modelId"
code="zy_toolmodel" code="zy_toolmodel"
:multi="false" :multi="false"
:param="parm1"
@input="popupCallback" @input="popupCallback"
/> />
</a-form-model-item> </a-form-model-item>
@ -121,6 +129,9 @@
data () { data () {
return { return {
bianhao:'', bianhao:'',
parm1:{
brand_id:''
},
model:{ model:{
status:1, status:1,
}, },
@ -134,6 +145,10 @@
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
name:[
{ required: true, message: '请输入设备名称!'},
{min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'},
],
}, },
url: { url: {
add: "/zytool/zyTool/add", add: "/zytool/zyTool/add",
@ -152,6 +167,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.model = Object.assign({}, this.modelDefault); this.model = Object.assign({}, this.modelDefault);
}, },

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

@ -134,7 +134,7 @@ public class ZyDevicebrandController extends JeecgController<ZyDevicebrand, IZyD
queryWrapper.eq("brand_id",id); queryWrapper.eq("brand_id",id);
int a=zyDevicemodelService.count(queryWrapper); int a=zyDevicemodelService.count(queryWrapper);
if(a>=0){ if(a>=0){
return Result.error("本型号已被使用,删除失败!!"); return Result.error("本品牌已被使用,删除失败!!");
} }
zyDevicebrandService.removeById(id); zyDevicebrandService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");

@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.zytool.toolbrand.entity.ZyToolBrand; import org.jeecg.modules.zytool.toolbrand.entity.ZyToolBrand;
import org.jeecg.modules.zytool.toolbrand.service.IZyToolBrandService; import org.jeecg.modules.zytool.toolbrand.service.IZyToolBrandService;
import org.jeecg.modules.zytool.toolmodel.service.IZyToolModelService;
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,7 +52,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyToolBrandController extends JeecgController<ZyToolBrand, IZyToolBrandService> { public class ZyToolBrandController extends JeecgController<ZyToolBrand, IZyToolBrandService> {
@Autowired @Autowired
private IZyToolBrandService zyToolBrandService; private IZyToolBrandService zyToolBrandService;
@Autowired
private IZyToolModelService zyToolModelService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -126,6 +128,12 @@ public class ZyToolBrandController extends JeecgController<ZyToolBrand, IZyToolB
@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=zyToolModelService.count(queryWrapper);
if(a>=0){
return Result.error("本品牌已被使用,删除失败!!");
}
zyToolBrandService.removeById(id); zyToolBrandService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

@ -30,6 +30,7 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.zytool.toolmodel.entity.ZyToolModel; import org.jeecg.modules.zytool.toolmodel.entity.ZyToolModel;
import org.jeecg.modules.zytool.toolmodel.service.IZyToolModelService; import org.jeecg.modules.zytool.toolmodel.service.IZyToolModelService;
import org.jeecg.modules.zytool.zytool.service.IZyToolService;
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;
@ -59,6 +60,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyToolModelController extends JeecgController<ZyToolModel, IZyToolModelService> { public class ZyToolModelController extends JeecgController<ZyToolModel, IZyToolModelService> {
@Autowired @Autowired
private IZyToolModelService zyToolModelService; private IZyToolModelService zyToolModelService;
@Autowired
private IZyToolService zyToolService;
/** /**
* 分页列表查询 * 分页列表查询
@ -162,6 +165,12 @@ public class ZyToolModelController extends JeecgController<ZyToolModel, IZyToolM
@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=zyToolService.count(queryWrapper);
if(a>=1){
return Result.error("工具型号有使用,删除失败!!!");
}
zyToolModelService.removeById(id); zyToolModelService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

@ -19,6 +19,8 @@ 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.devicetype.entity.ZyDevicetype;
import org.jeecg.modules.zytool.toolmodel.service.IZyToolModelService;
import org.jeecg.modules.zytool.tooltype.entity.ZyToolType; import org.jeecg.modules.zytool.tooltype.entity.ZyToolType;
import org.jeecg.modules.zytool.tooltype.service.IZyToolTypeService; import org.jeecg.modules.zytool.tooltype.service.IZyToolTypeService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
@ -50,7 +52,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyToolTypeController extends JeecgController<ZyToolType, IZyToolTypeService> { public class ZyToolTypeController extends JeecgController<ZyToolType, IZyToolTypeService> {
@Autowired @Autowired
private IZyToolTypeService zyToolTypeService; private IZyToolTypeService zyToolTypeService;
@Autowired
private IZyToolModelService zyToolModelService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -127,6 +130,20 @@ public class ZyToolTypeController extends JeecgController<ZyToolType, IZyToolTyp
@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) {
ZyToolType zyTooltype = zyToolTypeService.getById(id);
//判断型号中是否被使用
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("tooltype_code",zyTooltype.getCode());
int a=zyToolModelService.count(queryWrapper);
if(a>=1){
return Result.error("本类型已被使用,请先删除对应型号!!!");
}
QueryWrapper queryWrapper1=new QueryWrapper();
queryWrapper.eq("self_id",id);
int sonCount=zyToolTypeService.count(queryWrapper1);
if(sonCount>=1){
return Result.error("请先删除子节点");
}
zyToolTypeService.removeById(id); zyToolTypeService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

@ -78,7 +78,27 @@ public class ZyToolController extends JeecgController<ZyTool, IZyToolService> {
@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<ZyTool> queryWrapper = QueryGenerator.initQueryWrapper(zyTool, req.getParameterMap()); //QueryWrapper<ZyTool> queryWrapper = QueryGenerator.initQueryWrapper(zyTool, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
if(zyTool.getName()!=null){
queryWrapper.like("name",zyTool.getName());
}
if(zyTool.getCode()!=null){
queryWrapper.like("code",zyTool.getCode());
}
if(zyTool.getStatus()!=null){
queryWrapper.eq("status",zyTool.getStatus());
}
if(zyTool.getBrandId()!=null){
String s="%"+zyTool.getBrandId()+"%";
List<String> brand=zyToolService.findAllBrand(s);
queryWrapper.in("brand_id",brand);
}
if(zyTool.getModelId()!=null){
String s="%"+zyTool.getModelId()+"%";
List<String> model=zyToolService.findAllModel(s);
queryWrapper.in("model_id",model);
}
Page<ZyTool> page = new Page<ZyTool>(pageNo, pageSize); Page<ZyTool> page = new Page<ZyTool>(pageNo, pageSize);
IPage<ZyTool> pageList = zyToolService.page(page, queryWrapper); IPage<ZyTool> pageList = zyToolService.page(page, queryWrapper);
MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
@ -192,6 +212,10 @@ public class ZyToolController extends JeecgController<ZyTool, IZyToolService> {
@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=zyToolService.find(id);
if(a>=1){
return Result.error("有工序使用本工具,删除失败!!!");
}
zyToolService.removeById(id); zyToolService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

@ -25,4 +25,12 @@ public interface ZyToolMapper extends BaseMapper<ZyTool> {
@Select("select code from zy_tool order by code desc limit 0,1") @Select("select code from zy_tool order by code desc limit 0,1")
String getCode(); String getCode();
@Select("select id from zy_tool_brand where brand like #{s}")
List<String> findAllBrand(String s);
@Select("select id from zy_tool_model where model like #{s}")
List<String> findAllModel(String s);
@Select("select count(1) from zy_operationtool where toolid=#{id}")
int find(String id);
} }

@ -6,6 +6,8 @@ import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel;
import org.jeecg.modules.zytool.toolmodel.entity.ZyToolModel; import org.jeecg.modules.zytool.toolmodel.entity.ZyToolModel;
import org.jeecg.modules.zytool.zytool.entity.ZyTool; import org.jeecg.modules.zytool.zytool.entity.ZyTool;
import java.util.List;
/** /**
* @Description: 工具表 * @Description: 工具表
* @Author: jeecg-boot * @Author: jeecg-boot
@ -17,4 +19,10 @@ public interface IZyToolService extends IService<ZyTool> {
ZyToolModel findByModelId(String modelId); ZyToolModel findByModelId(String modelId);
String getCode(); String getCode();
List<String> findAllBrand(String s);
List<String> findAllModel(String s);
int find(String id);
} }

@ -10,6 +10,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
@ -30,4 +32,19 @@ public class ZyToolServiceImpl extends ServiceImpl<ZyToolMapper, ZyTool> impleme
public String getCode() { public String getCode() {
return zyToolMapper.getCode(); return zyToolMapper.getCode();
} }
@Override
public List<String> findAllBrand(String s) {
return zyToolMapper.findAllBrand(s);
}
@Override
public List<String> findAllModel(String s) {
return zyToolMapper.findAllModel(s);
}
@Override
public int find(String id) {
return zyToolMapper.find(id);
}
} }

Loading…
Cancel
Save