Browse Source

fix: MES对接

master
李永德 12 months ago
parent
commit
b9f18e997f
  1. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java
  2. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/dao/MonthlyWorkOrderVo.java
  3. 18
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java
  4. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.java
  5. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.xml
  6. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/controller/MdBaseClassstandardController.java
  7. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/IMdBaseClassstandardService.java
  8. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/impl/MdBaseClassstandardServiceImpl.java
  9. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  10. 48
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/controller/WmsToMesController.java
  11. 16
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java
  12. 13
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java
  13. 36
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml
  14. 23
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapDto.java
  15. 14
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapQuery.java
  16. 53
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SemiProductGXPFDo.java
  17. 81
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java
  18. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java
  19. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  20. 10
      lms/nladmin-ui/src/views/wms/basedata/classification/mdBaseClassstandard.js
  21. 271
      lms/nladmin-ui/src/views/wms/pdm/scrap/index.vue
  22. 10
      lms/nladmin-ui/src/views/wms/pdm/scrap/scrap.js

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java

@ -41,6 +41,6 @@ public class LogMessageConstant {
/** 背景颜色:黄色 */ /** 背景颜色:黄色 */
public final static String BACKGROUND_YELLOW = "\u001B[43m"; public final static String BACKGROUND_YELLOW = "\u001B[43m";
/** 索引路径 */ /** 索引路径 */
public final static String INDEX_DIR = "D:\\lucene\\index"; public final static String INDEX_DIR = "E:\\lucene\\index";
} }

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/dao/MonthlyWorkOrderVo.java

@ -0,0 +1,17 @@
package org.nl.wms.cockpit.service.dao;
import lombok.Data;
/**
* @Author: lyd
* @Description:
* @Date: 2023/11/30
*/
@Data
public class MonthlyWorkOrderVo {
private String name;
private Long order_num;
private Long guada_num;
private Long residue_num; // 剩余
}

18
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java

@ -3,10 +3,7 @@ package org.nl.wms.cockpit.service.impl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.config.thread.ThreadPoolExecutorUtil; import org.nl.config.thread.ThreadPoolExecutorUtil;
import org.nl.wms.cockpit.service.CockpitService; import org.nl.wms.cockpit.service.CockpitService;
import org.nl.wms.cockpit.service.dao.PersonnelMonthlyProductionVo; import org.nl.wms.cockpit.service.dao.*;
import org.nl.wms.cockpit.service.dao.PressProductHeaderVo;
import org.nl.wms.cockpit.service.dao.ProductTaskVo;
import org.nl.wms.cockpit.service.dao.ShiftProductionVo;
import org.nl.wms.cockpit.service.mapper.CockPitMapper; import org.nl.wms.cockpit.service.mapper.CockPitMapper;
import org.nl.wms.util.CommonUtils; import org.nl.wms.util.CommonUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -73,12 +70,23 @@ public class CockpitServiceImpl implements CockpitService {
map.put("ProductionTask", null); map.put("ProductionTask", null);
return null; return null;
}); });
// 5、当月工单
CompletableFuture<List<MonthlyWorkOrderVo>> monthlyWorkOrderFuture = CompletableFuture.supplyAsync(
() -> cockPitMapper.getMonthlyWorkOrderFutureList(), pool);
monthlyWorkOrderFuture.thenAccept(result -> {
map.put("MonthlyWorkOrder", result);
}).exceptionally((e) -> {
log.error("当月工单: {}", e.getMessage(), e);
map.put("MonthlyWorkOrder", null);
return null;
});
// 提交 // 提交
CompletableFuture<Void> allQuery = CompletableFuture.allOf( CompletableFuture<Void> allQuery = CompletableFuture.allOf(
listCompletableFuture, listCompletableFuture,
listShiftProductionFuture, listShiftProductionFuture,
listPersonnelMonthlyProductionFuture, listPersonnelMonthlyProductionFuture,
listProductionTaskFuture); listProductionTaskFuture,
monthlyWorkOrderFuture);
CompletableFuture<ConcurrentHashMap<String, Object>> future CompletableFuture<ConcurrentHashMap<String, Object>> future
= allQuery.thenApply((result) -> map).exceptionally((e) -> { = allQuery.thenApply((result) -> map).exceptionally((e) -> {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.java

@ -1,9 +1,7 @@
package org.nl.wms.cockpit.service.mapper; package org.nl.wms.cockpit.service.mapper;
import org.nl.wms.cockpit.service.dao.PersonnelMonthlyProductionVo; import com.baomidou.dynamic.datasource.annotation.DS;
import org.nl.wms.cockpit.service.dao.PressProductHeaderVo; import org.nl.wms.cockpit.service.dao.*;
import org.nl.wms.cockpit.service.dao.ProductTaskVo;
import org.nl.wms.cockpit.service.dao.ShiftProductionVo;
import java.util.List; import java.util.List;
@ -25,4 +23,7 @@ public interface CockPitMapper {
List<PersonnelMonthlyProductionVo> getPersonnelMonthlyProductionList(String dayShift); List<PersonnelMonthlyProductionVo> getPersonnelMonthlyProductionList(String dayShift);
List<ProductTaskVo> getProductionTaskList(); List<ProductTaskVo> getProductionTaskList();
@DS("oracle")
List<MonthlyWorkOrderVo> getMonthlyWorkOrderFutureList();
} }

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.xml

@ -67,4 +67,13 @@
WHERE w.region_code = 'YZ' WHERE w.region_code = 'YZ'
ORDER BY w.team DESC, w.workorder_status ORDER BY w.team DESC, w.workorder_status
</select> </select>
<select id="getMonthlyWorkOrderFutureList" resultType="org.nl.wms.cockpit.service.dao.MonthlyWorkOrderVo">
SELECT FMATSPEC AS name
, FORDER_SUBNUM AS order_num
, GUADANSUM AS guada_num
, (FORDER_SUBNUM - GUADANSUM) AS residue_num
FROM "RTMG"."VIEW_POP_ORDER_SEMINPRO_LMS"
WHERE TO_DATE(FPLANSTART_DATE, 'YYYYMMDD') <![CDATA[ >= ]]> TRUNC(SYSDATE, 'MONTH')
AND TO_DATE(FPLANSTART_DATE, 'YYYYMMDD') <![CDATA[ < ]]> ADD_MONTHS(TRUNC(SYSDATE, 'MONTH'), 1);
</select>
</mapper> </mapper>

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/controller/MdBaseClassstandardController.java

@ -89,5 +89,12 @@ public class MdBaseClassstandardController {
ArrayList<MdBaseClassstandard> list = mdBaseClassstandardService.getSuperior(classstandard, new ArrayList<>()); ArrayList<MdBaseClassstandard> list = mdBaseClassstandardService.getSuperior(classstandard, new ArrayList<>());
return new ResponseEntity<>(mdBaseClassstandardService.buildTree(list), HttpStatus.OK); return new ResponseEntity<>(mdBaseClassstandardService.buildTree(list), HttpStatus.OK);
} }
@PostMapping("/getClassByCode")
@Log("根据编码获取分类名称下拉框")
@ApiOperation("根据编码获取分类名称下拉框")
public ResponseEntity<Object> getClassByCode(@RequestBody String code) {
return new ResponseEntity<>(mdBaseClassstandardService.getClassByCode(code), HttpStatus.OK);
}
} }

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/IMdBaseClassstandardService.java

@ -69,4 +69,6 @@ public interface IMdBaseClassstandardService extends IService<MdBaseClassstandar
* @return * @return
*/ */
List<MdBaseClassstandard> buildTree(ArrayList<MdBaseClassstandard> list); List<MdBaseClassstandard> buildTree(ArrayList<MdBaseClassstandard> list);
List<MdBaseClassstandard> getClassByCode(String code);
} }

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/impl/MdBaseClassstandardServiceImpl.java

@ -63,6 +63,7 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
MdBaseClassstandard mdBaseClassstandard = mdBaseClassstandardMapper MdBaseClassstandard mdBaseClassstandard = mdBaseClassstandardMapper
.selectOne(new LambdaQueryWrapper<MdBaseClassstandard>() .selectOne(new LambdaQueryWrapper<MdBaseClassstandard>()
.eq(MdBaseClassstandard::getClass_code, entity.getClass_code()) .eq(MdBaseClassstandard::getClass_code, entity.getClass_code())
.eq(MdBaseClassstandard::getParent_class_id, entity.getParent_class_id())
.eq(MdBaseClassstandard::getIs_delete, false)); .eq(MdBaseClassstandard::getIs_delete, false));
if (ObjectUtil.isNotEmpty(mdBaseClassstandard) && !mdBaseClassstandard.getClass_id().equals(entity.getClass_id())) { if (ObjectUtil.isNotEmpty(mdBaseClassstandard) && !mdBaseClassstandard.getClass_id().equals(entity.getClass_id())) {
throw new BadRequestException("存在相同的基础类别编号"); throw new BadRequestException("存在相同的基础类别编号");
@ -245,4 +246,18 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
return trees; return trees;
} }
@Override
public List<MdBaseClassstandard> getClassByCode(String code) {
// 获取父类
MdBaseClassstandard fpType = mdBaseClassstandardMapper.selectOne(new LambdaQueryWrapper<MdBaseClassstandard>()
.eq(MdBaseClassstandard::getClass_code, "fp_type")
.eq(MdBaseClassstandard::getParent_class_id, "0"));
MdBaseClassstandard parentClass = mdBaseClassstandardMapper.selectOne(new LambdaQueryWrapper<MdBaseClassstandard>()
.eq(MdBaseClassstandard::getClass_code, code)
.eq(MdBaseClassstandard::getParent_class_id, fpType.getClass_id()));
return mdBaseClassstandardMapper.selectList(new LambdaQueryWrapper<MdBaseClassstandard>()
.eq(MdBaseClassstandard::getParent_class_id, parentClass.getClass_id())
.eq(MdBaseClassstandard::getIs_delete, false));
}
} }

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -517,10 +517,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
mesPackDto.setBATCHNO(ObjectUtil.isNotEmpty(groupInfo.getPcsn()) ? groupInfo.getPcsn() mesPackDto.setBATCHNO(ObjectUtil.isNotEmpty(groupInfo.getPcsn()) ? groupInfo.getPcsn()
: DateUtil.format(DateUtil.date(), "yyyyMMdd")); : DateUtil.format(DateUtil.date(), "yyyyMMdd"));
mesPackDto.setTRAY_NO(groupInfo.getVehicle_code()); mesPackDto.setTRAY_NO(groupInfo.getVehicle_code());
mesPackDto.setPRO_NUM(BigDecimal.valueOf(groupInfo.getMaterial_qty())); mesPackDto.setPRO_NUM(multiply);
mesPackDto.setPRO_UNIT(""); mesPackDto.setPRO_UNIT("");
mesPackDto.setPRO_SUBNUM(multiply); mesPackDto.setPRO_SUBNUM(BigDecimal.valueOf(groupInfo.getMaterial_qty()));
mesPackDto.setPRO_SUBUNIT(""); mesPackDto.setPRO_SUBUNIT("");
mesPackDto.setMATERIAL_ID(groupInfo.getMaterial_id()); mesPackDto.setMATERIAL_ID(groupInfo.getMaterial_id());
mesPackDto.setMATERIAL_NAME(baseMaterial.getMaterial_name()); mesPackDto.setMATERIAL_NAME(baseMaterial.getMaterial_name());
mesPackDto.setPROSPEC(baseMaterial.getMaterial_spec()); mesPackDto.setPROSPEC(baseMaterial.getMaterial_spec());
@ -749,7 +749,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
throw new BadRequestException("入窑失败:载具[" + baseRequest.getVehicle_code() + "]组盘信息不存在!"); throw new BadRequestException("入窑失败:载具[" + baseRequest.getVehicle_code() + "]组盘信息不存在!");
} }
// 记录入窑数据给MES // 记录入窑数据给MES
wmsToMesService.reportGdyMaterialInfoIn(groupInfo.getGroup_id());
groupInfo.setInto_kiln_time(DateUtil.now()); groupInfo.setInto_kiln_time(DateUtil.now());
if (ObjectUtil.isNotEmpty(basePoint)) { if (ObjectUtil.isNotEmpty(basePoint)) {
// 记录当前位置 // 记录当前位置
@ -759,6 +758,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
TaskUtils.setGroupUpdateByAcs(groupInfo); TaskUtils.setGroupUpdateByAcs(groupInfo);
vehiclematerialgroupService.updateById(groupInfo); vehiclematerialgroupService.updateById(groupInfo);
wmsToMesService.reportGdyMaterialInfoIn(groupInfo);
// 插入生产过程跟踪表 // 插入生产过程跟踪表
PdmBdProductionProcessTracking processTracking = new PdmBdProductionProcessTracking(); PdmBdProductionProcessTracking processTracking = new PdmBdProductionProcessTracking();
processTracking.setBuss_move_id(groupInfo.getBuss_move_id()); processTracking.setBuss_move_id(groupInfo.getBuss_move_id());

48
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/controller/WmsToMesController.java

@ -0,0 +1,48 @@
package org.nl.wms.ext.mes.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.database.classification.service.dao.MdBaseClassstandard;
import org.nl.wms.ext.mes.service.WmsToMesService;
import org.nl.wms.ext.mes.service.dto.ScrapDto;
import org.nl.wms.ext.mes.service.dto.ScrapQuery;
import org.nl.wms.pdm.workorder.service.dto.PdmBdWorkorderQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @Author: lyd
* @Description: 直接与mes交互的功能 - 工序判废
* @Date: 2023/11/29
*/
@RestController
@Api(tags = "mes请求lms")
@RequestMapping("/api/mes")
@Slf4j
public class WmsToMesController {
@Autowired
private WmsToMesService wmsToMesService;
@GetMapping("/mesScrapInfo")
@Log("查询工序报废信息")
@ApiOperation("查询工序报废信息")
public ResponseEntity<Object> queryMesScrapInfo(ScrapQuery query, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(wmsToMesService.queryMesScrapInfo(query,page)), HttpStatus.OK);
}
@PostMapping("/addScrap")
@Log("新增工序报废")
@ApiOperation("新增工序报废")
//@SaCheckPermission("@el.check('mdBaseClassstandard:add')")
public ResponseEntity<Object> addScrap(@Validated @RequestBody ScrapDto entity){
wmsToMesService.addScrap(entity);
return new ResponseEntity<>(HttpStatus.CREATED);
}
}

16
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java

@ -1,9 +1,11 @@
package org.nl.wms.ext.mes.service; package org.nl.wms.ext.mes.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.database.brick.service.dao.MdBaseBrickInfo; import org.nl.wms.database.brick.service.dao.MdBaseBrickInfo;
import org.nl.wms.ext.mes.service.dto.*; import org.nl.wms.ext.mes.service.dto.*;
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
import java.util.List; import java.util.List;
@ -46,9 +48,9 @@ public interface WmsToMesService {
/** /**
* wms上报入窑记录信息 * wms上报入窑记录信息
* @param groupId * @param group
*/ */
void reportGdyMaterialInfoIn(String groupId); void reportGdyMaterialInfoIn(SchBaseVehiclematerialgroup group);
/** /**
* wms上报出窑数据 * wms上报出窑数据
@ -146,4 +148,14 @@ public interface WmsToMesService {
* @param mesPackDto * @param mesPackDto
*/ */
void reportPackInfo(MesPackDto mesPackDto); void reportPackInfo(MesPackDto mesPackDto);
/**
* 分页获取上报给mes的工序判废信息
* @param query
* @param page
* @return
*/
IPage<SemiProductGXPFDo> queryMesScrapInfo(ScrapQuery query, PageQuery page);
void addScrap(ScrapDto entity);
} }

13
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java

@ -79,4 +79,17 @@ public interface MesRequestMapper {
void reportSpreaderInfoToMes(SpreaderDto spreaderDto); void reportSpreaderInfoToMes(SpreaderDto spreaderDto);
@DS("oracle") @DS("oracle")
void reportPackInfo(MesPackDto mesPackDto); void reportPackInfo(MesPackDto mesPackDto);
/**
* 无参分页 - 自写
* @param currentPage
* @param currentSize
* @return
*/
@DS("oracle")
List<SemiProductGXPFDo> selectMesScrapInfo(int currentPage, int currentSize);
@DS("oracle")
int getSemiProductGXPFTotal();
@DS("oracle")
void reportSemiProductGXPF(SemiProductGXPFDo semiProductGXPFDo);
} }

36
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml

@ -23,23 +23,23 @@
</insert> </insert>
<insert id="insertSemiProductOutInfo" parameterType="org.nl.wms.ext.mes.service.dto.MesSemiProductionInfoOutDto"> <insert id="insertSemiProductOutInfo" parameterType="org.nl.wms.ext.mes.service.dto.MesSemiProductionInfoOutDto">
INSERT INTO "LMSTELCOM"."RECEIVE_CS_SEMIPROINFO_OUT"(MSGID, SEMIPRODUCT_BATCHNO, PRODUCT_BATCHNO, FPRODUCT_MATERIAL_ID INSERT INTO "LMSTELCOM"."RECEIVE_CS_SEMIPROINFO_OUT"(MSGID, SEMIPRODUCT_BATCHNO, PRODUCT_BATCHNO, FPRODUCT_MATERIAL_ID
, FPRODUCT_MATERIAL_NAME, FMATSPEC, FMATMODEL, PRO_NUM, PRO_UNIT, STOCK, STOCK_NAME, CHECKEROUT_TIM, OUTTYPE , FPRODUCT_MATERIAL_NAME, FMATSPEC, FMATMODEL, PRO_SUBNUM, PRO_SUBUNIT, STOCK, STOCK_NAME, CHECKEROUT_TIM, OUTTYPE
, CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{SEMIPRODUCT_BATCHNO}, #{PRODUCT_BATCHNO}, #{FPRODUCT_MATERIAL_ID} , CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{SEMIPRODUCT_BATCHNO}, #{PRODUCT_BATCHNO}, #{FPRODUCT_MATERIAL_ID}
, #{FPRODUCT_MATERIAL_NAME}, #{FMATSPEC}, #{FMATMODEL}, #{PRO_NUM}, #{PRO_UNIT}, #{STOCK}, #{STOCK_NAME} , #{FPRODUCT_MATERIAL_NAME}, #{FMATSPEC}, #{FMATMODEL}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{STOCK}, #{STOCK_NAME}
, #{CHECKEROUT_TIM}, #{OUTTYPE}, #{CREATE_TM}, #{OP_FLAG}) , #{CHECKEROUT_TIM}, #{OUTTYPE}, #{CREATE_TM}, #{OP_FLAG})
</insert> </insert>
<insert id="insertGdyMaterialIn" parameterType="org.nl.wms.ext.mes.service.dto.MesGdyMaterialInDto"> <insert id="insertGdyMaterialIn" parameterType="org.nl.wms.ext.mes.service.dto.MesGdyMaterialInDto">
INSERT INTO "LMSTELCOM"."RECEIVE_GDY_MATIN"(MSGID, TRAY_NO, FPRODUCT_MATERIAL_ID, FPRODUCT_MATERIAL_NAME INSERT INTO "LMSTELCOM"."RECEIVE_GDY_MATIN"(MSGID, TRAY_NO, FPRODUCT_MATERIAL_ID, FPRODUCT_MATERIAL_NAME
, FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, PRO_NUM, PRO_UNIT, FCONVERTRATE, STOCK, DEVICE, IN_DATE , FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, PRO_SUBNUM, PRO_SUBUNIT, FCONVERTRATE, STOCK, DEVICE, IN_DATE
, CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{TRAY_NO}, #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME} , CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{TRAY_NO}, #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME}
, #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_NUM}, #{PRO_UNIT}, #{FCONVERTRATE} , #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{FCONVERTRATE}
, #{STOCK}, #{DEVICE}, #{IN_DATE}, #{CREATE_TM}, #{OP_FLAG}) , #{STOCK}, #{DEVICE}, #{IN_DATE}, #{CREATE_TM}, #{OP_FLAG})
</insert> </insert>
<insert id="insertGdyMaterialOut" parameterType="org.nl.wms.ext.mes.service.dto.MesGdyMaterialOutDto"> <insert id="insertGdyMaterialOut" parameterType="org.nl.wms.ext.mes.service.dto.MesGdyMaterialOutDto">
INSERT INTO "LMSTELCOM"."RECEIVE_GDY_MATOUT"(MSGID, TRAY_NO, FPRODUCT_MATERIAL_ID, FPRODUCT_MATERIAL_NAME INSERT INTO "LMSTELCOM"."RECEIVE_GDY_MATOUT"(MSGID, TRAY_NO, FPRODUCT_MATERIAL_ID, FPRODUCT_MATERIAL_NAME
, FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, PRO_NUM, PRO_UNIT, FCONVERTRATE, STOCK, DEVICE, OUT_DATE , FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, PRO_SUBNUM, PRO_SUBUNIT, FCONVERTRATE, STOCK, DEVICE, OUT_DATE
, CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{TRAY_NO}, #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME} , CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{TRAY_NO}, #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME}
, #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_NUM}, #{PRO_UNIT}, #{FCONVERTRATE} , #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{FCONVERTRATE}
, #{STOCK}, #{DEVICE}, #{OUT_DATE}, #{CREATE_TM}, #{OP_FLAG}) , #{STOCK}, #{DEVICE}, #{OUT_DATE}, #{CREATE_TM}, #{OP_FLAG})
</insert> </insert>
<insert id="saveSemiProductionBatchToMes" parameterType="org.nl.wms.ext.mes.service.dto.MesSemiProductionInfo"> <insert id="saveSemiProductionBatchToMes" parameterType="org.nl.wms.ext.mes.service.dto.MesSemiProductionInfo">
@ -103,6 +103,13 @@
VALUES (#{MSGID}, #{BATCHNO}, #{TRAY_NO}, #{PRO_NUM}, #{PRO_UNIT}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{MATERIAL_ID} VALUES (#{MSGID}, #{BATCHNO}, #{TRAY_NO}, #{PRO_NUM}, #{PRO_UNIT}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{MATERIAL_ID}
, #{MATERIAL_NAME}, #{PROSPEC}, #{PROMODEL}, #{CHECKERIN_TIM}, #{ORDER_NO}) , #{MATERIAL_NAME}, #{PROSPEC}, #{PROMODEL}, #{CHECKERIN_TIM}, #{ORDER_NO})
</insert> </insert>
<insert id="reportSemiProductGXPF" parameterType="org.nl.wms.ext.mes.service.dto.SemiProductGXPFDo">
INSERT INTO "LMSTELCOM"."RECEIVE_R_SEMIPRODUCT_GXPF"(MSGID, FORDER_NO, BATCHNO, DEVICE, FTEAM, PRODATE, WORKUNIT
, FP_NUM, FP_UNIT, FP_SUBNUM, FP_SUBUNIT, FP_REASON, FP_REMARK, IFJJ, EDTPFJJ_PROMATNO, CHECKERIN, CHECKERIN_TIM
, CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{FORDER_NO}, #{BATCHNO}, #{DEVICE}, #{FTEAM}, #{PRODATE}, #{WORKUNIT}
, #{FP_NUM}, #{FP_UNIT}, #{FP_SUBNUM}, #{FP_SUBUNIT}, #{FP_REASON}, #{FP_REMARK}, #{IFJJ}, #{EDTPFJJ_PROMATNO}
, #{CHECKERIN}, #{CHECKERIN_TIM}, #{CREATE_TM}, #{OP_FLAG})
</insert>
<update id="updateWorkOrderRead" parameterType="java.util.List"> <update id="updateWorkOrderRead" parameterType="java.util.List">
UPDATE "LMSTELCOM"."SEND_POP_SCHEDULE_PRESS" UPDATE "LMSTELCOM"."SEND_POP_SCHEDULE_PRESS"
SET OP_FLAG = '1' SET OP_FLAG = '1'
@ -258,7 +265,7 @@
LEFT JOIN sch_base_point p ON p.point_code = vg.source_vehicle_code LEFT JOIN sch_base_point p ON p.point_code = vg.source_vehicle_code
LEFT JOIN sch_base_point p2 ON p.parent_point_code = p2.point_code LEFT JOIN sch_base_point p2 ON p.parent_point_code = p2.point_code
WHERE WHERE
vg.point_code IN ( 'HCSSX01', 'HCSSX63' ) vg.point_code IN ( 'HCSSX01', 'HCSSX63' ) AND vg.group_bind_material_status = '2'
AND pw.workorder_code IS NOT NULL AND pw.workorder_code IS NOT NULL
</select> </select>
<select id="getAllShelfInfos" resultType="org.nl.wms.ext.mes.service.dto.MesShelfInfo"> <select id="getAllShelfInfos" resultType="org.nl.wms.ext.mes.service.dto.MesShelfInfo">
@ -347,4 +354,19 @@
FROM "RTMG"."VIEW_CUSTER_LMS" FROM "RTMG"."VIEW_CUSTER_LMS"
WHERE CUSTER_NAME = #{custerName} WHERE CUSTER_NAME = #{custerName}
</select> </select>
<select id="selectMesScrapInfo" resultType="org.nl.wms.ext.mes.service.dto.SemiProductGXPFDo">
SELECT
*
FROM
"LMSTELCOM"."RECEIVE_R_SEMIPRODUCT_GXPF"
WHERE
ROWNUM <![CDATA[ >= ]]> #{currentPage}
AND ROWNUM <![CDATA[ <= ]]> #{currentSize}
</select>
<select id="getSemiProductGXPFTotal" resultType="java.lang.Integer">
SELECT
COUNT( * ) AS total_count
FROM
"LMSTELCOM"."RECEIVE_R_SEMIPRODUCT_GXPF"
</select>
</mapper> </mapper>

23
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapDto.java

@ -0,0 +1,23 @@
package org.nl.wms.ext.mes.service.dto;
import lombok.Data;
/**
* @Author: lyd
* @Description:
* @Date: 2023/11/29
*/
@Data
public class ScrapDto {
private String process;
private String region_code;
private String point_code;
private String fp_weight;
private String fp_number;
private String vehicle_code;
private String fp_remark;
private String pf_name;
private String jj_material;
private String fp_big_type;
private String is_jj;
}

14
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapQuery.java

@ -0,0 +1,14 @@
package org.nl.wms.ext.mes.service.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: lyd
* @Description:
* @Date: 2023/11/29
*/
@Data
public class ScrapQuery implements Serializable {
}

53
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SemiProductGXPFDo.java

@ -0,0 +1,53 @@
package org.nl.wms.ext.mes.service.dto;
import lombok.Data;
/**
* @Author: lyd
* @Description:
* @Date: 2023/11/29
* 唯一标识
* 订单号
* 半成品批次号
* 设备
* 工序(H01:RH砖原料仓储H02:RH砖配料H03:RH砖成型H04:RH砖热处理H05:RH砖包装H06:RH砖入库)
* 班组(大夜班小夜班白班
* 废品重量
* 重量单位
* 废品数量
* 数量单位
* 废品大类
* 废品备注
* 是否降级是1否0
* 降级后物料编码
* 判废人
* 判废日期
* 生产日期
* 写入时间
* 读取标志,0未读取1已读取
* 读取时间
*/
@Data
public class SemiProductGXPFDo {
private String MSGID;
private String FORDER_NO;
private String BATCHNO;
private String DEVICE;
private String WORKUNIT;
private String FTEAM;
private String FP_NUM;
private String FP_UNIT;
private String FP_SUBNUM;
private String FP_SUBUNIT;
private String FP_REASON;
private String FP_REMARK;
private String IFJJ;
private String EDTPFJJ_PROMATNO;
private String CHECKERIN;
private String CHECKERIN_TIM;
private String PRODATE;
private String CREATE_TM;
private String OP_FLAG;
private String OP_TM;
}

81
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java

@ -4,8 +4,12 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.system.service.notice.ISysNoticeService; import org.nl.system.service.notice.ISysNoticeService;
import org.nl.wms.database.brick.service.dao.MdBaseBrickInfo; import org.nl.wms.database.brick.service.dao.MdBaseBrickInfo;
@ -21,6 +25,7 @@ import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.GeneralDefinition;
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum; import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum;
import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -179,7 +184,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
semiProductionInfoInDto.setFMATSPEC(mesWorkOrderDto.getFMATSPEC()); semiProductionInfoInDto.setFMATSPEC(mesWorkOrderDto.getFMATSPEC());
semiProductionInfoInDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); semiProductionInfoInDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL());
semiProductionInfoInDto.setBATCHNO(mesWorkOrderDto.getBATCHNO()); semiProductionInfoInDto.setBATCHNO(mesWorkOrderDto.getBATCHNO());
semiProductionInfoInDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT());
semiProductionInfoInDto.setFTEAM(workorder.getTeam()); semiProductionInfoInDto.setFTEAM(workorder.getTeam());
semiProductionInfoInDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); semiProductionInfoInDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code());
semiProductionInfoInDto.setPRO_SUBNUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty()));// 数量 semiProductionInfoInDto.setPRO_SUBNUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty()));// 数量
@ -223,8 +227,8 @@ public class WmsToMesServiceImpl implements WmsToMesService {
semiProductionInfoOutDto.setFPRODUCT_MATERIAL_NAME(mesWorkOrderDto.getFPRODUCT_MATERIAL_NAME()); semiProductionInfoOutDto.setFPRODUCT_MATERIAL_NAME(mesWorkOrderDto.getFPRODUCT_MATERIAL_NAME());
semiProductionInfoOutDto.setFMATSPEC(mesWorkOrderDto.getFMATSPEC()); semiProductionInfoOutDto.setFMATSPEC(mesWorkOrderDto.getFMATSPEC());
semiProductionInfoOutDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); semiProductionInfoOutDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL());
semiProductionInfoOutDto.setPRO_NUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty())); semiProductionInfoOutDto.setPRO_SUBNUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty()));
semiProductionInfoOutDto.setPRO_UNIT("块"); semiProductionInfoOutDto.setPRO_SUBUNIT("块");
semiProductionInfoOutDto.setSTOCK("未知"); semiProductionInfoOutDto.setSTOCK("未知");
semiProductionInfoOutDto.setSTOCK_NAME("未知"); semiProductionInfoOutDto.setSTOCK_NAME("未知");
semiProductionInfoOutDto.setCHECKEROUT_TIM(vehiclematerialgroup.getUpdate_time()); semiProductionInfoOutDto.setCHECKEROUT_TIM(vehiclematerialgroup.getUpdate_time());
@ -246,9 +250,9 @@ public class WmsToMesServiceImpl implements WmsToMesService {
@Override @Override
@Async @Async
public void reportGdyMaterialInfoIn(String groupId) { public void reportGdyMaterialInfoIn(SchBaseVehiclematerialgroup vehiclematerialgroup) {
// 获取组盘信息 // 获取组盘信息
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); // SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId);
String workorderCode = vehiclematerialgroup.getWorkorder_code(); String workorderCode = vehiclematerialgroup.getWorkorder_code();
// 获取工单 // 获取工单
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode);
@ -263,8 +267,8 @@ public class WmsToMesServiceImpl implements WmsToMesService {
gdyMaterialInDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); gdyMaterialInDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL());
gdyMaterialInDto.setBATCHNO(mesWorkOrderDto.getBATCHNO()); gdyMaterialInDto.setBATCHNO(mesWorkOrderDto.getBATCHNO());
gdyMaterialInDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT()); gdyMaterialInDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT());
gdyMaterialInDto.setPRO_NUM(String.valueOf(vehiclematerialgroup.getMaterial_qty())); gdyMaterialInDto.setPRO_SUBNUM(String.valueOf(vehiclematerialgroup.getMaterial_qty()));
gdyMaterialInDto.setPRO_UNIT("块"); gdyMaterialInDto.setPRO_SUBUNIT("块");
gdyMaterialInDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE()); gdyMaterialInDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE());
gdyMaterialInDto.setSTOCK("未知"); gdyMaterialInDto.setSTOCK("未知");
gdyMaterialInDto.setDEVICE(GeneralDefinition.YES); gdyMaterialInDto.setDEVICE(GeneralDefinition.YES);
@ -305,8 +309,8 @@ public class WmsToMesServiceImpl implements WmsToMesService {
gdyMaterialOutDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); // 型号,mes给的工单都有 gdyMaterialOutDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); // 型号,mes给的工单都有
gdyMaterialOutDto.setBATCHNO(mesWorkOrderDto.getBATCHNO()); gdyMaterialOutDto.setBATCHNO(mesWorkOrderDto.getBATCHNO());
gdyMaterialOutDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT()); gdyMaterialOutDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT());
gdyMaterialOutDto.setPRO_NUM(String.valueOf(vehiclematerialgroup.getMaterial_qty())); gdyMaterialOutDto.setPRO_SUBNUM(String.valueOf(vehiclematerialgroup.getMaterial_qty()));
gdyMaterialOutDto.setPRO_UNIT("块"); gdyMaterialOutDto.setPRO_SUBUNIT("块");
gdyMaterialOutDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE()); gdyMaterialOutDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE());
gdyMaterialOutDto.setSTOCK("未知"); gdyMaterialOutDto.setSTOCK("未知");
gdyMaterialOutDto.setDEVICE("1"); gdyMaterialOutDto.setDEVICE("1");
@ -449,6 +453,65 @@ public class WmsToMesServiceImpl implements WmsToMesService {
mesRequestMapper.reportPackInfo(mesPackDto); mesRequestMapper.reportPackInfo(mesPackDto);
} }
@Override
public IPage<SemiProductGXPFDo> queryMesScrapInfo(ScrapQuery query, PageQuery pageQuery) {
Integer page = pageQuery.getPage();
Integer size = pageQuery.getSize();
IPage<SemiProductGXPFDo> pages = new Page<>(page, size);
int currentPage = page * size + 1; // start
int currentSize = (pageQuery.getPage() + 1) * size; // end
List<SemiProductGXPFDo> mesScrapInfoList = mesRequestMapper.selectMesScrapInfo(currentPage, currentSize);
pages.setRecords(mesScrapInfoList);
int total = mesRequestMapper.getSemiProductGXPFTotal();
pages.setTotal(total);
return pages;
}
@Override
public void addScrap(ScrapDto entity) {
SemiProductGXPFDo semiProductGXPFDo = new SemiProductGXPFDo();
MesWorkOrderDto mesWorkOrderDto = null;
if (ObjectUtil.isNotEmpty(entity.getPoint_code())) {
// 设备为准
PdmBdWorkorder deviceProductionTask = pdmBdWorkorderService.getDeviceProductionTask(entity.getPoint_code());
if (ObjectUtil.isEmpty(deviceProductionTask)) {
throw new BadRequestException("设备[" + entity.getPoint_code() + "]不存在!");
}
String extData = deviceProductionTask.getExt_data();
mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
} else {
if (ObjectUtil.isEmpty(entity.getVehicle_code())) {
throw new BadRequestException("载具编码与设备必须选择一个");
}
SchBaseVehiclematerialgroup gtp = vehiclematerialgroupService.getGroupInfo(entity.getVehicle_code(), "GTP", GroupBindMaterialStatusEnum.BOUND.getValue());
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(gtp.getWorkorder_code());
mesWorkOrderDto = JSON.parseObject(workorder.getExt_data(), MesWorkOrderDto.class);
}
semiProductGXPFDo.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
semiProductGXPFDo.setFORDER_NO(mesWorkOrderDto.getFORDER_NO());
semiProductGXPFDo.setBATCHNO(mesWorkOrderDto.getBATCHNO());
semiProductGXPFDo.setDEVICE(mesWorkOrderDto.getPRESSUNIT());
semiProductGXPFDo.setFTEAM(mesWorkOrderDto.getFTEAM());
semiProductGXPFDo.setPRODATE(mesWorkOrderDto.getFPRODUCT_DATE());
semiProductGXPFDo.setWORKUNIT(entity.getProcess());
semiProductGXPFDo.setFP_NUM(entity.getFp_weight());
semiProductGXPFDo.setFP_UNIT("千克");
semiProductGXPFDo.setFP_SUBNUM(entity.getFp_number());
semiProductGXPFDo.setFP_SUBUNIT("块");
semiProductGXPFDo.setFP_REASON(entity.getFp_big_type());
semiProductGXPFDo.setFP_REMARK(entity.getFp_remark());
semiProductGXPFDo.setIFJJ(entity.getIs_jj());
semiProductGXPFDo.setEDTPFJJ_PROMATNO(entity.getJj_material());
semiProductGXPFDo.setCHECKERIN(entity.getPf_name());
semiProductGXPFDo.setCHECKERIN_TIM(DateUtil.now());
semiProductGXPFDo.setCREATE_TM(DateUtil.now());
semiProductGXPFDo.setOP_FLAG(GeneralDefinition.NO);
if (entity.getIs_jj().equals(GeneralDefinition.NO)) {
semiProductGXPFDo.setEDTPFJJ_PROMATNO("-");
}
mesRequestMapper.reportSemiProductGXPF(semiProductGXPFDo);
}
/** /**
* 转换 * 转换
* *

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java

@ -256,8 +256,8 @@ public class PdaController {
} }
@PostMapping("/shelf/updateData") @PostMapping("/shelf/updateData")
@Log("货架盘点-物料查询") @Log("货架盘点-更新")
@ApiOperation("货架盘点-物料查询") @ApiOperation("货架盘点-更新")
public ResponseEntity<Object>updateData(@Validated @RequestBody ShelfSaveDto shelfSaveDto){ public ResponseEntity<Object>updateData(@Validated @RequestBody ShelfSaveDto shelfSaveDto){
return new ResponseEntity<>(pdaService.updateData(shelfSaveDto), HttpStatus.OK); return new ResponseEntity<>(pdaService.updateData(shelfSaveDto), HttpStatus.OK);
} }

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java

@ -358,6 +358,7 @@ public class PdaServiceImpl implements PdaService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public PdaResponseVo updateData(ShelfSaveDto shelfSaveDto) { public PdaResponseVo updateData(ShelfSaveDto shelfSaveDto) {
log.info("人工操作库存, {}", shelfSaveDto);
// 货位号填充HCHJ+*** // 货位号填充HCHJ+***
String pointCode = "HCHJ" + String.format("%03d", Integer.parseInt(shelfSaveDto.getPoint_code())); String pointCode = "HCHJ" + String.format("%03d", Integer.parseInt(shelfSaveDto.getPoint_code()));
// 获取点位 // 获取点位
@ -370,6 +371,7 @@ public class PdaServiceImpl implements PdaService {
if (ObjectUtil.isNotEmpty(basePoint.getVehicle_code())) { if (ObjectUtil.isNotEmpty(basePoint.getVehicle_code())) {
SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(basePoint.getVehicle_code(), SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(basePoint.getVehicle_code(),
GeneralDefinition.STEEL_TRAY, GroupBindMaterialStatusEnum.BOUND.getValue()); GeneralDefinition.STEEL_TRAY, GroupBindMaterialStatusEnum.BOUND.getValue());
log.info("解绑载具数据{}", groupInfo);
if (ObjectUtil.isNotEmpty(groupInfo)) { if (ObjectUtil.isNotEmpty(groupInfo)) {
TaskUtils.setGroupUpdateByPC(groupInfo); TaskUtils.setGroupUpdateByPC(groupInfo);
groupInfo.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); groupInfo.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());

10
lms/nladmin-ui/src/views/wms/basedata/classification/mdBaseClassstandard.js

@ -79,4 +79,12 @@ export function getClassName() {
}) })
} }
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName } export function getClassByCode(data) {
return request({
url: 'api/Classstandard/getClassByCode',
method: 'post',
data
})
}
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName, getClassByCode }

271
lms/nladmin-ui/src/views/wms/pdm/scrap/index.vue

@ -0,0 +1,271 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 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="820px"
>
<el-form
ref="form"
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
:inline="true"
:model="form"
:rules="rules"
size="mini"
label-width="135px"
label-suffix=":"
>
<el-form-item label="所属工序" prop="region_code">
<el-select
v-model="form.process"
filterable
placeholder="请选择"
style="width: 240px;"
>
<el-option
v-for="item in dict.rh_production"
:key="item.label"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="载具编码" prop="vehicle_code">
<el-input v-model="form.vehicle_code" style="width: 240px;"/>
</el-form-item>
<el-form-item label="选择区域" prop="region_code">
<el-select
v-model="form.region_code"
filterable
placeholder="请选择"
style="width: 240px;"
@change="setRegionName"
>
<el-option
v-for="item in regionList"
:key="item.region_code"
:label="item.region_code"
:value="item.region_code"
>
<span style="float: left">{{ item.region_name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.region_code }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="选择设备" prop="point_code">
<el-select
v-model="form.point_code"
filterable
placeholder="请选择"
style="width: 240px;"
>
<el-option
v-for="item in pointList"
:key="item.point_code"
:label="item.point_code"
:value="item.point_code"
>
<span style="float: left">{{ item.point_name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.point_code }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="废品重量" prop="fp_weight">
<el-input-number
v-model.number="form.fp_weight"
:min="0"
:max="999"
style="width: 240px;"
/>
</el-form-item>
<el-form-item label="废品数量" prop="fp_number">
<el-input-number
v-model.number="form.fp_number"
:min="0"
:max="999"
style="width: 240px;"
/>
</el-form-item>
<el-form-item label="是否降级" prop="is_jj">
<el-radio-group v-model="form.is_jj" style="width: 240px">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.is_jj === '1'" label="降级物料" prop="jj_material">
<el-input v-model="form.jj_material" style="width: 240px;"/>
</el-form-item>
<el-form-item label="判废人" prop="pf_name">
<el-input v-model="form.pf_name" style="width: 240px;"/>
</el-form-item>
<el-form-item label="废品大类" prop="region_code">
<el-select
v-model="form.fp_big_type"
filterable
placeholder="请选择"
style="width: 240px;"
@change="setFpTypeList"
>
<el-option
v-for="item in dict.fp_big_type"
:key="item.label"
:label="item.label"
:value="item.label"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item v-show="fpTypeList.length > 0" label="废品描述" prop="region_code">
<el-radio-group v-model="form.fp_remark" style="width: 630px;">
<el-radio
v-for="item in fpTypeList"
:key="item.class_name"
style="margin: 8px 10px"
:label="item.class_name"
>
{{ item.class_name }}
</el-radio>
</el-radio-group>
</el-form-item>
</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 type="selection" width="55" />
<el-table-column prop="forder_NO" label="订单号" :min-width="flexWidth('forder_NO',crud.data,'订单号')" />
<el-table-column prop="batchno" label="半成品批次" :min-width="flexWidth('batchno',crud.data,'半成品批次')" />
<el-table-column prop="device" label="设备" :min-width="flexWidth('device',crud.data,'设备')" />
<el-table-column prop="workunit" label="工序" :min-width="flexWidth('workunit',crud.data,'拆垛工位')" />
<el-table-column prop="fteam" label="班组" :min-width="flexWidth('fteam',crud.data,'分拣工单')" />
<el-table-column prop="fp_NUM" label="废品重量" :min-width="flexWidth('fp_NUM',crud.data,'分拣工单')" />
<el-table-column prop="fp_UNIT" label="重量单位" :min-width="flexWidth('fp_UNIT',crud.data,'分拣工单')" />
<el-table-column prop="fp_SUBNUM" label="废品数量" :min-width="flexWidth('fp_SUBNUM',crud.data,'分拣工单')" />
<el-table-column prop="fp_SUBUNIT" label="数量单位" :min-width="flexWidth('fp_SUBUNIT',crud.data,'分拣工单')" />
<el-table-column prop="fp_REASON" label="废品大类" :min-width="flexWidth('fp_REASON',crud.data,'分拣工单')" />
<el-table-column prop="fp_REMARK" label="废品描述" :min-width="flexWidth('fp_REMARK',crud.data,'分拣工单')" />
<el-table-column prop="ifjj" label="降级" :min-width="flexWidth('ifjj',crud.data,'降级')" />
<el-table-column prop="edtpfjj_PROMATNO" label="降级后物料编码" :min-width="flexWidth('edtpfjj_PROMATNO',crud.data,'降级后物料编码')" />
<el-table-column prop="checkerin" label="判废人" :min-width="flexWidth('checkerin',crud.data,'判废人')" />
<el-table-column prop="checkerin_TIM" label="判废时间" :min-width="flexWidth('checkerin_TIM',crud.data,'分拣工单')" />
<el-table-column prop="prodate" label="生产日期" :min-width="flexWidth('prodate',crud.data,'分拣工单')" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import CRUD, { crud, header, form, 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 crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
import crudParamBaseClassstandard from '@/views/wms/basedata/classification/mdBaseClassstandard'
import crudScrap from './scrap'
const defaultForm = {
process: null,
region_code: null,
point_code: null,
fp_weight: null,
fp_number: null,
vehicle_code: null,
fp_remark: null,
pf_name: null,
jj_material: null,
fp_big_type: null,
is_jj: '0'
}
export default {
name: 'Scrap',
dicts: ['rh_production', 'fp_big_type'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '工序报废',
url: 'api/mes/mesScrapInfo',
optShow: {
add: true,
edit: false,
del: false,
download: false
},
crudMethod: { ...crudScrap }
})
},
data() {
return {
permission: {
},
rules: {
},
regionList: [],
fpTypeList: [],
regionCodeParam: null,
pointList: []
}
},
created() {
this.getRegionList()
},
methods: {
// false
[CRUD.HOOK.beforeRefresh]() {
return true
},
setFpTypeList(data) {
const res = this.dict.fp_big_type.filter(item => item.label === data).map(item => item.value)
crudParamBaseClassstandard.getClassByCode(res[0]).then(res => {
this.fpTypeList = res
})
},
setRegionName(data) {
//
this.form.point_code = null
this.regionCodeParam = data
this.getPointList()
},
getRegionList() { //
const param = {
is_has_workder: true
}
crudSchBaseRegion.getRegionList(param).then(res => {
this.regionList = res
})
},
getPointList() { //
if (this.regionCodeParam) {
const param = {
region_code: this.regionCodeParam
}
crudSchBasePoint.getPointList(param).then(res => {
this.pointList = res
this.regionCodeParam = null
})
}
}
}
}
</script>
<style scoped>
</style>

10
lms/nladmin-ui/src/views/wms/pdm/scrap/scrap.js

@ -0,0 +1,10 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/mes/addScrap',
method: 'post',
data
})
}
export default { add }
Loading…
Cancel
Save