Browse Source

新增工单页面批量选择工单物料进行出库

master
psh 10 months ago
parent
commit
7b8ab73513
  1. 4
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java
  2. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java
  3. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES098RequestBodyItem2.java
  4. 45
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PdmBdWorkorderDetailController.java
  5. 41
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java
  6. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/IPdmBdWorkorderService.java
  7. 45
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PdmBdWorkorderDetail.java
  8. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetail.java
  9. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetailAdd.java

4
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java

@ -68,7 +68,9 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem
} }
if (close != last_close) { if (close != last_close) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号close:" + last_close + "->" + close); logServer.deviceExecuteLog(this.device_code, "", "", "信号close:" + last_close + "->" + close);
if(close ==1 ){
this.writing("to_close","0");
}
} }
if (toClose != last_toClose) { if (toClose != last_toClose) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号toClose:" + last_toClose + "->" + toClose); logServer.deviceExecuteLog(this.device_code, "", "", "信号toClose:" + last_toClose + "->" + toClose);

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java

@ -13,6 +13,7 @@ import org.nl.common.logging.annotation.Log;
import org.nl.wms.mes.domain.*; import org.nl.wms.mes.domain.*;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail;
import org.nl.wms.sch.material.service.dao.Material; import org.nl.wms.sch.material.service.dao.Material;
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper;
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
@ -108,6 +109,13 @@ public class MesController {
entity.setCreate_name("MES"); entity.setCreate_name("MES");
entity.setCreate_time(DateUtil.now()); entity.setCreate_time(DateUtil.now());
pdmBdWorkorderService.create(entity); pdmBdWorkorderService.create(entity);
for(QPMES098RequestBodyItem2 qpmes098RequestBodyItem2:qpmes098Request.getBODY().get(0).getITEM2()){
PdmBdWorkorderDetail pdmBdWorkorderDetail=new PdmBdWorkorderDetail();
pdmBdWorkorderDetail.setReal_qty(BigDecimal.valueOf(0));
pdmBdWorkorderDetail.setWorkorder_code(entity.getWorkorder_code());
pdmBdWorkorderDetail.copyFrom(qpmes098RequestBodyItem2);
pdmBdWorkorderService.createDetail(pdmBdWorkorderDetail);
}
qpmes098ResponseBody.setMESSAGE("工单下发成功"); qpmes098ResponseBody.setMESSAGE("工单下发成功");
qpmes098ResponseBody.setSTATUS("S"); qpmes098ResponseBody.setSTATUS("S");
qpmes098ResponseBody.setFKEY_VALUE01(qpmes098Request.getBODY().get(0).getAUFNR()); qpmes098ResponseBody.setFKEY_VALUE01(qpmes098Request.getBODY().get(0).getAUFNR());

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES098RequestBodyItem2.java

@ -4,19 +4,34 @@ import lombok.Data;
@Data @Data
public class QPMES098RequestBodyItem2 { public class QPMES098RequestBodyItem2 {
/** 订单行项目编号 **/
private String POSNR; private String POSNR;
/** 预留行项目编号 **/
private String RSPOS; private String RSPOS;
/** 移动类型 **/
private String BWART; private String BWART;
/** 物料编码 **/
private String MATNR; private String MATNR;
/** 物料名称 **/
private String MAKTX; private String MAKTX;
/** 产品类别 **/
private String MTYPE; private String MTYPE;
/** 产品类别描述 **/
private String MTYTXT; private String MTYTXT;
/** 数量 **/
private String BDMNG; private String BDMNG;
/** 计量单位 **/
private String MEINS; private String MEINS;
/** 物料供应标识 **/
private String BEIKZ; private String BEIKZ;
/** 预留字段11 **/
private String ZRSV11; private String ZRSV11;
/** 预留字段12 **/
private String ZRSV12; private String ZRSV12;
/** 预留字段13 **/
private String ZRSV13; private String ZRSV13;
/** 预留字段14 **/
private String ZRSV14; private String ZRSV14;
/** 预留字段15 **/
private String ZRSV15; private String ZRSV15;
} }

45
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PdmBdWorkorderDetailController.java

@ -8,6 +8,7 @@ import org.nl.common.domain.query.PageQuery;
import org.nl.common.logging.annotation.Log; import org.nl.common.logging.annotation.Log;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail;
import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery; import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -16,51 +17,23 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Set; import java.util.Set;
/**
* @author lyd
* @date 2023-05-05
**/
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "工单管理管理") @Api(tags = "工单详情管理")
@RequestMapping("/api/pdmBdWorkorder") @RequestMapping("/api/pdmBdWorkorderDetail")
public class PdmBdWorkorderController { public class PdmBdWorkorderDetailController {
@Autowired @Autowired
private IPdmBdWorkorderService pdmBdWorkorderService; private IPdmBdWorkorderService pdmBdWorkorderService;
@GetMapping @GetMapping
@Log("查询工单管理") @Log("查询工单详情管理")
@ApiOperation("查询工单管理") @ApiOperation("查询工单详情管理")
//@SaCheckPermission("@el.check('pdmBdWorkorder:list')") //@SaCheckPermission("@el.check('pdmBdWorkorder:list')")
public ResponseEntity<Object> query(PdmBdWorkorderQuery query, PageQuery page){ public ResponseEntity<Object> query(PdmBdWorkorderQuery query, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAll(query,page)),HttpStatus.OK); return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAllDetail(query,page)),HttpStatus.OK);
}
@PostMapping
@Log("新增工单管理")
@ApiOperation("新增工单管理")
//@SaCheckPermission("@el.check('pdmBdWorkorder:add')")
public ResponseEntity<Object> create(@Validated @RequestBody PdmBdWorkorder entity){
pdmBdWorkorderService.create(entity);
return new ResponseEntity<>(HttpStatus.CREATED);
} }
@PutMapping
@Log("修改工单管理")
@ApiOperation("修改工单管理")
//@SaCheckPermission("@el.check('pdmBdWorkorder:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody PdmBdWorkorder entity){
pdmBdWorkorderService.update(entity);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除工单管理")
@ApiOperation("删除工单管理")
//@SaCheckPermission("@el.check('pdmBdWorkorder:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
pdmBdWorkorderService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
} }

41
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java

@ -1,47 +1,56 @@
package org.nl.wms.pdm.controller; package org.nl.wms.pdm.controller;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo; import org.nl.common.base.TableDataInfo;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.common.logging.annotation.Log; import org.nl.common.logging.annotation.Log;
import org.nl.wms.pda.service.PdaService;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PointDetailAdd;
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail;
import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery; import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Set;
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "工单详情管理") @Api(tags = "工单详情管理")
@RequestMapping("/api/pdmBdWorkorderDetail") @RequestMapping("/api/pointDetail")
public class PdmBdWorkorderDetailController { public class PointDetailController {
@Autowired @Autowired
private IPdmBdWorkorderService pdmBdWorkorderService; private IPdmBdWorkorderService pdmBdWorkorderService;
@Autowired
private PdaService pdaService;
@GetMapping @GetMapping
@Log("查询工单详情管理") @Log("根据物料查询点位库存")
@ApiOperation("查询工单详情管理") @ApiOperation("根据物料查询点位库存")
//@SaCheckPermission("@el.check('pdmBdWorkorder:list')") //@SaCheckPermission("@el.check('pdmBdWorkorder:list')")
public ResponseEntity<Object> query(PdmBdWorkorderQuery query, PageQuery page){ public ResponseEntity<Object> query(String productname, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAllDetail(query,page)),HttpStatus.OK); return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryPointDetail(productname,page)),HttpStatus.OK);
} }
@GetMapping @PostMapping("/add")
@Log("根据物料查询点位库存") @Log("批量新增原材料出库任务")
@ApiOperation("根据物料查询点位库存") @ApiOperation("批量新增原材料出库任务")
//@SaCheckPermission("@el.check('pdmBdWorkorder:list')") //@SaCheckPermission("@el.check('pdmBdWorkorder:list')")
public ResponseEntity<Object> queryPointDetail(String PalletSN, PageQuery page){ public ResponseEntity<Object> add(@RequestBody PointDetailAdd pointDetailAdd){
return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryPointDetail(PalletSN,page)),HttpStatus.OK); log.info("批量新增原材料出库任务:"+pointDetailAdd.toString());
for(String point_code:pointDetailAdd.getPointCodes()){
JSONObject param=new JSONObject();
param.put("start_point",point_code);
param.put("time",pointDetailAdd.getTime());
param.put("mode",pointDetailAdd.getMode());
param.put("workorder_code",pointDetailAdd.getWorkorder_code());
pdaService.yclck(param);
}
return new ResponseEntity<>(HttpStatus.OK);
} }
} }

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/IPdmBdWorkorderService.java

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail;
import org.nl.wms.pdm.service.dao.PointDetail;
import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery; import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery;
import java.util.Set; import java.util.Set;
@ -40,4 +42,14 @@ public interface IPdmBdWorkorderService extends IService<PdmBdWorkorder> {
* @param ids / * @param ids /
*/ */
void deleteAll(Set<String> ids); void deleteAll(Set<String> ids);
/**
* 创建
* @param entity /
*/
void createDetail(PdmBdWorkorderDetail entity);
IPage<PdmBdWorkorderDetail> queryAllDetail(PdmBdWorkorderQuery query, PageQuery page);
IPage<PointDetail> queryPointDetail(String productname, PageQuery page);
} }

45
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PdmBdWorkorderDetail.java

@ -1,50 +1,27 @@
package org.nl.wms.pdm.service.dto; package org.nl.wms.pdm.service.dao;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.nl.wms.mes.domain.QPMES060RequestBody;
import org.nl.wms.mes.domain.QPMES098RequestBodyItem2;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("sch_base_material") @TableName("pmd_bd_workorder_detail")
public class PdmBdWorkorderDetail implements Serializable { public class PdmBdWorkorderDetail extends QPMES098RequestBodyItem2 implements Serializable {
/** 工单编号 */ /** 工单编号 */
private String workorder_code; private String workorder_code;
/** 实际数量 */ /** 实际数量 */
private BigDecimal real_qty; private BigDecimal real_qty;
/** 订单行项目编号 **/
private String POSNR; public void copyFrom(QPMES098RequestBodyItem2 source){
/** 预留行项目编号 **/ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
private String RSPOS; }
/** 移动类型 **/
private String BWART;
/** 物料编码 **/
private String MATNR;
/** 物料名称 **/
private String MAKTX;
/** 产品类别 **/
private String MTYPE;
/** 产品类别描述 **/
private String MTYTXT;
/** 数量 **/
private String BDMNG;
/** 计量单位 **/
private String MEINS;
/** 物料供应标识 **/
private String BEIKZ;
/** 预留字段11 **/
private String ZRSV11;
/** 预留字段12 **/
private String ZRSV12;
/** 预留字段13 **/
private String ZRSV13;
/** 预留字段14 **/
private String ZRSV14;
/** 预留字段15 **/
private String ZRSV15;
} }

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetail.java

@ -1,2 +1,11 @@
package org.nl.wms.pdm.service.dao;public class PointDetail { package org.nl.wms.pdm.service.dao;
import lombok.Data;
@Data
public class PointDetail {
private String point_code;
private String productName;
private String PalletSN;
private String qty;
} }

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetailAdd.java

@ -2,10 +2,12 @@ package org.nl.wms.pdm.service.dao;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class PointDetail { public class PointDetailAdd {
private String point_code; private List<String> pointCodes;
private String productName; private String mode;
private String PalletSN; private String time;
private String qty; private String workorder_code;
} }

Loading…
Cancel
Save