人工入库,新增出库单表
parent
634de44a0b
commit
774009ed54
|
|
@ -29,8 +29,8 @@ import java.util.Map;
|
||||||
* @date 2023-07-26
|
* @date 2023-07-26
|
||||||
**/
|
**/
|
||||||
public interface PointRepository extends JpaRepository<Point, Long>, JpaSpecificationExecutor<Point> {
|
public interface PointRepository extends JpaRepository<Point, Long>, JpaSpecificationExecutor<Point> {
|
||||||
@Query(value = "SELECT u.id,u.code FROM base_point p WHERE p.enabled=1 and p.status='FREE'", nativeQuery = true)
|
@Query(value = "SELECT p.* FROM base_point p WHERE p.enabled=1 and p.status='FREE'", nativeQuery = true)
|
||||||
public List<Map<String, String>> getKyPointList();
|
List<Point> getKyPointList();
|
||||||
@Query(value = "SELECT p FROM Point p WHERE p.area.code=?1 and p.enabled=true and p.storageType is not null")
|
@Query(value = "SELECT p FROM Point p WHERE p.area.code=?1 and p.enabled=true and p.storageType is not null")
|
||||||
List<Point> findByAreaCode(String areaCode);
|
List<Point> findByAreaCode(String areaCode);
|
||||||
@Query(value = "SELECT p FROM Point p WHERE p.code=?1 and p.enabled=true")
|
@Query(value = "SELECT p FROM Point p WHERE p.code=?1 and p.enabled=true")
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import com.youchain.annotation.AnonymousAccess;
|
||||||
import com.youchain.annotation.Log;
|
import com.youchain.annotation.Log;
|
||||||
import com.youchain.basicdata.domain.Area;
|
import com.youchain.basicdata.domain.Area;
|
||||||
import com.youchain.basicdata.domain.Point;
|
import com.youchain.basicdata.domain.Point;
|
||||||
|
import com.youchain.basicdata.repository.PointRepository;
|
||||||
import com.youchain.basicdata.service.AreaService;
|
import com.youchain.basicdata.service.AreaService;
|
||||||
import com.youchain.basicdata.service.PointService;
|
import com.youchain.basicdata.service.PointService;
|
||||||
import com.youchain.basicdata.service.dto.AreaDto;
|
import com.youchain.basicdata.service.dto.AreaDto;
|
||||||
|
|
@ -66,6 +67,7 @@ import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||||
public class PointController {
|
public class PointController {
|
||||||
|
|
||||||
private final PointService pointService;
|
private final PointService pointService;
|
||||||
|
private final PointRepository pointRepository;
|
||||||
|
|
||||||
private final AreaService areaService;
|
private final AreaService areaService;
|
||||||
|
|
||||||
|
|
@ -182,6 +184,11 @@ public class PointController {
|
||||||
public ResponseEntity<Object> queryPointList(PointQueryCriteria criteria) {
|
public ResponseEntity<Object> queryPointList(PointQueryCriteria criteria) {
|
||||||
return new ResponseEntity<>(pointService.queryAll(criteria), HttpStatus.OK);
|
return new ResponseEntity<>(pointService.queryAll(criteria), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@PostMapping(value = "/getPointList")
|
||||||
|
@AnonymousAccess
|
||||||
|
public ResponseEntity<Object> getPointList() {
|
||||||
|
return new ResponseEntity<>(pointRepository.getKyPointList(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/queryKyPointList")
|
@GetMapping(value = "/queryKyPointList")
|
||||||
@Log("查询可用空闲的点位point")
|
@Log("查询可用空闲的点位point")
|
||||||
|
|
|
||||||
|
|
@ -160,4 +160,5 @@ public interface PointService {
|
||||||
* 前后桶根据设置的小库区存储类型,未设置的混放
|
* 前后桶根据设置的小库区存储类型,未设置的混放
|
||||||
*/
|
*/
|
||||||
Point getPointByFreeQH(String areaName,String goodType);
|
Point getPointByFreeQH(String areaName,String goodType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class PointServiceImpl implements PointService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PointSmallDto> queryKyPointList() {
|
public List<PointSmallDto> queryKyPointList() {
|
||||||
List<Map<String, String>> maps = pointRepository.getKyPointList();
|
List<Point> maps = pointRepository.getKyPointList();
|
||||||
String irsStr = JSON.toJSONString(maps);
|
String irsStr = JSON.toJSONString(maps);
|
||||||
List<PointSmallDto> evaUserResps = JSON.parseArray(irsStr, PointSmallDto.class);
|
List<PointSmallDto> evaUserResps = JSON.parseArray(irsStr, PointSmallDto.class);
|
||||||
return evaUserResps;
|
return evaUserResps;
|
||||||
|
|
|
||||||
|
|
@ -126,10 +126,6 @@ public class Inventory extends BaseEntity implements Serializable {
|
||||||
@NotNull
|
@NotNull
|
||||||
@ApiModelProperty(value = "仓库")
|
@ApiModelProperty(value = "仓库")
|
||||||
private Dept dept;
|
private Dept dept;
|
||||||
@OneToMany
|
|
||||||
private List<Task> tasks;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void copy(Inventory source){
|
public void copy(Inventory source){
|
||||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.youchain.businessdata.domain;
|
||||||
|
|
||||||
|
import com.youchain.base.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://eladmin.vip
|
||||||
|
* @description /
|
||||||
|
* @author hjl
|
||||||
|
* @date 2024-03-11
|
||||||
|
**/
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@Table(name="data_pick")
|
||||||
|
public class Pick extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "`id`")
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "`dept_id`")
|
||||||
|
@ApiModelProperty(value = "仓库ID")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Column(name = "`bill_type_id`")
|
||||||
|
@ApiModelProperty(value = "单据类型ID")
|
||||||
|
private String billTypeId;
|
||||||
|
|
||||||
|
@Column(name = "`order_origin`")
|
||||||
|
@ApiModelProperty(value = "订单来源")
|
||||||
|
private Long orderOrigin;
|
||||||
|
|
||||||
|
@Column(name = "`priority`")
|
||||||
|
@ApiModelProperty(value = "优先级")
|
||||||
|
private Long priority;
|
||||||
|
|
||||||
|
@Column(name = "`owner`")
|
||||||
|
@ApiModelProperty(value = "货主")
|
||||||
|
private String owner;
|
||||||
|
|
||||||
|
@Column(name = "`related_bill1`")
|
||||||
|
@ApiModelProperty(value = "系统单号")
|
||||||
|
private String relatedBill1;
|
||||||
|
|
||||||
|
@Column(name = "`related_bill2`")
|
||||||
|
@ApiModelProperty(value = "客户订单号")
|
||||||
|
private String relatedBill2;
|
||||||
|
|
||||||
|
@Column(name = "`source_name`")
|
||||||
|
@ApiModelProperty(value = "来源名称")
|
||||||
|
private String sourceName;
|
||||||
|
|
||||||
|
@Column(name = "`status`")
|
||||||
|
@ApiModelProperty(value = "订单状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Column(name = "`address`")
|
||||||
|
@ApiModelProperty(value = "合并或分阶段处理的地点")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Column(name = "`dispatch_date`")
|
||||||
|
@ApiModelProperty(value = "发货时间")
|
||||||
|
private Long dispatchDate;
|
||||||
|
|
||||||
|
@Column(name = "`er_time`")
|
||||||
|
@ApiModelProperty(value = "操作时间")
|
||||||
|
private Long erTime;
|
||||||
|
|
||||||
|
@Column(name = "`create_by`")
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@Column(name = "`update_by`")
|
||||||
|
@ApiModelProperty(value = "修改人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
@Column(name = "`create_time`")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Timestamp createTime;
|
||||||
|
|
||||||
|
@Column(name = "`update_time`")
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Timestamp updateTime;
|
||||||
|
|
||||||
|
@Column(name = "`order_date`")
|
||||||
|
@ApiModelProperty(value = "订单时间")
|
||||||
|
private Timestamp orderDate;
|
||||||
|
|
||||||
|
public void copy(Pick source){
|
||||||
|
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -25,6 +25,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;
|
||||||
|
|
@ -149,6 +152,7 @@ public class Task extends BaseEntity implements Serializable {
|
||||||
@JoinColumn(name="inv_id")
|
@JoinColumn(name="inv_id")
|
||||||
@ApiModelProperty(value = "库存ID")
|
@ApiModelProperty(value = "库存ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
@NotFound(action= NotFoundAction.IGNORE)
|
||||||
private Inventory inventory;
|
private Inventory inventory;
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "dept_id")
|
@JoinColumn(name = "dept_id")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.youchain.businessdata.repository;
|
||||||
|
|
||||||
|
import com.youchain.businessdata.domain.Pick;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://eladmin.vip
|
||||||
|
* @author hjl
|
||||||
|
* @date 2024-03-11
|
||||||
|
**/
|
||||||
|
public interface PickRepository extends JpaRepository<Pick, Long>, JpaSpecificationExecutor<Pick> {
|
||||||
|
}
|
||||||
|
|
@ -32,8 +32,15 @@ import java.util.Map;
|
||||||
public interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificationExecutor<Task> {
|
public interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificationExecutor<Task> {
|
||||||
@Query(value = "SELECT u.id FROM data_task u WHERE u.asn_detail_id=?1", nativeQuery = true)
|
@Query(value = "SELECT u.id FROM data_task u WHERE u.asn_detail_id=?1", nativeQuery = true)
|
||||||
public List<Map<String,String>> getAsnTask(Long id);
|
public List<Map<String,String>> getAsnTask(Long id);
|
||||||
@Query(value = " select sum(move_qty) qty,GROUP_CONCAT(id) taskIds,item_key_id ikID,dst_point_id pointId from data_task where agv_task_id=?1 and task_type='ASN' and task_status='RECEIVING' group by item_key_id ",nativeQuery = true)
|
/**
|
||||||
List<Map<String,Object>> findByAgvTask(Integer agvTaskId);
|
* 查询出入库相关的AGV任务
|
||||||
|
* @param agvTaskId
|
||||||
|
* @param type ASN
|
||||||
|
* @param agvFlag 是否AGV任务
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Query(value = " select sum(move_qty) qty,GROUP_CONCAT(id) taskIds,item_key_id ikID,dst_point_id pointId from data_task where if((?1 !='' or ?1 is not null),agv_task_id=?1,1=1) and task_type=?2 and be_skip=?3 and task_status='RECEIVING' group by item_key_id ",nativeQuery = true)
|
||||||
|
List<Map<String,Object>> findByAgvTask(Integer agvTaskId,String type,Long agvFlag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据出库单明细查询未完成的Task集合
|
* 根据出库单明细查询未完成的Task集合
|
||||||
|
|
|
||||||
|
|
@ -533,12 +533,4 @@ public class AsnDetailController {
|
||||||
obj.putAll(map);
|
obj.putAll(map);
|
||||||
return new ResponseEntity<>(ApiResult.success("",obj), HttpStatus.OK);
|
return new ResponseEntity<>(ApiResult.success("",obj), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@PostMapping("/importAsnApi")
|
|
||||||
@Log("接收SAP入库单")
|
|
||||||
@ApiOperation("接收SAP入库单")
|
|
||||||
@AnonymousAccess
|
|
||||||
public ResponseEntity<Object> importAsnApi(@RequestBody JSONObject jsonObject) {
|
|
||||||
asnDetailService.importAsnApi(jsonObject);
|
|
||||||
return new ResponseEntity<>(ApiResult.success("",""), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.youchain.businessdata.rest;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.youchain.annotation.AnonymousAccess;
|
||||||
|
import com.youchain.annotation.Log;
|
||||||
|
import com.youchain.businessdata.service.AsnDetailService;
|
||||||
|
import com.youchain.businessdata.service.PickDetailService;
|
||||||
|
import com.youchain.exception.handler.ApiResult;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "接口日志")
|
||||||
|
@RequestMapping("/synq/resources")
|
||||||
|
public class InterfaceController {
|
||||||
|
private final AsnDetailService asnDetailService;
|
||||||
|
private final PickDetailService pickDetailService;
|
||||||
|
@PostMapping("/importAsnApi")
|
||||||
|
@Log("接收SAP入库单")
|
||||||
|
@ApiOperation("接收SAP入库单")
|
||||||
|
@AnonymousAccess
|
||||||
|
public ResponseEntity<Object> importAsnApi(@RequestBody JSONObject jsonObject) {
|
||||||
|
asnDetailService.importAsnApi(jsonObject);
|
||||||
|
return new ResponseEntity<>(ApiResult.success("",""), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
@PostMapping("/importPtApi")
|
||||||
|
@Log("接收SAP入库单")
|
||||||
|
@ApiOperation("接收SAP入库单")
|
||||||
|
@AnonymousAccess
|
||||||
|
public ResponseEntity<Object> importPtApi(@RequestBody JSONObject jsonObject) {
|
||||||
|
ApiResult apiResult = pickDetailService.importPtApi(jsonObject);
|
||||||
|
return new ResponseEntity<>(apiResult, HttpStatus.valueOf(apiResult.getStatus()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.youchain.businessdata.rest;
|
||||||
|
|
||||||
|
import com.youchain.annotation.Log;
|
||||||
|
import com.youchain.businessdata.domain.Pick;
|
||||||
|
import com.youchain.businessdata.service.PickService;
|
||||||
|
import com.youchain.businessdata.service.dto.PickQueryCriteria;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://eladmin.vip
|
||||||
|
* @author hjl
|
||||||
|
* @date 2024-03-11
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "pick管理")
|
||||||
|
@RequestMapping("/api/pick")
|
||||||
|
public class PickController {
|
||||||
|
|
||||||
|
private final PickService pickService;
|
||||||
|
|
||||||
|
@Log("导出数据")
|
||||||
|
@ApiOperation("导出数据")
|
||||||
|
@GetMapping(value = "/download")
|
||||||
|
@PreAuthorize("@el.check('pick:list')")
|
||||||
|
public void exportPick(HttpServletResponse response, PickQueryCriteria criteria) throws IOException {
|
||||||
|
pickService.download(pickService.queryAll(criteria), response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询pick")
|
||||||
|
@ApiOperation("查询pick")
|
||||||
|
@PreAuthorize("@el.check('pick:list')")
|
||||||
|
public ResponseEntity<Object> queryPick(PickQueryCriteria criteria, Pageable pageable){
|
||||||
|
return new ResponseEntity<>(pickService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增pick")
|
||||||
|
@ApiOperation("新增pick")
|
||||||
|
@PreAuthorize("@el.check('pick:add')")
|
||||||
|
public ResponseEntity<Object> createPick(@Validated @RequestBody Pick resources){
|
||||||
|
return new ResponseEntity<>(pickService.create(resources),HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改pick")
|
||||||
|
@ApiOperation("修改pick")
|
||||||
|
@PreAuthorize("@el.check('pick:edit')")
|
||||||
|
public ResponseEntity<Object> updatePick(@Validated @RequestBody Pick resources){
|
||||||
|
pickService.update(resources);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Log("删除pick")
|
||||||
|
@ApiOperation("删除pick")
|
||||||
|
@PreAuthorize("@el.check('pick:del')")
|
||||||
|
public ResponseEntity<Object> deletePick(@RequestBody Long[] ids) {
|
||||||
|
pickService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -68,6 +68,14 @@ public class TaskController {
|
||||||
public ResponseEntity<Object> queryTask(TaskQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTask(TaskQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(taskService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(taskService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/manualReceiving")
|
||||||
|
@Log("人工入库")
|
||||||
|
@ApiOperation("人工入库")
|
||||||
|
@AnonymousAccess
|
||||||
|
public ResponseEntity<Object> manualReceiving(@RequestBody JSONObject request){
|
||||||
|
ApiResult apiResult = taskService.manualReceiving(request);
|
||||||
|
return new ResponseEntity<>(ApiResult.success(apiResult.getMessage(),apiResult.getData()), HttpStatus.valueOf(apiResult.getStatus()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping(value = "/queryAsnTask")
|
@GetMapping(value = "/queryAsnTask")
|
||||||
|
|
@ -118,7 +126,8 @@ public class TaskController {
|
||||||
@AnonymousAccess
|
@AnonymousAccess
|
||||||
public ResponseEntity<Object> readRfid(@RequestBody JSONObject body) {
|
public ResponseEntity<Object> readRfid(@RequestBody JSONObject body) {
|
||||||
String rfid=body.getString("rfid");
|
String rfid=body.getString("rfid");
|
||||||
ApiResult apiResult = taskService.readRfid(rfid);
|
String type=body.getString("type");
|
||||||
|
ApiResult apiResult = taskService.readRfid(rfid,type);
|
||||||
return new ResponseEntity<>(apiResult, HttpStatus.valueOf(apiResult.getStatus()));
|
return new ResponseEntity<>(apiResult, HttpStatus.valueOf(apiResult.getStatus()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,10 @@
|
||||||
package com.youchain.businessdata.service;
|
package com.youchain.businessdata.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.youchain.basicdata.domain.Item;
|
|
||||||
import com.youchain.basicdata.domain.Point;
|
|
||||||
import com.youchain.basicdata.domain.Stock;
|
|
||||||
import com.youchain.basicdata.service.dto.StockDto;
|
|
||||||
import com.youchain.businessdata.domain.AsnDetail;
|
import com.youchain.businessdata.domain.AsnDetail;
|
||||||
import com.youchain.businessdata.service.dto.AsnDetailDto;
|
import com.youchain.businessdata.service.dto.AsnDetailDto;
|
||||||
import com.youchain.businessdata.service.dto.AsnDetailQueryCriteria;
|
import com.youchain.businessdata.service.dto.AsnDetailQueryCriteria;
|
||||||
|
import com.youchain.exception.handler.ApiResult;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.youchain.businessdata.service;
|
package com.youchain.businessdata.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.youchain.basicdata.domain.Box;
|
import com.youchain.basicdata.domain.Box;
|
||||||
import com.youchain.basicdata.domain.Item;
|
import com.youchain.basicdata.domain.Item;
|
||||||
import com.youchain.basicdata.domain.Point;
|
import com.youchain.basicdata.domain.Point;
|
||||||
|
|
@ -22,6 +23,7 @@ import com.youchain.basicdata.service.dto.BoxDto;
|
||||||
import com.youchain.businessdata.domain.PickDetail;
|
import com.youchain.businessdata.domain.PickDetail;
|
||||||
import com.youchain.businessdata.service.dto.PickDetailDto;
|
import com.youchain.businessdata.service.dto.PickDetailDto;
|
||||||
import com.youchain.businessdata.service.dto.PickDetailQueryCriteria;
|
import com.youchain.businessdata.service.dto.PickDetailQueryCriteria;
|
||||||
|
import com.youchain.exception.handler.ApiResult;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -119,4 +121,11 @@ public interface PickDetailService {
|
||||||
PickDetail toEntity(PickDetailDto pickDetailDto);
|
PickDetail toEntity(PickDetailDto pickDetailDto);
|
||||||
|
|
||||||
PickDetail createPickDetail(Item item,String po);
|
PickDetail createPickDetail(Item item,String po);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库单接收
|
||||||
|
* @param jsonObject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ApiResult importPtApi(JSONObject jsonObject);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.youchain.businessdata.service;
|
||||||
|
|
||||||
|
import com.youchain.businessdata.domain.Pick;
|
||||||
|
import com.youchain.businessdata.service.dto.PickDto;
|
||||||
|
import com.youchain.businessdata.service.dto.PickQueryCriteria;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://eladmin.vip
|
||||||
|
* @description 服务接口
|
||||||
|
* @author hjl
|
||||||
|
* @date 2024-03-11
|
||||||
|
**/
|
||||||
|
public interface PickService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param criteria 条件
|
||||||
|
* @param pageable 分页参数
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
Map<String,Object> queryAll(PickQueryCriteria criteria, Pageable pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据不分页
|
||||||
|
* @param criteria 条件参数
|
||||||
|
* @return List<PickDto>
|
||||||
|
*/
|
||||||
|
List<PickDto> queryAll(PickQueryCriteria criteria);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询
|
||||||
|
* @param id ID
|
||||||
|
* @return PickDto
|
||||||
|
*/
|
||||||
|
PickDto findById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
* @param resources /
|
||||||
|
* @return PickDto
|
||||||
|
*/
|
||||||
|
PickDto create(Pick resources);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param resources /
|
||||||
|
*/
|
||||||
|
void update(Pick resources);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
* @param all 待导出的数据
|
||||||
|
* @param response /
|
||||||
|
* @throws IOException /
|
||||||
|
*/
|
||||||
|
void download(List<PickDto> all, HttpServletResponse response) throws IOException;
|
||||||
|
}
|
||||||
|
|
@ -15,6 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package com.youchain.businessdata.service;
|
package com.youchain.businessdata.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.youchain.basicdata.domain.Point;
|
||||||
import com.youchain.businessdata.ReturnJson.RPTaskList;
|
import com.youchain.businessdata.ReturnJson.RPTaskList;
|
||||||
import com.youchain.businessdata.domain.AgvTask;
|
import com.youchain.businessdata.domain.AgvTask;
|
||||||
import com.youchain.businessdata.domain.Task;
|
import com.youchain.businessdata.domain.Task;
|
||||||
|
|
@ -129,5 +131,14 @@ public interface TaskService {
|
||||||
|
|
||||||
List<Task> findByPointCode(Long boxId);
|
List<Task> findByPointCode(Long boxId);
|
||||||
|
|
||||||
ApiResult readRfid(String rfid);
|
/**
|
||||||
|
* 读取RFID生成Task任务
|
||||||
|
* @param rfid
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ApiResult readRfid(String rfid,String type);
|
||||||
|
|
||||||
|
ApiResult manualReceiving(JSONObject request);
|
||||||
|
ApiResult getAsnTask(Point point, Task task);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.youchain.businessdata.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://eladmin.vip
|
||||||
|
* @description /
|
||||||
|
* @author hjl
|
||||||
|
* @date 2024-03-11
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class PickDto implements Serializable {
|
||||||
|
|
||||||
|
/** ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 仓库ID */
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
/** 单据类型ID */
|
||||||
|
private String billTypeId;
|
||||||
|
|
||||||
|
/** 订单来源 */
|
||||||
|
private Long orderOrigin;
|
||||||
|
|
||||||
|
/** 优先级 */
|
||||||
|
private Long priority;
|
||||||
|
|
||||||
|
/** 货主 */
|
||||||
|
private String owner;
|
||||||
|
|
||||||
|
/** 系统单号 */
|
||||||
|
private String relatedBill1;
|
||||||
|
|
||||||
|
/** 客户订单号 */
|
||||||
|
private String relatedBill2;
|
||||||
|
|
||||||
|
/** 来源名称 */
|
||||||
|
private String sourceName;
|
||||||
|
|
||||||
|
/** 订单状态 */
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 合并或分阶段处理的地点 */
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/** 发货时间 */
|
||||||
|
private Long dispatchDate;
|
||||||
|
|
||||||
|
/** 操作时间 */
|
||||||
|
private Long erTime;
|
||||||
|
|
||||||
|
/** 创建人 */
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/** 修改人 */
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
private Timestamp createTime;
|
||||||
|
|
||||||
|
/** 修改时间 */
|
||||||
|
private Timestamp updateTime;
|
||||||
|
|
||||||
|
/** 订单时间 */
|
||||||
|
private Timestamp orderDate;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.youchain.businessdata.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.List;
|
||||||
|
import com.youchain.annotation.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://eladmin.vip
|
||||||
|
* @author hjl
|
||||||
|
* @date 2024-03-11
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class PickQueryCriteria{
|
||||||
|
/** BETWEEN */
|
||||||
|
@Query(type = Query.Type.BETWEEN)
|
||||||
|
private List<Long> dispatchDate;
|
||||||
|
/** BETWEEN */
|
||||||
|
@Query(type = Query.Type.BETWEEN)
|
||||||
|
private List<Long> erTime;
|
||||||
|
}
|
||||||
|
|
@ -159,26 +159,48 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param agvTasks
|
* @param agvTask
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized String sendAgvTaskImpl(AgvTask agvTasks) {
|
public synchronized String sendAgvTaskImpl(AgvTask agvTask) {
|
||||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
|
JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
|
||||||
|
String api="";
|
||||||
String resultJson = HttpPostUtil.sendPostReq(UrlApi.submitMission, jsonObject.toString());//返回ResponseJson*/
|
if (agvTask.getType().equals(BizStatus.AGV)) {
|
||||||
|
//搬运任务
|
||||||
|
jsonObject.put("requestId", agvTask.getId());
|
||||||
|
jsonObject.put("missionCode", agvTask.getId());
|
||||||
|
jsonObject.put("priority", agvTask.getJobPriority());
|
||||||
|
jsonObject.put("containerModeCode", agvTask.getStockTypeCode());
|
||||||
|
jsonObject.put("startPosition", agvTask.getStartSlotCode());
|
||||||
|
jsonObject.put("endPosition", agvTask.getEndSlotCode());
|
||||||
|
api=UrlApi.submitMission;
|
||||||
|
}
|
||||||
|
if (agvTask.getType().equals(BizStatus.AGV_R)){
|
||||||
|
jsonObject.put("requestId", agvTask.getId());
|
||||||
|
jsonObject.put("containerModeCode", agvTask.getStockTypeCode());
|
||||||
|
// jsonObject.put("containerCode", agvTask.getStockTypeCode());
|
||||||
|
jsonObject.put("position", agvTask.getEndSlotCode());
|
||||||
|
api=UrlApi.containerIn;
|
||||||
|
}
|
||||||
|
if (agvTask.getType().equals(BizStatus.AGV_C)){
|
||||||
|
jsonObject.put("requestId", agvTask.getId());
|
||||||
|
jsonObject.put("position", agvTask.getEndSlotCode());
|
||||||
|
api=UrlApi.containerOut;
|
||||||
|
}
|
||||||
|
String resultJson = HttpPostUtil.sendPostReq(api, jsonObject.toString());//返回ResponseJson*/
|
||||||
JSONObject resulObject = JSON.parseObject(resultJson);
|
JSONObject resulObject = JSON.parseObject(resultJson);
|
||||||
String code = resulObject.getString("code") == null ? "" : resulObject.getString("code");
|
String code = resulObject.getString("code") == null ? "" : resulObject.getString("code");
|
||||||
if (code.equals("0")) {
|
if (code.equals("0")) {
|
||||||
agvTasks.setStatus(BizStatus.ATCALL);
|
agvTask.setStatus(BizStatus.ATCALL);
|
||||||
agvTasks.setJobMessage(resultJson);
|
agvTask.setJobMessage(resultJson);
|
||||||
agvTasks.setReqMessage(jsonObject.toString());
|
agvTask.setReqMessage(jsonObject.toString());
|
||||||
agvTasks.setStartTime(new Timestamp(new Date().getTime()));
|
agvTask.setStartTime(new Timestamp(new Date().getTime()));
|
||||||
update(agvTasks);
|
update(agvTask);
|
||||||
} else {
|
} else {
|
||||||
agvTasks.setJobMessage(resultJson);
|
agvTask.setJobMessage(resultJson);
|
||||||
agvTasks.setReqMessage(jsonObject.toString());
|
agvTask.setReqMessage(jsonObject.toString());
|
||||||
update(agvTasks);
|
update(agvTask);
|
||||||
}
|
}
|
||||||
return resultJson;
|
return resultJson;
|
||||||
}
|
}
|
||||||
|
|
@ -443,7 +465,7 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
AgvTask agvTask=agvTaskRepository.getById(Integer.valueOf(taskCode));
|
AgvTask agvTask=agvTaskRepository.getById(Integer.valueOf(taskCode));
|
||||||
// task库存任务
|
// task库存任务
|
||||||
// List<Task> tasks=taskRepository.getAgvTaskList(agvTask.getId(),BizStatus.ASN);
|
// List<Task> tasks=taskRepository.getAgvTaskList(agvTask.getId(),BizStatus.ASN);
|
||||||
List<Map<String,Object>> taskMapList=taskRepository.findByAgvTask(agvTask.getId());
|
List<Map<String,Object>> taskMapList=taskRepository.findByAgvTask(agvTask.getId(),"ASN",1l);
|
||||||
Point startPoint=null;
|
Point startPoint=null;
|
||||||
Point endPoint=null;
|
Point endPoint=null;
|
||||||
if (status.equals("1")){
|
if (status.equals("1")){
|
||||||
|
|
@ -612,7 +634,7 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
if (!endPoint.getStatus().equals(BaseStatus.FREE)){
|
if (!endPoint.getStatus().equals(BaseStatus.FREE)){
|
||||||
return endPoint.getCode()+":被任务占用";
|
return endPoint.getCode()+":被任务占用";
|
||||||
}
|
}
|
||||||
AgvTask agvTask = addAgvTask(BizStatus.AGV_F, startPoint.getStorageType(), startPoint.getCode(),endPoint.getCode() , BizStatus.OPEN, BizStatus.ASN);
|
AgvTask agvTask = addAgvTask(BizStatus.AGV, startPoint.getStorageType(), startPoint.getCode(),endPoint.getCode() , BizStatus.OPEN, BizStatus.ASN);
|
||||||
}else {
|
}else {
|
||||||
return pointEndCode+":目标点错误";
|
return pointEndCode+":目标点错误";
|
||||||
}
|
}
|
||||||
|
|
@ -657,15 +679,9 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
List<Task> taskList=taskRepository.findByItemType(BizStatus.RECEIVING,1,"SMGS");
|
List<Task> taskList=taskRepository.findByItemType(BizStatus.RECEIVING,1,"SMGS");
|
||||||
for (int i = 0; i < taskList.size(); i++) {
|
for (int i = 0; i < taskList.size(); i++) {
|
||||||
Task task=taskList.get(i);
|
Task task=taskList.get(i);
|
||||||
task.setDstPoint(point);
|
//跟新Task任务
|
||||||
task.setMoveQty(task.getPlanQty());
|
ApiResult success = taskService.getAsnTask(point, task);
|
||||||
List<AsnDetail> asnDetailList=asnDetailRepository.findByAsnAndItem(task.getBillCode(),task.getItemKey().getItem().getCode());
|
if (success != null) return success;
|
||||||
if (asnDetailList.size()>0){
|
|
||||||
AsnDetail asnDetail=asnDetailList.get(0);
|
|
||||||
asnDetailService.receivingAsnDetail(asnDetail,task.getMoveQty());
|
|
||||||
}else {
|
|
||||||
return ApiResult.success(500, "收货单异常!!", "");
|
|
||||||
}
|
|
||||||
AgvTask agvTask=addAgvTask("叉车搬运", "半成品托盘", task.getSrcPoint().getCode(), point.getCode(), BizStatus.OPEN, "ASN2");
|
AgvTask agvTask=addAgvTask("叉车搬运", "半成品托盘", task.getSrcPoint().getCode(), point.getCode(), BizStatus.OPEN, "ASN2");
|
||||||
task.setAgvTask(agvTask);
|
task.setAgvTask(agvTask);
|
||||||
taskRepository.save(task);
|
taskRepository.save(task);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package com.youchain.businessdata.service.impl;
|
package com.youchain.businessdata.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.youchain.basicdata.domain.Box;
|
import com.youchain.basicdata.domain.Box;
|
||||||
import com.youchain.basicdata.domain.Item;
|
import com.youchain.basicdata.domain.Item;
|
||||||
import com.youchain.basicdata.domain.Point;
|
import com.youchain.basicdata.domain.Point;
|
||||||
|
|
@ -408,4 +410,16 @@ public class PickDetailServiceImpl implements PickDetailService {
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResult importPtApi(JSONObject jsonObject) {
|
||||||
|
JSONArray orders=jsonObject.getJSONArray("order");
|
||||||
|
for (int i = 0; i < orders.size(); i++) {
|
||||||
|
PickDetail pickDetail = new PickDetail();
|
||||||
|
|
||||||
|
JSONObject order=orders.getJSONObject(i);
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.youchain.businessdata.service.impl;
|
||||||
|
|
||||||
|
import com.youchain.businessdata.domain.Pick;
|
||||||
|
import com.youchain.utils.FileUtil;
|
||||||
|
import com.youchain.utils.PageUtil;
|
||||||
|
import com.youchain.utils.QueryHelp;
|
||||||
|
import com.youchain.utils.ValidationUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import com.youchain.businessdata.repository.PickRepository;
|
||||||
|
import com.youchain.businessdata.service.PickService;
|
||||||
|
import com.youchain.businessdata.service.dto.PickDto;
|
||||||
|
import com.youchain.businessdata.service.dto.PickQueryCriteria;
|
||||||
|
import com.youchain.businessdata.service.mapstruct.PickMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://eladmin.vip
|
||||||
|
* @description 服务实现
|
||||||
|
* @author hjl
|
||||||
|
* @date 2024-03-11
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PickServiceImpl implements PickService {
|
||||||
|
|
||||||
|
private final PickRepository pickRepository;
|
||||||
|
private final PickMapper pickMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String,Object> queryAll(PickQueryCriteria criteria, Pageable pageable){
|
||||||
|
Page<Pick> page = pickRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||||
|
return PageUtil.toPage(page.map(pickMapper::toDto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PickDto> queryAll(PickQueryCriteria criteria){
|
||||||
|
return pickMapper.toDto(pickRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public PickDto findById(Long id) {
|
||||||
|
Pick pick = pickRepository.findById(id).orElseGet(Pick::new);
|
||||||
|
ValidationUtil.isNull(pick.getId(),"Pick","id",id);
|
||||||
|
return pickMapper.toDto(pick);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public PickDto create(Pick resources) {
|
||||||
|
return pickMapper.toDto(pickRepository.save(resources));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(Pick resources) {
|
||||||
|
Pick pick = pickRepository.findById(resources.getId()).orElseGet(Pick::new);
|
||||||
|
ValidationUtil.isNull( pick.getId(),"Pick","id",resources.getId());
|
||||||
|
pick.copy(resources);
|
||||||
|
pickRepository.save(pick);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAll(Long[] ids) {
|
||||||
|
for (Long id : ids) {
|
||||||
|
pickRepository.deleteById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void download(List<PickDto> all, HttpServletResponse response) throws IOException {
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
for (PickDto pick : all) {
|
||||||
|
Map<String,Object> map = new LinkedHashMap<>();
|
||||||
|
map.put("仓库ID", pick.getDeptId());
|
||||||
|
map.put("单据类型ID", pick.getBillTypeId());
|
||||||
|
map.put("订单来源", pick.getOrderOrigin());
|
||||||
|
map.put("优先级", pick.getPriority());
|
||||||
|
map.put("货主", pick.getOwner());
|
||||||
|
map.put("系统单号", pick.getRelatedBill1());
|
||||||
|
map.put("客户订单号", pick.getRelatedBill2());
|
||||||
|
map.put("来源名称", pick.getSourceName());
|
||||||
|
map.put("订单状态", pick.getStatus());
|
||||||
|
map.put("合并或分阶段处理的地点", pick.getAddress());
|
||||||
|
map.put("发货时间", pick.getDispatchDate());
|
||||||
|
map.put("操作时间", pick.getErTime());
|
||||||
|
map.put("创建人", pick.getCreateBy());
|
||||||
|
map.put("修改人", pick.getUpdateBy());
|
||||||
|
map.put("创建时间", pick.getCreateTime());
|
||||||
|
map.put("修改时间", pick.getUpdateTime());
|
||||||
|
map.put("订单时间", pick.getOrderDate());
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
FileUtil.downloadExcel(list, response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -29,15 +29,12 @@ import com.youchain.businessdata.ReturnJson.RPTaskList;
|
||||||
import com.youchain.businessdata.domain.*;
|
import com.youchain.businessdata.domain.*;
|
||||||
import com.youchain.businessdata.inputJson.IPTask;
|
import com.youchain.businessdata.inputJson.IPTask;
|
||||||
import com.youchain.businessdata.repository.*;
|
import com.youchain.businessdata.repository.*;
|
||||||
import com.youchain.businessdata.service.AsnService;
|
import com.youchain.businessdata.service.*;
|
||||||
import com.youchain.businessdata.service.InventoryLogService;
|
|
||||||
import com.youchain.businessdata.service.ItemKeyService;
|
|
||||||
import com.youchain.businessdata.service.dto.InventoryDto;
|
import com.youchain.businessdata.service.dto.InventoryDto;
|
||||||
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.utils.*;
|
import com.youchain.utils.*;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import com.youchain.businessdata.service.TaskService;
|
|
||||||
import com.youchain.businessdata.service.dto.TaskDto;
|
import com.youchain.businessdata.service.dto.TaskDto;
|
||||||
import com.youchain.businessdata.service.dto.TaskQueryCriteria;
|
import com.youchain.businessdata.service.dto.TaskQueryCriteria;
|
||||||
import com.youchain.businessdata.service.mapstruct.TaskMapper;
|
import com.youchain.businessdata.service.mapstruct.TaskMapper;
|
||||||
|
|
@ -66,13 +63,17 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Transactional
|
||||||
public class TaskServiceImpl implements TaskService {
|
public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
private final TaskRepository taskRepository;
|
private final TaskRepository taskRepository;
|
||||||
private final TaskMapper taskMapper;
|
private final TaskMapper taskMapper;
|
||||||
private final AsnRepository asnRepository;
|
private final AsnRepository asnRepository;
|
||||||
private final InventoryRepository inventoryRepository;
|
private final InventoryRepository inventoryRepository;
|
||||||
|
private final InventoryService inventoryService;
|
||||||
private final PickDetailRepository pickDetailRepository;
|
private final PickDetailRepository pickDetailRepository;
|
||||||
|
private final AsnDetailRepository asnDetailRepository;
|
||||||
|
private final AsnDetailService asnDetailService;
|
||||||
private final InventoryLogService inventoryLogService;
|
private final InventoryLogService inventoryLogService;
|
||||||
private final EntityManager entityMapper;
|
private final EntityManager entityMapper;
|
||||||
private final StockRepository stockRepository;
|
private final StockRepository stockRepository;
|
||||||
|
|
@ -278,7 +279,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public ApiResult readRfid(String rfid) {
|
public ApiResult readRfid(String rfid,String type) {
|
||||||
String[] rfids=rfid.split("\\|");
|
String[] rfids=rfid.split("\\|");
|
||||||
String itemCode=rfids[0]+"";
|
String itemCode=rfids[0]+"";
|
||||||
String propC1=rfids[1]+"";
|
String propC1=rfids[1]+"";
|
||||||
|
|
@ -332,7 +333,11 @@ public class TaskServiceImpl implements TaskService {
|
||||||
task.setPlanQty(1d);
|
task.setPlanQty(1d);
|
||||||
task.setDept(UserUtils.getDept());
|
task.setDept(UserUtils.getDept());
|
||||||
task.setTaskStatus(BizStatus.RECEIVING);
|
task.setTaskStatus(BizStatus.RECEIVING);
|
||||||
|
if (type.equals("AGV")) {
|
||||||
task.setBeSkip(1);
|
task.setBeSkip(1);
|
||||||
|
} else if (type.equals("RG")) {
|
||||||
|
task.setBeSkip(0);
|
||||||
|
}
|
||||||
task.setPutCode(lsh[i]);
|
task.setPutCode(lsh[i]);
|
||||||
task.setBillCode(propC3);
|
task.setBillCode(propC3);
|
||||||
task.setTaskType(BizStatus.ASN);
|
task.setTaskType(BizStatus.ASN);
|
||||||
|
|
@ -343,6 +348,30 @@ public class TaskServiceImpl implements TaskService {
|
||||||
return ApiResult.result(200, "操作成功", "");
|
return ApiResult.result(200, "操作成功", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResult manualReceiving(JSONObject request) {
|
||||||
|
String rfid=request.getString("RFID");
|
||||||
|
Point point= pointRepository.getById(request.getLong("pointId"));
|
||||||
|
System.out.println("rfid:"+rfid);
|
||||||
|
// 读取RFID生成Task
|
||||||
|
ApiResult apiResult = readRfid(rfid, "RG");
|
||||||
|
if (apiResult.getStatus()!=200){
|
||||||
|
return apiResult;
|
||||||
|
}
|
||||||
|
// 分配Task库位
|
||||||
|
List<Task> taskList=taskRepository.findByItemType(BizStatus.RECEIVING,0,BizStatus.SMGS);
|
||||||
|
for (int i = 0; i < taskList.size(); i++) {
|
||||||
|
Task task=taskList.get(i);
|
||||||
|
getAsnTask(point, task);
|
||||||
|
taskRepository.save(task);
|
||||||
|
}
|
||||||
|
// 生成库存
|
||||||
|
List<Map<String,Object>> taskMapList=taskRepository.findByAgvTask(null,"ASN",0l);
|
||||||
|
Inventory inventory = inventoryService.asnAddInventory(taskMapList);
|
||||||
|
|
||||||
|
return ApiResult.result(200, "操作成功", "");
|
||||||
|
}
|
||||||
|
|
||||||
public List<Object[]> queryAreaMonth(String type) {
|
public List<Object[]> queryAreaMonth(String type) {
|
||||||
List<Object[]> taskList=null;
|
List<Object[]> taskList=null;
|
||||||
String hql = "";
|
String hql = "";
|
||||||
|
|
@ -379,4 +408,17 @@ public class TaskServiceImpl implements TaskService {
|
||||||
taskList = query.getResultList();
|
taskList = query.getResultList();
|
||||||
return taskList;
|
return taskList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ApiResult getAsnTask(Point point, Task task) {
|
||||||
|
task.setDstPoint(point);
|
||||||
|
task.setMoveQty(task.getPlanQty());
|
||||||
|
List<AsnDetail> asnDetailList=asnDetailRepository.findByAsnAndItem(task.getBillCode(), task.getItemKey().getItem().getCode());
|
||||||
|
if (asnDetailList.size()>0){
|
||||||
|
AsnDetail asnDetail=asnDetailList.get(0);
|
||||||
|
asnDetailService.receivingAsnDetail(asnDetail, task.getMoveQty());
|
||||||
|
}else {
|
||||||
|
return ApiResult.success(500, "收货单异常!!", "");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.youchain.businessdata.service.mapstruct;
|
||||||
|
|
||||||
|
import com.youchain.base.BaseMapper;
|
||||||
|
import com.youchain.businessdata.domain.Pick;
|
||||||
|
import com.youchain.businessdata.service.dto.PickDto;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @website https://eladmin.vip
|
||||||
|
* @author hjl
|
||||||
|
* @date 2024-03-11
|
||||||
|
**/
|
||||||
|
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||||
|
public interface PickMapper extends BaseMapper<PickDto, Pick> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -208,9 +208,12 @@ public interface BizStatus {
|
||||||
*/
|
*/
|
||||||
public static String EMPTY_OUT = "EMPTY_OUT";
|
public static String EMPTY_OUT = "EMPTY_OUT";
|
||||||
|
|
||||||
/** AGV叉车任务*/
|
/** AGV_搬运任务*/
|
||||||
public static String AGV_F="AGV_F";
|
public static String AGV="AGV";
|
||||||
|
/** AGV_容器入场*/
|
||||||
/** AGV潜伏车任务*/
|
String AGV_R="AGV_R";
|
||||||
public static String AGV_R="AGV_R";
|
/** AGV_容器出场*/
|
||||||
|
String AGV_C="AGV_C";
|
||||||
|
/** 半成品入库*/
|
||||||
|
String SMGS="SMGS";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@ public class UrlApi {
|
||||||
/**
|
/**
|
||||||
* 容器入场
|
* 容器入场
|
||||||
*/
|
*/
|
||||||
public static String containerIn = "http://10.177.202.230:10870/interfaces/api/amr/containerIn";
|
public static String containerIn = "http://localhost:8000/interfaces/api/amr/containerIn";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 容器相关操作,出场
|
* 容器相关操作,出场
|
||||||
*/
|
*/
|
||||||
public static String containerOut = "http://10.177.202.230:10870/interfaces/api/amr/containerOut";
|
public static String containerOut = "http://localhost:8000/interfaces/api/amr/containerOut";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 容器相关操作,查询容器信息
|
* 容器相关操作,查询容器信息
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue