Merge branch 'master' of http://121.40.234.130:8899/root/wuHanXinRui
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.pda.st.out.service.impl;
|
package org.nl.pda.st.out.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@@ -408,6 +409,8 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> confirmOutStore2(Map<String, String> jsonObject) {
|
public Map<String, Object> confirmOutStore2(Map<String, String> jsonObject) {
|
||||||
|
String input_optid = MapUtil.getStr(jsonObject, "input_optid");
|
||||||
|
String input_optname = MapUtil.getStr(jsonObject, "input_optid");
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
UserDto userDto = userService.findById(currentUserId);
|
UserDto userDto = userService.findById(currentUserId);
|
||||||
// 仓位属性表【ST_IVT_StructAttr】
|
// 仓位属性表【ST_IVT_StructAttr】
|
||||||
@@ -550,8 +553,8 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
|||||||
invrow.put("detail_count", 1);
|
invrow.put("detail_count", 1);
|
||||||
invrow.put("bill_status", "99");
|
invrow.put("bill_status", "99");
|
||||||
invrow.put("create_mode", "02");
|
invrow.put("create_mode", "02");
|
||||||
invrow.put("input_optid", currentUserId);
|
invrow.put("input_optid", input_optid);
|
||||||
invrow.put("input_optname", userDto.getNickName());
|
invrow.put("input_optname", input_optname);
|
||||||
invrow.put("input_time", now);
|
invrow.put("input_time", now);
|
||||||
invrow.put("update_optid", currentUserId);
|
invrow.put("update_optid", currentUserId);
|
||||||
invrow.put("update_optname", userDto.getNickName());
|
invrow.put("update_optname", userDto.getNickName());
|
||||||
@@ -559,8 +562,8 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
|||||||
invrow.put("dis_optid", currentUserId);
|
invrow.put("dis_optid", currentUserId);
|
||||||
invrow.put("dis_optname", userDto.getNickName());
|
invrow.put("dis_optname", userDto.getNickName());
|
||||||
invrow.put("dis_time", now);
|
invrow.put("dis_time", now);
|
||||||
invrow.put("confirm_optid", currentUserId);
|
invrow.put("confirm_optid", input_optid);
|
||||||
invrow.put("confirm_optname", userDto.getNickName());
|
invrow.put("confirm_optname", input_optname);
|
||||||
invrow.put("confirm_time", now);
|
invrow.put("confirm_time", now);
|
||||||
invrow.put("sysdeptid", userDto.getDept().getId());
|
invrow.put("sysdeptid", userDto.getDept().getId());
|
||||||
invrow.put("syscompanyid", userDto.getDept().getId());
|
invrow.put("syscompanyid", userDto.getDept().getId());
|
||||||
|
|||||||
@@ -553,6 +553,8 @@ public class FlourworkServiceImpl implements FlourworkService {
|
|||||||
}
|
}
|
||||||
map.put("bucketunique", jsonFormDtlJob.getString("bucketunique"));
|
map.put("bucketunique", jsonFormDtlJob.getString("bucketunique"));
|
||||||
map.put("out_qty", jsonFormDtlJob.getString("outconfirm_qty"));
|
map.put("out_qty", jsonFormDtlJob.getString("outconfirm_qty"));
|
||||||
|
map.put("input_optid", jsonFormDtlJob.getString("create_id"));
|
||||||
|
map.put("input_optname", jsonFormDtlJob.getString("create_name"));
|
||||||
handPFOutIvtService.confirmOutStore2(map);
|
handPFOutIvtService.confirmOutStore2(map);
|
||||||
} else {
|
} else {
|
||||||
// 2.如果不是
|
// 2.如果不是
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.sb.run.rest;
|
||||||
|
|
||||||
|
|
||||||
|
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.sb.run.service.DeviceScrapService;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @date 2022-06-27
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "设备报废")
|
||||||
|
@RequestMapping("/api/devicescrap")
|
||||||
|
@Slf4j
|
||||||
|
public class DeviceScrapController {
|
||||||
|
|
||||||
|
private final DeviceScrapService deviceScrapService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询设备报废")
|
||||||
|
@ApiOperation("查询设备报废")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||||
|
return new ResponseEntity<>(deviceScrapService.queryAll(whereJson, page), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/scrap")
|
||||||
|
@Log("报废")
|
||||||
|
@ApiOperation("报废")
|
||||||
|
public ResponseEntity<Object> scrap(@RequestBody JSONObject whereJson) {
|
||||||
|
deviceScrapService.scrap(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.sb.run.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description 服务接口
|
||||||
|
* @date 2022-06-27
|
||||||
|
**/
|
||||||
|
public interface DeviceScrapService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
*
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String, Object>
|
||||||
|
*/
|
||||||
|
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报废
|
||||||
|
* @param whereJson 参数
|
||||||
|
*/
|
||||||
|
void scrap(JSONObject whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.sb.run.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||||
|
import org.nl.wms.sb.run.service.DeviceScrapService;
|
||||||
|
import org.nl.wql.WQL;
|
||||||
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.wql.util.WqlUtil;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description 服务实现
|
||||||
|
* @date 2022-06-27
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class DeviceScrapServiceImpl implements DeviceScrapService {
|
||||||
|
private final ClassstandardService classstandardService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
|
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||||
|
String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
|
||||||
|
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||||
|
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||||
|
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
|
String manufacturer = MapUtil.getStr(whereJson, "manufacturer");
|
||||||
|
String supplier_code = MapUtil.getStr(whereJson, "supplier_code");
|
||||||
|
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
map.put("flag", "1");
|
||||||
|
map.put("begin_time", begin_time);
|
||||||
|
map.put("end_time", end_time);
|
||||||
|
map.put("device_type", MapUtil.getStr(whereJson, "device_type"));
|
||||||
|
map.put("status", MapUtil.getStr(whereJson, "status"));
|
||||||
|
map.put("is_produceuse", MapUtil.getStr(whereJson, "is_produceuse"));
|
||||||
|
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||||
|
if (ObjectUtil.isNotEmpty(manufacturer)) map.put("manufacturer","%"+manufacturer+"%");
|
||||||
|
if (ObjectUtil.isNotEmpty(supplier_code)) map.put("supplier_code","%"+supplier_code+"%");
|
||||||
|
//处理物料当前节点的所有子节点
|
||||||
|
if (!StrUtil.isEmpty(material_type_id)) {
|
||||||
|
map.put("material_type_id", material_type_id);
|
||||||
|
String classIds = classstandardService.getChildIdStr(material_type_id);
|
||||||
|
map.put("classIds", classIds);
|
||||||
|
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
||||||
|
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
||||||
|
map.put("classIds", classIds);
|
||||||
|
}
|
||||||
|
JSONObject json = WQL.getWO("EM_DEVICESCRAP001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "file.update_time DESC");
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void scrap(JSONObject whereJson) {
|
||||||
|
String devicerecord_id = whereJson.getString("devicerecord_id");
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
|
||||||
|
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile");
|
||||||
|
WQLObject lifeTab = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle");
|
||||||
|
|
||||||
|
// 更新设备档案表状态为报废
|
||||||
|
JSONObject json = fileTab.query("devicerecord_id ='" + devicerecord_id + "' and is_delete = '0'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(json)) throw new BootstrapMethodError("档案已被删除");
|
||||||
|
|
||||||
|
json.put("status", "90");
|
||||||
|
json.put("update_optid", currentUserId);
|
||||||
|
json.put("update_optname", nickName);
|
||||||
|
json.put("update_time", DateUtil.now());
|
||||||
|
fileTab.update(json);
|
||||||
|
|
||||||
|
// 插入设备生命周期表
|
||||||
|
JSONObject jsonLife = new JSONObject();
|
||||||
|
jsonLife.put("devicechangedtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||||
|
jsonLife.put("devicerecord_id",json.get("devicerecord_id"));
|
||||||
|
jsonLife.put("changetype","40");
|
||||||
|
jsonLife.put("change_id",currentUserId);
|
||||||
|
jsonLife.put("change_name",nickName);
|
||||||
|
jsonLife.put("change_time",DateUtil.now());
|
||||||
|
jsonLife.put("create_id",currentUserId);
|
||||||
|
jsonLife.put("create_name",nickName);
|
||||||
|
jsonLife.put("create_time",DateUtil.now());
|
||||||
|
lifeTab.insert(jsonLife);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
[交易说明]
|
||||||
|
交易名: 设备报废分页查询
|
||||||
|
所属模块:
|
||||||
|
功能简述:
|
||||||
|
版权所有:
|
||||||
|
表引用:
|
||||||
|
版本经历:
|
||||||
|
|
||||||
|
[数据库]
|
||||||
|
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||||
|
|
||||||
|
[IO定义]
|
||||||
|
#################################################
|
||||||
|
## 表字段对应输入参数
|
||||||
|
#################################################
|
||||||
|
输入.flag TYPEAS s_string
|
||||||
|
输入.classIds TYPEAS f_string
|
||||||
|
输入.device_code TYPEAS s_string
|
||||||
|
输入.begin_time TYPEAS s_string
|
||||||
|
输入.end_time TYPEAS s_string
|
||||||
|
输入.manufacturer TYPEAS s_string
|
||||||
|
输入.supplier_code TYPEAS s_string
|
||||||
|
输入.device_type TYPEAS s_string
|
||||||
|
输入.status TYPEAS s_string
|
||||||
|
输入.is_produceuse TYPEAS s_string
|
||||||
|
|
||||||
|
|
||||||
|
[临时表]
|
||||||
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
|
|
||||||
|
[临时变量]
|
||||||
|
--所有中间过程变量均可在此处定义
|
||||||
|
|
||||||
|
[业务过程]
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 1、输入输出检查 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 2、主过程前处理 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 3、业务主过程 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
IF 输入.flag = "1"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
file.*,
|
||||||
|
class.class_name,
|
||||||
|
dept1.name AS use_groupid_name,
|
||||||
|
dept2.name AS use_deptid_name,
|
||||||
|
work.workprocedure_name,
|
||||||
|
info.is_active,
|
||||||
|
info.is_delete AS device_is_delete
|
||||||
|
FROM
|
||||||
|
EM_BI_EquipmentFile file
|
||||||
|
LEFT JOIN em_bi_deviceinfo info ON file.device_code = info.device_code
|
||||||
|
LEFT JOIN md_pb_classstandard class ON file.material_type_id = class.class_id
|
||||||
|
LEFT JOIN sys_dept dept1 ON file.use_groupid = dept1.dept_id
|
||||||
|
LEFT JOIN sys_dept dept2 ON file.use_deptid = dept2.dept_id
|
||||||
|
LEFT JOIN pdm_bi_workprocedure work ON file.workprocedure_id = work.workprocedure_id
|
||||||
|
WHERE
|
||||||
|
file.is_delete = '0'
|
||||||
|
|
||||||
|
OPTION 输入.device_code <> ""
|
||||||
|
(file.device_code like 输入.device_code or
|
||||||
|
file.device_name like 输入.device_code)
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.classIds <> ""
|
||||||
|
class.class_id in 输入.classIds
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.begin_time <> ""
|
||||||
|
file.beginuse_date >= 输入.begin_time
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.end_time <> ""
|
||||||
|
file.beginuse_date <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.manufacturer <> ""
|
||||||
|
file.manufacturer like 输入.manufacturer
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.device_type <> ""
|
||||||
|
file.device_type = 输入.device_type
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.status <> ""
|
||||||
|
file.status = 输入.status
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.is_produceuse <> ""
|
||||||
|
file.is_produceuse = 输入.is_produceuse
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.supplier_code <> ""
|
||||||
|
(file.supplier_code like 输入.supplier_code or
|
||||||
|
file.supplier_name like 输入.supplier_code)
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.sb.stat.rest;
|
||||||
|
|
||||||
|
|
||||||
|
import org.nl.wms.sb.stat.service.DevicesparepartivtService;
|
||||||
|
import org.nl.wms.sb.stat.service.dto.DevicesparepartivtDto;
|
||||||
|
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.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @date 2022-06-28
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "备件库存查询管理")
|
||||||
|
@RequestMapping("/api/devicesparepartivt")
|
||||||
|
@Slf4j
|
||||||
|
public class DevicesparepartivtController {
|
||||||
|
|
||||||
|
private final DevicesparepartivtService devicesparepartivtService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询备件库存查询")
|
||||||
|
@ApiOperation("查询备件库存查询")
|
||||||
|
//@PreAuthorize("@el.check('devicesparepartivt:list')")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||||
|
return new ResponseEntity<>(devicesparepartivtService.queryAll(whereJson, page), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增备件库存查询")
|
||||||
|
@ApiOperation("新增备件库存查询")
|
||||||
|
//@PreAuthorize("@el.check('devicesparepartivt:add')")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody DevicesparepartivtDto dto) {
|
||||||
|
devicesparepartivtService.create(dto);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改备件库存查询")
|
||||||
|
@ApiOperation("修改备件库存查询")
|
||||||
|
//@PreAuthorize("@el.check('devicesparepartivt:edit')")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody DevicesparepartivtDto dto) {
|
||||||
|
devicesparepartivtService.update(dto);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除备件库存查询")
|
||||||
|
@ApiOperation("删除备件库存查询")
|
||||||
|
//@PreAuthorize("@el.check('devicesparepartivt:del')")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||||
|
devicesparepartivtService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出数据")
|
||||||
|
@GetMapping(value = "/download")
|
||||||
|
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||||
|
devicesparepartivtService.download(whereJson, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.sb.stat.service;
|
||||||
|
|
||||||
|
import org.nl.wms.sb.stat.service.dto.DevicesparepartivtDto;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description 服务接口
|
||||||
|
* @date 2022-06-28
|
||||||
|
**/
|
||||||
|
public interface DevicesparepartivtService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
*
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String, Object>
|
||||||
|
*/
|
||||||
|
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据不分页
|
||||||
|
*
|
||||||
|
* @param whereJson 条件参数
|
||||||
|
* @return List<DevicesparepartivtDto>
|
||||||
|
*/
|
||||||
|
List<DevicesparepartivtDto> queryAll(Map whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询
|
||||||
|
*
|
||||||
|
* @param stockrecord_id ID
|
||||||
|
* @return Devicesparepartivt
|
||||||
|
*/
|
||||||
|
DevicesparepartivtDto findById(Long stockrecord_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据编码查询
|
||||||
|
*
|
||||||
|
* @param code code
|
||||||
|
* @return Devicesparepartivt
|
||||||
|
*/
|
||||||
|
DevicesparepartivtDto findByCode(String code);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
*
|
||||||
|
* @param dto /
|
||||||
|
*/
|
||||||
|
void create(DevicesparepartivtDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param dto /
|
||||||
|
*/
|
||||||
|
void update(DevicesparepartivtDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
*
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Long[] ids);
|
||||||
|
|
||||||
|
void download(Map whereJson, HttpServletResponse response) throws IOException;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package org.nl.wms.sb.stat.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description /
|
||||||
|
* @author Liuxy
|
||||||
|
* @date 2022-06-28
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class DevicesparepartivtDto implements Serializable {
|
||||||
|
|
||||||
|
/** 库存记录标识 */
|
||||||
|
/** 防止精度丢失 */
|
||||||
|
@JsonSerialize(using= ToStringSerializer.class)
|
||||||
|
private Long stockrecord_id;
|
||||||
|
|
||||||
|
/** 备件唯一标识 */
|
||||||
|
private String sparepart_only_id;
|
||||||
|
|
||||||
|
/** 物料标识 */
|
||||||
|
private Long material_id;
|
||||||
|
|
||||||
|
/** 批次 */
|
||||||
|
private String pcsn;
|
||||||
|
|
||||||
|
/** 仓库标识 */
|
||||||
|
private Long stor_id;
|
||||||
|
|
||||||
|
/** 仓库名称 */
|
||||||
|
private String stor_name;
|
||||||
|
|
||||||
|
/** 仓位标识 */
|
||||||
|
private Long struct_id;
|
||||||
|
|
||||||
|
/** 仓位编码 */
|
||||||
|
private String struct_code;
|
||||||
|
|
||||||
|
/** 仓位名称 */
|
||||||
|
private String struct_name;
|
||||||
|
|
||||||
|
/** 库存数 */
|
||||||
|
private BigDecimal ivt_qty;
|
||||||
|
|
||||||
|
/** 数量计量单位标识 */
|
||||||
|
private Long qty_unit_id;
|
||||||
|
|
||||||
|
/** 数量计量单位名称 */
|
||||||
|
private String qty_unit_name;
|
||||||
|
|
||||||
|
/** 入库时间 */
|
||||||
|
private String instorage_time;
|
||||||
|
}
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.sb.stat.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.nl.exception.BadRequestException;
|
||||||
|
import org.nl.utils.FileUtil;
|
||||||
|
import org.nl.wms.sb.stat.service.DevicesparepartivtService;
|
||||||
|
import org.nl.wms.sb.stat.service.dto.DevicesparepartivtDto;
|
||||||
|
import org.nl.wql.WQL;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
|
import org.nl.wql.core.bean.ResultBean;
|
||||||
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.wql.util.WqlUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description 服务实现
|
||||||
|
* @date 2022-06-28
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class DevicesparepartivtServiceImpl implements DevicesparepartivtService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
|
String material_code = MapUtil.getStr(whereJson, "material_code");
|
||||||
|
String is_all = MapUtil.getStr(whereJson, "is_all");
|
||||||
|
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
if (ObjectUtil.isEmpty(is_all) || StrUtil.equals(is_all, "0")) {
|
||||||
|
map.put("flag", "1");
|
||||||
|
} else {
|
||||||
|
map.put("flag", "2");
|
||||||
|
}
|
||||||
|
map.put("stor_id", MapUtil.getStr(whereJson,"stor_id"));
|
||||||
|
map.put("sect_id", MapUtil.getStr(whereJson,"sect_id"));
|
||||||
|
if (ObjectUtil.isNotEmpty(material_code)) map.put("material_code", "%"+material_code+"%");
|
||||||
|
JSONObject json = WQL.getWO("EM_DEVICEIVT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ivt.material_id DESC");
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DevicesparepartivtDto> queryAll(Map whereJson) {
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicesparepartivt");
|
||||||
|
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(DevicesparepartivtDto.class);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DevicesparepartivtDto findById(Long stockrecord_id) {
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicesparepartivt");
|
||||||
|
JSONObject json = wo.query("stockrecord_id = '" + stockrecord_id + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(json)) {
|
||||||
|
return json.toJavaObject(DevicesparepartivtDto.class);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DevicesparepartivtDto findByCode(String code) {
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicesparepartivt");
|
||||||
|
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(json)) {
|
||||||
|
return json.toJavaObject(DevicesparepartivtDto.class);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void create(DevicesparepartivtDto dto) {
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
dto.setStockrecord_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicesparepartivt");
|
||||||
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
|
wo.insert(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(DevicesparepartivtDto dto) {
|
||||||
|
DevicesparepartivtDto entity = this.findById(dto.getStockrecord_id());
|
||||||
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
|
||||||
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicesparepartivt");
|
||||||
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
|
wo.update(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void deleteAll(Long[] ids) {
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicesparepartivt");
|
||||||
|
for (Long stockrecord_id : ids) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("stockrecord_id", String.valueOf(stockrecord_id));
|
||||||
|
param.put("is_delete", "1");
|
||||||
|
param.put("update_optid", currentUserId);
|
||||||
|
param.put("update_optname", nickName);
|
||||||
|
param.put("update_time", now);
|
||||||
|
wo.update(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void download(Map whereJson, HttpServletResponse response) throws IOException {
|
||||||
|
String material_code = MapUtil.getStr(whereJson, "material_code");
|
||||||
|
String is_all = MapUtil.getStr(whereJson, "is_all");
|
||||||
|
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
if (ObjectUtil.isEmpty(is_all) || StrUtil.equals(is_all, "0")) {
|
||||||
|
map.put("flag", "1");
|
||||||
|
} else {
|
||||||
|
map.put("flag", "2");
|
||||||
|
}
|
||||||
|
map.put("stor_id", MapUtil.getStr(whereJson,"stor_id"));
|
||||||
|
map.put("sect_id", MapUtil.getStr(whereJson,"sect_id"));
|
||||||
|
if (ObjectUtil.isNotEmpty(material_code)) map.put("material_code", "%"+material_code+"%");
|
||||||
|
JSONArray rows = WQL.getWO("EM_DEVICEIVT001").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
|
JSONObject jo = rows.getJSONObject(i);
|
||||||
|
Map<String, Object> dtl_map = new LinkedHashMap<>();
|
||||||
|
dtl_map.put("库区编码", jo.getString("sect_code"));
|
||||||
|
dtl_map.put("库区名称", jo.getString("sect_name"));
|
||||||
|
dtl_map.put("物料编码", jo.getString("material_code"));
|
||||||
|
dtl_map.put("物料名称", jo.getString("material_name"));
|
||||||
|
dtl_map.put("型号", jo.getString("material_model"));
|
||||||
|
dtl_map.put("技术规格", jo.getString("material_spec"));
|
||||||
|
dtl_map.put("批次", jo.getString("pcsn"));
|
||||||
|
dtl_map.put("库存数", jo.getString("ivt_qty"));
|
||||||
|
dtl_map.put("单位", jo.getString("qty_unit_name"));
|
||||||
|
dtl_map.put("入库时间", jo.getString("instorage_time"));
|
||||||
|
list.add(dtl_map);
|
||||||
|
}
|
||||||
|
FileUtil.downloadExcel(list, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
[交易说明]
|
||||||
|
交易名: 备件库存分页查询
|
||||||
|
所属模块:
|
||||||
|
功能简述:
|
||||||
|
版权所有:
|
||||||
|
表引用:
|
||||||
|
版本经历:
|
||||||
|
|
||||||
|
[数据库]
|
||||||
|
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||||
|
|
||||||
|
[IO定义]
|
||||||
|
#################################################
|
||||||
|
## 表字段对应输入参数
|
||||||
|
#################################################
|
||||||
|
输入.flag TYPEAS s_string
|
||||||
|
输入.stor_id TYPEAS s_string
|
||||||
|
输入.sect_id TYPEAS s_string
|
||||||
|
输入.material_code TYPEAS s_string
|
||||||
|
|
||||||
|
|
||||||
|
[临时表]
|
||||||
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
|
|
||||||
|
[临时变量]
|
||||||
|
--所有中间过程变量均可在此处定义
|
||||||
|
|
||||||
|
[业务过程]
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 1、输入输出检查 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 2、主过程前处理 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 3、业务主过程 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
IF 输入.flag = "1"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
MAX(struct.sect_code) AS sect_code,
|
||||||
|
MAX(struct.sect_name) AS sect_name,
|
||||||
|
me.material_code,
|
||||||
|
me.material_name,
|
||||||
|
me.material_spec,
|
||||||
|
me.material_model,
|
||||||
|
ivt.pcsn,
|
||||||
|
sum(ivt.ivt_qty) AS ivt_qty,
|
||||||
|
MAX(ivt.qty_unit_name) AS qty_unit_name,
|
||||||
|
MAX(ivt.instorage_time) AS instorage_time
|
||||||
|
FROM
|
||||||
|
EM_BI_DeviceSparePartIvt ivt
|
||||||
|
LEFT JOIN ST_IVT_StructAttr struct ON ivt.struct_id = struct.struct_id
|
||||||
|
LEFT JOIN MD_ME_MaterialBase me ON me.material_id = ivt.material_id
|
||||||
|
WHERE 1=1
|
||||||
|
OPTION 输入.stor_id <> ""
|
||||||
|
struct.stor_id = 输入.stor_id
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.sect_id <> ""
|
||||||
|
struct.sect_id = 输入.sect_id
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.material_code <> ""
|
||||||
|
(me.material_name like 输入.material_code or
|
||||||
|
me.material_code like 输入.material_code)
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
group by ivt.material_id,ivt.pcsn
|
||||||
|
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "2"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
struct.sect_code,
|
||||||
|
struct.sect_name,
|
||||||
|
me.material_code,
|
||||||
|
me.material_name,
|
||||||
|
me.material_spec,
|
||||||
|
me.material_model,
|
||||||
|
ivt.*
|
||||||
|
FROM
|
||||||
|
EM_BI_DeviceSparePartIvt ivt
|
||||||
|
LEFT JOIN ST_IVT_StructAttr struct ON ivt.struct_id = struct.struct_id
|
||||||
|
LEFT JOIN MD_ME_MaterialBase me ON me.material_id = ivt.material_id
|
||||||
|
WHERE 1=1
|
||||||
|
OPTION 输入.stor_id <> ""
|
||||||
|
struct.stor_id = 输入.stor_id
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.sect_id <> ""
|
||||||
|
struct.sect_id = 输入.sect_id
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.material_code <> ""
|
||||||
|
(me.material_name like 输入.material_code or
|
||||||
|
me.material_code like 输入.material_code)
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
35
mes/qd/src/api/wms/sb/devicescrap.js
Normal file
35
mes/qd/src/api/wms/sb/devicescrap.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/devicescrap',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/devicescrap/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/devicescrap',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function scrap(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/devicescrap/scrap',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, scrap }
|
||||||
27
mes/qd/src/api/wms/sb/devicesparepartivt.js
Normal file
27
mes/qd/src/api/wms/sb/devicesparepartivt.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/devicesparepartivt',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/devicesparepartivt/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/devicesparepartivt',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del }
|
||||||
@@ -113,9 +113,9 @@
|
|||||||
<el-table-column prop="bill_status" label="单据状态" :formatter="formatStatus" />
|
<el-table-column prop="bill_status" label="单据状态" :formatter="formatStatus" />
|
||||||
<el-table-column v-if="false" prop="biz_date" label="业务日期" />
|
<el-table-column v-if="false" prop="biz_date" label="业务日期" />
|
||||||
<el-table-column v-if="false" prop="material_id" label="物料标识" />
|
<el-table-column v-if="false" prop="material_id" label="物料标识" />
|
||||||
<el-table-column prop="material_code" label="物料编码" show-overflow-tooltip />
|
<el-table-column prop="material_code" label="物料编码" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip />
|
<el-table-column prop="material_name" label="物料名称" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="pcsn" label="批号" />
|
<el-table-column prop="pcsn" label="批号" min-width="100" show-overflow-tooltip />
|
||||||
<el-table-column prop="is_effective" label="是否有效" :formatter="format_is_active" />
|
<el-table-column prop="is_effective" label="是否有效" :formatter="format_is_active" />
|
||||||
<el-table-column prop="result" label="结果" :formatter="format_result" />
|
<el-table-column prop="result" label="结果" :formatter="format_result" />
|
||||||
<el-table-column prop="remark" show-overflow-tooltip label="备注" />
|
<el-table-column prop="remark" show-overflow-tooltip label="备注" />
|
||||||
|
|||||||
277
mes/qd/src/views/wms/sb/run/devicescrap/index.vue
Normal file
277
mes/qd/src/views/wms/sb/run/devicescrap/index.vue
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="110px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="启用日期">
|
||||||
|
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备类别">
|
||||||
|
<treeselect
|
||||||
|
v-model="query.material_type_id"
|
||||||
|
:load-options="loadClass"
|
||||||
|
:options="classes"
|
||||||
|
style="width: 200px;"
|
||||||
|
placeholder="请选择"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备编码">
|
||||||
|
<el-input
|
||||||
|
v-model="query.device_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请输入设备编码、名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生产厂家">
|
||||||
|
<el-input
|
||||||
|
v-model="query.manufacturer"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请输入生产厂家"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商">
|
||||||
|
<el-input
|
||||||
|
v-model="query.supplier_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请输入供应商编码、名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备属性">
|
||||||
|
<el-select
|
||||||
|
v-model="query.device_type"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请选择"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.DEVICE_ATTRIBUTE_SCODE"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备状态">
|
||||||
|
<el-select
|
||||||
|
v-model="query.status"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请选择"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.EM_BI_DEVICESTATUS"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生产用途">
|
||||||
|
<el-select
|
||||||
|
v-model="query.is_produceuse"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请选择"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.EM_BI_DEVICEUSE"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission">
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-position"
|
||||||
|
size="mini"
|
||||||
|
:disabled="crud.selections.length !== 1"
|
||||||
|
@click="scrap"
|
||||||
|
>
|
||||||
|
报废
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="device_code" label="设备代码" width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="device_name" label="设备名称" width="120px" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="extend_code" label="外部编码" width="120px" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="device_model" label="设备型号" width="120px" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="device_spec" label="设备规格" />
|
||||||
|
<el-table-column prop="class_name" label="设备类类别" />
|
||||||
|
<el-table-column prop="is_produceuse" label="生产用途" :formatter="formatProduceName" />
|
||||||
|
<el-table-column prop="status" label="设备状态" :formatter="formatStatusName" />
|
||||||
|
<el-table-column prop="beginuse_date" label="启用日期" width="120px" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="use_deptid_name" label="使用部门" />
|
||||||
|
<el-table-column prop="use_groupid_name" label="使用班组" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="supplier_name" label="供应商" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="manufacturer" label="制造商" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="leavefactory_date" label="出厂日期" width="120px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="leavefactory_number" label="出厂编号" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="drawing_number" label="图号" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="device_type" label="设备属性" :formatter="formatTypeName" />
|
||||||
|
<el-table-column prop="workprocedure_name" label="工序" />
|
||||||
|
<el-table-column prop="assets_code" label="资产编码" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="assets_name" label="资产名称" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="create_name" label="生成人" />
|
||||||
|
<el-table-column prop="create_time" label="生成时间" width="150px" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="update_optname" label="修改人" />
|
||||||
|
<el-table-column prop="update_time" label="修改时间" width="150px" show-overflow-tooltip/>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudDevicescrap from '@/api/wms/sb/devicescrap'
|
||||||
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||||
|
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||||
|
import DateRangePicker from '@/components/DateRangePicker'
|
||||||
|
|
||||||
|
const defaultForm = { status: null }
|
||||||
|
export default {
|
||||||
|
name: 'Devicescrap',
|
||||||
|
dicts: ['EM_BI_DEVICEUSE', 'EM_BI_DEVICESTATUS', 'DEVICE_ATTRIBUTE_SCODE'],
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect, DateRangePicker },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '设备报废',
|
||||||
|
url: 'api/devicescrap',
|
||||||
|
idField: 'devicerecord_id',
|
||||||
|
sort: 'devicerecord_id,desc',
|
||||||
|
crudMethod: { ...crudDevicescrap },
|
||||||
|
optShow: {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
classes: [],
|
||||||
|
class_idStr: null,
|
||||||
|
materOpt_code: '23',
|
||||||
|
deviceDialog: false,
|
||||||
|
permission: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
const param = {
|
||||||
|
'materOpt_code': this.materOpt_code
|
||||||
|
}
|
||||||
|
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||||
|
this.class_idStr = res.class_idStr
|
||||||
|
this.crud.query.class_idStr = this.class_idStr
|
||||||
|
this.crud.toQuery()
|
||||||
|
this.queryClassId()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
hand(value) {
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
loadClass({ action, parentNode, callback }) {
|
||||||
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
|
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||||
|
parentNode.children = res.content.map(function(obj) {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
callback()
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
queryClassId() {
|
||||||
|
const param = {
|
||||||
|
'class_idStr': this.class_idStr
|
||||||
|
}
|
||||||
|
crudClassstandard.queryClassById(param).then(res => {
|
||||||
|
this.classes = res.content.map(obj => {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
formatProduceName(row, cloum) {
|
||||||
|
return this.dict.label.EM_BI_DEVICEUSE[row.is_produceuse]
|
||||||
|
},
|
||||||
|
formatStatusName(row, cloum) {
|
||||||
|
return this.dict.label.EM_BI_DEVICESTATUS[row.status]
|
||||||
|
},
|
||||||
|
formatTypeName(row, cloum) {
|
||||||
|
return this.dict.label.DEVICE_ATTRIBUTE_SCODE[row.device_type]
|
||||||
|
},
|
||||||
|
scrap() {
|
||||||
|
const _selectData = this.$refs.table.selection
|
||||||
|
const data = _selectData[0]
|
||||||
|
if (data.is_active !== '1') {
|
||||||
|
return this.crud.notify('设备未启用或不存在', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
}
|
||||||
|
if (data.device_is_delete === '1') {
|
||||||
|
return this.crud.notify('设备不存在或被删除', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
}
|
||||||
|
if (data.status === '10' || data.status === '11') {
|
||||||
|
crudDevicescrap.scrap(data).then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return this.crud.notify('设备状态不为正常或者闲置', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
154
mes/qd/src/views/wms/sb/stat/deviceivtquery/index.vue
Normal file
154
mes/qd/src/views/wms/sb/stat/deviceivtquery/index.vue
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<el-form
|
||||||
|
size="mini"
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="80px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="所属库区">
|
||||||
|
<el-cascader
|
||||||
|
placeholder="所属库区"
|
||||||
|
:options="sects"
|
||||||
|
:props="{ checkStrictly: true }"
|
||||||
|
clearable
|
||||||
|
class="filter-item"
|
||||||
|
@change="sectQueryChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="备件物料">
|
||||||
|
<el-input
|
||||||
|
v-model="query.material_code"
|
||||||
|
clearable
|
||||||
|
placeholder="编码、名称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="按备件" label-width="120px">
|
||||||
|
<el-switch v-model="query.is_all" active-value="1" inactive-value="0" @change="crud.toQuery()" />
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission">
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-check"
|
||||||
|
size="mini"
|
||||||
|
@click="downdtl"
|
||||||
|
>
|
||||||
|
导出Excel
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="sect_code" label="库区编码" />
|
||||||
|
<el-table-column prop="sect_name" label="库区名称" />
|
||||||
|
<el-table-column prop="material_code" label="物料编码" />
|
||||||
|
<el-table-column prop="material_name" label="名称" />
|
||||||
|
<el-table-column prop="material_model" label="型号" />
|
||||||
|
<el-table-column prop="material_spec" label="技术规格" />
|
||||||
|
<el-table-column prop="pcsn" label="批次" />
|
||||||
|
<el-table-column prop="ivt_qty" label="库存数" />
|
||||||
|
<el-table-column prop="qty_unit_name" label="单位" />
|
||||||
|
<el-table-column prop="instorage_time" label="入库时间" width="150px" />
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudDevicesparepartivt from '@/api/wms/sb/devicesparepartivt'
|
||||||
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||||
|
import { download } from '@/api/data'
|
||||||
|
import { downloadFile } from '@/utils'
|
||||||
|
|
||||||
|
const defaultForm = { stockrecord_id: null, sparepart_only_id: null, material_id: null, pcsn: null, stor_id: null, stor_name: null, struct_id: null, struct_code: null, struct_name: null, ivt_qty: null, qty_unit_id: null, qty_unit_name: null, instorage_time: null }
|
||||||
|
export default {
|
||||||
|
name: 'Deviceivtquery',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '备件库存查询',
|
||||||
|
url: 'api/devicesparepartivt',
|
||||||
|
idField: 'stockrecord_id',
|
||||||
|
sort: 'stockrecord_id,desc',
|
||||||
|
crudMethod: { ...crudDevicesparepartivt },
|
||||||
|
optShow: {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sects: [],
|
||||||
|
permission: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudSectattr.getSect({ 'is_attachment': '1' }).then(res => {
|
||||||
|
this.sects = res.content
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
sectQueryChange(val) {
|
||||||
|
if (val.length === 1) {
|
||||||
|
this.query.stor_id = val[0]
|
||||||
|
this.query.sect_id = ''
|
||||||
|
}
|
||||||
|
if (val.length === 0) {
|
||||||
|
this.query.sect_id = ''
|
||||||
|
this.query.stor_id = ''
|
||||||
|
}
|
||||||
|
if (val.length === 2) {
|
||||||
|
this.query.stor_id = val[0]
|
||||||
|
this.query.sect_id = val[1]
|
||||||
|
}
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
downdtl() {
|
||||||
|
if (this.currentRow !== null) {
|
||||||
|
crud.downloadLoading = true
|
||||||
|
download('/api/devicesparepartivt/download', this.crud.query).then(result => {
|
||||||
|
downloadFile(result, '备件库存', 'xlsx')
|
||||||
|
crud.downloadLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
crud.downloadLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -236,9 +236,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
crudSectattr.getSect().then(res => {
|
// crudSectattr.getSect().then(res => {
|
||||||
this.sects = res.content
|
// this.sects = res.content
|
||||||
})
|
// })
|
||||||
crudSectattr.getSect({ 'is_materialstore': '1' }).then(res => {
|
crudSectattr.getSect({ 'is_materialstore': '1' }).then(res => {
|
||||||
this.sects = res.content
|
this.sects = res.content
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user