parent
077b3087ec
commit
016b963ba9
23 changed files with 704 additions and 162 deletions
@ -0,0 +1,198 @@ |
||||
package org.jeecg.modules.demo.pro.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.demo.pro.entity.ZyProcessAccessories; |
||||
import org.jeecg.modules.demo.pro.service.IZyProcessAccessoriesService; |
||||
|
||||
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.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-08-18 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="面料表") |
||||
@RestController |
||||
@RequestMapping("/pro/zyProcessAccessories") |
||||
@Slf4j |
||||
public class ZyProcessAccessoriesController extends JeecgController<ZyProcessAccessories, IZyProcessAccessoriesService> { |
||||
@Autowired |
||||
private IZyProcessAccessoriesService zyProcessAccessoriesService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param zyProcessAccessories |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
/* |
||||
* 这个真正的是辅料表 |
||||
* |
||||
* */ |
||||
@AutoLog(value = "面料表-分页列表查询") |
||||
@ApiOperation(value="面料表-分页列表查询", notes="面料表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(ZyProcessAccessories zyProcessAccessories, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
// QueryWrapper<ZyProcessAccessories> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessAccessories, req.getParameterMap());
|
||||
String s=null,t=null; |
||||
if(zyProcessAccessories.getProcessId()!=null){ |
||||
s="%"+zyProcessAccessories.getProcessId()+"%"; |
||||
} |
||||
if(zyProcessAccessories.getAccessoriesId()!=null){ |
||||
t="%"+zyProcessAccessories.getAccessoriesId()+"%"; |
||||
} |
||||
Page<ZyProcessAccessories> page = new Page<ZyProcessAccessories>(pageNo, pageSize); |
||||
IPage<ZyProcessAccessories> pageList = zyProcessAccessoriesService.page(page, s,t); |
||||
return Result.OK(pageList); |
||||
} |
||||
@AutoLog(value = "面料表-分页列表查询") |
||||
@ApiOperation(value="面料表-分页列表查询", notes="面料表-分页列表查询") |
||||
@GetMapping(value = "/list1") |
||||
public Result<?> queryPageList1(ZyProcessAccessories zyProcessAccessories, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
// QueryWrapper<ZyProcessAccessories> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessAccessories, req.getParameterMap());
|
||||
String s=zyProcessAccessories.getProcessId(),t=null; |
||||
if(zyProcessAccessories.getAccessoriesId()!=null){ |
||||
t="%"+zyProcessAccessories.getAccessoriesId()+"%"; |
||||
} |
||||
Page<ZyProcessAccessories> page = new Page<ZyProcessAccessories>(pageNo, pageSize); |
||||
IPage<ZyProcessAccessories> pageList = zyProcessAccessoriesService.page1(page, s,t); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param zyProcessAccessories |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "面料表-添加") |
||||
@ApiOperation(value="面料表-添加", notes="面料表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody ZyProcessAccessories zyProcessAccessories) { |
||||
zyProcessAccessoriesService.save(zyProcessAccessories); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param zyProcessAccessories |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "面料表-编辑") |
||||
@ApiOperation(value="面料表-编辑", notes="面料表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody ZyProcessAccessories zyProcessAccessories) { |
||||
zyProcessAccessoriesService.updateById(zyProcessAccessories); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "面料表-通过id删除") |
||||
@ApiOperation(value="面料表-通过id删除", notes="面料表-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
zyProcessAccessoriesService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "面料表-批量删除") |
||||
@ApiOperation(value="面料表-批量删除", notes="面料表-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.zyProcessAccessoriesService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "面料表-通过id查询") |
||||
@ApiOperation(value="面料表-通过id查询", notes="面料表-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ZyProcessAccessories zyProcessAccessories = zyProcessAccessoriesService.getById(id); |
||||
if(zyProcessAccessories==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(zyProcessAccessories); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param zyProcessAccessories |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ZyProcessAccessories zyProcessAccessories) { |
||||
return super.exportXls(request, zyProcessAccessories, ZyProcessAccessories.class, "面料表"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ZyProcessAccessories.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,67 @@ |
||||
package org.jeecg.modules.demo.pro.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-08-18 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("zy_process_accessories") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="zy_process_accessories对象", description="辅料表与面料表反了") |
||||
public class ZyProcessAccessories implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private String sysOrgCode; |
||||
/**工序表id*/ |
||||
@Excel(name = "工序", width = 15, dictTable = "zy_process", dicText = "process_name", dicCode = "id") |
||||
@Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id") |
||||
@ApiModelProperty(value = "工序表id") |
||||
private String processId; |
||||
/**面料表id*/ |
||||
@Excel(name = "机器", width = 15, dictTable = "zy_devicetype", dicText = "name", dicCode = "id") |
||||
@Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id") |
||||
@ApiModelProperty(value = "面料表id") |
||||
private String accessoriesId; |
||||
} |
@ -0,0 +1,25 @@ |
||||
package org.jeecg.modules.demo.pro.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.jeecg.modules.demo.pro.entity.ZyProcessAccessories; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-08-18 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Mapper |
||||
public interface ZyProcessAccessoriesMapper extends BaseMapper<ZyProcessAccessories> { |
||||
@Select("<script>select * from zy_process_accessories <where><if test=\" p != null\">process_id in (select id from zy_process where process_name like #{p})</if><if test=\" m != null\"> and accessories_id in (select id from zy_accessories where contents like #{m})</if></where></script>") |
||||
IPage<ZyProcessAccessories> page(Page<ZyProcessAccessories> page, @Param("p") String s, @Param("m") String t); |
||||
@Select("<script>select * from zy_process_accessories <where>process_id =#{p}<if test=\" m != null\"> and accessories_id in (select id from zy_accessories where contents like #{m})</if></where></script>") |
||||
IPage<ZyProcessAccessories> page1(Page<ZyProcessAccessories> page, @Param("p") String s, @Param("m") String t); |
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.demo.pro.mapper.ZyProcessAccessoriesMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.pro.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import org.jeecg.modules.demo.pro.entity.ZyProcessAccessories; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-08-18 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IZyProcessAccessoriesService extends IService<ZyProcessAccessories> { |
||||
|
||||
IPage<ZyProcessAccessories> page(Page<ZyProcessAccessories> page, String s, String t); |
||||
|
||||
IPage<ZyProcessAccessories> page1(Page<ZyProcessAccessories> page, String s, String t); |
||||
} |
@ -0,0 +1,33 @@ |
||||
package org.jeecg.modules.demo.pro.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import org.jeecg.modules.demo.pro.entity.ZyProcessAccessories; |
||||
import org.jeecg.modules.demo.pro.mapper.ZyProcessAccessoriesMapper; |
||||
import org.jeecg.modules.demo.pro.service.IZyProcessAccessoriesService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-08-18 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyProcessAccessoriesServiceImpl extends ServiceImpl<ZyProcessAccessoriesMapper, ZyProcessAccessories> implements IZyProcessAccessoriesService { |
||||
|
||||
@Autowired |
||||
ZyProcessAccessoriesMapper zyProcessAccessoriesMapper; |
||||
@Override |
||||
public IPage<ZyProcessAccessories> page(Page<ZyProcessAccessories> page, String s, String t) { |
||||
return zyProcessAccessoriesMapper.page(page,s,t); |
||||
} |
||||
|
||||
@Override |
||||
public IPage<ZyProcessAccessories> page1(Page<ZyProcessAccessories> page, String s, String t) { |
||||
return zyProcessAccessoriesMapper.page1(page,s,t); |
||||
} |
||||
} |
@ -1,171 +1,177 @@ |
||||
package org.jeecg.modules.operationtool.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.operationtool.entity.ZyOperationtool; |
||||
import org.jeecg.modules.operationtool.service.IZyOperationtoolService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.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.api.vo.Result; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.jeecg.modules.operationtool.entity.ZyOperationtool; |
||||
import org.jeecg.modules.operationtool.service.IZyOperationtoolService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 工序工具 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-12-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* @Description: 工序工具 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-12-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="工序工具") |
||||
@RestController |
||||
@RequestMapping("/operationtool/zyOperationtool") |
||||
@Slf4j |
||||
public class ZyOperationtoolController extends JeecgController<ZyOperationtool, IZyOperationtoolService> { |
||||
@Autowired |
||||
private IZyOperationtoolService zyOperationtoolService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param zyOperationtool |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-分页列表查询") |
||||
@ApiOperation(value="工序工具-分页列表查询", notes="工序工具-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(ZyOperationtool zyOperationtool, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ZyOperationtool> queryWrapper = QueryGenerator.initQueryWrapper(zyOperationtool, req.getParameterMap()); |
||||
Page<ZyOperationtool> page = new Page<ZyOperationtool>(pageNo, pageSize); |
||||
IPage<ZyOperationtool> pageList = zyOperationtoolService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param zyOperationtool |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-添加") |
||||
@ApiOperation(value="工序工具-添加", notes="工序工具-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody ZyOperationtool zyOperationtool) { |
||||
zyOperationtoolService.save(zyOperationtool); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param zyOperationtool |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-编辑") |
||||
@ApiOperation(value="工序工具-编辑", notes="工序工具-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody ZyOperationtool zyOperationtool) { |
||||
zyOperationtoolService.updateById(zyOperationtool); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-通过id删除") |
||||
@ApiOperation(value="工序工具-通过id删除", notes="工序工具-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
zyOperationtoolService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-批量删除") |
||||
@ApiOperation(value="工序工具-批量删除", notes="工序工具-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.zyOperationtoolService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-通过id查询") |
||||
@ApiOperation(value="工序工具-通过id查询", notes="工序工具-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ZyOperationtool zyOperationtool = zyOperationtoolService.getById(id); |
||||
if(zyOperationtool==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(zyOperationtool); |
||||
} |
||||
@Autowired |
||||
private IZyOperationtoolService zyOperationtoolService; |
||||
|
||||
/** |
||||
* 导出excel |
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param request |
||||
* @param zyOperationtool |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ZyOperationtool zyOperationtool) { |
||||
return super.exportXls(request, zyOperationtool, ZyOperationtool.class, "工序工具"); |
||||
@AutoLog(value = "工序工具-分页列表查询") |
||||
@ApiOperation(value="工序工具-分页列表查询", notes="工序工具-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(ZyOperationtool zyOperationtool, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
//QueryWrapper<ZyOperationtool> queryWrapper = QueryGenerator.initQueryWrapper(zyOperationtool, req.getParameterMap());
|
||||
System.out.println("asdadad*********************************************"); |
||||
String s=null,t=null; |
||||
if(zyOperationtool.getOperationid()!=null){ |
||||
s="%"+zyOperationtool.getOperationid()+"%"; |
||||
} |
||||
if(zyOperationtool.getToolid()!=null){ |
||||
t="%"+zyOperationtool.getToolid()+"%"; |
||||
} |
||||
Page<ZyOperationtool> page = new Page<ZyOperationtool>(pageNo, pageSize); |
||||
IPage<ZyOperationtool> pageList = zyOperationtoolService.page(page, s,t); |
||||
return Result.OK(pageList); |
||||
} |
||||
@AutoLog(value = "工序工具-分页列表查询") |
||||
@ApiOperation(value="工序工具-分页列表查询", notes="工序工具-分页列表查询") |
||||
@GetMapping(value = "/list1") |
||||
public Result<?> queryPageList1(ZyOperationtool zyOperationtool, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
//QueryWrapper<ZyOperationtool> queryWrapper = QueryGenerator.initQueryWrapper(zyOperationtool, req.getParameterMap());
|
||||
String s=zyOperationtool.getOperationid(),t=null; |
||||
|
||||
if(zyOperationtool.getToolid()!=null){ |
||||
t="%"+zyOperationtool.getToolid()+"%"; |
||||
} |
||||
Page<ZyOperationtool> page = new Page<ZyOperationtool>(pageNo, pageSize); |
||||
IPage<ZyOperationtool> pageList = zyOperationtoolService.page1(page, s,t); |
||||
return Result.OK(pageList); |
||||
} |
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param zyOperationtool |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-添加") |
||||
@ApiOperation(value="工序工具-添加", notes="工序工具-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody ZyOperationtool zyOperationtool) { |
||||
zyOperationtoolService.save(zyOperationtool); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @param zyOperationtool |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ZyOperationtool.class); |
||||
} |
||||
@AutoLog(value = "工序工具-编辑") |
||||
@ApiOperation(value="工序工具-编辑", notes="工序工具-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody ZyOperationtool zyOperationtool) { |
||||
zyOperationtoolService.updateById(zyOperationtool); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-通过id删除") |
||||
@ApiOperation(value="工序工具-通过id删除", notes="工序工具-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
zyOperationtoolService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-批量删除") |
||||
@ApiOperation(value="工序工具-批量删除", notes="工序工具-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.zyOperationtoolService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "工序工具-通过id查询") |
||||
@ApiOperation(value="工序工具-通过id查询", notes="工序工具-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ZyOperationtool zyOperationtool = zyOperationtoolService.getById(id); |
||||
if(zyOperationtool==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(zyOperationtool); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param zyOperationtool |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ZyOperationtool zyOperationtool) { |
||||
return super.exportXls(request, zyOperationtool, ZyOperationtool.class, "工序工具"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ZyOperationtool.class); |
||||
} |
||||
|
||||
} |
||||
|
Loading…
Reference in new issue