| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.mapper.ManualTechnologyMapper; |
| | | import com.yuanchu.mom.pojo.ManualTechnology; |
| | | import com.yuanchu.mom.pojo.dto.ManualTechnologyDto; |
| | | import com.yuanchu.mom.service.DeviceService; |
| | | import com.yuanchu.mom.service.ManualTechnologyService; |
| | | import com.yuanchu.mom.service.ManufactureSchedulingService; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import com.yuanchu.mom.service.ManufactureOrderService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.xml.crypto.Data; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Autowired |
| | | private ManufactureOrderService manufactureOrderService; |
| | | |
| | | @Autowired |
| | | private ManufactureSchedulingService manufactureSchedulingService; |
| | | |
| | | @Resource |
| | | ManualTechnologyService manualTechnologyService; |
| | | |
| | | @Resource |
| | | DeviceService deviceService; |
| | | |
| | | |
| | | @ApiOperation(value = "查询生产订单列表") |
| | | @ApiImplicitParams(value = { |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "排产-->1.查看") |
| | | @ApiOperation(value = "点击排产获取表格二级树") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | |
| | | return Result.success(manualTechnologyService.seleDatil(manOrdId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "排产-->2.选择设备") |
| | | @ApiOperation(value = "点击查看排产") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/select_Scheduling") |
| | | public Result<?> selectScheduling(Integer manOrdId) { |
| | | return Result.success(manufactureSchedulingService.selectScheduling(manOrdId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "点击排产-->二级树选择设备") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "deviceGroup", value = "设备组", dataTypeClass = String.class, required = true) |
| | | }) |
| | |
| | | return Result.success(deviceService.getDeviceNameByGroup(deviceGroup)); |
| | | } |
| | | |
| | | @ApiOperation(value = "排产-->3.更新") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "date", value = "排产开始日期", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @ApiOperation(value = "点击排产-->确定按钮") |
| | | @PostMapping("/output") |
| | | public Result output(String date ,@Validated @RequestBody List<ManualTechnologyDto> manualTechnologyDtoList) throws ParseException { |
| | | manualTechnologyService.output(date,manualTechnologyDtoList); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看排产详情") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/sePros") |
| | | public Result sePros(Integer manOrdId) { |
| | | return Result.success(manufactureOrderService.sePros(manOrdId)); |
| | | public Result<?> output(@Validated @RequestBody ManualTechnologyDto manualTechnologyDto) throws ParseException { |
| | | // 判断输入数量是否超出 |
| | | Integer isExceed = manufactureOrderService.checkScheduled(manualTechnologyDto.getManOrdId(), manualTechnologyDto.getSchedulingNumber()); |
| | | if (isExceed >= 0){ |
| | | manualTechnologyService.output(manualTechnologyDto); |
| | | return Result.success("排产成功!"); |
| | | } else { |
| | | MyUtil.PrintLog(isExceed.toString()); |
| | | int i = manualTechnologyDto.getSchedulingNumber() + isExceed; |
| | | return Result.fail("排产错误,当前剩余排产为:" + i); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "下达") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = Integer.class, required = true) |
| | | @ApiImplicitParam(name = "manufactureOrderId", value = "订单id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "schedulingId", value = "排产Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/down") |
| | | public Result down(Integer manOrdId) { |
| | | manufactureOrderService.down(manOrdId); |
| | | public Result<?> down(Integer manufactureOrderId, Integer schedulingId) { |
| | | manufactureOrderService.down(manufactureOrderId, schedulingId); |
| | | return Result.success("下达成功!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "多选删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = String.class, dataType = "list", required = true) |
| | | }) |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteManufacture(List<String> manOrdId) { |
| | | manufactureOrderService.deleteManufacture(manOrdId); |
| | | return Result.success("删除成功!"); |
| | | } |
| | | } |
| | | |