This commit is contained in:
2022-08-02 13:21:19 +08:00
parent 20d6197c77
commit e17321fd0e
8 changed files with 455 additions and 252 deletions

View File

@@ -68,9 +68,12 @@
FROM
pdm_bi_devicerunstatusrecord run
LEFT JOIN pdm_bi_device device ON device.device_id = run.device_id
WHERE
run.status_type = '05'
GROUP BY
run.device_id
LIMIT 10
run.device_id
ORDER BY err_num desc
LIMIT 10
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -15,12 +15,13 @@ import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @author qinx
* @date 2022-05-24
**/
* @author qinx
* @date 2022-05-24
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "工单管理")
@@ -34,24 +35,35 @@ public class ProduceshiftorderController {
@Log("查询工单")
@ApiOperation("查询工单")
//@PreAuthorize("@el.check('produceshiftorder:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(produceshiftorderService.queryAll(whereJson,page),HttpStatus.OK);
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(produceshiftorderService.queryAll(whereJson, page), HttpStatus.OK);
}
@PostMapping
@Log("新增工单")
@ApiOperation("新增工单")
//@PreAuthorize("@el.check('produceshiftorder:add')")
public ResponseEntity<Object> create(@Validated @RequestBody ProduceshiftorderDto dto){
public ResponseEntity<Object> create(@Validated @RequestBody ProduceshiftorderDto dto) {
produceshiftorderService.create(dto);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PostMapping("/addRows")
@Log("批量新增工单")
@ApiOperation("批量新增工单")
//@PreAuthorize("@el.check('produceshiftorder:add')")
public ResponseEntity<Object> create(@Validated @RequestBody List<ProduceshiftorderDto> rows) {
for (ProduceshiftorderDto dto : rows) {
produceshiftorderService.create(dto);
}
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@Log("修改工单")
@ApiOperation("修改工单")
//@PreAuthorize("@el.check('produceshiftorder:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody ProduceshiftorderDto dto){
public ResponseEntity<Object> update(@Validated @RequestBody ProduceshiftorderDto dto) {
produceshiftorderService.update(dto);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@@ -69,7 +81,7 @@ public class ProduceshiftorderController {
@Log("工单下发")
@ApiOperation("工单下发")
//@PreAuthorize("@el.check('produceshiftorder:edit')")
public ResponseEntity<Object> submits(@RequestBody JSONObject param){
public ResponseEntity<Object> submits(@RequestBody JSONObject param) {
produceshiftorderService.submits(param);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@@ -78,23 +90,23 @@ public class ProduceshiftorderController {
@Log("根据登录用户设备下拉")
@ApiOperation("根据登录用户设备下拉")
//@PreAuthorize("@el.check('produceshiftorder:list')")
public ResponseEntity<Object> getDevice(@RequestBody JSONObject param){
return new ResponseEntity<>(produceshiftorderService.getDevice(param),HttpStatus.OK);
public ResponseEntity<Object> getDevice(@RequestBody JSONObject param) {
return new ResponseEntity<>(produceshiftorderService.getDevice(param), HttpStatus.OK);
}
@PostMapping("/getTable")
@Log("获取工单生产记录")
@ApiOperation("获取工单生产记录")
//@PreAuthorize("@el.check('produceshiftorder:list')")
public ResponseEntity<Object> getTable(@RequestBody JSONObject param){
return new ResponseEntity<>(produceshiftorderService.getTable(param),HttpStatus.OK);
public ResponseEntity<Object> getTable(@RequestBody JSONObject param) {
return new ResponseEntity<>(produceshiftorderService.getTable(param), HttpStatus.OK);
}
@PostMapping("/openStart")
@Log("看板开工")
@ApiOperation("看板开工")
//@PreAuthorize("@el.check('produceshiftorder:list')")
public ResponseEntity<Object> openStart(@RequestBody JSONObject param){
public ResponseEntity<Object> openStart(@RequestBody JSONObject param) {
produceshiftorderService.openStart(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@@ -103,7 +115,7 @@ public class ProduceshiftorderController {
@Log("看板报工")
@ApiOperation("看板报工")
//@PreAuthorize("@el.check('produceshiftorder:list')")
public ResponseEntity<Object> saveReport(@RequestBody JSONObject param){
public ResponseEntity<Object> saveReport(@RequestBody JSONObject param) {
produceshiftorderService.saveReport(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@@ -112,7 +124,7 @@ public class ProduceshiftorderController {
@Log("看板强制完成")
@ApiOperation("看板强制完成")
//@PreAuthorize("@el.check('produceshiftorder:list')")
public ResponseEntity<Object> finish(@RequestBody JSONObject param){
public ResponseEntity<Object> finish(@RequestBody JSONObject param) {
produceshiftorderService.finish(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@@ -121,15 +133,15 @@ public class ProduceshiftorderController {
@Log("获取当前报工记录")
@ApiOperation("获取当前报工记录")
//@PreAuthorize("@el.check('produceshiftorder:list')")
public ResponseEntity<Object> getReportWork(@RequestBody JSONObject param){
return new ResponseEntity<>(produceshiftorderService.getReportWork(param),HttpStatus.OK);
public ResponseEntity<Object> getReportWork(@RequestBody JSONObject param) {
return new ResponseEntity<>(produceshiftorderService.getReportWork(param), HttpStatus.OK);
}
@PostMapping("/forceFinish")
@Log("工单强制完成")
@ApiOperation("工单强制完成")
//@PreAuthorize("@el.check('produceshiftorder:list')")
public ResponseEntity<Object> forceFinish(@RequestBody JSONObject param){
public ResponseEntity<Object> forceFinish(@RequestBody JSONObject param) {
produceshiftorderService.forceFinish(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@@ -138,8 +150,8 @@ public class ProduceshiftorderController {
@Log("获取当前工单下的工单生产记录")
@ApiOperation("获取当前工单下的工单生产记录")
//@PreAuthorize("@el.check('produceshiftorder:list')")
public ResponseEntity<Object> getDtl(@RequestBody JSONObject param){
return new ResponseEntity<>(produceshiftorderService.getDtl(param),HttpStatus.OK);
public ResponseEntity<Object> getDtl(@RequestBody JSONObject param) {
return new ResponseEntity<>(produceshiftorderService.getDtl(param), HttpStatus.OK);
}
}

View File

@@ -124,6 +124,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
JwtUserDto currentUser = (JwtUserDto) SecurityUtils.getCurrentUser();
Long deptId = currentUser.getDeptId();
String newCode = CodeUtil.getNewCode("PDM_SHIFTORDER");
dto.setProduce_date(dto.getProduce_date().substring(0,10));
dto.setProduceorder_id(IdUtil.getSnowflake(1, 1).nextId());
dto.setProduceorder_code(newCode);
dto.setProducedeviceorder_code(newCode);