| | |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.entity.MdcTorqueConfig; |
| | | import org.jeecg.modules.mdc.service.IMdcTorqueConfigService; |
| | | import org.jeecg.modules.mdc.vo.MdcTorqueConfigVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 扭矩配置管理 |
| | |
| | | /** |
| | | * 扭矩配置管理-新增 |
| | | * |
| | | * @param torqueVo |
| | | * @param mdcTorqueConfig |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "扭矩配置管理-新增") |
| | | @ApiOperation(value = "扭矩配置管理-新增", notes = "扭矩配置管理-新增") |
| | | @PostMapping("/addMdcTorqueConfig") |
| | | public Result addMdcTorqueConfig(@RequestBody MdcTorqueConfigVo torqueVo) { |
| | | if (StringUtils.isBlank(torqueVo.getEquipmentIds())) { |
| | | public Result addMdcTorqueConfig(@RequestBody MdcTorqueConfig mdcTorqueConfig) { |
| | | if (StringUtils.isBlank(mdcTorqueConfig.getEquipmentIds())) { |
| | | return Result.error("未选择设备,请排查"); |
| | | } |
| | | boolean result = mdcTorqueConfigService.addTorque(torqueVo); |
| | | boolean result = mdcTorqueConfigService.addTorque(mdcTorqueConfig); |
| | | if (!result) { |
| | | return Result.error("时间段数据已存在,请排查"); |
| | | } |
| | |
| | | @ApiOperation(value = "扭矩配置管理-导出", notes = "扭矩配置管理-导出") |
| | | @RequestMapping("/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MdcTorqueConfig mdcTorqueConfig) { |
| | | return super.exportXls(request, mdcTorqueConfig, MdcTorqueConfig.class, "扭矩配置管理导出"); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | return this.mdcTorqueConfigService.exportXls(userId, mdcTorqueConfig); |
| | | } |
| | | |
| | | /** |
| | |
| | | @RequestMapping("/importExcel") |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, MdcTorqueConfig.class); |
| | | } |
| | | |
| | | /** |
| | | * 根据扭矩值生成主轴运行曲线 |
| | | * |
| | | * @param torqueValue |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "扭矩配置管理-根据扭矩值生成主轴运行曲线") |
| | | @ApiOperation(value = "扭矩配置管理-根据扭矩值生成主轴运行曲线", notes = "扭矩配置管理-根据扭矩值生成主轴运行曲线") |
| | | @GetMapping("/findSpindleRunningCurve") |
| | | public Result<List<MdcTorqueConfig>> findSpindleRunningCurve(@RequestParam(name = "torqueValue", required = true) float torqueValue, |
| | | @RequestParam(name = "equipmentId", required = true) String equipmentId) { |
| | | List<MdcTorqueConfig> list = mdcTorqueConfigService.findSpindleRunningCurve(torqueValue, equipmentId); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |