rev:新增设备状态监控功能;修改点位查询和批量修改;任务下方ACSAGV参数修改;烘箱温度和时间用redis进行存储和查询;
This commit is contained in:
@@ -40,6 +40,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -59,15 +60,22 @@ public class UserController {
|
||||
|
||||
@ApiOperation("查询用户")
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(UserQuery query, PageQuery page){
|
||||
return new ResponseEntity(userService.getUserDetail(query, page),HttpStatus.OK);
|
||||
public ResponseEntity<Object> query(UserQuery query, PageQuery page) {
|
||||
return new ResponseEntity(userService.getUserDetail(query, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("查询用户")
|
||||
@PostMapping(value = "/getUserList")
|
||||
public ResponseEntity<Object> query() {
|
||||
List<SysUser> userList = userService.list(new QueryWrapper<SysUser>().eq("is_used", true));
|
||||
return new ResponseEntity(userList, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增用户")
|
||||
@ApiOperation("新增用户")
|
||||
@PostMapping
|
||||
// @SaCheckPermission("user:add")
|
||||
public ResponseEntity<Object> create(@RequestBody Map user){
|
||||
public ResponseEntity<Object> create(@RequestBody Map user) {
|
||||
userService.create(user);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
@@ -76,7 +84,7 @@ public class UserController {
|
||||
@ApiOperation("修改用户")
|
||||
@PutMapping
|
||||
// @SaCheckPermission("user:edit")
|
||||
public ResponseEntity<Object> update( @RequestBody Map resources) throws Exception {
|
||||
public ResponseEntity<Object> update(@RequestBody Map resources) throws Exception {
|
||||
userService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@@ -84,8 +92,8 @@ public class UserController {
|
||||
@Log("修改用户:个人中心")
|
||||
@ApiOperation("修改用户:个人中心")
|
||||
// @PutMapping(value = "center")
|
||||
public ResponseEntity<Object> center(@RequestBody SysUser resources){
|
||||
if(!resources.getUserId().equals(StpUtil.getLoginIdAsLong())){
|
||||
public ResponseEntity<Object> center(@RequestBody SysUser resources) {
|
||||
if (!resources.getUserId().equals(StpUtil.getLoginIdAsLong())) {
|
||||
throw new BadRequestException("不能修改他人资料");
|
||||
}
|
||||
userService.saveOrUpdate(resources);
|
||||
@@ -110,20 +118,20 @@ public class UserController {
|
||||
|
||||
@ApiOperation("修改头像")
|
||||
@PostMapping(value = "/updateAvatar")
|
||||
public ResponseEntity<Object> updateAvatar(@RequestParam MultipartFile avatar){
|
||||
public ResponseEntity<Object> updateAvatar(@RequestParam MultipartFile avatar) {
|
||||
return new ResponseEntity<>(userService.updateAvatar(avatar), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("修改邮箱")
|
||||
@ApiOperation("修改邮箱")
|
||||
@PostMapping(value = "/updateEmail/{code}")
|
||||
public ResponseEntity<Object> updateEmail(@PathVariable String code,@RequestBody SysUser user) throws Exception {
|
||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,user.getPassword());
|
||||
public ResponseEntity<Object> updateEmail(@PathVariable String code, @RequestBody SysUser user) throws Exception {
|
||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, user.getPassword());
|
||||
SysUser userInfo = userService.getOne(new QueryWrapper<SysUser>().eq("username", SecurityUtils.getCurrentUsername()));
|
||||
if(!SaSecureUtil.md5BySalt(userInfo.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(password, "salt"))){
|
||||
if (!SaSecureUtil.md5BySalt(userInfo.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(password, "salt"))) {
|
||||
throw new BadRequestException("密码错误");
|
||||
}
|
||||
userService.update(new UpdateWrapper<SysUser>().set(userInfo.getUsername(),user.getEmail()));
|
||||
userService.update(new UpdateWrapper<SysUser>().set(userInfo.getUsername(), user.getEmail()));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
package org.nl.wms.basedata.master.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.modules.logging.annotation.Log;
|
||||
import org.nl.wms.basedata.master.service.DeviceStatusService;
|
||||
import org.nl.wms.basedata.master.service.dto.CustomerbaseDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @date 2021-12-06
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "设备状态监控")
|
||||
@RequestMapping("/api/devicestatus")
|
||||
@Slf4j
|
||||
public class DeviceStatusController {
|
||||
|
||||
private final DeviceStatusService deviceStatusService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询设备状态监控")
|
||||
@ApiOperation("查询设备状态监控")
|
||||
//@PreAuthorize("@el.check('customerbase:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(deviceStatusService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改客户基础表")
|
||||
@ApiOperation("修改客户基础表")
|
||||
//@PreAuthorize("@el.check('customerbase:edit')")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject jo) {
|
||||
deviceStatusService.update(jo);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除客户基础表")
|
||||
@ApiOperation("删除客户基础表")
|
||||
//@PreAuthorize("@el.check('customerbase:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
deviceStatusService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
package org.nl.wms.basedata.master.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.basedata.master.service.dto.CustomerbaseDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author ldjun
|
||||
* @date 2021-12-06
|
||||
**/
|
||||
public interface DeviceStatusService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<CustomerbaseDto>
|
||||
*/
|
||||
List<CustomerbaseDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(JSONObject jo);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
|
||||
package org.nl.wms.basedata.master.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.basedata.master.service.DeviceStatusService;
|
||||
import org.nl.wms.basedata.master.service.dto.CustomerbaseDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @description 服务实现
|
||||
* @date 2021-12-06
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class DeviceStatusServiceImpl implements DeviceStatusService {
|
||||
@Autowired
|
||||
private DeviceStatusService deviceStatusService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String where = "";
|
||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicestatus");
|
||||
String search = (String) whereJson.get("search");
|
||||
if (!StrUtil.isEmpty(search)) {
|
||||
where = "AND (device_code like '%" + search + "%' OR device_name like '%" + search + "%')";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1=1" + where, "device_code desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomerbaseDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
List<CustomerbaseDto> list = arr.toJavaList(CustomerbaseDto.class);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(JSONObject jo) {
|
||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicestatus");
|
||||
String device_code = jo.getString("device_code");
|
||||
if (!jo.containsKey("need_update_flag")){
|
||||
JSONArray rows = jo.getJSONArray("upload_user");
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
String msg = "";
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
if (i!=rows.size()-1){
|
||||
msg += rows.getString(i)+",";
|
||||
}else {
|
||||
msg += rows.getString(i);
|
||||
}
|
||||
}
|
||||
map.put("upload_user",msg);
|
||||
wo.update(map,"device_code = '"+device_code+"'");
|
||||
}else {
|
||||
wo.update(jo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase");
|
||||
for (Long cust_id : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("cust_id", String.valueOf(cust_id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -87,6 +87,13 @@ public class AcsToWmsController {
|
||||
return new ResponseEntity<>(acsToWmsService.shipDeviceUpdate(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/sendDeviceStatus")
|
||||
@ApiOperation("设备状态变更上报")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> sendDeviceStatus(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(acsToWmsService.sendDeviceStatus(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/initialize")
|
||||
@Log(value = "仓位初始化", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("仓位初始化")
|
||||
|
||||
@@ -78,6 +78,15 @@ public interface AcsToWmsService {
|
||||
*/
|
||||
JSONObject shipDeviceUpdate(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* ACS客户端--->LMS服务端
|
||||
* 输送线光电无货上报
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject sendDeviceStatus(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 仓位初始化
|
||||
*/
|
||||
|
||||
@@ -714,8 +714,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
} else if (type.equals("3")) {
|
||||
//判断AGV是否启用
|
||||
String device_code = whereJson.getString("device_code");
|
||||
String product_area = device_code.substring(0,2);
|
||||
String agv_status = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode(product_area+"_agv_status").getValue();
|
||||
String product_area = device_code.substring(0, 2);
|
||||
String agv_status = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode(product_area + "_agv_status").getValue();
|
||||
|
||||
if ("0".equals(agv_status)) {
|
||||
log.info("当前AGV未启用,不启用自动出烘箱功能!");
|
||||
@@ -806,6 +806,40 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject sendDeviceStatus(JSONObject whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicestatus");
|
||||
String device_code = whereJson.getString("device_code");
|
||||
if (StrUtil.isEmpty(device_code)) {
|
||||
log.info("未传入设备号,输入参数为:" + whereJson.toString());
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
} else {
|
||||
JSONObject device = wo.query("device_code = '" + device_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
log.info("未查询到对应的设备:" + device_code);
|
||||
} else {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
if (whereJson.containsKey("mode")) {
|
||||
map.put("mode", whereJson.getString("mode"));
|
||||
map.put("mode_update_time", DateUtil.now());
|
||||
}
|
||||
if (whereJson.containsKey("error")) {
|
||||
map.put("error", whereJson.getString("error"));
|
||||
map.put("error_msg", whereJson.getString("error_msg"));
|
||||
map.put("error_update_time", DateUtil.now());
|
||||
}
|
||||
wo.update(map, "device_code = '" + device_code + "'");
|
||||
}
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject shipDeviceUpdate(JSONObject whereJson) {
|
||||
|
||||
@@ -337,17 +337,25 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
String car_no = whereJson.getString("car_no");
|
||||
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
if ("2,3,4,5".contains(car_no)) {
|
||||
/*if ("2,3,4,5".contains(car_no)) {
|
||||
jsonParam.put("agv_system", "2");
|
||||
jsonParam.put("car_no", car_no);
|
||||
|
||||
} else if ("1".contains(car_no)) {
|
||||
jsonParam.put("agv_system", "1");
|
||||
jsonParam.put("car_no", car_no);
|
||||
} else if ("6,7,8,9".contains(car_no)) {
|
||||
jsonParam.put("agv_system", "3");
|
||||
jsonParam.put("car_no", car_no);
|
||||
}*/
|
||||
if ("1".contains(car_no)) {
|
||||
jsonParam.put("agv_system", "1");
|
||||
jsonParam.put("car_no", car_no);
|
||||
}else {
|
||||
jsonParam.put("agv_system", "2");
|
||||
jsonParam.put("car_no", car_no);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(jsonParam))
|
||||
|
||||
@@ -986,6 +986,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String box_length = param.getString("Attribute2"); // 木箱料号
|
||||
String box_width = param.getString("Attribute3"); // 木箱料号
|
||||
String box_high = param.getString("Attribute4"); // 木箱料号
|
||||
String sub_type = param.getString("Attribute5"); // 包装关系类型
|
||||
JSONArray details = param.getJSONArray("details");
|
||||
if (ObjectUtil.isEmpty(details)) throw new BadRequestException("明细为空");
|
||||
for (int i = 0; i < details.size(); i++) {
|
||||
@@ -1009,6 +1010,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String sap_pcsn = detail.getString("Attribute1");//SAP批次
|
||||
String thickness_request = detail.getString("Attribute2");//物料主数据厚度
|
||||
String width_standard = detail.getString("Attribute3");//要求幅宽
|
||||
String demand_limit = detail.getString("Attribute4");//客户需求抗拉下限
|
||||
String standard_limit = detail.getString("Attribute5");//内控标准抗拉下限
|
||||
String actual_value = detail.getString("Attribute6");//生产实际抗拉值
|
||||
|
||||
//查询库内是否存在相同的子卷号
|
||||
JSONObject container_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("container_name = '" + ContainerName + "'").uniqueResult(0);
|
||||
@@ -1020,10 +1024,14 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
jo.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jo.put("package_box_sn", PackageBoxSN);
|
||||
jo.put("sap_pcsn", sap_pcsn);
|
||||
jo.put("sub_type", sub_type);
|
||||
jo.put("box_type", box_type);
|
||||
jo.put("box_length", box_length);
|
||||
jo.put("box_width", box_width);
|
||||
jo.put("box_high", box_high);
|
||||
jo.put("demand_limit", demand_limit);
|
||||
jo.put("standard_limit", standard_limit);
|
||||
jo.put("actual_value", actual_value);
|
||||
jo.put("quanlity_in_box", QuanlityInBox);
|
||||
if (StrUtil.equals(BoxWeight, "0")) {
|
||||
BoxWeight2 = NumberUtil.add(BoxWeight2, NetWeight).toString();
|
||||
|
||||
@@ -56,4 +56,12 @@ public class SapToLmsController {
|
||||
return new ResponseEntity<>(sapToLmsService.getCannibalize(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@PostMapping("/getReCutInfo")
|
||||
@Log("SAP给LMS推送改切出库单")
|
||||
@ApiOperation("SAP给LMS推送改切出库单")
|
||||
public ResponseEntity<Object> getReCutInfo(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(sapToLmsService.getReCutInfo(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,4 +21,6 @@ public interface SapToLmsService {
|
||||
* SAP给LMS推送调拨出库单
|
||||
* */
|
||||
JSONObject getCannibalize(JSONObject jo);
|
||||
|
||||
JSONObject getReCutInfo(JSONObject jo);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,93 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
private final RawAssistIStorService rawAssistIStorService;
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject getReCutInfo(JSONObject jo) {
|
||||
log.info("getReCutInfo的输入参数为:------------------------" + jo.toString());
|
||||
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
String msg = "改切出库单据推送成功!";
|
||||
try {
|
||||
String LGORT = jo.getString("LGORT");
|
||||
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(stor_jo)) {
|
||||
result.put("RTYPE", "E");
|
||||
result.put("RTMSG", "操作失败!" + "未查询到外部标识为:" + LGORT + "对应的仓库!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
return result;
|
||||
}
|
||||
|
||||
jsonMst.put("stor_id", stor_jo.getString("stor_id"));
|
||||
jsonMst.put("stor_code", stor_jo.getString("stor_code"));
|
||||
jsonMst.put("stor_name", stor_jo.getString("stor_name"));
|
||||
jsonMst.put("detail_count", "1");
|
||||
jsonMst.put("bill_status", "10");
|
||||
jsonMst.put("create_mode", "03");
|
||||
jsonMst.put("bill_type", "1003");
|
||||
jsonMst.put("biz_date", DateUtil.now());
|
||||
jsonMst.put("user", "sap");
|
||||
|
||||
JSONArray dtls = new JSONArray();
|
||||
String sap_pcsn = jo.getString("CHARG");
|
||||
if (StrUtil.isEmpty("sap_pcsn")) {
|
||||
throw new BadRequestException("请求参数SAP批次不能为空!");
|
||||
}
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系");
|
||||
}
|
||||
String container_name = sub_jo.getString("container_name");
|
||||
JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(struct_ivt)) {
|
||||
throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!");
|
||||
} else {
|
||||
if (struct_ivt.getDoubleValue("frozen_qty") > 0) {
|
||||
msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中";
|
||||
}else {
|
||||
JSONObject dtl = new JSONObject();
|
||||
//查询该物料
|
||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(mater_jo)) {
|
||||
throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!");
|
||||
}
|
||||
dtl.put("material_id", mater_jo.getString("material_id"));
|
||||
dtl.put("pcsn", container_name);
|
||||
dtl.put("box_no", sub_jo.getString("package_box_sn"));
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(unit)) {
|
||||
throw new BadRequestException("未查询到物料计量单位:" + mater_jo.getString("base_unit_id") + ",信息!");
|
||||
}
|
||||
dtl.put("qty_unit_id", unit.getString("measure_unit_id"));
|
||||
dtl.put("qty_unit_name", unit.getString("unit_name"));
|
||||
dtl.put("plan_qty", sub_jo.getString("net_weight"));
|
||||
dtls.add(dtl);
|
||||
|
||||
|
||||
jsonMst.put("tableData", dtls);
|
||||
String iostorinv_id = checkOutBillService.insertDtl(jsonMst);
|
||||
|
||||
//调用自动分配
|
||||
JSONObject out_jo = new JSONObject();
|
||||
out_jo.put("iostorinv_id", iostorinv_id);
|
||||
checkOutBillService.allDiv(out_jo);
|
||||
}
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
result.put("TYPE", "E");
|
||||
result.put("MESSAGE", "推送失败!" + exception.getMessage());
|
||||
log.info("getMaterialInfo的输出参数为:------------------------" + result.toString());
|
||||
return result;
|
||||
}
|
||||
result.put("TYPE", "S");
|
||||
result.put("MESSAGE", msg);
|
||||
log.info("getMaterialInfo的输出参数为:------------------------" + result.toString());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getMaterialInfo(JSONObject jo) {
|
||||
JSONArray rows = jo.getJSONArray("DATAS");
|
||||
|
||||
@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
@@ -25,6 +26,7 @@ import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.InCoolIvtTask;
|
||||
import org.nl.wms.sch.tasks.InHotTask;
|
||||
import org.nl.wms.sch.tasks.OutHotTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -33,6 +35,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Slf4j
|
||||
public class BakingServiceImpl implements BakingService {
|
||||
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
|
||||
/*
|
||||
* 业务流程:
|
||||
* 入烤箱:
|
||||
@@ -112,8 +117,8 @@ public class BakingServiceImpl implements BakingService {
|
||||
*/
|
||||
JSONObject jsonPointZc = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonPointZc)) {
|
||||
if (!in_area_id.contains(jsonPointZc.getString("product_area"))){
|
||||
throw new BadRequestException("当前登录人员暂无【"+jsonPointZc.getString("product_area")+"】操作权限");
|
||||
if (!in_area_id.contains(jsonPointZc.getString("product_area"))) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + jsonPointZc.getString("product_area") + "】操作权限");
|
||||
}
|
||||
/*
|
||||
* 暂存区入烘箱
|
||||
@@ -123,10 +128,23 @@ public class BakingServiceImpl implements BakingService {
|
||||
jsonMap.put("flag", "1");
|
||||
jsonMap.put("product_area", jsonPointZc.getString("product_area"));
|
||||
//获取温度幅度
|
||||
jsonMap.put("min_temperature", (NumberUtil.sub(temperature, temperature_lose)).toString());
|
||||
jsonMap.put("max_temperature", (NumberUtil.add(temperature, temperature_lose)).toString());
|
||||
/*jsonMap.put("min_temperature", (NumberUtil.sub(temperature, temperature_lose)).toString());
|
||||
jsonMap.put("max_temperature", (NumberUtil.add(temperature, temperature_lose)).toString());*/
|
||||
jsonMap.put("point_location", jsonPointZc.getString("point_location"));
|
||||
JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0);
|
||||
JSONArray hot_rows = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().getResultJSONArray(0);
|
||||
JSONObject jsonHotIvt = new JSONObject();
|
||||
for (int i = 0; i < hot_rows.size(); i++) {
|
||||
JSONObject hot_row = hot_rows.getJSONObject(i);
|
||||
String point_code = hot_row.getString("point_code");
|
||||
String point_temperature = (String) redisUtils.hget(point_code, "temperature");
|
||||
if (!ObjectUtil.isEmpty(point_temperature)) {
|
||||
if (point_temperature.equals(temperature)) {
|
||||
jsonHotIvt = hot_row;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) {
|
||||
throw new BadRequestException("烘烤区没有合适温度的空位!");
|
||||
}
|
||||
@@ -175,8 +193,8 @@ public class BakingServiceImpl implements BakingService {
|
||||
String point_location = jsonCoolIvt.getString("point_location"); // 位置
|
||||
String reging_id = "";
|
||||
|
||||
if (!in_area_id.contains(product_area)){
|
||||
throw new BadRequestException("当前登录人员暂无【"+product_area+"】操作权限");
|
||||
if (!in_area_id.contains(product_area)) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + product_area + "】操作权限");
|
||||
}
|
||||
switch (product_area) {
|
||||
case "A1":
|
||||
@@ -215,10 +233,22 @@ public class BakingServiceImpl implements BakingService {
|
||||
JSONObject jsonMap = new JSONObject();
|
||||
jsonMap.put("flag", "1");
|
||||
jsonMap.put("product_area", product_area);
|
||||
jsonMap.put("min_temperature", NumberUtil.sub(temperature, temperature_lose) + "");
|
||||
jsonMap.put("max_temperature", NumberUtil.add(temperature, temperature_lose) + "");
|
||||
/*jsonMap.put("min_temperature", NumberUtil.sub(temperature, temperature_lose) + "");
|
||||
jsonMap.put("max_temperature", NumberUtil.add(temperature, temperature_lose) + "");*/
|
||||
jsonMap.put("point_location", map.getString("point_location"));
|
||||
JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0);
|
||||
JSONArray hot_rows = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().getResultJSONArray(0);
|
||||
JSONObject jsonHotIvt = new JSONObject();
|
||||
for (int i = 0; i < hot_rows.size(); i++) {
|
||||
JSONObject hot_row = hot_rows.getJSONObject(i);
|
||||
String point_code = hot_row.getString("point_code");
|
||||
String point_temperature = (String) redisUtils.hget(point_code, "temperature");
|
||||
if (!ObjectUtil.isEmpty(point_temperature)) {
|
||||
if (point_temperature.equals(temperature)) {
|
||||
jsonHotIvt = hot_row;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) {
|
||||
throw new BadRequestException("烘烤区没有合适温度的空位!");
|
||||
}
|
||||
@@ -308,8 +338,8 @@ public class BakingServiceImpl implements BakingService {
|
||||
}
|
||||
// 1.查询暂存位有没有空位
|
||||
String product_area = jsonHotIvt.getString("product_area");
|
||||
if (!in_area_id.contains(product_area)){
|
||||
throw new BadRequestException("当前登录人员暂无【"+product_area+"】操作权限");
|
||||
if (!in_area_id.contains(product_area)) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + product_area + "】操作权限");
|
||||
}
|
||||
String reging_id = "";
|
||||
switch (product_area) {
|
||||
@@ -443,8 +473,8 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("请扫描点位类型为出箱的烘箱对接位!");
|
||||
}
|
||||
|
||||
if (!in_area_id.contains(jsonPoint.getString("product_area"))){
|
||||
throw new BadRequestException("当前登录人员暂无【"+jsonPoint.getString("product_area")+"】操作权限");
|
||||
if (!in_area_id.contains(jsonPoint.getString("product_area"))) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + jsonPoint.getString("product_area") + "】操作权限");
|
||||
}
|
||||
// 2.找冷却区空货位
|
||||
JSONObject map = new JSONObject();
|
||||
@@ -570,8 +600,8 @@ public class BakingServiceImpl implements BakingService {
|
||||
public JSONObject release(JSONObject whereJson) {
|
||||
JSONArray rows = new JSONArray();
|
||||
JSONObject jo = new JSONObject();
|
||||
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '"+whereJson.getString("point_code")+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)){
|
||||
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + whereJson.getString("point_code") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("未查询到对应的报警灯点位!");
|
||||
}
|
||||
jo.put("device_code", whereJson.getString("point_code"));
|
||||
@@ -594,7 +624,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
JSONObject json = new JSONObject();
|
||||
|
||||
if (point_code.endsWith("BJD")){
|
||||
if (point_code.endsWith("BJD")) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", json);
|
||||
result.put("message", "操作成功!");
|
||||
@@ -609,24 +639,24 @@ public class BakingServiceImpl implements BakingService {
|
||||
if (ObjectUtil.isNotEmpty(jsonCool) && ObjectUtil.isNotEmpty(jsonCool.getString("container_name"))) {
|
||||
json.put("container_name", jsonCool.getString("container_name"));
|
||||
String product_area = jsonCool.getString("product_area");
|
||||
if (!in_area_id.contains(product_area)){
|
||||
throw new BadRequestException("当前登录人员暂无【"+product_area+"】操作权限");
|
||||
if (!in_area_id.contains(product_area)) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + product_area + "】操作权限");
|
||||
}
|
||||
} else {
|
||||
JSONObject jsonHot = hotIvtTab.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonHot) && ObjectUtil.isNotEmpty(jsonHot.getString("container_name"))) {
|
||||
json.put("container_name", jsonHot.getString("container_name"));
|
||||
String product_area = jsonHot.getString("product_area");
|
||||
if (!in_area_id.contains(product_area)){
|
||||
throw new BadRequestException("当前登录人员暂无【"+product_area+"】操作权限");
|
||||
if (!in_area_id.contains(product_area)) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + product_area + "】操作权限");
|
||||
}
|
||||
} else {
|
||||
JSONObject jsonPoint = pointIvtTab.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonPoint) && ObjectUtil.isNotEmpty(jsonPoint.getString("material_code"))) {
|
||||
json.put("container_name", jsonPoint.getString("material_code"));
|
||||
String product_area = jsonPoint.getString("product_area");
|
||||
if (!in_area_id.contains(product_area)){
|
||||
throw new BadRequestException("当前登录人员暂无【"+product_area+"】操作权限");
|
||||
if (!in_area_id.contains(product_area)) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + product_area + "】操作权限");
|
||||
}
|
||||
} else {
|
||||
if (ObjectUtil.isEmpty(jsonCool) && ObjectUtil.isEmpty(jsonHot) && ObjectUtil.isEmpty(jsonPoint)) {
|
||||
|
||||
@@ -136,6 +136,9 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray.getJSONArray("content"));
|
||||
jo.put("size", resultJSONArray.getString("totalElements"));
|
||||
if (StrUtil.isNotEmpty(whereJson.getString("container_name")) && ObjectUtil.isEmpty(resultJSONArray.getJSONArray("content"))){
|
||||
throw new BadRequestException("当前输入的母卷工单已结束或不存在!");
|
||||
}
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@@ -51,33 +51,90 @@
|
||||
sch_base_point a
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
COUNT( task.task_id ) AS num,
|
||||
point_code
|
||||
COUNT( c.task_id ) AS num,
|
||||
c.point_code
|
||||
FROM
|
||||
SCH_BASE_Point po
|
||||
LEFT JOIN sch_base_task task ON ( task.point_code1 = po.point_code OR task.point_code2 = po.point_code OR task.point_code3 = po.point_code )
|
||||
AND task.task_status < '07'
|
||||
AND task.is_delete = '0'
|
||||
WHERE
|
||||
po.is_delete = '0'
|
||||
AND po.is_used = '1'
|
||||
(
|
||||
SELECT
|
||||
task.task_id,
|
||||
point_code
|
||||
FROM
|
||||
SCH_BASE_Point po
|
||||
LEFT JOIN sch_base_task task ON task.point_code1 = po.point_code
|
||||
AND task.task_status < '07'
|
||||
AND task.is_delete = '0'
|
||||
WHERE
|
||||
po.is_delete = '0'
|
||||
AND po.is_used = '1'
|
||||
OPTION 输入.reging_id <> ""
|
||||
po.region_id = 输入.reging_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.reging_id <> ""
|
||||
po.region_id = 输入.reging_id
|
||||
ENDOPTION
|
||||
OPTION 输入.point_location <> ""
|
||||
po.point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_location <> ""
|
||||
po.point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
OPTION 输入.point_type <> ""
|
||||
po.point_type = 输入.point_type
|
||||
ENDOPTION
|
||||
OPTION 输入.point_type = "5"
|
||||
IFNULL(po.material_code,'') = ''
|
||||
ENDOPTION
|
||||
UNION
|
||||
SELECT
|
||||
task.task_id,
|
||||
point_code
|
||||
FROM
|
||||
SCH_BASE_Point po
|
||||
LEFT JOIN sch_base_task task ON task.point_code1 = po.point_code
|
||||
AND task.task_status < '07'
|
||||
AND task.is_delete = '0'
|
||||
WHERE
|
||||
po.is_delete = '0'
|
||||
AND po.is_used = '1'
|
||||
OPTION 输入.reging_id <> ""
|
||||
po.region_id = 输入.reging_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_type <> ""
|
||||
po.point_type = 输入.point_type
|
||||
ENDOPTION
|
||||
OPTION 输入.point_type = "5"
|
||||
IFNULL(po.material_code,'') = ''
|
||||
ENDOPTION
|
||||
GROUP BY
|
||||
po.point_code
|
||||
OPTION 输入.point_location <> ""
|
||||
po.point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_type <> ""
|
||||
po.point_type = 输入.point_type
|
||||
ENDOPTION
|
||||
OPTION 输入.point_type = "5"
|
||||
IFNULL(po.material_code,'') = ''
|
||||
ENDOPTION
|
||||
UNION
|
||||
SELECT
|
||||
task.task_id,
|
||||
point_code
|
||||
FROM
|
||||
SCH_BASE_Point po
|
||||
LEFT JOIN sch_base_task task ON task.point_code1 = po.point_code
|
||||
AND task.task_status < '07'
|
||||
AND task.is_delete = '0'
|
||||
WHERE
|
||||
po.is_delete = '0'
|
||||
AND po.is_used = '1'
|
||||
OPTION 输入.reging_id <> ""
|
||||
po.region_id = 输入.reging_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_location <> ""
|
||||
po.point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_type <> ""
|
||||
po.point_type = 输入.point_type
|
||||
ENDOPTION
|
||||
OPTION 输入.point_type = "5"
|
||||
IFNULL(po.material_code,'') = ''
|
||||
ENDOPTION
|
||||
) c
|
||||
GROUP BY
|
||||
c.point_code
|
||||
) b ON b.point_code = a.point_code
|
||||
ORDER BY num,a.point_code
|
||||
ENDSELECT
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "半成品入库")
|
||||
@Api(tags = "成品入库")
|
||||
@RequestMapping("/api/pda/st")
|
||||
@Slf4j
|
||||
public class ProductInstorController {
|
||||
@@ -38,8 +38,8 @@ public class ProductInstorController {
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("查询子卷包装关系")
|
||||
@ApiOperation("查询子卷包装关系")
|
||||
@Log("手持生产入库确认")
|
||||
@ApiOperation("手持生产入库确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(productInstorService.confirm(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -129,6 +129,14 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
if (option.equals("4")) {
|
||||
mst_jo.put("bill_type", "0005");
|
||||
}
|
||||
HashMap box_map = box_rows.get(0);
|
||||
Object sub_type = box_map.get("sub_type");
|
||||
if (ObjectUtil.isNotEmpty(sub_type)){
|
||||
if (sub_type.equals("1")){
|
||||
//如果为返检的包装关系则变为返检入库
|
||||
mst_jo.put("bill_type", "0006");
|
||||
}
|
||||
}
|
||||
//查询成品库仓库
|
||||
JSONObject stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1'").uniqueResult(0);
|
||||
mst_jo.put("stor_id", stor.getString("stor_id"));
|
||||
|
||||
@@ -70,7 +70,8 @@
|
||||
container_name,
|
||||
product_name,
|
||||
product_description,
|
||||
net_weight
|
||||
net_weight,
|
||||
sub_type
|
||||
FROM
|
||||
pdm_bi_subpackagerelation sub
|
||||
WHERE
|
||||
@@ -85,7 +86,8 @@
|
||||
sub.container_name,
|
||||
sub.product_name,
|
||||
sub.product_description,
|
||||
sub.net_weight
|
||||
sub.net_weight,
|
||||
sub_type
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
|
||||
@@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
@@ -22,6 +23,7 @@ import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.pdm.ivt.service.HotPointIvtService;
|
||||
import org.nl.wms.pdm.ivt.service.dto.HotPointIvtDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -40,6 +42,9 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
public class HotPointIvtServiceImpl implements HotPointIvtService {
|
||||
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
//获取人员对应的区域
|
||||
@@ -59,6 +64,17 @@ public class HotPointIvtServiceImpl implements HotPointIvtService {
|
||||
|
||||
if (ObjectUtil.isNotEmpty(in_area_id)) map.put("in_area_id", in_area_id);
|
||||
JSONObject json = WQL.getWO("ST_IVT_HOTPOINTIVT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "product_area,point_code");
|
||||
JSONArray rows = json.getJSONArray("content");
|
||||
JSONArray new_rows = new JSONArray();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
String temperature = (String) redisUtils.hget(row.getString("point_code"), "temperature");
|
||||
String last_time = (String) redisUtils.hget(row.getString("point_code"), "last_time");
|
||||
row.put("temperature",temperature);
|
||||
row.put("last_time",last_time);
|
||||
new_rows.add(row);
|
||||
}
|
||||
json.put("content",new_rows);
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -6,10 +6,12 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.sch.tasks.URLEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -18,9 +20,12 @@ import java.util.HashMap;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoQueryDeviceStatus {
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
private final WmsToAcsService wmsToAcsService;
|
||||
|
||||
public void run() {
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
for (URLEnum url : URLEnum.values()) {
|
||||
try {
|
||||
String product_area = url.getProduct_area();
|
||||
@@ -30,13 +35,12 @@ public class AutoQueryDeviceStatus {
|
||||
continue;
|
||||
}
|
||||
JSONObject jo = wmsToAcsService.getHotPointStatus(device_rows);
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
JSONArray de_rows = jo.getJSONArray("data");
|
||||
for (int i = 0; i < de_rows.size(); i++) {
|
||||
JSONObject row = de_rows.getJSONObject(i);
|
||||
String device_code = row.getString("device_code");
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("temperature", row.getString("temperature"));
|
||||
map.put("temperature", row.getString("now_temperature"));
|
||||
//获取倒计时,分,秒
|
||||
String countdown_house = row.getString("countdown_house");
|
||||
String countdown_min = row.getString("countdown_min");
|
||||
@@ -53,7 +57,9 @@ public class AutoQueryDeviceStatus {
|
||||
}
|
||||
String last_time = countdown_house + "小时" + countdown_min + "分钟";
|
||||
map.put("last_time", last_time);
|
||||
ivtTab.update(map,"point_code = '"+device_code+"'");
|
||||
redisUtils.hset(device_code,"temperature",row.getString("temperature"));
|
||||
redisUtils.hset(device_code,"last_time",last_time);
|
||||
//ivtTab.update(map,"point_code = '"+device_code+"'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info(e.getMessage());
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.nl.wms.sch.manage;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.config.RedisConfig;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.sch.tasks.URLEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoSendFeiShu {
|
||||
public void run() {
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicestatus");
|
||||
//查询故障了还未发送的
|
||||
JSONArray send_rows = wo.query("error = '1' AND is_upload = '0' AND upload_flag = '1'").getResultJSONArray(0);
|
||||
this.sendInfo(send_rows);
|
||||
|
||||
//查询已经发送了但是还是故障中的
|
||||
String resend_time = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_URL").getValue();
|
||||
JSONArray resend_rows = wo.query("error = '1' AND is_upload = '1' AND upload_flag = '1' AND TIMESTAMPDIFF(MINUTE,upload_time,NOW()) > " + resend_time).getResultJSONArray(0);
|
||||
this.sendInfo(resend_rows);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void sendInfo(JSONArray device_rows) {
|
||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicestatus");
|
||||
for (int i = 0; i < device_rows.size(); i++) {
|
||||
JSONObject row = device_rows.getJSONObject(i);
|
||||
String device_code = row.getString("device_code");
|
||||
String device_name = row.getString("device_name");
|
||||
String product_area = row.getString("product_area");
|
||||
String error_msg = row.getString("error_msg");
|
||||
String upload_user = row.getString("upload_user");
|
||||
String[] split = upload_user.split(",");
|
||||
JSONArray UserList = new JSONArray();
|
||||
if (split.length > 0) {
|
||||
for (String s : split) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("User", s);
|
||||
UserList.add(jo);
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
String Message = product_area + "区域的设备:" + device_code + "[" + device_name + "],发生故障。故障信息为:" + error_msg;
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("SendType", "L");
|
||||
jo.put("Title", "LMS设备故障信息");
|
||||
jo.put("WarnType", "string");
|
||||
jo.put("MessageType", "P");
|
||||
jo.put("UserList", UserList);
|
||||
jo.put("Message", Message);
|
||||
|
||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_URL").getValue();
|
||||
String api = "/FeiShuNoticesWebApi/CommunalApi";
|
||||
url = url + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(jo))
|
||||
.execute().body();
|
||||
log.info("飞书输入参数为:-------------------" + jo);
|
||||
log.info("飞书输出参数为:-------------------" + resultMsg);
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_upload", "1");
|
||||
map.put("upload_time", DateUtil.now());
|
||||
wo.update(map, "device_code = '" + device_code + "'");
|
||||
} catch (Exception e) {
|
||||
log.info(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
package org.nl.wms.sch.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -84,6 +85,18 @@ public class PointController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActives")
|
||||
@Log("批量修改点位启用状态")
|
||||
@ApiOperation("批量修改点位启用状态")
|
||||
//@SaCheckPermission("store:edit")
|
||||
public ResponseEntity<Object> update2(@RequestBody JSONArray rows) {
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject json = rows.getJSONObject(i);
|
||||
pointService.changeActive(json);
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/getPoint")
|
||||
@Log("查询点位下拉框")
|
||||
@ApiOperation("查询点位下拉框")
|
||||
|
||||
@@ -50,7 +50,13 @@ public class PointServiceImpl implements PointService {
|
||||
map.put("point_status", whereJson.get("point_status"));
|
||||
map.put("is_used", whereJson.get("is_used"));
|
||||
map.put("point_type", whereJson.get("point_type"));
|
||||
map.put("name", whereJson.get("name"));
|
||||
Object name = whereJson.get("name");
|
||||
if (ObjectUtil.isNotEmpty(name)){
|
||||
String search = (String) name;
|
||||
String[] split = search.split("_");
|
||||
name = String.join("\\_", split);
|
||||
map.put("name", name);
|
||||
}
|
||||
JSONObject json = WQL.getWO("QSCH_BASE_POINT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "point_code asc");
|
||||
JSONArray content = json.getJSONArray("content");
|
||||
JSONArray res = new JSONArray();
|
||||
|
||||
@@ -45,13 +45,13 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
String product_area = json.getString("product_area");
|
||||
String agv_system_type = "";
|
||||
if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
String agv_system_type = "2";
|
||||
/*if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
agv_system_type = "2";
|
||||
}
|
||||
if (product_area.equals("A3") || product_area.equals("A4")) {
|
||||
agv_system_type = "3";
|
||||
}
|
||||
}*/
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
|
||||
@@ -44,13 +44,13 @@ public class CoolCutTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
String product_area = json.getString("product_area");
|
||||
String agv_system_type = "";
|
||||
if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
String agv_system_type = "2";
|
||||
/*if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
agv_system_type = "2";
|
||||
}
|
||||
if (product_area.equals("A3") || product_area.equals("A4")) {
|
||||
agv_system_type = "3";
|
||||
}
|
||||
}*/
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
|
||||
@@ -42,13 +42,13 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
String product_area = json.getString("product_area");
|
||||
String agv_system_type = "";
|
||||
if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
String agv_system_type = "2";
|
||||
/*if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
agv_system_type = "2";
|
||||
}
|
||||
if (product_area.equals("A3") || product_area.equals("A4")) {
|
||||
agv_system_type = "3";
|
||||
}
|
||||
}*/
|
||||
|
||||
//添加过滤,如果为分切机B轴的下料位,要判断该分切机A轴的点位是否存在未下发的任务,存在则也不允许下发
|
||||
String point_code1 = json.getString("point_code1");
|
||||
|
||||
@@ -47,13 +47,13 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
String product_area = json.getString("product_area");
|
||||
String agv_system_type = "";
|
||||
if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
String agv_system_type = "2";
|
||||
/*if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
agv_system_type = "2";
|
||||
}
|
||||
if (product_area.equals("A3") || product_area.equals("A4")) {
|
||||
agv_system_type = "3";
|
||||
}
|
||||
}*/
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
|
||||
@@ -45,13 +45,13 @@ public class InHotTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
String product_area = json.getString("product_area");
|
||||
String agv_system_type = "";
|
||||
if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
String agv_system_type = "2";
|
||||
/*if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
agv_system_type = "2";
|
||||
}
|
||||
if (product_area.equals("A3") || product_area.equals("A4")) {
|
||||
agv_system_type = "3";
|
||||
}
|
||||
}*/
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
|
||||
@@ -45,13 +45,13 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
String product_area = json.getString("product_area");
|
||||
String agv_system_type = "";
|
||||
if (product_area.equals("A1") || product_area.equals("A2")){
|
||||
String agv_system_type = "2";
|
||||
/*if (product_area.equals("A1") || product_area.equals("A2")){
|
||||
agv_system_type = "2";
|
||||
}
|
||||
if (product_area.equals("A3") || product_area.equals("A4")){
|
||||
agv_system_type = "3";
|
||||
}
|
||||
}*/
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
|
||||
@@ -227,6 +227,9 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
mp.put("居中度(mm)", "±1");
|
||||
mp.put("塌边(mm)", "≤10");
|
||||
mp.put("米数(长度)", NumberUtil.round(json.getString("length"), 1));
|
||||
mp.put("生产实际抗拉值", json.getString("actual_value"));
|
||||
mp.put("内控标准抗拉下限", json.getString("standard_limit"));
|
||||
mp.put("客户需求抗拉下限", json.getString("demand_limit"));
|
||||
mp.put("生产日期", json.getString("date_of_production").replace("-","/"));
|
||||
mp.put("入库日期", json.getString("confirm_time").substring(0,10).replace("-","/"));
|
||||
list.add(mp);
|
||||
|
||||
@@ -78,6 +78,9 @@
|
||||
sub.thickness_request,
|
||||
sub.width_standard,
|
||||
sub.mass_per_unit_area,
|
||||
sub.demand_limit,
|
||||
sub.standard_limit,
|
||||
sub.actual_value,
|
||||
(case when plan.parent_container_name <> '' then plan.parent_container_name else plan.restruct_container_name end) AS parent_container_name,
|
||||
mst.remark,
|
||||
(case when DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='08:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '19:59:59' then '白班'
|
||||
@@ -315,6 +318,9 @@
|
||||
sub.thickness,
|
||||
sub.box_weight,
|
||||
sub.length,
|
||||
sub.actual_value,
|
||||
sub.standard_limit,
|
||||
sub.demand_limit,
|
||||
sub.thickness_request,
|
||||
sub.width_standard,
|
||||
sub.mass_per_unit_area,
|
||||
|
||||
@@ -33,6 +33,14 @@ export function editUser(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserList(data) {
|
||||
return request({
|
||||
url: 'api/users/getUserList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updatePass(user) {
|
||||
const data = {
|
||||
oldPass: encrypt(user.oldPass),
|
||||
@@ -57,5 +65,5 @@ export function updateEmail(form) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, updatePass }
|
||||
export default { add, edit, del, updatePass, getUserList }
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/devicestatus',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/devicestatus/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/devicestatus',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
195
lms/nladmin-ui/src/views/wms/agvrush/devicestatus/index.vue
Normal file
195
lms/nladmin-ui/src/views/wms/agvrush/devicestatus/index.vue
Normal file
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="输入设备编码或设备名称"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="1100px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="140px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码" prop="device_code">
|
||||
<el-input v-model="form.device_code" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人" prop="upload_user">
|
||||
<el-select v-model="form.upload_user" placeholder="请选择" filterable multiple clearable style="width: 250px">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.username"
|
||||
:label="item.username"
|
||||
:value="item.username"
|
||||
>
|
||||
<span style="float: left">{{ item.username }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.personName }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="device_code" label="设备编码" show-overflow-tooltip width="150px" />
|
||||
<el-table-column prop="device_name" label="设备名称" show-overflow-tooltip width="150px" />
|
||||
<el-table-column prop="product_area" label="区域" show-overflow-tooltip />
|
||||
<el-table-column prop="device_type" label="设备类型" show-overflow-tooltip />
|
||||
<el-table-column prop="mode" label="工作状态" show-overflow-tooltip />
|
||||
<el-table-column prop="mode_update_time" label="工作状态变更时间" show-overflow-tooltip width="150px" />
|
||||
<el-table-column prop="error" label="故障状态" show-overflow-tooltip />
|
||||
<el-table-column prop="error_msg" label="故障信息" width="180px" show-overflow-tooltip />
|
||||
<el-table-column prop="error_update_time" label="故障状态更新时间" width="150px" show-overflow-tooltip />
|
||||
<el-table-column prop="error_update_time" label="故障状态更新时间" width="150px" show-overflow-tooltip />
|
||||
<el-table-column label="是否上报" align="center" prop="upload_flag">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.upload_flag"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeEnabled(scope.row, scope.row.upload_flag)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="upload_user" label="负责人" width="150px" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
v-permission="['admin','customerbase:edit','customerbase:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:is-visiable-del="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDeviceStatus from '@/views/wms/agvrush/devicestatus/devicestatus'
|
||||
import CRUD, { crud, form, header, presenter } 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 crudUser from '@/views/system/user/user'
|
||||
|
||||
const defaultForm = {
|
||||
device_code: null,
|
||||
upload_user: null
|
||||
}
|
||||
export default {
|
||||
name: 'DeviceStatus',
|
||||
dicts: ['is_used', 'print_temple'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '设备状态',
|
||||
url: 'api/devicestatus',
|
||||
optShow: {
|
||||
add: true,
|
||||
reset: true
|
||||
},
|
||||
idField: 'device_code',
|
||||
sort: 'device_code,desc',
|
||||
crudMethod: { ...crudDeviceStatus }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
classes: [],
|
||||
userList: [],
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
this.getUserList()
|
||||
form.upload_user = form.upload_user.split(',')
|
||||
},
|
||||
// 改变状态
|
||||
getUserList() {
|
||||
crudUser.getUserList().then(res => {
|
||||
this.userList = res
|
||||
})
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.device_code + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
data.need_update_flag = '1'
|
||||
crudDeviceStatus.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
if (data.upload_flag === '0') {
|
||||
data.upload_flag = '1'
|
||||
return
|
||||
}
|
||||
if (data.upload_flag === '1') {
|
||||
data.upload_flag = '0'
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
if (data.upload_flag === '0') {
|
||||
data.upload_flag = '1'
|
||||
return
|
||||
}
|
||||
if (data.upload_flag === '1') {
|
||||
data.upload_flag = '0'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -85,8 +85,7 @@
|
||||
style="width: 185px"
|
||||
value-format="yyyy-MM-dd"
|
||||
@change="hand"
|
||||
>
|
||||
</el-date-picker>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期">
|
||||
<el-date-picker
|
||||
@@ -96,8 +95,7 @@
|
||||
style="width: 185px"
|
||||
value-format="yyyy-MM-dd"
|
||||
@change="hand"
|
||||
>
|
||||
</el-date-picker>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select
|
||||
@@ -162,7 +160,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<rrOperation :crud="crud"/>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
@@ -179,196 +177,219 @@
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title" width="1000px">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="1000px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="160px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="木箱唯一码" prop="package_box_sn">
|
||||
<el-input v-model="form.package_box_sn" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.package_box_sn" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="箱内子卷数量">
|
||||
<el-input v-model="form.quanlity_in_box" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.quanlity_in_box" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="木箱自身重量">
|
||||
<el-input v-model="form.box_weight" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.box_weight" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保质期">
|
||||
<el-input v-model="form.quality_guaran_period" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.quality_guaran_period" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户编码" prop="customer_name">
|
||||
<el-input v-model="form.customer_name" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.customer_name" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称" prop="customer_description">
|
||||
<el-input v-model="form.customer_description" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.customer_description" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编码" prop="product_name">
|
||||
<el-input v-model="form.product_name" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.product_name" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品描述" prop="product_description">
|
||||
<el-input v-model="form.product_description" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.product_description" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入库日期">
|
||||
<el-input v-model="form.date_of_fg_inbound" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.date_of_fg_inbound" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子卷号" prop="container_name">
|
||||
<el-input v-model="form.container_name" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.container_name" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品规格(幅宽)" prop="width">
|
||||
<el-input v-model="form.width" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.width" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品厚度" prop="thickness">
|
||||
<el-input v-model="form.thickness" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.thickness" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位面积质量" prop="mass_per_unit_area">
|
||||
<el-input v-model="form.mass_per_unit_area" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.mass_per_unit_area" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="净重" prop="net_weight">
|
||||
<el-input v-model="form.net_weight" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.net_weight" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="长度" prop="length">
|
||||
<el-input v-model="form.length" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.length" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="制造完成日期" prop="date_of_production">
|
||||
<el-input v-model="form.date_of_production" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.date_of_production" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划外分切的子卷" prop="is_un_plan_production">
|
||||
<el-input v-model="form.is_un_plan_production" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.is_un_plan_production" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子卷的物性值1">
|
||||
<el-input v-model="form.un_plan_product_property1" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.un_plan_product_property1" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子卷的物性值2">
|
||||
<el-input v-model="form.un_plan_product_property2" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.un_plan_product_property2" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子卷的物性值3">
|
||||
<el-input v-model="form.un_plan_product_property3" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.un_plan_product_property3" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="木箱料号">
|
||||
<el-input v-model="form.box_type" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.box_type" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="SAP批次" prop="sap_pcsn">
|
||||
<el-input v-model="form.sap_pcsn" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.sap_pcsn" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否重打外包装标签">
|
||||
<el-input v-model="form.isreprintpackageboxlabel" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.isreprintpackageboxlabel" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否拆包重打子卷标签">
|
||||
<el-input v-model="form.isunpackbox" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.isunpackbox" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="长" prop="box_length">
|
||||
<el-input-number v-model="form.box_length" :max="10000" :min="0" :precision="2" :controls="false"
|
||||
style="width: 300px;"/>
|
||||
<el-input-number
|
||||
v-model="form.box_length"
|
||||
:max="10000"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
style="width: 300px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="宽" prop="box_width">
|
||||
<el-input-number v-model="form.box_width" :max="10000" :min="0" :precision="2" :controls="false"
|
||||
style="width: 300px;"/>
|
||||
<el-input-number
|
||||
v-model="form.box_width"
|
||||
:max="10000"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
style="width: 300px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="高" prop="box_high">
|
||||
<el-input-number v-model="form.box_high" :max="10000" :min="0" :precision="2" :controls="false"
|
||||
style="width: 300px;"/>
|
||||
<el-input-number
|
||||
v-model="form.box_high"
|
||||
:max="10000"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
style="width: 300px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售订单及行号" prop="sale_order_name">
|
||||
<el-input v-model="form.sale_order_name" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.sale_order_name" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料主数据厚度" prop="thickness_request">
|
||||
<el-input v-model="form.thickness_request" :disabled="crud.status.edit > 0 && form.status !== '0'" :controls="false" style="width: 300px;"/>
|
||||
<el-input v-model="form.thickness_request" :disabled="crud.status.edit > 0 && form.status !== '0'" :controls="false" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="要求幅宽" prop="width_standard">
|
||||
<el-input v-model="form.width_standard" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;"/>
|
||||
<el-input v-model="form.width_standard" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
<el-input type="textarea" :rows="2" v-model="form.remark" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 750px;"/>
|
||||
<el-input v-model="form.remark" type="textarea" :rows="2" :disabled="crud.status.edit > 0 && form.status !== '0'" style="width: 750px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -379,94 +400,175 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" height v-loading="crud.loading" style="width: 100%" :data="crud.data" size="mini"
|
||||
@selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection"/>
|
||||
<el-table-column sortable prop="package_box_sn" label="木箱码"
|
||||
:min-width="flexWidth('package_box_sn',crud.data,'木箱码')"/>
|
||||
<el-table-column prop="quanlity_in_box" label="箱内子卷数量"
|
||||
:min-width="flexWidth('quanlity_in_box',crud.data,'箱内子卷数量')"/>
|
||||
<el-table-column prop="customer_name" label="客户编码" :min-width="flexWidth('customer_name',crud.data,'客户编码')"/>
|
||||
<el-table-column prop="customer_description" label="客户名称"
|
||||
:min-width="flexWidth('customer_description',crud.data,'客户名称')"/>
|
||||
<el-table-column prop="sale_order_name" label="销售订单及行号"
|
||||
:min-width="flexWidth('sale_order_name',crud.data,'销售订单及行号')"/>
|
||||
<el-table-column sortable prop="container_name" label="子卷号"
|
||||
:min-width="flexWidth('container_name',crud.data,'子卷号')"/>
|
||||
<el-table-column prop="product_name" label="产品编码" :min-width="flexWidth('product_name',crud.data,'产品描述')"/>
|
||||
<el-table-column prop="product_description" label="产品描述"
|
||||
:min-width="flexWidth('product_description',crud.data,'产品描述')"/>
|
||||
<el-table-column sortable prop="sap_pcsn" label="sap批次" :min-width="flexWidth('sap_pcsn',crud.data,'SAP批次')"/>
|
||||
<el-table-column prop="width" label="产品规格(幅宽)" :min-width="flexWidth('width',crud.data,'产品规格(幅宽)')"/>
|
||||
<el-table-column prop="width_standard" label="客户要求幅宽" :min-width="flexWidth('width_standard',crud.data,'客户要求幅宽')"/>
|
||||
<el-table-column prop="thickness" label="产品厚度" :min-width="flexWidth('thickness',crud.data,'产品厚度')"/>
|
||||
<el-table-column prop="mass_per_unit_area" label="单位面积质量" :formatter="crud.formatNum3"
|
||||
:min-width="flexWidth('mass_per_unit_area',crud.data,'单位面积质量')"/>
|
||||
<el-table-column prop="net_weight" label="净重" :formatter="crud.formatNum3"
|
||||
:min-width="flexWidth('net_weight',crud.data,'净重')"/>
|
||||
<el-table-column prop="length" label="长度" :formatter="crud.formatNum3"
|
||||
:min-width="flexWidth('length',crud.data,'长度')"/>
|
||||
<el-table-column prop="date_of_production" label="制造完成日期"
|
||||
:min-width="flexWidth('date_of_production',crud.data,'制造完成日期')"/>
|
||||
<el-table-column prop="date_of_fg_inbound" label="入库日期"
|
||||
:min-width="flexWidth('date_of_fg_inbound',crud.data,'入库日期')"/>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
height
|
||||
style="width: 100%"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column
|
||||
sortable
|
||||
prop="package_box_sn"
|
||||
label="木箱码"
|
||||
:min-width="flexWidth('package_box_sn',crud.data,'木箱码')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="quanlity_in_box"
|
||||
label="箱内子卷数量"
|
||||
:min-width="flexWidth('quanlity_in_box',crud.data,'箱内子卷数量')"
|
||||
/>
|
||||
<el-table-column prop="customer_name" label="客户编码" :min-width="flexWidth('customer_name',crud.data,'客户编码')" />
|
||||
<el-table-column
|
||||
prop="customer_description"
|
||||
label="客户名称"
|
||||
:min-width="flexWidth('customer_description',crud.data,'客户名称')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="sale_order_name"
|
||||
label="销售订单及行号"
|
||||
:min-width="flexWidth('sale_order_name',crud.data,'销售订单及行号')"
|
||||
/>
|
||||
<el-table-column
|
||||
sortable
|
||||
prop="container_name"
|
||||
label="子卷号"
|
||||
:min-width="flexWidth('container_name',crud.data,'子卷号')"
|
||||
/>
|
||||
<el-table-column prop="product_name" label="产品编码" :min-width="flexWidth('product_name',crud.data,'产品描述')" />
|
||||
<el-table-column
|
||||
prop="product_description"
|
||||
label="产品描述"
|
||||
:min-width="flexWidth('product_description',crud.data,'产品描述')"
|
||||
/>
|
||||
<el-table-column sortable prop="sap_pcsn" label="sap批次" :min-width="flexWidth('sap_pcsn',crud.data,'SAP批次')" />
|
||||
<el-table-column prop="width" label="产品规格(幅宽)" :min-width="flexWidth('width',crud.data,'产品规格(幅宽)')" />
|
||||
<el-table-column prop="width_standard" label="客户要求幅宽" :min-width="flexWidth('width_standard',crud.data,'客户要求幅宽')" />
|
||||
<el-table-column prop="thickness" label="产品厚度" :min-width="flexWidth('thickness',crud.data,'产品厚度')" />
|
||||
<el-table-column
|
||||
prop="mass_per_unit_area"
|
||||
label="单位面积质量"
|
||||
:formatter="crud.formatNum3"
|
||||
:min-width="flexWidth('mass_per_unit_area',crud.data,'单位面积质量')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="net_weight"
|
||||
label="净重"
|
||||
:formatter="crud.formatNum3"
|
||||
:min-width="flexWidth('net_weight',crud.data,'净重')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="length"
|
||||
label="长度"
|
||||
:formatter="crud.formatNum3"
|
||||
:min-width="flexWidth('length',crud.data,'长度')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="date_of_production"
|
||||
label="制造完成日期"
|
||||
:min-width="flexWidth('date_of_production',crud.data,'制造完成日期')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="date_of_fg_inbound"
|
||||
label="入库日期"
|
||||
:min-width="flexWidth('date_of_fg_inbound',crud.data,'入库日期')"
|
||||
/>
|
||||
<el-table-column prop="status" label="状态" :min-width="flexWidth('status',crud.data,'状态')">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.sub_package_relation[scope.row.status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="box_weight" label="木箱自身重量" :min-width="flexWidth('box_weight',crud.data,'木箱自身重量')"
|
||||
:formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="quality_guaran_period" label="保质期"
|
||||
:min-width="flexWidth('quality_guaran_period',crud.data,'保质期')"/>
|
||||
<el-table-column prop="is_un_plan_production" label="计划外分切的子卷"
|
||||
:min-width="flexWidth('is_un_plan_production',crud.data,'计划外分切的子卷')">
|
||||
<el-table-column
|
||||
prop="box_weight"
|
||||
label="木箱自身重量"
|
||||
:min-width="flexWidth('box_weight',crud.data,'木箱自身重量')"
|
||||
:formatter="crud.formatNum3"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="quality_guaran_period"
|
||||
label="保质期"
|
||||
:min-width="flexWidth('quality_guaran_period',crud.data,'保质期')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="is_un_plan_production"
|
||||
label="计划外分切的子卷"
|
||||
:min-width="flexWidth('is_un_plan_production',crud.data,'计划外分切的子卷')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.IS_OR_NOT[scope.row.is_un_plan_production] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="un_plan_product_property1" label="子卷的物性值1"
|
||||
:min-width="flexWidth('un_plan_product_property1',crud.data,'子卷的物性值1',-220)"/>
|
||||
<el-table-column prop="un_plan_product_property2" label="子卷的物性值2"
|
||||
:min-width="flexWidth('un_plan_product_property2',crud.data,'子卷的物性值2')"/>
|
||||
<el-table-column prop="un_plan_product_property3" label="子卷的物性值3"
|
||||
:min-width="flexWidth('un_plan_product_property3',crud.data,'子卷的物性值3')"/>
|
||||
<el-table-column prop="box_type" label="木箱料号" :min-width="flexWidth('box_type',crud.data,'木箱料号')"/>
|
||||
<el-table-column prop="box_length" label="长" :min-width="flexWidth('box_length',crud.data,'长')"/>
|
||||
<el-table-column prop="box_width" label="宽" :min-width="flexWidth('box_width',crud.data,'宽')"/>
|
||||
<el-table-column prop="box_high" label="高" :min-width="flexWidth('box_high',crud.data,'高')"/>
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')"/>
|
||||
<el-table-column prop="vbeln" label="来源交货单" :min-width="flexWidth('vbeln',crud.data,'来源交货单')"/>
|
||||
<el-table-column prop="posnr" label="来源交货单行" :min-width="flexWidth('posnr',crud.data,'来源交货单行')"/>
|
||||
<el-table-column prop="sale_order_description" label="销售订单描述"
|
||||
:min-width="flexWidth('sale_order_description',crud.data,'销售订单描述')"/>
|
||||
<el-table-column prop="isreprintpackageboxlabel" label="是否需要重打外包装标签"
|
||||
:min-width="flexWidth('isreprintpackageboxlabel',crud.data,'是否需要重打外包装标签')">
|
||||
<el-table-column
|
||||
prop="un_plan_product_property1"
|
||||
label="子卷的物性值1"
|
||||
:min-width="flexWidth('un_plan_product_property1',crud.data,'子卷的物性值1',-220)"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="un_plan_product_property2"
|
||||
label="子卷的物性值2"
|
||||
:min-width="flexWidth('un_plan_product_property2',crud.data,'子卷的物性值2')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="un_plan_product_property3"
|
||||
label="子卷的物性值3"
|
||||
:min-width="flexWidth('un_plan_product_property3',crud.data,'子卷的物性值3')"
|
||||
/>
|
||||
<el-table-column prop="box_type" label="木箱料号" :min-width="flexWidth('box_type',crud.data,'木箱料号')" />
|
||||
<el-table-column prop="box_length" label="长" :min-width="flexWidth('box_length',crud.data,'长')" />
|
||||
<el-table-column prop="box_width" label="宽" :min-width="flexWidth('box_width',crud.data,'宽')" />
|
||||
<el-table-column prop="box_high" label="高" :min-width="flexWidth('box_high',crud.data,'高')" />
|
||||
<el-table-column prop="demand_limit" label="客户需求抗拉下限" :min-width="flexWidth('demand_limit',crud.data,'客户需求抗拉下限')" />
|
||||
<el-table-column prop="standard_limit" label="内控标准抗拉下限" :min-width="flexWidth('standard_limit',crud.data,'内控标准抗拉下限')" />
|
||||
<el-table-column prop="actual_value" label="生产实际抗拉值" :min-width="flexWidth('actual_value',crud.data,'生产实际抗拉值')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column prop="vbeln" label="来源交货单" :min-width="flexWidth('vbeln',crud.data,'来源交货单')" />
|
||||
<el-table-column prop="posnr" label="来源交货单行" :min-width="flexWidth('posnr',crud.data,'来源交货单行')" />
|
||||
<el-table-column
|
||||
prop="sale_order_description"
|
||||
label="销售订单描述"
|
||||
:min-width="flexWidth('sale_order_description',crud.data,'销售订单描述')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="isreprintpackageboxlabel"
|
||||
label="是否需要重打外包装标签"
|
||||
:min-width="flexWidth('isreprintpackageboxlabel',crud.data,'是否需要重打外包装标签')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.IS_OR_NOT[scope.row.isreprintpackageboxlabel] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isunpackbox" label="是否需要拆包重打子卷标签"
|
||||
:min-width="flexWidth('isunpackbox',crud.data,'是否需要拆包重打子卷标签')">
|
||||
<el-table-column
|
||||
prop="isunpackbox"
|
||||
label="是否需要拆包重打子卷标签"
|
||||
:min-width="flexWidth('isunpackbox',crud.data,'是否需要拆包重打子卷标签')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.IS_OR_NOT[scope.row.isunpackbox] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')"/>
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')"/>
|
||||
<el-table-column v-permission="['admin','sub:edit','sub:del']" label="操作" align="center" fixed="right"
|
||||
min-width="120">
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||
<el-table-column
|
||||
v-permission="['admin','sub:edit','sub:del']"
|
||||
label="操作"
|
||||
align="center"
|
||||
fixed="right"
|
||||
min-width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:isVisiableDel="false"
|
||||
:is-visiable-del="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -357,7 +357,7 @@
|
||||
|
||||
<script>
|
||||
import crudRegion from '@/views/wms/sch/region/region'
|
||||
import crudPoint, { changeActive } from '@/views/wms/sch/point/point'
|
||||
import crudPoint, { changeActive, changeActives } from '@/views/wms/sch/point/point'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -503,9 +503,7 @@ export default {
|
||||
})
|
||||
},
|
||||
changeUsed(data, flag) { // 更改启用状态
|
||||
const param = data[0]
|
||||
param.lock_type = flag
|
||||
crudPoint.changeActive(param).then(res => {
|
||||
crudPoint.changeActives(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
|
||||
@@ -37,6 +37,14 @@ export function changeActive(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActives(data) {
|
||||
return request({
|
||||
url: 'api/point/changeActives',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getPoint(data) {
|
||||
return request({
|
||||
url: '/api/point/getPoint',
|
||||
@@ -82,4 +90,4 @@ export function download() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed, changeLock, sync }
|
||||
export default { add, edit, del, changeActive, changeActives, findPoints, getPoint, getRegion, changeUsed, changeLock, sync }
|
||||
|
||||
@@ -189,7 +189,10 @@
|
||||
<el-table-column show-overflow-tooltip prop="input_optname" label="入库人" :min-width="flexWidth('input_optname',crud.data,'入库人')" />
|
||||
<el-table-column v-if="crud.query.is_all === '0'" show-overflow-tooltip prop="width" label="产品规格" :min-width="flexWidth('width',crud.data,'产品规格')" />
|
||||
<el-table-column v-if="crud.query.is_all === '0'" show-overflow-tooltip prop="thickness" label="产品厚度" :min-width="flexWidth('thickness',crud.data,'产品厚度')" />
|
||||
<el-table-column v-if="crud.query.is_all === '0'" show-overflow-tooltip prop="mass_per_unit_area" label="单位面积" :formatter="crud.formatNum2" :min-width="flexWidth('mass_per_unit_area',crud.data,'单位面积')" />
|
||||
<el-table-column v-if="crud.query.is_all === '0'" show-overflow-tooltip prop="mass_per_unit_area" label="单位面积" :min-width="flexWidth('mass_per_unit_area',crud.data,'单位面积')" />
|
||||
<el-table-column v-if="crud.query.is_all === '0'" show-overflow-tooltip prop="demand_limit" label="客户需求抗拉下限" :min-width="flexWidth('demand_limit',crud.data,'客户需求抗拉下限')" />
|
||||
<el-table-column v-if="crud.query.is_all === '0'" show-overflow-tooltip prop="standard_limit" label="内控标准抗拉下线" :min-width="flexWidth('standard_limit',crud.data,'内控标准抗拉下线')" />
|
||||
<el-table-column v-if="crud.query.is_all === '0'" show-overflow-tooltip prop="actual_value" label="生产实际抗拉值" :min-width="flexWidth('actual_value',crud.data,'生产实际抗拉值')" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
|
||||
Reference in New Issue
Block a user