rev:工单报工

This commit is contained in:
zhangzhiqiang
2023-05-29 13:02:05 +08:00
parent 27f8851f5d
commit 298b5b1e1d
5 changed files with 61 additions and 19 deletions

View File

@@ -1,15 +1,20 @@
package org.nl.wms.product_manage.controller.device;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.TableDataInfo;
import org.nl.common.anno.Log;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.product_manage.service.device.IPdmBiDeviceService;
import org.nl.wms.product_manage.service.device.dao.PdmBiDevice;
import org.nl.wms.product_manage.service.device.dto.DeviceQuery;
import org.nl.wms.product_manage.备份pdm.service.DeviceService;
import org.nl.wms.product_manage.备份pdm.service.dto.DeviceDto;
import org.springframework.beans.factory.annotation.Autowired;
@@ -19,6 +24,7 @@ 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;
/**
@@ -31,23 +37,33 @@ import java.util.Map;
@Slf4j
public class PdmBiDeviceController {
@Autowired
private DeviceService deviceService;
private DeviceService deviceService;
@Autowired
private IPdmBiDeviceService iDeviceService;
@GetMapping
@Log("查询生产设备")
@ApiOperation("查询生产设备")
//@PreAuthorize("@el.check('device:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(deviceService.queryAll(whereJson,page),HttpStatus.OK);
@SaIgnore
public ResponseEntity<Object> query(DeviceQuery query, PageQuery page) {
Page<PdmBiDevice> result = iDeviceService.page(page.build(PdmBiDevice.class), query.build());
return new ResponseEntity<>(TableDataInfo.build(result), HttpStatus.OK);
}
@PostMapping("/list")
@Log("查询生产设备列表")
@ApiOperation("查询生产设备列表")
@SaIgnore
public ResponseEntity<Object> queryList (@RequestBody DeviceQuery query){
List<Map<String, Object>> list = iDeviceService.listMaps(query.build().select("device_code", "device_name"));
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
}
@PostMapping
@Log("新增生产设备")
@ApiOperation("新增生产设备")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> create( @RequestBody JSONObject form){
public ResponseEntity<Object> create (@RequestBody JSONObject form){
PdmBiDevice device = form.toJavaObject(PdmBiDevice.class);
device.setCreate_id(SecurityUtils.getCurrentUserId());
device.setCreate_name(SecurityUtils.getCurrentNickName());
@@ -60,7 +76,7 @@ public class PdmBiDeviceController {
@Log("修改生产设备")
@ApiOperation("修改生产设备")
//@PreAuthorize("@el.check('device:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject form){
public ResponseEntity<Object> update (@Validated @RequestBody JSONObject form){
PdmBiDevice device = form.toJavaObject(PdmBiDevice.class);
device.setUpdate_id(SecurityUtils.getCurrentUserId());
device.setUpdate_name(SecurityUtils.getCurrentNickName());
@@ -73,7 +89,7 @@ public class PdmBiDeviceController {
@ApiOperation("删除生产设备")
//@PreAuthorize("@el.check('device:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
public ResponseEntity<Object> delete (@RequestBody String[]ids){
deviceService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@@ -82,16 +98,16 @@ public class PdmBiDeviceController {
@Log("工序下拉")
@ApiOperation("工序下拉")
//@PreAuthorize("@el.check('device:list')")
public ResponseEntity<Object> getWorkprocedure(){
return new ResponseEntity<>(deviceService.getWorkprocedure(),HttpStatus.OK);
public ResponseEntity<Object> getWorkprocedure () {
return new ResponseEntity<>(deviceService.getWorkprocedure(), HttpStatus.OK);
}
@GetMapping("/getDeviceList")
@Log("设备下拉框")
@ApiOperation("设备下拉框")
//@PreAuthorize("@el.check('device:list')")
public ResponseEntity<Object> getDeviceList(){
return new ResponseEntity<>(deviceService.getDeviceList(),HttpStatus.OK);
public ResponseEntity<Object> getDeviceList () {
return new ResponseEntity<>(deviceService.getDeviceList(), HttpStatus.OK);
}
}

View File

@@ -70,7 +70,8 @@ public class ProduceshiftorderController{
if(null == param) {
throw new BizCoreException(ResultCode.VALIDATE_FAILED);
}
return new ResponseEntity<>(produceshiftorderService.getOrderList(param, page), HttpStatus.OK);
List<Map> list = iPdmProduceWorkorderService.getOrderList(param, page);
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
}
@PostMapping("/getOrderList2")
@@ -134,6 +135,24 @@ public class ProduceshiftorderController{
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/deleteReport")
@Log("deleteReport")
@ApiOperation("deleteReport")
public ResponseEntity<Object> deleteReport(@RequestBody JSONObject param) {
iPdmProduceWorkorderService.removeById(param.getString("macoperate_id"));
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/updateReport")
@Log("报工数修改")
@ApiOperation("报工数修改")
public ResponseEntity<Object> updateReport(@RequestBody JSONObject param) {
iPdmProduceWorkorderService.updateReport(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/getUser")
@Log("查询操作人员")
@ApiOperation("查询操作人员")

View File

@@ -58,11 +58,11 @@
</select>
<select id="getworkOrderDtl" resultType="java.util.Map">
SELECT
record.*,
device.device_code,
device.device_name
record.*,
device.device_code,
device.device_name
FROM
PDM_produce_workOrderRecord record
PDM_produce_workOrderRecord record
LEFT JOIN PDM_BI_Device device ON record.device_code = device.device_code
<where>
<if test="workorder_id != null and workorder_id != ''">
@@ -91,14 +91,14 @@
and workorder.workorder_status in ( ${workorder_status} )
</if>
<if test="key_value != null and key_value != ''">
and (
and (
workorder.workorder_code like %${key_value}% or
mater.material_name like%${key_value}% or
mater.material_code like %${key_value}%
)
</if>
<if test="realproducestart_date != null and realproducestart_date != ''">
and workorder.realproducestart_date >= #{realproducestart_date}
and workorder.realproducestart_date >= #{realproducestart_date}
</if>
<if test="realproduceend_date != null and realproduceend_date != ''">
and #{realproduceend_date} >= workorder.realproducestart_date
@@ -124,3 +124,4 @@
</update>
</mapper>

View File

@@ -22,6 +22,9 @@
<if test="query.workorder_code != null and query.workorder_code != ''">
and wr.workorder_code = #{query.workorder_code}
</if>
<if test="query.workorder_id != null and query.workorder_id != ''">
and wr.workorder_id = #{query.workorder_id}
</if>
<if test="query.start_time != null and query.start_time != ''">
and wr.realproducestart_date >= #{query.start_time}
</if>

View File

@@ -1,3 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelineVehicleMapper">
<select id="getCachelineVehicle"
@@ -14,3 +16,4 @@
</if>
</select>
</mapper>