|
|
@ -2,27 +2,29 @@ |
|
|
|
package org.nl.wms.pdm.rest; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.nl.annotation.Log; |
|
|
|
import org.nl.wms.pdm.service.ProducetaskService; |
|
|
|
import org.nl.wms.pdm.service.dto.ProducetaskDto; |
|
|
|
import org.springframework.data.domain.Pageable; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.nl.annotation.Log; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import io.swagger.annotations.*; |
|
|
|
import java.util.Map; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author geng by |
|
|
|
* @date 2022-04-26 |
|
|
|
**/ |
|
|
|
* @author geng by |
|
|
|
* @date 2022-04-26 |
|
|
|
**/ |
|
|
|
@RestController |
|
|
|
@RequiredArgsConstructor |
|
|
|
@Api(tags = "生产任务管理") |
|
|
@ -36,15 +38,15 @@ public class ProducetaskController { |
|
|
|
@Log("查询生产任务") |
|
|
|
@ApiOperation("查询生产任务") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){ |
|
|
|
return new ResponseEntity<>(producetaskService.queryAll(whereJson,page),HttpStatus.OK); |
|
|
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) { |
|
|
|
return new ResponseEntity<>(producetaskService.queryAll(whereJson, page), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping |
|
|
|
@Log("新增生产任务") |
|
|
|
@ApiOperation("新增生产任务") |
|
|
|
//@PreAuthorize("@el.check('producetask:add')")
|
|
|
|
public ResponseEntity<Object> create(@Validated @RequestBody ProducetaskDto dto){ |
|
|
|
public ResponseEntity<Object> create(@Validated @RequestBody ProducetaskDto dto) { |
|
|
|
producetaskService.create(dto); |
|
|
|
return new ResponseEntity<>(HttpStatus.CREATED); |
|
|
|
} |
|
|
@ -53,7 +55,7 @@ public class ProducetaskController { |
|
|
|
@Log("修改生产任务") |
|
|
|
@ApiOperation("修改生产任务") |
|
|
|
//@PreAuthorize("@el.check('producetask:edit')")
|
|
|
|
public ResponseEntity<Object> update(@Validated @RequestBody ProducetaskDto dto){ |
|
|
|
public ResponseEntity<Object> update(@Validated @RequestBody ProducetaskDto dto) { |
|
|
|
producetaskService.update(dto); |
|
|
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
|
|
|
} |
|
|
@ -71,55 +73,55 @@ public class ProducetaskController { |
|
|
|
@Log("查询物料") |
|
|
|
@ApiOperation("查询物料") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> getMaterial(){ |
|
|
|
return new ResponseEntity<>(producetaskService.getMaterial(),HttpStatus.OK); |
|
|
|
public ResponseEntity<Object> getMaterial() { |
|
|
|
return new ResponseEntity<>(producetaskService.getMaterial(), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/getDevice") |
|
|
|
@Log("查询设备") |
|
|
|
@ApiOperation("查询设备") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> getDevice(@RequestBody JSONObject param){ |
|
|
|
return new ResponseEntity<>(producetaskService.getDevice(param),HttpStatus.OK); |
|
|
|
public ResponseEntity<Object> getDevice(@RequestBody JSONObject param) { |
|
|
|
return new ResponseEntity<>(producetaskService.getDevice(param), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/getDevice1") |
|
|
|
@Log("查询设备") |
|
|
|
@ApiOperation("查询设备") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> getDevice1(){ |
|
|
|
return new ResponseEntity<>(producetaskService.getDevice1(),HttpStatus.OK); |
|
|
|
public ResponseEntity<Object> getDevice1() { |
|
|
|
return new ResponseEntity<>(producetaskService.getDevice1(), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/getProduceline") |
|
|
|
@Log("查询生产产线") |
|
|
|
@ApiOperation("查询生产产线") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> getProduceline(){ |
|
|
|
return new ResponseEntity<>(producetaskService.getProduceline(),HttpStatus.OK); |
|
|
|
public ResponseEntity<Object> getProduceline() { |
|
|
|
return new ResponseEntity<>(producetaskService.getProduceline(), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/getCust") |
|
|
|
@Log("查询客户") |
|
|
|
@ApiOperation("查询客户") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> getCust(){ |
|
|
|
return new ResponseEntity<>(producetaskService.getCust(),HttpStatus.OK); |
|
|
|
public ResponseEntity<Object> getCust() { |
|
|
|
return new ResponseEntity<>(producetaskService.getCust(), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/getWorkprocedure") |
|
|
|
@Log("查询工序") |
|
|
|
@ApiOperation("查询工序") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> getWorkprocedure(){ |
|
|
|
return new ResponseEntity<>(producetaskService.getWorkprocedure(),HttpStatus.OK); |
|
|
|
public ResponseEntity<Object> getWorkprocedure() { |
|
|
|
return new ResponseEntity<>(producetaskService.getWorkprocedure(), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/excelImport") |
|
|
|
@Log("excel导入") |
|
|
|
@ApiOperation("excel导入") |
|
|
|
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request){ |
|
|
|
producetaskService.excelImport(file,request); |
|
|
|
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request) { |
|
|
|
producetaskService.excelImport(file, request); |
|
|
|
return new ResponseEntity<>(HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
@ -127,7 +129,7 @@ public class ProducetaskController { |
|
|
|
@Log("复制新增") |
|
|
|
@ApiOperation("复制新增") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> copyAdd(@RequestBody JSONObject param){ |
|
|
|
public ResponseEntity<Object> copyAdd(@RequestBody JSONObject param) { |
|
|
|
producetaskService.copyAdd(param); |
|
|
|
return new ResponseEntity<>(HttpStatus.OK); |
|
|
|
} |
|
|
@ -136,15 +138,15 @@ public class ProducetaskController { |
|
|
|
@Log("根据设备查询任务") |
|
|
|
@ApiOperation("根据设备查询任务") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> getTaskByDeviceId(@RequestParam Map whereJson, Pageable page){ |
|
|
|
return new ResponseEntity<>(producetaskService.getTaskByDeviceId(whereJson,page),HttpStatus.OK); |
|
|
|
public ResponseEntity<Object> getTaskByDeviceId(@RequestParam Map whereJson, Pageable page) { |
|
|
|
return new ResponseEntity<>(producetaskService.getTaskByDeviceId(whereJson, page), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@PutMapping("/sortUpdate") |
|
|
|
@Log("排序") |
|
|
|
@ApiOperation("排序") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> sortUpdate(@RequestBody JSONObject param){ |
|
|
|
public ResponseEntity<Object> sortUpdate(@RequestBody JSONObject param) { |
|
|
|
producetaskService.sortUpdate(param); |
|
|
|
return new ResponseEntity<>(HttpStatus.OK); |
|
|
|
} |
|
|
@ -153,7 +155,7 @@ public class ProducetaskController { |
|
|
|
@Log("强制完成") |
|
|
|
@ApiOperation("强制完成") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> mandFinish(@RequestBody JSONObject param){ |
|
|
|
public ResponseEntity<Object> mandFinish(@RequestBody JSONObject param) { |
|
|
|
producetaskService.mandFinish(param); |
|
|
|
return new ResponseEntity<>(HttpStatus.OK); |
|
|
|
} |
|
|
@ -162,9 +164,16 @@ public class ProducetaskController { |
|
|
|
@Log("下发") |
|
|
|
@ApiOperation("下发") |
|
|
|
//@PreAuthorize("@el.check('producetask:list')")
|
|
|
|
public ResponseEntity<Object> issued(@RequestBody JSONObject param){ |
|
|
|
public ResponseEntity<Object> issued(@RequestBody JSONObject param) { |
|
|
|
producetaskService.issued(param); |
|
|
|
return new ResponseEntity<>(HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/getVehicleType") |
|
|
|
@Log("通过设备查询可用载具类型") |
|
|
|
@ApiOperation("通过设备查询可用载具类型") |
|
|
|
public ResponseEntity<JSONObject> getVehicleTypeByDeviceId(@RequestBody JSONObject device) { |
|
|
|
return new ResponseEntity<>(producetaskService.getVehicleTypeByDeviceId(device.getLong("device_id")), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|