parent
23efc65bad
commit
6416562761
@ -1,156 +0,0 @@
|
|||||||
<template>
|
|
||||||
<j-modal
|
|
||||||
:title="title"
|
|
||||||
:width="width"
|
|
||||||
:visible="visible"
|
|
||||||
:confirmLoading="confirmLoading"
|
|
||||||
switchFullscreen
|
|
||||||
@ok="handleOk"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
cancelText="关闭">
|
|
||||||
<a-spin :spinning="confirmLoading">
|
|
||||||
<a-form-model ref="form" :model="model" :rules="validatorRules">
|
|
||||||
<a-form-model-item label="商品分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeName">
|
|
||||||
<a-input v-model="model.typeName" placeholder="请输入商品分类" ></a-input>
|
|
||||||
</a-form-model-item>
|
|
||||||
<a-form-model-item label="分类图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pic">
|
|
||||||
<j-image-upload isMultiple v-model="model.pic" ></j-image-upload>
|
|
||||||
</a-form-model-item>
|
|
||||||
<a-form-model-item label="父级节点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid">
|
|
||||||
<j-tree-select
|
|
||||||
ref="treeSelect"
|
|
||||||
placeholder="请选择父级节点"
|
|
||||||
v-model="model.pid"
|
|
||||||
dict="test_shoptype_tree,type_name,id"
|
|
||||||
pidField="pid"
|
|
||||||
pidValue="0"
|
|
||||||
hasChildField="has_child"
|
|
||||||
>
|
|
||||||
</j-tree-select>
|
|
||||||
</a-form-model-item>
|
|
||||||
|
|
||||||
</a-form-model>
|
|
||||||
</a-spin>
|
|
||||||
</j-modal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
import { httpAction } from '@/api/manage'
|
|
||||||
import { validateDuplicateValue } from '@/utils/util'
|
|
||||||
export default {
|
|
||||||
name: "TestShoptypeTreeModal",
|
|
||||||
components: {
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
title:"操作",
|
|
||||||
width:800,
|
|
||||||
visible: false,
|
|
||||||
model:{
|
|
||||||
},
|
|
||||||
labelCol: {
|
|
||||||
xs: { span: 24 },
|
|
||||||
sm: { span: 5 },
|
|
||||||
},
|
|
||||||
wrapperCol: {
|
|
||||||
xs: { span: 24 },
|
|
||||||
sm: { span: 16 },
|
|
||||||
},
|
|
||||||
|
|
||||||
confirmLoading: false,
|
|
||||||
validatorRules: {
|
|
||||||
},
|
|
||||||
url: {
|
|
||||||
add: "/demo888/testShoptypeTree/add",
|
|
||||||
edit: "/demo888/testShoptypeTree/edit",
|
|
||||||
},
|
|
||||||
expandedRowKeys:[],
|
|
||||||
pidField:"pid"
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created () {
|
|
||||||
//备份model原始值
|
|
||||||
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
add (obj) {
|
|
||||||
this.modelDefault.pid=''
|
|
||||||
this.edit(Object.assign(this.modelDefault , obj));
|
|
||||||
},
|
|
||||||
edit (record) {
|
|
||||||
this.model = Object.assign({}, record);
|
|
||||||
this.visible = true;
|
|
||||||
},
|
|
||||||
close () {
|
|
||||||
this.$emit('close');
|
|
||||||
this.visible = false;
|
|
||||||
this.$refs.form.clearValidate()
|
|
||||||
},
|
|
||||||
handleOk () {
|
|
||||||
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';
|
|
||||||
}
|
|
||||||
if(this.model.id && this.model.id === this.model[this.pidField]){
|
|
||||||
that.$message.warning("父级节点不能选择自己");
|
|
||||||
that.confirmLoading = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
httpAction(httpurl,this.model,method).then((res)=>{
|
|
||||||
if(res.success){
|
|
||||||
that.$message.success(res.message);
|
|
||||||
this.$emit('ok');
|
|
||||||
}else{
|
|
||||||
that.$message.warning(res.message);
|
|
||||||
}
|
|
||||||
}).finally(() => {
|
|
||||||
that.confirmLoading = false;
|
|
||||||
that.close();
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleCancel () {
|
|
||||||
this.close()
|
|
||||||
},
|
|
||||||
submitSuccess(formData,flag){
|
|
||||||
if(!formData.id){
|
|
||||||
let treeData = this.$refs.treeSelect.getCurrTreeData()
|
|
||||||
this.expandedRowKeys=[]
|
|
||||||
this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
|
|
||||||
this.$emit('ok',formData,this.expandedRowKeys.reverse());
|
|
||||||
}else{
|
|
||||||
this.$emit('ok',formData,flag);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getExpandKeysByPid(pid,arr,all){
|
|
||||||
if(pid && arr && arr.length>0){
|
|
||||||
for(let i=0;i<arr.length;i++){
|
|
||||||
if(arr[i].key==pid){
|
|
||||||
this.expandedRowKeys.push(arr[i].key)
|
|
||||||
this.getExpandKeysByPid(arr[i]['parentId'],all,all)
|
|
||||||
}else{
|
|
||||||
this.getExpandKeysByPid(pid,arr[i].children,all)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -0,0 +1,200 @@
|
|||||||
|
package org.jeecg.modules.demo.ttmoldingequip.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.demo.tteqtbase.entity.TtEqtBase;
|
||||||
|
import org.jeecg.modules.demo.tteqtbase.service.ITtEqtBaseService;
|
||||||
|
import org.jeecg.modules.demo.ttmoldingequip.entity.TtMoldingEquip;
|
||||||
|
import org.jeecg.modules.demo.ttmoldingequip.service.ITtMoldingEquipService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecg.modules.demo.ttpouringequip.entity.TtPouringEquip;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 模温机设备管理
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="模温机设备管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ttmoldingequip/ttMoldingEquip")
|
||||||
|
@Slf4j
|
||||||
|
public class TtMoldingEquipController extends JeecgController<TtMoldingEquip, ITtMoldingEquipService> {
|
||||||
|
@Autowired
|
||||||
|
private ITtMoldingEquipService ttMoldingEquipService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITtEqtBaseService ttEqtBaseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param ttMoldingEquip
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "模温机设备管理-分页列表查询")
|
||||||
|
@ApiOperation(value="模温机设备管理-分页列表查询", notes="模温机设备管理-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<TtMoldingEquip>> queryPageList(TtMoldingEquip ttMoldingEquip,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) {
|
||||||
|
QueryWrapper<TtMoldingEquip> queryWrapper = QueryGenerator.initQueryWrapper(ttMoldingEquip, req.getParameterMap());
|
||||||
|
Page<TtMoldingEquip> page = new Page<TtMoldingEquip>(pageNo, pageSize);
|
||||||
|
IPage<TtMoldingEquip> pageList = ttMoldingEquipService.page(page, queryWrapper);
|
||||||
|
List<TtMoldingEquip> list = pageList.getRecords();
|
||||||
|
if (list.size() > 0) {
|
||||||
|
// 查询所有浇注设备,按ip标注
|
||||||
|
LambdaQueryWrapper<TtEqtBase> lwq = new LambdaQueryWrapper<>();
|
||||||
|
lwq.eq(TtEqtBase::getEqtStatus, 1);
|
||||||
|
lwq.eq(TtEqtBase::getEqtType, 7);
|
||||||
|
List<TtEqtBase> deviceList = ttEqtBaseService.list(lwq);
|
||||||
|
Map<String, TtEqtBase> deviceMap = deviceList.stream().collect(Collectors.toMap(TtEqtBase::getEqtIp, v -> v));
|
||||||
|
for (TtMoldingEquip molding : list) {
|
||||||
|
TtEqtBase eqtBase = deviceMap.get(molding.getEqtIp());
|
||||||
|
if(eqtBase != null) {
|
||||||
|
molding.setDescr(eqtBase.getDescr());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param ttMoldingEquip
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "模温机设备管理-添加")
|
||||||
|
@ApiOperation(value="模温机设备管理-添加", notes="模温机设备管理-添加")
|
||||||
|
//@RequiresPermissions("ttmoldingequip:tt_molding_equip:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody TtMoldingEquip ttMoldingEquip) {
|
||||||
|
ttMoldingEquipService.save(ttMoldingEquip);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param ttMoldingEquip
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "模温机设备管理-编辑")
|
||||||
|
@ApiOperation(value="模温机设备管理-编辑", notes="模温机设备管理-编辑")
|
||||||
|
//@RequiresPermissions("ttmoldingequip:tt_molding_equip:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody TtMoldingEquip ttMoldingEquip) {
|
||||||
|
ttMoldingEquipService.updateById(ttMoldingEquip);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "模温机设备管理-通过id删除")
|
||||||
|
@ApiOperation(value="模温机设备管理-通过id删除", notes="模温机设备管理-通过id删除")
|
||||||
|
//@RequiresPermissions("ttmoldingequip:tt_molding_equip:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
ttMoldingEquipService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "模温机设备管理-批量删除")
|
||||||
|
@ApiOperation(value="模温机设备管理-批量删除", notes="模温机设备管理-批量删除")
|
||||||
|
//@RequiresPermissions("ttmoldingequip:tt_molding_equip:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.ttMoldingEquipService.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<TtMoldingEquip> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
TtMoldingEquip ttMoldingEquip = ttMoldingEquipService.getById(id);
|
||||||
|
if(ttMoldingEquip==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(ttMoldingEquip);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param ttMoldingEquip
|
||||||
|
*/
|
||||||
|
//@RequiresPermissions("ttmoldingequip:tt_molding_equip:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, TtMoldingEquip ttMoldingEquip) {
|
||||||
|
return super.exportXls(request, ttMoldingEquip, TtMoldingEquip.class, "模温机设备管理");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@RequiresPermissions("ttmoldingequip:tt_molding_equip:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, TtMoldingEquip.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.jeecg.modules.demo.ttmoldingequip.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.demo.ttmoldingequip.entity.TtMoldingEquip;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 模温机设备管理
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface TtMoldingEquipMapper extends BaseMapper<TtMoldingEquip> {
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.jeecg.modules.demo.ttmoldtemperatureequip.mapper.TtMoldTemperatureEquipMapper">
|
<mapper namespace="org.jeecg.modules.demo.ttmoldingequip.mapper.TtMoldingEquipMapper">
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -0,0 +1,14 @@
|
|||||||
|
package org.jeecg.modules.demo.ttmoldingequip.service;
|
||||||
|
|
||||||
|
import org.jeecg.modules.demo.ttmoldingequip.entity.TtMoldingEquip;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 模温机设备管理
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ITtMoldingEquipService extends IService<TtMoldingEquip> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package org.jeecg.modules.demo.ttmoldingequip.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.demo.ttmoldingequip.entity.TtMoldingEquip;
|
||||||
|
import org.jeecg.modules.demo.ttmoldingequip.mapper.TtMoldingEquipMapper;
|
||||||
|
import org.jeecg.modules.demo.ttmoldingequip.service.ITtMoldingEquipService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 模温机设备管理
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TtMoldingEquipServiceImpl extends ServiceImpl<TtMoldingEquipMapper, TtMoldingEquip> implements ITtMoldingEquipService {
|
||||||
|
|
||||||
|
}
|
@ -1,226 +0,0 @@
|
|||||||
package org.jeecg.modules.demo.ttmoldtemperatureequip.controller;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
|
||||||
|
|
||||||
|
|
||||||
import org.jeecg.modules.demo.tteqtbase.entity.TtEqtBase;
|
|
||||||
import org.jeecg.modules.demo.tteqtbase.service.ITtEqtBaseService;
|
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
|
|
||||||
import org.jeecg.modules.demo.ttmoldtemperatureequip.entity.TtMoldTemperatureEquip;
|
|
||||||
import org.jeecg.modules.demo.ttmoldtemperatureequip.service.ITtMoldTemperatureEquipService;
|
|
||||||
import org.jeecg.modules.demo.ttpouringequip.entity.TtPouringEquip;
|
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: tt_mold_temperature_equip
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2023-02-14
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Api(tags = "tt_mold_temperature_equip")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/ttmoldtemperatureequip/ttMoldTemperatureEquip")
|
|
||||||
@Slf4j
|
|
||||||
public class TtMoldTemperatureEquipController extends JeecgController<TtMoldTemperatureEquip, ITtMoldTemperatureEquipService> {
|
|
||||||
@Autowired
|
|
||||||
private ITtMoldTemperatureEquipService ttMoldTemperatureEquipService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ITtEqtBaseService ttEqtBaseService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param ttMoldTemperatureEquip
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "tt_mold_temperature_equip-分页列表查询")
|
|
||||||
@ApiOperation(value = "tt_mold_temperature_equip-分页列表查询", notes = "tt_mold_temperature_equip-分页列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<IPage<TtMoldTemperatureEquip>> queryPageList(TtMoldTemperatureEquip ttMoldTemperatureEquip,
|
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<TtMoldTemperatureEquip> queryWrapper = QueryGenerator.initQueryWrapper(ttMoldTemperatureEquip, req.getParameterMap());
|
|
||||||
Page<TtMoldTemperatureEquip> page = new Page<TtMoldTemperatureEquip>(pageNo, pageSize);
|
|
||||||
IPage<TtMoldTemperatureEquip> pageList = ttMoldTemperatureEquipService.page(page, queryWrapper);
|
|
||||||
List<TtMoldTemperatureEquip> list = pageList.getRecords();
|
|
||||||
if (list.size() > 0) {
|
|
||||||
for (TtMoldTemperatureEquip mold : list) {
|
|
||||||
QueryWrapper<TtEqtBase> eqtBase = new QueryWrapper<>();
|
|
||||||
eqtBase.eq("eqt_no", mold.getEqtNo());
|
|
||||||
eqtBase.eq("eqt_type", 7);
|
|
||||||
TtEqtBase ttEqtBase = ttEqtBaseService.getOne(eqtBase);
|
|
||||||
if (ttEqtBase != null) {
|
|
||||||
mold.setDescr(ttEqtBase.getDescr());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param ttMoldTemperatureEquip
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "tt_mold_temperature_equip-添加")
|
|
||||||
@ApiOperation(value = "tt_mold_temperature_equip-添加", notes = "tt_mold_temperature_equip-添加")
|
|
||||||
//@RequiresPermissions("ttmoldtemperatureequip:tt_mold_temperature_equip:add")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<String> add(@RequestBody TtMoldTemperatureEquip ttMoldTemperatureEquip) {
|
|
||||||
ttMoldTemperatureEquipService.save(ttMoldTemperatureEquip);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param ttMoldTemperatureEquip
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "tt_mold_temperature_equip-编辑")
|
|
||||||
@ApiOperation(value = "tt_mold_temperature_equip-编辑", notes = "tt_mold_temperature_equip-编辑")
|
|
||||||
//@RequiresPermissions("ttmoldtemperatureequip:tt_mold_temperature_equip:edit")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
||||||
public Result<String> edit(@RequestBody TtMoldTemperatureEquip ttMoldTemperatureEquip) {
|
|
||||||
ttMoldTemperatureEquipService.updateById(ttMoldTemperatureEquip);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "tt_mold_temperature_equip-通过id删除")
|
|
||||||
@ApiOperation(value = "tt_mold_temperature_equip-通过id删除", notes = "tt_mold_temperature_equip-通过id删除")
|
|
||||||
//@RequiresPermissions("ttmoldtemperatureequip:tt_mold_temperature_equip:delete")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
||||||
ttMoldTemperatureEquipService.removeById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "tt_mold_temperature_equip-批量删除")
|
|
||||||
@ApiOperation(value = "tt_mold_temperature_equip-批量删除", notes = "tt_mold_temperature_equip-批量删除")
|
|
||||||
//@RequiresPermissions("ttmoldtemperatureequip:tt_mold_temperature_equip:deleteBatch")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
||||||
this.ttMoldTemperatureEquipService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "tt_mold_temperature_equip-通过id查询")
|
|
||||||
@ApiOperation(value = "tt_mold_temperature_equip-通过id查询", notes = "tt_mold_temperature_equip-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<TtMoldTemperatureEquip> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
||||||
TtMoldTemperatureEquip ttMoldTemperatureEquip = ttMoldTemperatureEquipService.getById(id);
|
|
||||||
if (ttMoldTemperatureEquip == null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(ttMoldTemperatureEquip);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出excel
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param ttMoldTemperatureEquip
|
|
||||||
*/
|
|
||||||
//@RequiresPermissions("ttmoldtemperatureequip:tt_mold_temperature_equip:exportXls")
|
|
||||||
// @RequestMapping(value = "/exportXls")
|
|
||||||
// public ModelAndView exportXls(HttpServletRequest request, TtMoldTemperatureEquip ttMoldTemperatureEquip) {
|
|
||||||
// return super.exportXls(request, ttMoldTemperatureEquip, TtMoldTemperatureEquip.class, "tt_mold_temperature_equip");
|
|
||||||
// }
|
|
||||||
@RequestMapping(value = "/exportXls")
|
|
||||||
public ModelAndView exportXls(HttpServletRequest request, TtMoldTemperatureEquip ttMoldTemperatureEquip) {
|
|
||||||
ModelAndView modelAndView = super.exportXls(request, ttMoldTemperatureEquip, TtMoldTemperatureEquip.class, "tt_mold_temperature_equip");
|
|
||||||
Object model = modelAndView.getModel().get("data");
|
|
||||||
List<TtMoldTemperatureEquip> list = new ArrayList<>();
|
|
||||||
if (model instanceof ArrayList<?>) {
|
|
||||||
for (Object o : (List<?>) model) {
|
|
||||||
list.add((TtMoldTemperatureEquip) o);
|
|
||||||
}
|
|
||||||
if (list.size() > 0) {
|
|
||||||
for (TtMoldTemperatureEquip Temperature : list) {
|
|
||||||
QueryWrapper<TtEqtBase> eqtBase = new QueryWrapper<>();
|
|
||||||
eqtBase.eq("eqt_no", Temperature.getEqtNo());
|
|
||||||
eqtBase.eq("eqt_type", 7);
|
|
||||||
eqtBase.eq("location", "模温车间");
|
|
||||||
TtEqtBase ttEqtBase = ttEqtBaseService.getOne(eqtBase);
|
|
||||||
if (ttEqtBase != null) {
|
|
||||||
Temperature.setDescr(ttEqtBase.getDescr());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return modelAndView;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过excel导入数据
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@RequiresPermissions("ttmoldtemperatureequip:tt_mold_temperature_equip:importExcel")
|
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
return super.importExcel(request, response, TtMoldTemperatureEquip.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
package org.jeecg.modules.demo.ttmoldtemperatureequip.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.jeecg.modules.demo.ttmoldtemperatureequip.entity.TtMoldTemperatureEquip;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: tt_mold_temperature_equip
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2023-02-14
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface TtMoldTemperatureEquipMapper extends BaseMapper<TtMoldTemperatureEquip> {
|
|
||||||
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
package org.jeecg.modules.demo.ttmoldtemperatureequip.service;
|
|
||||||
|
|
||||||
import org.jeecg.modules.demo.ttmoldtemperatureequip.entity.TtMoldTemperatureEquip;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: tt_mold_temperature_equip
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2023-02-14
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface ITtMoldTemperatureEquipService extends IService<TtMoldTemperatureEquip> {
|
|
||||||
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
package org.jeecg.modules.demo.ttmoldtemperatureequip.service.impl;
|
|
||||||
|
|
||||||
import org.jeecg.modules.demo.ttmoldtemperatureequip.entity.TtMoldTemperatureEquip;
|
|
||||||
import org.jeecg.modules.demo.ttmoldtemperatureequip.mapper.TtMoldTemperatureEquipMapper;
|
|
||||||
import org.jeecg.modules.demo.ttmoldtemperatureequip.service.ITtMoldTemperatureEquipService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: tt_mold_temperature_equip
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2023-02-14
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class TtMoldTemperatureEquipServiceImpl extends ServiceImpl<TtMoldTemperatureEquipMapper, TtMoldTemperatureEquip> implements ITtMoldTemperatureEquipService {
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in new issue