package cn.gistack.sm.sg.controller; import cn.gistack.sm.sg.DO.SgGxRoleDO; import cn.gistack.sm.sg.DO.SgGxStepDO; import cn.gistack.sm.sg.DTO.ProjectSearchDTO; import cn.gistack.sm.sg.VO.SgGxRoleVO; import cn.gistack.sm.sg.VO.SgGxVO; import cn.gistack.sm.sg.service.SgGxStepService; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Arrays; import java.util.List; /** *

* 施工工序步骤表 前端控制器 *

* * @author shenyijian * @since 2024-06-13 15:46:18 */ @RestController @RequestMapping("/sg_gx_step") public class SgGxStepController extends BladeController { @Autowired private SgGxStepService sgGxStepService; /** * 新增工序步骤 */ @PostMapping(value = "/add") public R add(@RequestBody SgGxStepDO sgGxStepDO) { sgGxStepService.add(sgGxStepDO); return R.success("添加成功"); } /** * 修改工序步骤 */ @PostMapping(value = "/update") public R update(@RequestBody SgGxStepDO sgGxStepDO) { sgGxStepService.updateOne(sgGxStepDO); return R.success("修改成功"); } /** * 删除工序步骤 */ @GetMapping(value = "/delete") public R delete(String id) { sgGxStepService.delete(id); return R.success("删除成功"); } /** * 分页 */ @GetMapping(value = "/page") public R queryPageList(ProjectSearchDTO searchDTO, Query query) { IPage page = sgGxStepService.queryPageList(Condition.getPage(query), searchDTO); return R.data(page); } /** * 详情 */ @GetMapping(value = "/detail") public R queryPageList(String id) { return R.data(sgGxStepService.getById(id)); } /** * 新增工序角色配置记录 * @param SgGxRoleVO * @return */ @PostMapping(value = "/addSgGxRole") public R addSgGxRole(@RequestBody SgGxRoleVO SgGxRoleVO) { sgGxStepService.insertSgGxRole(SgGxRoleVO); return R.success("添加成功"); } /** * 更新工序角色配置记录 * @param SgGxRoleVO * @return */ @PostMapping(value = "/updateSgGxRole") public R updateSgGxRole(@RequestBody SgGxRoleVO SgGxRoleVO) { sgGxStepService.updateSgGxRole(SgGxRoleVO); return R.success("修改成功"); } @GetMapping(value = "/getSgGxRoles") public R getSgGxRoles(String gxDeviceType,String gxStepId) { List roleIds=sgGxStepService.getSgGxRoles(gxDeviceType,gxStepId); return R.data(roleIds); } }