package cn.stylefeng.guns.modular.zsx.bs.productRouteChildInfo.controller;
|
|
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
|
import cn.stylefeng.guns.modular.zsx.bs.productBomInfo.entity.ProductBomInfo;
|
import cn.stylefeng.guns.modular.zsx.bs.productRouteChildInfo.entity.ProductRouteChildInfo;
|
import cn.stylefeng.guns.modular.zsx.bs.productRouteChildInfo.model.params.ProductRouteChildInfoParam;
|
import cn.stylefeng.guns.modular.zsx.bs.productRouteChildInfo.service.ProductRouteChildInfoService;
|
import cn.stylefeng.guns.modular.zsx.bs.productRouteInfo.entity.ProductRouteInfo;
|
import cn.stylefeng.guns.modular.zsx.bs.productRouteInfo.service.ProductRouteInfoService;
|
import cn.stylefeng.roses.core.base.controller.BaseController;
|
import cn.stylefeng.roses.core.mutidatasource.annotion.DataSource;
|
import cn.stylefeng.roses.kernel.model.exception.RequestEmptyException;
|
import cn.stylefeng.roses.kernel.model.response.ResponseData;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.ui.Model;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
/**
|
* 工艺路线子信息控制器
|
*
|
* @author ruimin
|
* @Date 2023-08-24 16:26:51
|
*/
|
@Controller
|
@RequestMapping("/productRouteChildInfo")
|
public class ProductRouteChildInfoController extends BaseController {
|
|
private String PREFIX = "/modular/bs/productRouteChildInfo";
|
|
@Autowired
|
private ProductRouteChildInfoService productRouteChildInfoService;
|
|
@Autowired
|
private ProductRouteInfoService productRouteInfoService;
|
|
/**
|
* 跳转到主页面
|
*
|
* @author ruimin
|
* @Date 2023-08-24
|
*/
|
@RequestMapping("")
|
@DataSource(name = "self")
|
public String index(@RequestParam("routeCode") String routeInfoCode, Model model) {
|
model.addAttribute("routeInfoCode", routeInfoCode);
|
ProductRouteInfo routeCode = productRouteInfoService.getOne(new QueryWrapper<ProductRouteInfo>().eq("route_code", routeInfoCode));
|
if (routeCode == null) {
|
throw new RequestEmptyException();
|
}
|
return PREFIX + "/productRouteChildInfo.html";
|
}
|
|
/**
|
* 新增页面
|
*
|
* @author ruimin
|
* @Date 2023-08-24
|
*/
|
@RequestMapping("/add")
|
@DataSource(name = "self")
|
public String add(@RequestParam("routeInfoCode") String routeInfoCode, Model model) {
|
model.addAttribute("routeInfoCode", routeInfoCode);
|
ProductRouteInfo routeCode = productRouteInfoService.getOne(new QueryWrapper<ProductRouteInfo>().eq("route_code", routeInfoCode));
|
if (routeCode == null) {
|
throw new RequestEmptyException();
|
}
|
return PREFIX + "/productRouteChildInfo_add.html";
|
}
|
|
/**
|
* 编辑页面
|
*
|
* @author ruimin
|
* @Date 2023-08-24
|
*/
|
@RequestMapping("/edit")
|
public String edit() {
|
return PREFIX + "/productRouteChildInfo_edit.html";
|
}
|
|
/**
|
* 新增接口
|
*
|
* @author ruimin
|
* @Date 2023-08-24
|
*/
|
@RequestMapping("/addItem")
|
@ResponseBody
|
@DataSource(name = "self")
|
public ResponseData addItem(ProductRouteChildInfoParam productRouteChildInfoParam) {
|
this.productRouteChildInfoService.add(productRouteChildInfoParam);
|
return ResponseData.success();
|
}
|
|
/**
|
* 编辑接口
|
*
|
* @author ruimin
|
* @Date 2023-08-24
|
*/
|
@RequestMapping("/editItem")
|
@ResponseBody
|
@DataSource(name = "self")
|
public ResponseData editItem(ProductRouteChildInfoParam productRouteChildInfoParam) {
|
this.productRouteChildInfoService.update(productRouteChildInfoParam);
|
return ResponseData.success();
|
}
|
|
/**
|
* 删除接口
|
*
|
* @author ruimin
|
* @Date 2023-08-24
|
*/
|
@RequestMapping("/delete")
|
@ResponseBody
|
@DataSource(name = "self")
|
public ResponseData delete(ProductRouteChildInfoParam productRouteChildInfoParam) {
|
this.productRouteChildInfoService.delete(productRouteChildInfoParam);
|
return ResponseData.success();
|
}
|
|
/**
|
* 查看详情接口
|
*
|
* @author ruimin
|
* @Date 2023-08-24
|
*/
|
@RequestMapping("/detail")
|
@ResponseBody
|
@DataSource(name = "self")
|
public ResponseData detail(ProductRouteChildInfoParam productRouteChildInfoParam) {
|
ProductRouteChildInfo detail = this.productRouteChildInfoService.getById(productRouteChildInfoParam.getId());
|
return ResponseData.success(detail);
|
}
|
|
/**
|
* 查询列表
|
*
|
* @author ruimin
|
* @Date 2023-08-24
|
*/
|
@ResponseBody
|
@RequestMapping("/list")
|
@DataSource(name = "self")
|
public LayuiPageInfo list(ProductRouteChildInfoParam productRouteChildInfoParam) {
|
return this.productRouteChildInfoService.findPageBySpec(productRouteChildInfoParam);
|
}
|
|
}
|