add:手持通用功能
This commit is contained in:
@@ -38,4 +38,14 @@ public interface MdMeMaterialbaseMapper extends BaseMapper<MdMeMaterialbase> {
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryPdaMaterInfo(@Param("param") JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 手持
|
||||
* 库存查询 - 查询物料维护信息
|
||||
* @param whereJson {
|
||||
* search: 物料编码、物料名称
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> pdaQueryMaterialInfo(@Param("param") JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -48,4 +48,27 @@
|
||||
ORDER BY mater.update_time Desc
|
||||
</select>
|
||||
|
||||
<select id="pdaQueryMaterialInfo" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
mater.*,
|
||||
class.class_name,
|
||||
class.class_code,
|
||||
unit.unit_code,
|
||||
unit.unit_name
|
||||
FROM
|
||||
md_me_materialbase mater
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mater.material_type_id
|
||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = mater.base_unit_id
|
||||
<where>
|
||||
mater.is_used = '1'
|
||||
AND mater.is_delete = '0'
|
||||
<if test="param.search != null and param.search != ''">
|
||||
AND
|
||||
(mater.material_code LIKE #{param.search} or
|
||||
mater.material_name LIKE #{param.search})
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY mater.update_time Desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -111,4 +111,31 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject queryBagIvt(@Param("param") JSONObject param);
|
||||
|
||||
/**
|
||||
* 手持
|
||||
* 库存查询(根据库区查询)
|
||||
* @param whereJson {
|
||||
* sect_code: 查询类型(库区)
|
||||
* point_code: 点位
|
||||
* material_code: 物料
|
||||
* pcsn: 批号
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> pdaQueryIvtSect(@Param("param") JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 手持
|
||||
* 库存查询(外包材库存)
|
||||
* @param whereJson {
|
||||
* sect_code: 查询类型(区域)
|
||||
* point_code: 点位
|
||||
* material_code: 物料
|
||||
* pcsn: 批号
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> pdaQueryIvtRegion(@Param("param") JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -463,4 +463,84 @@
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="pdaQueryIvtSect" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ext.*,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
material.material_spec,
|
||||
material.material_model,
|
||||
class.class_code,
|
||||
class.class_name,
|
||||
attr.struct_code
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
INNER JOIN md_me_materialbase material ON material.material_id = ext.material_id
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = material.material_type_id
|
||||
<where>
|
||||
attr.is_used = "1"
|
||||
AND ext.canuse_qty > 0
|
||||
|
||||
<if test="param.sect_code != null and param.sect_code != ''">
|
||||
AND
|
||||
attr.sect_code = #{param.sect_code}
|
||||
</if>
|
||||
|
||||
<if test="param.point_code != null and param.point_code != ''">
|
||||
AND
|
||||
attr.struct_code = #{param.point_code}
|
||||
</if>
|
||||
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND
|
||||
material.material_code = #{param.material_code}
|
||||
</if>
|
||||
|
||||
<if test="param.pcsn != null and param.pcsn != ''">
|
||||
AND
|
||||
ext.pcsn = #{param.pcsn}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="pdaQueryIvtRegion" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
pack.qty AS canuse_qty,
|
||||
pack.pcsn,
|
||||
pack.point_code AS struct_code,
|
||||
pack.create_time AS insert_time,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
material.material_spec,
|
||||
material.material_model,
|
||||
class.class_code,
|
||||
class.class_name,
|
||||
'KG' AS qty_unit_name
|
||||
FROM
|
||||
md_pdm_packaging pack
|
||||
INNER JOIN md_me_materialbase material ON material.material_id = pack.material_id
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = material.material_type_id
|
||||
<where>
|
||||
1 = 1
|
||||
|
||||
<if test="param.point_code != null and param.point_code != ''">
|
||||
AND
|
||||
pack.point_code = #{param.point_code}
|
||||
</if>
|
||||
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND
|
||||
material.material_code = #{param.material_code}
|
||||
</if>
|
||||
|
||||
<if test="param.pcsn != null and param.pcsn != ''">
|
||||
AND
|
||||
pack.pcsn = #{param.pcsn}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -33,10 +33,31 @@ public class PdaPointAndPointController {
|
||||
private PdaPointAndPointBoxService pdaPointAndPointBoxService;
|
||||
|
||||
@PostMapping("/createTask")
|
||||
@Log("生成任务")
|
||||
@Log("点对点转运 - 生成任务")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> createTask(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaPointAndPointBoxService.createTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryPointDtl")
|
||||
@Log("点位更新 - 根据载具/点位查询明细")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryPointDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaPointAndPointBoxService.queryPointDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/bind")
|
||||
@Log("点位更新 - 绑定")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> bind(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaPointAndPointBoxService.bind(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/clearMaterial")
|
||||
@Log("点位更新 - 清物料")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> clearMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaPointAndPointBoxService.clearMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.nl.wms.pda.general_management.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.pda.general_management.service.PdaQueryIvtService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持物料查询
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2026-01-07
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/queryIvt")
|
||||
@Slf4j
|
||||
public class PdaQueryIvtController {
|
||||
|
||||
@Autowired
|
||||
private PdaQueryIvtService pdaQueryIvtService;
|
||||
|
||||
@PostMapping("/queryMaterial")
|
||||
@Log("查询物料维护信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaQueryIvtService.queryMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryIvt")
|
||||
@Log("库存查询")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryIvt(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaQueryIvtService.queryIvt(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,15 +14,57 @@ import org.nl.wms.pda.util.PdaResponse;
|
||||
public interface PdaPointAndPointBoxService {
|
||||
|
||||
/**
|
||||
* 生成任务
|
||||
* 点对点转运 - 生成任务
|
||||
*
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具编码
|
||||
* point_code1: 起点
|
||||
* point_code2: 终点
|
||||
* task_type: 载具类型
|
||||
* task_type: 任务类型
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse createTask(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 点位更新 - 根据载具/点位查询明细
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* vehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryPointDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 点位更新 - 绑定
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* vehicle_code: 载具编码
|
||||
* rows: 明细
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse bind(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 点位更新 - 清载具
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* vehicle_code: 载具编码
|
||||
* rows: 明细
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse clearVehicle(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 点位更新 - 清物料
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* vehicle_code: 载具编码
|
||||
* rows: 明细
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse clearMaterial(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.wms.pda.general_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持物料查询 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2026-01-07
|
||||
*/
|
||||
public interface PdaQueryIvtService {
|
||||
|
||||
/**
|
||||
* 查询物料维护信息
|
||||
* @param whereJson {
|
||||
* search: 物料编码、物料名称
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryMaterial(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 库存查询
|
||||
* @param whereJson {
|
||||
* sect_code: 查询类型(库区)
|
||||
* point_code: 点位
|
||||
* material_code: 物料
|
||||
* pcsn: 批号
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryIvt(JSONObject whereJson);
|
||||
}
|
||||
@@ -1,11 +1,22 @@
|
||||
package org.nl.wms.pda.general_management.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.pda.general_management.service.PdaPointAndPointBoxService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.nl.wms.sch_manage.service.PointToPointService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -24,9 +35,80 @@ public class PdaPointAndPointServiceImpl implements PdaPointAndPointBoxService {
|
||||
@Autowired
|
||||
private PointToPointService pointToPointService;
|
||||
|
||||
/**
|
||||
* 点位mapper服务
|
||||
*/
|
||||
@Autowired
|
||||
private SchBasePointMapper schBasePointMapper;
|
||||
|
||||
/**
|
||||
* 组盘服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
@Override
|
||||
public PdaResponse createTask(JSONObject whereJson) {
|
||||
pointToPointService.create(whereJson);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse queryPointDtl(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(schBasePointMapper.pdaQueryPointDtl(whereJson));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse bind(JSONObject whereJson) {
|
||||
// 查询当前点位信息
|
||||
SchBasePoint pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
if (ObjectUtil.isNotEmpty(pointDao.getVehicle_code())) {
|
||||
throw new BadRequestException("当前点位存在载具【"+pointDao.getVehicle_code()+"】");
|
||||
}
|
||||
pointDao.setVehicle_code(whereJson.getString("vehicle_code"));
|
||||
pointDao.setPoint_status(IOSEnum.POINT_STATUS.code("有箱有料"));
|
||||
schBasePointMapper.updateById(pointDao);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse clearVehicle(JSONObject whereJson) {
|
||||
// 查询当前点位信息
|
||||
SchBasePoint pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
pointDao.setVehicle_code("");
|
||||
pointDao.setPoint_status(IOSEnum.POINT_STATUS.code("空位"));
|
||||
schBasePointMapper.updateById(pointDao);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse clearMaterial(JSONObject whereJson) {
|
||||
// 查询当前点位信息
|
||||
SchBasePoint pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
if (ObjectUtil.isEmpty(pointDao.getVehicle_code())) {
|
||||
throw new BadRequestException("当前点位不存在载具");
|
||||
}
|
||||
|
||||
// 查询组盘信息
|
||||
List<GroupPlate> lateList = iMdPbGroupplateService.list(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getVehicle_code, pointDao.getVehicle_code())
|
||||
);
|
||||
// 校验组盘信息不能为入库状态
|
||||
boolean is_in = lateList.stream()
|
||||
.anyMatch(row -> row.getStatus().equals(IOSEnum.GROUP_PLATE_STATUS.code("入库")));
|
||||
if (is_in) {
|
||||
throw new BadRequestException("当前载具存在入库状态组盘信息【"+pointDao.getVehicle_code()+"】");
|
||||
}
|
||||
|
||||
// 删除组盘信息
|
||||
iMdPbGroupplateService.remove(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getVehicle_code, pointDao.getVehicle_code())
|
||||
);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.nl.wms.pda.general_management.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdMeMaterialbaseMapper;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
import org.nl.wms.pda.general_management.service.PdaQueryIvtService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持物料查询 实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-01-07
|
||||
*/
|
||||
@Service
|
||||
public class PdaQueryIvtServiceImpl implements PdaQueryIvtService {
|
||||
|
||||
/**
|
||||
* 物料mapper
|
||||
*/
|
||||
@Autowired
|
||||
private MdMeMaterialbaseMapper mdMeMaterialbaseMapper;
|
||||
|
||||
/**
|
||||
* 库存mapper
|
||||
*/
|
||||
@Autowired
|
||||
private MdPbStoragevehicleextMapper mdPbStoragevehicleextMapper;
|
||||
|
||||
@Override
|
||||
public PdaResponse queryMaterial(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(mdMeMaterialbaseMapper.pdaQueryMaterialInfo(whereJson));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse queryIvt(JSONObject whereJson) {
|
||||
List<JSONObject> resultList;
|
||||
// 判断是否外包材
|
||||
if (whereJson.getString("sect_code").equals(IOSConstant.WBC01)) {
|
||||
resultList = mdPbStoragevehicleextMapper.pdaQueryIvtRegion(whereJson);
|
||||
} else {
|
||||
resultList = mdPbStoragevehicleextMapper.pdaQueryIvtSect(whereJson);
|
||||
}
|
||||
return PdaResponse.requestParamOk(resultList);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public interface PointToPointService {
|
||||
IPage<JSONObject> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增载具入库
|
||||
* 新增点对点任务
|
||||
*
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具编码
|
||||
|
||||
@@ -67,4 +67,15 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
||||
* @return PdaResponse
|
||||
*/
|
||||
List<JSONObject> queryRegionPoint(@Param("param") JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 手持功能
|
||||
* 点位更新 - 根据载具/点位查询明细
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* vehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
List<JSONObject> pdaQueryPointDtl(@Param("param") JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -141,4 +141,34 @@
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="pdaQueryPointDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
point.*,
|
||||
mater.material_id,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
late.pcsn,
|
||||
late.qty,
|
||||
late.qty_unit_id,
|
||||
late.qty_unit_name
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN md_pb_groupplate late ON point.vehicle_code = late.vehicle_code
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = late.material_id
|
||||
<where>
|
||||
point.is_used = '1'
|
||||
|
||||
<if test="param.point_code != null and param.point_code != ''">
|
||||
AND
|
||||
point.point_code = #{param.point_code}
|
||||
</if>
|
||||
|
||||
<if test="param.vehicle_code != null and param.vehicle_code != ''">
|
||||
AND
|
||||
point.vehicle_code = #{param.vehicle_code}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
INNER JOIN sch_base_taskconfig config ON task.config_code = config.config_code
|
||||
<where>
|
||||
task.is_delete = '0'
|
||||
AND task_status = '5'
|
||||
AND task_status IN ('6','5')
|
||||
<if test="param.search != null and param.search != ''">
|
||||
AND
|
||||
(task.vehicle_code = #{param.search} or
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package org.nl.wms.sch_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.PointToPointService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.mapper.SchBaseTaskMapper;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.PdaPointTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -38,6 +41,12 @@ public class PointToPointServiceImpl implements PointToPointService {
|
||||
@Resource
|
||||
private PdaPointTask pdaPointTask;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Resource
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||
@@ -52,6 +61,15 @@ public class PointToPointServiceImpl implements PointToPointService {
|
||||
if (whereJson.getString("point_code1").equals(whereJson.getString("point_code2"))) {
|
||||
throw new BadRequestException("起点和终点不能相同!");
|
||||
}
|
||||
SchBasePoint point_code1 = iSchBasePointService.getById(whereJson.getString("point_code1"));
|
||||
if (ObjectUtil.isEmpty(point_code1)) {
|
||||
throw new BadRequestException("起点不存在!【"+whereJson.getString("point_code1")+"】");
|
||||
}
|
||||
SchBasePoint point_code2 = iSchBasePointService.getById(whereJson.getString("point_code2"));
|
||||
if (ObjectUtil.isEmpty(point_code2)) {
|
||||
throw new BadRequestException("终点不存在!【"+whereJson.getString("point_code2")+"】");
|
||||
}
|
||||
|
||||
// 创建点对点任务
|
||||
JSONObject jsonTask = new JSONObject();
|
||||
jsonTask.put("point_code1", whereJson.getString("point_code1"));
|
||||
|
||||
@@ -8,9 +8,6 @@ import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.sch_manage.enums.TaskEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
@@ -52,12 +49,6 @@ public class PdaPointTask extends AbstractTask {
|
||||
@Resource
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
*/
|
||||
@Resource
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
@@ -70,12 +61,6 @@ public class PdaPointTask extends AbstractTask {
|
||||
task.setVehicle_code(json.getString("vehicle_code"));
|
||||
task.setMaterial_id(json.getString("material_id"));
|
||||
task.setMaterial_qty(json.getBigDecimal("material_qty"));
|
||||
if (ObjectUtil.isEmpty(json.getString("task_type"))) {
|
||||
task.setTask_type(IOSConstant.ONE);
|
||||
} else {
|
||||
task.setTask_type(json.getString("task_type"));
|
||||
}
|
||||
task.setExt_group_data(json.getString("ext_group_data"));
|
||||
task.setRequest_param(json.toString());
|
||||
task.setPriority(json.getString("Priority"));
|
||||
task.setContact_task(json.getString("contact_task"));
|
||||
@@ -177,28 +162,13 @@ public class PdaPointTask extends AbstractTask {
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("空位"))
|
||||
.set(SchBasePoint::getIng_task_code, "")
|
||||
);
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code1())
|
||||
.set(Structattr::getStoragevehicle_code, "")
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
);
|
||||
// 更新终点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code2())
|
||||
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
|
||||
.set(SchBasePoint::getIng_task_code, taskObj.getTask_id())
|
||||
.set(taskObj.getTask_type().equals(TaskEnum.TASK_TYPE.code("载具")),
|
||||
SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("空载具"))
|
||||
.set(!taskObj.getTask_type().equals(TaskEnum.TASK_TYPE.code("载具")),
|
||||
SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有箱有料"))
|
||||
);
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code2())
|
||||
.set(Structattr::getStoragevehicle_code, taskObj.getVehicle_code())
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有箱有料"))
|
||||
);
|
||||
// 更新任务
|
||||
taskObj.setRemark("已完成");
|
||||
@@ -208,27 +178,12 @@ public class PdaPointTask extends AbstractTask {
|
||||
|
||||
@Transactional
|
||||
public void cancelTask(SchBaseTask taskObj) {
|
||||
// 更新起点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code1())
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("空位"))
|
||||
);
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code1())
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
);
|
||||
// 更新终点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code2())
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("空位"))
|
||||
);
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code2())
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.set(SchBasePoint::getIng_task_code, "")
|
||||
);
|
||||
// 更新任务
|
||||
taskObj.setRemark("已取消");
|
||||
|
||||
@@ -47,6 +47,11 @@ public class IOSConstant {
|
||||
*/
|
||||
public final static String AGVZJZ001 = "AGVZJZ001";
|
||||
|
||||
/**
|
||||
* 手持-库存查询-类型类型下拉框- 内包材值
|
||||
*/
|
||||
public final static String WBC01 = "WBC01";
|
||||
|
||||
/**
|
||||
* 更新库存状态:加可用(插入数据)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user