rev:工单修改
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
package org.nl.wms.pda.general_management.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.pda.general_management.service.PdaGeneralPublicService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平板通用公共接口 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/pdaGeneralPublic")
|
||||
@Slf4j
|
||||
public class PdaGeneralPublicController {
|
||||
|
||||
@Autowired
|
||||
private PdaGeneralPublicService pdaGeneralPublicService;
|
||||
|
||||
@PostMapping("/queryGroupQuality")
|
||||
@Log("查询品质类型")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryGroupQuality() {
|
||||
return new ResponseEntity<>(PdaResponse.requestParamOk(pdaGeneralPublicService.queryGroupQuality()), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryMaterial")
|
||||
@Log("查询物料")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(PdaResponse.requestParamOk(pdaGeneralPublicService.queryMaterial(whereJson)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/querySupp")
|
||||
@Log("查询供应商")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> querySupp(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(PdaResponse.requestParamOk(pdaGeneralPublicService.querySupp(whereJson)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryBoxType")
|
||||
@Log("查询料箱类型")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryBoxType() {
|
||||
return new ResponseEntity<>(PdaResponse.requestParamOk(pdaGeneralPublicService.queryBoxType()), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryGroupInfo")
|
||||
@Log("查询组盘记录")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryGroupInfo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(PdaResponse.requestParamOk(pdaGeneralPublicService.queryGroupInfo(whereJson)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryBomInfo")
|
||||
@Log("查询工单信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryBomInfo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(PdaResponse.requestParamOk(pdaGeneralPublicService.queryBomInfo(whereJson)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.nl.wms.pda.general_management.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.pda.general_management.service.PdaInGroupBoxService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 入库组箱
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/pdaInGroupBox")
|
||||
@Slf4j
|
||||
public class PdaInGroupBoxController {
|
||||
|
||||
@Autowired
|
||||
private PdaInGroupBoxService pdaInGroupBoxService;
|
||||
|
||||
@PostMapping("/confirmBox")
|
||||
@Log("确认组箱")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> confirmBox(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaInGroupBoxService.confirmBox(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/deliveryBox")
|
||||
@Log("配送组箱")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> deliveryBox(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaInGroupBoxService.deliveryBox(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.nl.wms.pda.general_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平板通用公共接口 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-03
|
||||
*/
|
||||
public interface PdaGeneralPublicService {
|
||||
|
||||
/**
|
||||
* 查询品质类型
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryGroupQuality();
|
||||
|
||||
/**
|
||||
* 查询物料信息
|
||||
*
|
||||
* @param whereJson {
|
||||
* material_code : 物料编码/名称
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryMaterial(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询组盘供应商
|
||||
*
|
||||
* @param whereJson {
|
||||
* supp_code : 供应商编码/名称
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse querySupp(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询料箱类型
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryBoxType();
|
||||
|
||||
/**
|
||||
* 查询组盘记录
|
||||
*
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryGroupInfo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询工单信息
|
||||
* @param whereJson {
|
||||
* start_time: 日期
|
||||
* search: 工单编码/机台编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryBomInfo(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package org.nl.wms.pda.general_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平板入库组箱 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-03
|
||||
*/
|
||||
public interface PdaInGroupBoxService {
|
||||
|
||||
/**
|
||||
* 确认组箱
|
||||
*
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具编码
|
||||
* material_id: 物料ID
|
||||
* material_code: 物料编码
|
||||
* material_name: 物料名称
|
||||
* supp_code: 供应商编码
|
||||
* supp_name: 供应商名称
|
||||
* pcsn: 批号
|
||||
* produce_time: 生产日期
|
||||
* qty: 重量
|
||||
* quality_type: 品质类型
|
||||
* bake_num: 烘干次数
|
||||
* box_type: 料箱类型
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse confirmBox(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 配送组箱
|
||||
* @param whereJson {
|
||||
* device_code: 机台编码
|
||||
* bom_id: 工单标识
|
||||
* bom_code: 工单编码
|
||||
* material_info: 物料标签信息 -- 可以为空
|
||||
* qty: 重量 -- 可以为空
|
||||
* rows [] -- 列表明细
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse deliveryBox(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package org.nl.wms.pda.general_management.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.wms.basedata_manage.service.IMdCsSupplierbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.pda.general_management.service.PdaGeneralPublicService;
|
||||
import org.nl.wms.pda.util.PDAEnum;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.nl.wms.pdm_manage.service.dao.mapper.PdmBomCallMaterialMapper;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.MdPbGroupplateMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平板通用公共接口 实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-03
|
||||
*/
|
||||
@Service
|
||||
public class PdaGeneralPublicServiceImpl implements PdaGeneralPublicService {
|
||||
|
||||
/**
|
||||
* 物料服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
/**
|
||||
* 供应商服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdCsSupplierbaseService iMdCsSupplierbaseService;
|
||||
|
||||
/**
|
||||
* 组盘mapper服务
|
||||
*/
|
||||
@Autowired
|
||||
private MdPbGroupplateMapper mdPbGroupplateMapper;
|
||||
|
||||
/**
|
||||
* 工单mapper
|
||||
*/
|
||||
@Autowired
|
||||
private PdmBomCallMaterialMapper pdmBomCallMaterialMapper;
|
||||
|
||||
@Override
|
||||
public PdaResponse queryGroupQuality() {
|
||||
return PdaResponse.requestParamOk(PDAEnum.QUALITY_TYPE.getDict());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse queryMaterial(JSONObject whereJson) {
|
||||
String material_code = whereJson.getString("material_code");
|
||||
|
||||
LambdaQueryWrapper<MdMeMaterialbase> qw = new QueryWrapper<MdMeMaterialbase>().lambda();
|
||||
qw.eq(MdMeMaterialbase::getIs_delete, IOSConstant.ZERO);
|
||||
qw.eq(MdMeMaterialbase::getIs_used, IOSConstant.ONE);
|
||||
if (ObjectUtil.isNotEmpty(material_code)) {
|
||||
qw.like(MdMeMaterialbase::getMaterial_code, material_code)
|
||||
.or(row -> row.like(MdMeMaterialbase::getMaterial_name, material_code));
|
||||
}
|
||||
|
||||
List<MdMeMaterialbase> materialList = iMdMeMaterialbaseService.list(qw);
|
||||
return PdaResponse.requestParamOk(materialList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse querySupp(JSONObject whereJson) {
|
||||
String supp_code = whereJson.getString("supp_code");
|
||||
|
||||
LambdaQueryWrapper<MdCsSupplierbase> wq = new QueryWrapper<MdCsSupplierbase>().lambda();
|
||||
wq.eq(MdCsSupplierbase::getIs_delete, IOSConstant.ZERO);
|
||||
wq.eq(MdCsSupplierbase::getIs_used, IOSConstant.ONE);
|
||||
if (ObjectUtil.isNotEmpty(supp_code)) {
|
||||
wq.like(MdCsSupplierbase::getSupp_code, supp_code)
|
||||
.or(row -> row.like(MdCsSupplierbase::getSupp_name, supp_code));
|
||||
}
|
||||
|
||||
List<MdCsSupplierbase> suppList = iMdCsSupplierbaseService.list(wq);
|
||||
return PdaResponse.requestParamOk(suppList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse queryBoxType() {
|
||||
return PdaResponse.requestParamOk(PDAEnum.BOX_TYPE.getDict());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse queryGroupInfo(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(mdPbGroupplateMapper.pdaQueryGeneralGroupInfo(whereJson));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse queryBomInfo(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(pdmBomCallMaterialMapper.queryBomInfo(whereJson));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package org.nl.wms.pda.general_management.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.pda.general_management.service.PdaInGroupBoxService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.nl.wms.pdm_manage.service.IPdmBomCallMaterialService;
|
||||
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平板入库组箱 实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-03
|
||||
*/
|
||||
@Service
|
||||
public class PdaInGroupBoxServiceImpl implements PdaInGroupBoxService {
|
||||
|
||||
/**
|
||||
* 组盘服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
/**
|
||||
* 工单服务
|
||||
*/
|
||||
@Autowired
|
||||
private IPdmBomCallMaterialService iPdmBomCallMaterialService;
|
||||
|
||||
/**
|
||||
* 物料服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
@Override
|
||||
public PdaResponse confirmBox(JSONObject whereJson) {
|
||||
GroupPlate groupPlate = JSONObject.parseObject(JSON.toJSONString(whereJson), GroupPlate.class);
|
||||
iMdPbGroupplateService.create(groupPlate);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse deliveryBox(JSONObject whereJson) {
|
||||
// 查询工单
|
||||
PdmBomCallMaterial bomDao = iPdmBomCallMaterialService.getById(whereJson.getString("bom_id"));
|
||||
// 获取当前组盘信息
|
||||
JSONObject jsonGroup = whereJson.getJSONArray("rows").toJavaList(JSONObject.class).get(0);
|
||||
GroupPlate groupDao = iMdPbGroupplateService.getById(jsonGroup.getString("group_id"));
|
||||
|
||||
// 校验当前工单与组盘记录是否相同
|
||||
if (!bomDao.getMaterial_id().equals(groupDao.getMaterial_id())) {
|
||||
throw new BadRequestException("当前组盘物料与工单物料不相同不允许组箱!");
|
||||
}
|
||||
|
||||
// 解析二维码信息
|
||||
if(ObjectUtil.isNotEmpty(whereJson.getString("material_info"))) {
|
||||
// 判断数量不能为空
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("qty"))) {
|
||||
throw new BadRequestException("重量不能为空!");
|
||||
}
|
||||
|
||||
String[] split = whereJson.getString("material_info").split("##");
|
||||
// 物料编码
|
||||
String mater_code = split[0];
|
||||
// 烘干次数
|
||||
String bake_num = split[10];
|
||||
// 校验物料
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(groupDao.getMaterial_id());
|
||||
if (!materDao.getMaterial_code().equals(mater_code)) {
|
||||
throw new BadRequestException("新增物料与组盘物料不符,不允许组箱!");
|
||||
}
|
||||
// 校验烘干次数
|
||||
if (!groupDao.getBake_num().toString().equals(bake_num)) {
|
||||
throw new BadRequestException("新增物料烘干次数与组盘物料烘干次数不符,不允许组箱!");
|
||||
}
|
||||
// 叠加组盘重量
|
||||
groupDao.setQty(NumberUtil.add(groupDao.getQty(),whereJson.getBigDecimal("qty")));
|
||||
}
|
||||
// 绑定工单信息
|
||||
groupDao.setBom_id(bomDao.getBom_id());
|
||||
iMdPbGroupplateService.updateById(groupDao);
|
||||
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,15 @@ public enum PDAEnum {
|
||||
// 库区编码
|
||||
SECT_CODE(MapOf.of("合格区", "HG01", "待检区", "DJ01", "不合格区", "BHG01")),
|
||||
|
||||
// 组盘品质类型
|
||||
QUALITY_TYPE(MapOf.of("待检", "1", "合格", "2", "不合格", "3")),
|
||||
|
||||
// 组盘品质类型
|
||||
BOX_TYPE(MapOf.of("小料箱", "1", "大料箱", "2", "焊条筒", "3")),
|
||||
|
||||
// 运送类型
|
||||
TASK_TYPE(MapOf.of("小料箱", "1", "大料箱或其他", "2")),
|
||||
|
||||
;
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
@@ -61,6 +61,13 @@ public class BomCallMaterialController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/startBom")
|
||||
@Log("提交叫料单")
|
||||
public ResponseEntity<Object> startBom(@RequestBody PdmBomCallMaterial dao) {
|
||||
iPdmBomCallMaterialService.startBom(dao);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("强制确认叫料单")
|
||||
public ResponseEntity<Object> confirm(@RequestBody PdmBomCallMaterial dao) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
public enum BomEnum {
|
||||
|
||||
// 叫料单主表状态
|
||||
CALL_BOM_STATUS(MapOf.of("生成", "1", "叫料中", "2", "叫料完成", "3"
|
||||
CALL_BOM_STATUS(MapOf.of("生成", "0", "提交", "1", "叫料中", "2", "叫料完成", "3"
|
||||
, "退料中", "4", "完成", "5"
|
||||
)),
|
||||
|
||||
|
||||
@@ -44,26 +44,39 @@ public interface IPdmBomCallMaterialService extends IService<PdmBomCallMaterial>
|
||||
|
||||
/**
|
||||
* 删除叫料单
|
||||
*
|
||||
* @param ids id集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 根据工单编码查询
|
||||
*
|
||||
* @param bom_code 工单编码
|
||||
* @return PdmBomCallMaterial 实体类
|
||||
*/
|
||||
PdmBomCallMaterial findByCode (String bom_code);
|
||||
PdmBomCallMaterial findByCode(String bom_code);
|
||||
|
||||
/**
|
||||
* 更新叫料单状态
|
||||
*
|
||||
* @param bom_id 叫料单标识
|
||||
*/
|
||||
void updateStatus(String bom_id);
|
||||
|
||||
/**
|
||||
* 提交
|
||||
*
|
||||
* @param dao 叫料单实体类
|
||||
*/
|
||||
void startBom(PdmBomCallMaterial dao);
|
||||
|
||||
/**
|
||||
* 强制确认叫料单
|
||||
*
|
||||
* @param dao 叫料单实体类
|
||||
*/
|
||||
void confirm(PdmBomCallMaterial dao);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,11 @@ public class PdmBomCallMaterial implements Serializable {
|
||||
*/
|
||||
private String device_code;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String device_name;
|
||||
|
||||
/**
|
||||
* 叫料重量
|
||||
*/
|
||||
@@ -89,6 +94,11 @@ public class PdmBomCallMaterial implements Serializable {
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String start_time;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pdm_manage.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -7,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial;
|
||||
import org.nl.wms.pdm_manage.service.dto.PdmBomCallMaterialDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -26,4 +28,14 @@ public interface PdmBomCallMaterialMapper extends BaseMapper<PdmBomCallMaterial>
|
||||
* @return IPage<PdmBomCallMaterialDto>
|
||||
*/
|
||||
IPage<PdmBomCallMaterialDto> queryAllByPage(Page<PdmBomCallMaterialDto> page, @Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 查询工单信息
|
||||
* @param whereJson {
|
||||
* start_time: 日期
|
||||
* search: 工单编码/机台编码
|
||||
* }
|
||||
* @return List<PdmBomCallMaterialDto>
|
||||
*/
|
||||
List<PdmBomCallMaterialDto> queryBomInfo(@Param("param") JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -39,4 +39,30 @@
|
||||
ORDER BY bom.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryBomInfo" resultType="org.nl.wms.pdm_manage.service.dto.PdmBomCallMaterialDto">
|
||||
SELECT
|
||||
bom.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec
|
||||
FROM
|
||||
pdm_bom_callmaterial bom
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = bom.material_id
|
||||
<where>
|
||||
'4' > bom.bom_status
|
||||
|
||||
<if test="param.device_code != null and param.device_code != ''">
|
||||
AND
|
||||
bom.device_code LIKE #{param.device_code}
|
||||
</if>
|
||||
|
||||
<if test="param.bom_code != null and param.bom_code != ''">
|
||||
AND
|
||||
bom.bom_code LIKE #{param.bom_code}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
ORDER BY bom.create_time Desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -114,6 +114,14 @@ public class PdmBomCallMaterialServiceImpl extends ServiceImpl<PdmBomCallMateria
|
||||
this.updateById(bomDao);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void startBom(PdmBomCallMaterial dao) {
|
||||
dao.setStart_time(DateUtil.today());
|
||||
dao.setBom_status(BomEnum.CALL_BOM_STATUS.code("提交"));
|
||||
this.updateById(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void confirm(PdmBomCallMaterial dao) {
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
import org.nl.wms.sch_manage.service.util.TaskType;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -68,7 +69,11 @@ public class PdaPointTask extends AbstractTask {
|
||||
task.setVehicle_code(json.getString("vehicle_code"));
|
||||
task.setMaterial_id(json.getString("material_id"));
|
||||
task.setMaterial_qty(json.getBigDecimal("material_qty"));
|
||||
task.setTask_type(json.getString("task_type"));
|
||||
if (ObjectUtil.isEmpty(json.getString("task_type"))) {
|
||||
task.setTask_type(IOSConstant.ONE);
|
||||
} else {
|
||||
task.setTask_type(json.getString("task_type"));
|
||||
}
|
||||
task.setExt_group_data(json.getString("ext_group_data"));
|
||||
task.setRequest_param(json.toString());
|
||||
task.setPriority(json.getString("Priority"));
|
||||
|
||||
@@ -45,4 +45,13 @@ public interface MdPbGroupplateMapper extends BaseMapper<GroupPlate> {
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> pdaQueryGroupInfo(@Param("param") JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 手持通用功能公共查询
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> pdaQueryGeneralGroupInfo(@Param("param") JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -79,4 +79,30 @@
|
||||
|
||||
ORDER BY late.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="pdaQueryGeneralGroupInfo" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
late.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
mater.material_model,
|
||||
mater.quality_time AS quality_time_day,
|
||||
supp.supp_name
|
||||
FROM
|
||||
md_pb_groupplate late
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = late.material_id
|
||||
INNER JOIN md_cs_supplierbase supp ON supp.supp_code = late.supp_code
|
||||
<where>
|
||||
late.status = '3'
|
||||
AND IFNULL(late.bom_id,'') = ''
|
||||
|
||||
<if test="param.storagevehicle_code != null and param.storagevehicle_code != ''">
|
||||
AND
|
||||
late.storagevehicle_code = #{param.storagevehicle_code}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
ORDER BY late.create_time Desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -32,4 +32,12 @@ export function confirm(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, confirm }
|
||||
export function startBom(data) {
|
||||
return request({
|
||||
url: 'api/bomCallMaterial/startBom',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, confirm, startBom }
|
||||
|
||||
@@ -60,6 +60,17 @@
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="startBom"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -107,6 +118,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="机台名称" prop="device_name">
|
||||
<el-input v-model="form.device_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="叫料重量" prop="call_qty">
|
||||
<el-input-number v-model="form.call_qty" :precision="2" :controls="false" :min="1" style="width: 200px" />
|
||||
@@ -139,12 +156,14 @@
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="device_code" label="机台编码" :min-width="flexWidth('device_code',crud.data,'机台编码')" />
|
||||
<el-table-column prop="device_name" label="机台名称" :min-width="flexWidth('device_name',crud.data,'机台名称')" />
|
||||
<el-table-column prop="call_qty" label="计划叫料重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="real_qty" label="实际叫料重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="real_weigh_qty" label="实际用料重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" :min-width="flexWidth('qty_unit_name',crud.data,'单位')" />
|
||||
<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 prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||
<el-table-column prop="start_time" label="开始时间" :min-width="flexWidth('start_time',crud.data,'开始时间')" />
|
||||
<el-table-column prop="confirm_time" label="结束时间" :min-width="flexWidth('confirm_time',crud.data,'结束时间')" />
|
||||
<el-table-column
|
||||
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
|
||||
@@ -156,8 +175,8 @@
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:disabled-dle="scope.row.bom_status !== '1'"
|
||||
:disabled-edit="scope.row.bom_status !== '1'"
|
||||
:disabled-dle="scope.row.bom_status !== '0'"
|
||||
:disabled-edit="scope.row.bom_status !== '0'"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
@@ -188,12 +207,14 @@ const defaultForm = {
|
||||
material_id: null,
|
||||
bom_id: null,
|
||||
device_code: null,
|
||||
device_name: null,
|
||||
call_qty: null,
|
||||
real_qty: null,
|
||||
bom_status: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
start_time: null,
|
||||
confirm_time: null
|
||||
}
|
||||
export default {
|
||||
@@ -272,6 +293,17 @@ export default {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
startBom() {
|
||||
const data = this.$refs.table.selection[0]
|
||||
if (data.bom_status !== '0') {
|
||||
this.crud.notify('当前状态不为生成不允许提交!!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudCallMaterial.startBom(data).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,13 +103,13 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.task_type === '2'" label="物料编码" prop="material_code">
|
||||
<el-form-item v-if="form.task_type === '1'" label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" @change="queryMater" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.task_type === '2'" label="物料名称" prop="material_name">
|
||||
<el-form-item v-if="form.task_type === '1'" label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -117,13 +117,13 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.task_type === '2'" label="物料规格" prop="material_spec">
|
||||
<el-form-item v-if="form.task_type === '1'" label="物料规格" prop="material_spec">
|
||||
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.task_type === '2'" label="物料重量" prop="material_qty">
|
||||
<el-form-item v-if="form.task_type === '1'" label="物料重量" prop="material_qty">
|
||||
<el-input-number v-model="form.material_qty" :precision="2" :controls="false" :min="0" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
Reference in New Issue
Block a user