手持提交
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package org.nl.wms.pda.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.pda.service.PdaService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 手持接口
|
||||
* @Date: 2023/8/1
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "手持接口")
|
||||
@RequestMapping("/api/pda")
|
||||
@SaIgnore
|
||||
public class PdaController {
|
||||
|
||||
private PdaService pdaService;
|
||||
|
||||
|
||||
@PostMapping("/outStruct/outSave")
|
||||
@Log("涂板线下料")
|
||||
@ApiOperation("涂板线下料")
|
||||
public ResponseEntity<Object> outSave(@RequestBody JSONObject param){
|
||||
return new ResponseEntity<>(pdaService.outSave(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/cleanVehicle")
|
||||
@Log("清空物料信息")
|
||||
@ApiOperation("清空物料信息")
|
||||
public ResponseEntity<Object> cleanVehicle(@RequestBody JSONObject param){
|
||||
return new ResponseEntity<>(pdaService.cleanVehicle(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/callingMaterialTask")
|
||||
@Log("包片机叫料")
|
||||
@ApiOperation("包片机叫料")
|
||||
public ResponseEntity<Object> callingMaterialTask(@RequestBody JSONObject param){
|
||||
return new ResponseEntity<>(pdaService.callingMaterialTask(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.wms.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/8/1
|
||||
*/
|
||||
public interface PdaService {
|
||||
PdaResponseVo outSave(JSONObject param);
|
||||
|
||||
PdaResponseVo cleanVehicle(JSONObject param);
|
||||
|
||||
PdaResponseVo callingMaterialTask(JSONObject param);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 混碾搬运参数
|
||||
* @Date: 2023/9/21
|
||||
*/
|
||||
@Data
|
||||
public class BlendingMoveDto {
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 混碾对接位
|
||||
*/
|
||||
private String start_point_code;
|
||||
/**
|
||||
* 压机号,需要自行寻找点位
|
||||
*/
|
||||
// private String end_point_code;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 通用实体
|
||||
* @Date: 2023/10/16
|
||||
*/
|
||||
@Data
|
||||
public class CommonQueryDto {
|
||||
private String material_code;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 强制静置实体
|
||||
* @Date: 2023/9/25
|
||||
*/
|
||||
@Data
|
||||
public class ForcedRestingDto {
|
||||
private Integer stand_time; // 静置时间
|
||||
private String group_id; // 组盘标识
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 人工组盘
|
||||
* @Date: 2023/9/18
|
||||
*/
|
||||
@Data
|
||||
public class ManualGroupDto {
|
||||
private String vehicle_code;
|
||||
private String vehicle_type;
|
||||
private String point_code;
|
||||
private String order_code; // 不需要
|
||||
private BigDecimal material_weight;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 剩料回库参数
|
||||
* @Date: 2023/9/28
|
||||
*/
|
||||
@Data
|
||||
public class ManualResidueInDto {
|
||||
private String vehicle_code;
|
||||
private String qty;
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
private String surplus_quantity;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 人工排产Dto
|
||||
* @Date: 2023/9/28
|
||||
*/
|
||||
@Data
|
||||
public class ManualSortingDto {
|
||||
private String workorder_code;
|
||||
private String username; // 用户
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 压机搬运dto
|
||||
* @Date: 2023/10/16
|
||||
*/
|
||||
@Data
|
||||
public class PressMoveDto {
|
||||
/**
|
||||
* 设备编码:对接位
|
||||
*/
|
||||
private String device_code;
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private String qty;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 货架组盘信息dto
|
||||
* @Date: 2023/10/16
|
||||
*/
|
||||
@Data
|
||||
public class ShelfSaveDto {
|
||||
private String point_code;
|
||||
private String point_status;
|
||||
private String vehicle_code;
|
||||
private String material_qty;
|
||||
private String material_id;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 载具绑定
|
||||
* @Date: 2023/10/7
|
||||
*/
|
||||
@Data
|
||||
public class VehicleBindingDto {
|
||||
private String origin_vehicle_code;
|
||||
private String target_vehicle_code;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.wms.pda.service.dao.mapper;
|
||||
|
||||
import org.nl.wms.pda.service.dao.dto.CommonQueryDto;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 手持mapper接口
|
||||
* @Date: 2023/8/1
|
||||
*/
|
||||
public interface PdaMapper {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.pda.service.dao.mapper.PdaMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.pda.service.dao.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 手持返回
|
||||
* @Date: 2023/8/3
|
||||
*/
|
||||
@Data
|
||||
public class PdaResponseVo {
|
||||
// 先提供一个message
|
||||
private String message;
|
||||
|
||||
public static PdaResponseVo pdaResultOk(String message) {
|
||||
PdaResponseVo vo = new PdaResponseVo();
|
||||
vo.setMessage(message);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package org.nl.wms.pda.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.database.material.service.IMdBaseMaterialService;
|
||||
import org.nl.wms.ext.service.AcsToWmsService;
|
||||
import org.nl.wms.pda.service.PdaService;
|
||||
import org.nl.wms.pda.service.dao.mapper.PdaMapper;
|
||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
||||
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 实现类
|
||||
* @Date: 2023/8/1
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PdaServiceImpl implements PdaService {
|
||||
@Autowired
|
||||
private PdaMapper pdaMapper;
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
@Autowired
|
||||
private IMdBaseMaterialService materialService;
|
||||
@Autowired
|
||||
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
@Autowired
|
||||
private AcsToWmsService acsToWmsService;
|
||||
|
||||
@Override
|
||||
public PdaResponseVo outSave(JSONObject param) {
|
||||
param.put("device_code",param.getString("point_code"));
|
||||
if(!param.getString("point_code").startsWith("TBX")){
|
||||
throw new BadRequestException("非涂板线禁止叫料!");
|
||||
}
|
||||
param.put("request_medthod_code","MJXLTask");
|
||||
param.put("request_medthod_name","涂板线满架下料");
|
||||
acsToWmsService.acsApply(param);
|
||||
return PdaResponseVo.pdaResultOk("涂板线满架下料请求成功");
|
||||
}
|
||||
@Override
|
||||
public PdaResponseVo cleanVehicle(JSONObject param) {
|
||||
//根据载具编码寻找点位,并且将它更新掉
|
||||
String vehicleCode=param.getString("vehicle_code");
|
||||
SchBaseVehiclematerialgroup groupEntity = vehiclematerialgroupService.getOne(new LambdaQueryWrapper<SchBaseVehiclematerialgroup>()
|
||||
.eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicleCode)
|
||||
.eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status,
|
||||
GroupBindMaterialStatusEnum.BOUND.getValue()));
|
||||
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
|
||||
groupEntity.setUpdate_id(GeneralDefinition.ACS_ID);
|
||||
groupEntity.setUpdate_name(GeneralDefinition.ACS_NAME);
|
||||
groupEntity.setUpdate_time(DateUtil.now());
|
||||
vehiclematerialgroupService.save(groupEntity);
|
||||
SchBasePoint pointObj=pointService.getById(groupEntity.getPoint_code());
|
||||
if(pointObj.getVehicle_code().contains(",")){
|
||||
vehicleCode+=',';
|
||||
}
|
||||
pointObj.setVehicle_code(pointObj.getVehicle_code().replace(vehicleCode,""));
|
||||
pointObj.setVehicle_qty(pointObj.getVehicle_qty()-1);
|
||||
pointService.update(pointObj);
|
||||
//清空组盘表的信息
|
||||
return PdaResponseVo.pdaResultOk("呼叫物料请求成功");
|
||||
}
|
||||
@Override
|
||||
public PdaResponseVo callingMaterialTask(JSONObject param) {
|
||||
if(!param.getString("point_code").startsWith("BP")){
|
||||
throw new BadRequestException("非包片机禁止叫料!");
|
||||
}
|
||||
param.put("device_code",param.getString("point_code"));
|
||||
param.put("request_medthod_code","BPSLTask");
|
||||
param.put("request_medthod_name","包片上料");
|
||||
acsToWmsService.acsApply(param);
|
||||
return PdaResponseVo.pdaResultOk("呼叫物料请求成功");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user