| | |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentOvertime; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentOvertimeService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | 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.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "设备加班管理-编辑", notes = "设备加班管理-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody MdcEquipmentOvertime mdcEquipmentOvertime) { |
| | | String startTime = mdcEquipmentOvertime.getStartTime(); |
| | | String endTime = mdcEquipmentOvertime.getEndTime(); |
| | | long duration = DateUtils.differentSecond(DateUtils.setTimeForDay(DateUtils.getNow(), startTime), DateUtils.setTimeForDay(DateUtils.getNow(), endTime)); |
| | | mdcEquipmentOvertime.setDuration(new BigDecimal(duration)); |
| | | mdcEquipmentOvertimeService.updateById(mdcEquipmentOvertime); |
| | | return Result.OK("编辑成功!"); |
| | | } |