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