no message
parent
7c4a152594
commit
26eb6d0774
|
|
@ -104,7 +104,7 @@ public class AgvTask extends BaseEntity implements Serializable {
|
||||||
private String reqMessage;
|
private String reqMessage;
|
||||||
|
|
||||||
@Column(name = "`be_scan`")
|
@Column(name = "`be_scan`")
|
||||||
@ApiModelProperty(value = "是否扫描")
|
@ApiModelProperty(value = "是否配置任务")
|
||||||
private Integer beScan=0;
|
private Integer beScan=0;
|
||||||
|
|
||||||
@Column(name = "`line_slot_code`")
|
@Column(name = "`line_slot_code`")
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@ import lombok.Data;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import cn.hutool.core.bean.copier.CopyOptions;
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
|
import org.hibernate.annotations.NotFound;
|
||||||
|
import org.hibernate.annotations.NotFoundAction;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
|
@ -45,6 +48,7 @@ public class ItemKey extends BaseEntity implements Serializable {
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
|
@NotFound(action = NotFoundAction.IGNORE)
|
||||||
@JoinColumn(name = "`item_id`")
|
@JoinColumn(name = "`item_id`")
|
||||||
@ApiModelProperty(value = "物料序号")
|
@ApiModelProperty(value = "物料序号")
|
||||||
private Item item;
|
private Item item;
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,13 @@ public class Task extends BaseEntity implements Serializable {
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
|
@NotFound(action = NotFoundAction.IGNORE)
|
||||||
@JoinColumn(name = "`item_id`")
|
@JoinColumn(name = "`item_id`")
|
||||||
@ApiModelProperty(value = "物料序号")
|
@ApiModelProperty(value = "物料序号")
|
||||||
private Item item;
|
private Item item;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
|
@NotFound(action = NotFoundAction.IGNORE)
|
||||||
@JoinColumn(name = "`item_key_id`")
|
@JoinColumn(name = "`item_key_id`")
|
||||||
@ApiModelProperty(value = "物料属性")
|
@ApiModelProperty(value = "物料属性")
|
||||||
private ItemKey itemKey;
|
private ItemKey itemKey;
|
||||||
|
|
@ -68,9 +70,10 @@ public class Task extends BaseEntity implements Serializable {
|
||||||
@ApiModelProperty(value = "任务类型")
|
@ApiModelProperty(value = "任务类型")
|
||||||
private String taskType;
|
private String taskType;
|
||||||
|
|
||||||
@OneToOne(cascade = CascadeType.PERSIST)
|
@OneToOne
|
||||||
@JoinColumn(name = "asn_detail_id")
|
@JoinColumn(name = "asn_detail_id")
|
||||||
@ApiModelProperty(value = "收货明细序号")
|
@ApiModelProperty(value = "收货明细序号")
|
||||||
|
@NotFound(action = NotFoundAction.IGNORE)
|
||||||
private AsnDetail asnDetail;
|
private AsnDetail asnDetail;
|
||||||
|
|
||||||
@Column(name = "`move_detail_id`")
|
@Column(name = "`move_detail_id`")
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ import com.youchain.basicdata.service.PointService;
|
||||||
import com.youchain.basicdata.service.impl.BoxServiceImpl;
|
import com.youchain.basicdata.service.impl.BoxServiceImpl;
|
||||||
import com.youchain.businessdata.domain.*;
|
import com.youchain.businessdata.domain.*;
|
||||||
import com.youchain.businessdata.repository.AsnDetailRepository;
|
import com.youchain.businessdata.repository.AsnDetailRepository;
|
||||||
|
import com.youchain.businessdata.repository.PickDetailRepository;
|
||||||
import com.youchain.businessdata.repository.TaskRepository;
|
import com.youchain.businessdata.repository.TaskRepository;
|
||||||
import com.youchain.businessdata.service.*;
|
import com.youchain.businessdata.service.*;
|
||||||
import com.youchain.exception.BadRequestException;
|
import com.youchain.exception.BadRequestException;
|
||||||
|
|
@ -80,6 +81,7 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
private final PointRepository pointRepository;
|
private final PointRepository pointRepository;
|
||||||
private final StockTypeRepository stockTypeRepository;
|
private final StockTypeRepository stockTypeRepository;
|
||||||
private final AsnDetailRepository asnDetailRepository;
|
private final AsnDetailRepository asnDetailRepository;
|
||||||
|
private final PickDetailRepository pickDetailRepository;
|
||||||
private final EntityManager entityMapper;
|
private final EntityManager entityMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -570,6 +572,26 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
pointRepository.save(endPoint);
|
pointRepository.save(endPoint);
|
||||||
/* 读取RFID生成上架任务*/
|
/* 读取RFID生成上架任务*/
|
||||||
addTaskRfid(billCode);
|
addTaskRfid(billCode);
|
||||||
|
}else if (agvTask.getJobType().equals(BizStatus.PSCK)) {
|
||||||
|
if (agvTask.getBeScan()==1) {
|
||||||
|
List<PickDetail> pickDetailList = pickDetailRepository.findByPick(Long.valueOf(agvTask.getJobForce()));
|
||||||
|
/* 出库完成反馈*/
|
||||||
|
for (PickDetail pickDetail : pickDetailList) {
|
||||||
|
UrlApi.ptBackSap(pickDetail.getPick().getOwner()
|
||||||
|
, pickDetail.getPick().getRelatedBill2()
|
||||||
|
, pickDetail.getItem().getCode()
|
||||||
|
, pickDetail.getLineNo() + ""
|
||||||
|
, pickDetail.getPickedQty(), pickDetail.getPropC1()
|
||||||
|
, pickDetail.getPropC2());
|
||||||
|
}
|
||||||
|
if (agvTask.getStockTypeCode().equals("Rack_760_1200")) {
|
||||||
|
// 料箱
|
||||||
|
} else if (agvTask.getStockTypeCode().equals("Semi_finished_goods_pallet")) {
|
||||||
|
// 半成品
|
||||||
|
AgvTask agvTaskPt = addAgvTask(BizStatus.AGV_C, "BTP", null, agvTask.getEndSlotCode(), BizStatus.OPEN, BizStatus.ASN);
|
||||||
|
sendAgvTaskImpl(agvTaskPt);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (status.equals("4")) {
|
} else if (status.equals("4")) {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,9 @@ import com.youchain.businessdata.service.AgvTaskService;
|
||||||
import com.youchain.exception.BadRequestException;
|
import com.youchain.exception.BadRequestException;
|
||||||
import com.youchain.exception.handler.ApiResult;
|
import com.youchain.exception.handler.ApiResult;
|
||||||
import com.youchain.modules.system.domain.Dept;
|
import com.youchain.modules.system.domain.Dept;
|
||||||
|
import com.youchain.modules.system.domain.Dict;
|
||||||
|
import com.youchain.modules.system.repository.DictRepository;
|
||||||
|
import com.youchain.modules.system.service.DictService;
|
||||||
import com.youchain.utils.*;
|
import com.youchain.utils.*;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import com.youchain.businessdata.service.PickDetailService;
|
import com.youchain.businessdata.service.PickDetailService;
|
||||||
|
|
@ -61,6 +64,7 @@ public class PickDetailServiceImpl implements PickDetailService {
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH");
|
||||||
private final PickDetailRepository pickDetailRepository;
|
private final PickDetailRepository pickDetailRepository;
|
||||||
private final PointRepository pointRepository;
|
private final PointRepository pointRepository;
|
||||||
|
private final DictService dictService;
|
||||||
private final AgvTaskService agvTaskService;
|
private final AgvTaskService agvTaskService;
|
||||||
private final PickRepository pickRepository;
|
private final PickRepository pickRepository;
|
||||||
private final PickDetailMapper pickDetailMapper;
|
private final PickDetailMapper pickDetailMapper;
|
||||||
|
|
@ -574,6 +578,34 @@ public class PickDetailServiceImpl implements PickDetailService {
|
||||||
pickDetail.setPick(pick);
|
pickDetail.setPick(pick);
|
||||||
pickDetailRepository.save(pickDetail);
|
pickDetailRepository.save(pickDetail);
|
||||||
}
|
}
|
||||||
|
// 是否启用配置
|
||||||
|
if (dictService.getPtBatchIsEnable()){
|
||||||
|
if (pick.getBillType().getCode().equals("RM_CK")){
|
||||||
|
// 料箱
|
||||||
|
String startCode = dictService.getPtBatchYStartCode();
|
||||||
|
// 容器入场
|
||||||
|
AgvTask agvTaskRc=agvTaskService.addAgvTask(BizStatus.AGV_R,"LXZ",null,startCode,BizStatus.OPEN,BizStatus.ASN);
|
||||||
|
agvTaskService.sendAgvTaskImpl(agvTaskRc);
|
||||||
|
|
||||||
|
AgvTask agvTask = agvTaskService.addAgvTask(BizStatus.AGV,"LXZ", startCode, pick.getAddress(), BizStatus.OPEN, BizStatus.PICK);
|
||||||
|
agvTask.setJobForce(pick.getId()+"");
|
||||||
|
agvTask.setBeScan(1);
|
||||||
|
agvTaskRepository.save(agvTask);
|
||||||
|
agvTaskService.sendAgvTaskImpl(agvTask);
|
||||||
|
}else if (pick.getBillType().getCode().equals("SM_CK")){
|
||||||
|
// 半成品
|
||||||
|
String startCode = dictService.getPtBatchBStartCode();
|
||||||
|
// 容器入场
|
||||||
|
AgvTask agvTaskRc=agvTaskService.addAgvTask(BizStatus.AGV_R,"BTP",null,startCode,BizStatus.OPEN,BizStatus.ASN);
|
||||||
|
agvTaskService.sendAgvTaskImpl(agvTaskRc);
|
||||||
|
AgvTask agvTask = agvTaskService.addAgvTask(BizStatus.AGV,"BTP", startCode, pick.getAddress(), BizStatus.OPEN, BizStatus.PICK);
|
||||||
|
agvTask.setJobForce(pick.getId()+"");
|
||||||
|
agvTask.setBeScan(1);
|
||||||
|
agvTaskRepository.save(agvTask);
|
||||||
|
agvTaskService.sendAgvTaskImpl(agvTask);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ApiResult.result(201, "操作成功",null);
|
return ApiResult.result(201, "操作成功",null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package com.youchain.modules.system.repository;
|
||||||
import com.youchain.modules.system.domain.DictDetail;
|
import com.youchain.modules.system.domain.DictDetail;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -33,4 +34,6 @@ public interface DictDetailRepository extends JpaRepository<DictDetail, Long>, J
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
List<DictDetail> findByDictName(String name);
|
List<DictDetail> findByDictName(String name);
|
||||||
}
|
@Query(value = "SELECT d FROM DictDetail d where d.dict.name=?1 and d.dictSort=?2", nativeQuery = false)
|
||||||
|
List<DictDetail> findDictNameAndSort(String ptBatch, int i);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,4 +74,15 @@ public interface DictService {
|
||||||
void download(List<DictDto> queryAll, HttpServletResponse response) throws IOException;
|
void download(List<DictDto> queryAll, HttpServletResponse response) throws IOException;
|
||||||
|
|
||||||
Dict getDictDescription(String name);
|
Dict getDictDescription(String name);
|
||||||
}
|
|
||||||
|
/** 是否启用出库配置*/
|
||||||
|
boolean getPtBatchIsEnable();
|
||||||
|
/** 获取原料起点*/
|
||||||
|
String getPtBatchYStartCode();
|
||||||
|
/** 获取原料终点*/
|
||||||
|
String getPtBatchYEndCode();
|
||||||
|
/** 获取半成品起点*/
|
||||||
|
String getPtBatchBStartCode();
|
||||||
|
/** 获取半成品终点*/
|
||||||
|
String getPtBatchBEndCode();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package com.youchain.modules.system.service.impl;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.youchain.modules.system.domain.Dict;
|
import com.youchain.modules.system.domain.Dict;
|
||||||
import com.youchain.modules.system.domain.DictDetail;
|
import com.youchain.modules.system.domain.DictDetail;
|
||||||
|
import com.youchain.modules.system.repository.DictDetailRepository;
|
||||||
import com.youchain.modules.system.service.DictService;
|
import com.youchain.modules.system.service.DictService;
|
||||||
import com.youchain.modules.system.service.dto.DictDetailDto;
|
import com.youchain.modules.system.service.dto.DictDetailDto;
|
||||||
import com.youchain.modules.system.service.dto.DictDto;
|
import com.youchain.modules.system.service.dto.DictDto;
|
||||||
|
|
@ -45,6 +46,7 @@ import java.util.*;
|
||||||
public class DictServiceImpl implements DictService {
|
public class DictServiceImpl implements DictService {
|
||||||
|
|
||||||
private final DictRepository dictRepository;
|
private final DictRepository dictRepository;
|
||||||
|
private final DictDetailRepository dictDetailRepository;
|
||||||
private final DictMapper dictMapper;
|
private final DictMapper dictMapper;
|
||||||
private final RedisUtils redisUtils;
|
private final RedisUtils redisUtils;
|
||||||
|
|
||||||
|
|
@ -122,7 +124,45 @@ public class DictServiceImpl implements DictService {
|
||||||
return dictRepository.getDictDescription(name);
|
return dictRepository.getDictDescription(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getPtBatchIsEnable() {
|
||||||
|
List<DictDetail> dictDetailList = dictDetailRepository.findDictNameAndSort("pt_batch",1);
|
||||||
|
if (!dictDetailList.isEmpty()){
|
||||||
|
DictDetail dictDetail=dictDetailList.get(0);
|
||||||
|
return dictDetail.getValue().equals("1");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPtBatchYStartCode() {
|
||||||
|
List<DictDetail> dictDetailList = dictDetailRepository.findDictNameAndSort("pt_batch",2);
|
||||||
|
if (!dictDetailList.isEmpty()){
|
||||||
|
return dictDetailList.get(0).getValue();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPtBatchYEndCode() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPtBatchBStartCode() {
|
||||||
|
List<DictDetail> dictDetailList = dictDetailRepository.findDictNameAndSort("pt_batch",3);
|
||||||
|
if (!dictDetailList.isEmpty()){
|
||||||
|
return dictDetailList.get(0).getValue();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPtBatchBEndCode() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void delCaches(Dict dict){
|
public void delCaches(Dict dict){
|
||||||
redisUtils.del(CacheKey.DICT_NAME + dict.getName());
|
redisUtils.del(CacheKey.DICT_NAME + dict.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ spring:
|
||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||||
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:nrwms2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:nrwms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:123456}
|
password: ${DB_PWD:123456}
|
||||||
# password: ${DB_PWD:Youchain@56}
|
# password: ${DB_PWD:Youchain@56}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ spring:
|
||||||
freemarker:
|
freemarker:
|
||||||
check-template-location: false
|
check-template-location: false
|
||||||
profiles:
|
profiles:
|
||||||
active: dock
|
active: dev
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
data:
|
data:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue