bug修改
parent
befae82898
commit
0fedc117bf
Binary file not shown.
|
After Width: | Height: | Size: 205 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 139 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 214 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 215 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,89 @@
|
||||
package cn.iocoder.yudao.module.camera.controller.admin.kesc;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.camera.framework.netty.ksec.KsecDataInfo;
|
||||
import cn.iocoder.yudao.module.camera.service.plc.PLCService;
|
||||
import cn.iocoder.yudao.module.system.service.sse.SseClient;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Tag(name = "管理后台 - 随行盘点")
|
||||
@RestController
|
||||
@RequestMapping("/logistics/StockController")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class StockControlController {
|
||||
|
||||
@Resource
|
||||
PLCService plcService;
|
||||
@Resource
|
||||
SseClient sseClient;
|
||||
|
||||
|
||||
@PostMapping("/openCamera")
|
||||
@Operation(summary = "随行盘点开始任务")
|
||||
@ResponseBody
|
||||
@PermitAll
|
||||
public CommonResult<String> openCamera(@RequestBody KsecDataInfo kescEntity){
|
||||
kescEntity = kescEntity.fromBySRMNumber(kescEntity);
|
||||
|
||||
// 随行开始
|
||||
if (kescEntity.getCmdName().equals("B1")){
|
||||
plcService.orderStart(kescEntity);
|
||||
}else if (kescEntity.getCmdName().equals("E")){
|
||||
// 盘点
|
||||
plcService.checkStart(kescEntity);
|
||||
}
|
||||
|
||||
return CommonResult.success("","OK");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/updateResult")
|
||||
@Operation(summary = "模拟随行盘点结果返回状态")
|
||||
@ResponseBody
|
||||
@PermitAll
|
||||
public CommonResult<KsecDataInfo> updateResult( KsecDataInfo kescEntity){
|
||||
log.info("模拟随行盘点结果返回状态:{}",kescEntity);
|
||||
return CommonResult.success(kescEntity,"OK");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/setUpdateStatus")
|
||||
@Operation(summary = "随行盘点更新状态")
|
||||
@ResponseBody
|
||||
@PermitAll
|
||||
public CommonResult<KsecDataInfo> setUpdateStatus(KsecDataInfo kescEntity){
|
||||
log.info("随行盘点更新状态:{}",kescEntity);
|
||||
return CommonResult.success(kescEntity,"OK");
|
||||
}
|
||||
@PostMapping("/updateStatus")
|
||||
@Operation(summary = "随行盘点更新状态")
|
||||
@ResponseBody
|
||||
@PermitAll
|
||||
public CommonResult<String> updateStatus(@RequestBody KsecDataInfo kescEntity){
|
||||
if (kescEntity.getCmdName().equals("B2")){
|
||||
// 随行结束
|
||||
plcService.orderStop(kescEntity.getTaskId());
|
||||
}else if (kescEntity.getCmdName().startsWith("E")){
|
||||
// 盘点操作
|
||||
plcService.check(kescEntity.getTaskId(),kescEntity.getCmdName());
|
||||
if (kescEntity.getCmdName().equals("E3")){
|
||||
plcService.checkStop(kescEntity.getTaskId());
|
||||
}
|
||||
}else if (kescEntity.getCmdName().startsWith("C")){
|
||||
plcService.action(kescEntity.getTaskId(),kescEntity.getCmdName());
|
||||
}
|
||||
|
||||
return CommonResult.success("","OK");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.camera.controller.admin.shelfCode;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo.ShelfCodePageReqVO;
|
||||
import cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo.ShelfCodeRespVO;
|
||||
import cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo.ShelfCodeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.camera.dal.dataobject.shelfCode.rfid.ShelfCodeDO;
|
||||
import cn.iocoder.yudao.module.camera.service.shelfCode.ShelfCodeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ShelfCode")
|
||||
@RestController
|
||||
@RequestMapping("/logistics/ShelfCode")
|
||||
@Validated
|
||||
public class ShelfCodeController {
|
||||
|
||||
@Resource
|
||||
private ShelfCodeService shelfCodeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ShelfCode")
|
||||
@PreAuthorize("@ss.hasPermission('logistics:ShelfCode:create')")
|
||||
public CommonResult<Integer> createShelfCode(@Valid @RequestBody ShelfCodeSaveReqVO createReqVO) {
|
||||
return success(shelfCodeService.createShelfCode(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ShelfCode")
|
||||
@PreAuthorize("@ss.hasPermission('logistics:ShelfCode:update')")
|
||||
public CommonResult<Boolean> updateShelfCode(@Valid @RequestBody ShelfCodeSaveReqVO updateReqVO) {
|
||||
shelfCodeService.updateShelfCode(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ShelfCode")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('logistics:ShelfCode:delete')")
|
||||
public CommonResult<Boolean> deleteShelfCode(@RequestParam("id") Integer id) {
|
||||
shelfCodeService.deleteShelfCode(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ShelfCode")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('logistics:ShelfCode:query')")
|
||||
public CommonResult<ShelfCodeRespVO> getShelfCode(@RequestParam("id") Integer id) {
|
||||
ShelfCodeDO ShelfCode = shelfCodeService.getShelfCode(id);
|
||||
return success(BeanUtils.toBean(ShelfCode, ShelfCodeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ShelfCode分页")
|
||||
@PreAuthorize("@ss.hasPermission('logistics:ShelfCode:query')")
|
||||
public CommonResult<PageResult<ShelfCodeRespVO>> getShelfCodePage(@Valid ShelfCodePageReqVO pageReqVO) {
|
||||
PageResult<ShelfCodeDO> pageResult = shelfCodeService.getShelfCodePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ShelfCodeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ShelfCode Excel")
|
||||
@PreAuthorize("@ss.hasPermission('logistics:ShelfCode:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportShelfCodeExcel(@Valid ShelfCodePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ShelfCodeDO> list = shelfCodeService.getShelfCodePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ShelfCode.xls", "数据", ShelfCodeRespVO.class,
|
||||
BeanUtils.toBean(list, ShelfCodeRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - ShelfCode分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ShelfCodePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "巷道id", example = "8923")
|
||||
private Integer streetId;
|
||||
|
||||
@Schema(description = "方向")
|
||||
private Integer direction;
|
||||
|
||||
@Schema(description = "separation")
|
||||
@ExcelProperty("separation")
|
||||
private String separation;
|
||||
|
||||
@Schema(description = "货架号")
|
||||
@ExcelProperty("货架号")
|
||||
private String shelfCode;
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - ShelfCode Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ShelfCodeRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3186")
|
||||
@ExcelProperty("id")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "巷道id", example = "8923")
|
||||
@ExcelProperty("巷道id")
|
||||
private Integer streetId;
|
||||
|
||||
@Schema(description = "方向")
|
||||
@ExcelProperty(value = "方向", converter = DictConvert.class)
|
||||
@DictFormat("direction") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer direction;
|
||||
|
||||
@Schema(description = "separation")
|
||||
@ExcelProperty("separation")
|
||||
private String separation;
|
||||
|
||||
@Schema(description = "货架号")
|
||||
@ExcelProperty("货架号")
|
||||
private String shelfCode;
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - ShelfCode新增/修改 Request VO")
|
||||
@Data
|
||||
public class ShelfCodeSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3186")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "巷道id", example = "8923")
|
||||
private Integer streetId;
|
||||
|
||||
@Schema(description = "方向")
|
||||
private Integer direction;
|
||||
|
||||
@Schema(description = "separation")
|
||||
@ExcelProperty("separation")
|
||||
private String separation;
|
||||
|
||||
@Schema(description = "货架号")
|
||||
@ExcelProperty("货架号")
|
||||
private String shelfCode;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.camera.dal.mysql.shelfCode;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo.ShelfCodePageReqVO;
|
||||
import cn.iocoder.yudao.module.camera.dal.dataobject.shelfCode.rfid.ShelfCodeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* RFID Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ShelfCodeMapper extends BaseMapperX<ShelfCodeDO> {
|
||||
|
||||
default PageResult<ShelfCodeDO> selectPage(ShelfCodePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ShelfCodeDO>()
|
||||
.eqIfPresent(ShelfCodeDO::getStreetId, reqVO.getStreetId())
|
||||
.eqIfPresent(ShelfCodeDO::getDirection, reqVO.getDirection())
|
||||
.eqIfPresent(ShelfCodeDO::getShelfCode, reqVO.getShelfCode())
|
||||
.eqIfPresent(ShelfCodeDO::getSeparation, reqVO.getSeparation())
|
||||
.orderByDesc(ShelfCodeDO::getId));
|
||||
}
|
||||
|
||||
|
||||
default List<ShelfCodeDO> selectListByStreetId(Integer streetId) {
|
||||
return selectList(ShelfCodeDO::getStreetId, streetId);
|
||||
}
|
||||
|
||||
default int deleteByStreetId(Integer streetId) {
|
||||
return delete(ShelfCodeDO::getStreetId, streetId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.camera.service.shelfCode;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo.ShelfCodePageReqVO;
|
||||
import cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo.ShelfCodeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.camera.dal.dataobject.shelfCode.rfid.ShelfCodeDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* RFID Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ShelfCodeService {
|
||||
|
||||
/**
|
||||
* 创建RFID
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createShelfCode(@Valid ShelfCodeSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新RFID
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateShelfCode(@Valid ShelfCodeSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除RFID
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteShelfCode(Integer id);
|
||||
|
||||
/**
|
||||
* 获得RFID
|
||||
*
|
||||
* @param id 编号
|
||||
* @return RFID
|
||||
*/
|
||||
ShelfCodeDO getShelfCode(Integer id);
|
||||
|
||||
/**
|
||||
* 获得RFID分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return RFID分页
|
||||
*/
|
||||
PageResult<ShelfCodeDO> getShelfCodePage(ShelfCodePageReqVO pageReqVO);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.camera.service.shelfCode;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo.ShelfCodePageReqVO;
|
||||
import cn.iocoder.yudao.module.camera.controller.admin.shelfCode.vo.ShelfCodeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.camera.dal.dataobject.shelfCode.rfid.ShelfCodeDO;
|
||||
import cn.iocoder.yudao.module.camera.dal.mysql.shelfCode.ShelfCodeMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.RFID_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* RFID Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ShelfCodeServiceImpl implements ShelfCodeService {
|
||||
|
||||
|
||||
@Resource
|
||||
private ShelfCodeMapper shelfCodeMapper;
|
||||
|
||||
@Override
|
||||
public Integer createShelfCode(ShelfCodeSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ShelfCodeDO shelfCode = BeanUtils.toBean(createReqVO, ShelfCodeDO.class);
|
||||
shelfCodeMapper.insert(shelfCode);
|
||||
// 返回
|
||||
return shelfCode.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShelfCode(ShelfCodeSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateShelfCodeExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ShelfCodeDO updateObj = BeanUtils.toBean(updateReqVO, ShelfCodeDO.class);
|
||||
shelfCodeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteShelfCode(Integer id) {
|
||||
// 校验存在
|
||||
validateShelfCodeExists(id);
|
||||
// 删除
|
||||
shelfCodeMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateShelfCodeExists(Integer id) {
|
||||
if (shelfCodeMapper.selectById(id) == null) {
|
||||
throw exception(RFID_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShelfCodeDO getShelfCode(Integer id) {
|
||||
return shelfCodeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ShelfCodeDO> getShelfCodePage(ShelfCodePageReqVO pageReqVO) {
|
||||
return shelfCodeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package cn.iocoder.yudao.module.camera.service.shelfCode;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* sick扫码枪
|
||||
*/
|
||||
@Slf4j
|
||||
public class ShelfCodeSocket {
|
||||
|
||||
}
|
||||
@ -1,13 +1,15 @@
|
||||
package cn.iocoder.yudao.module.camera.service.streamingMedia;
|
||||
|
||||
import cn.iocoder.yudao.module.camera.dal.dataobject.camera.CameraDO;
|
||||
import cn.iocoder.yudao.module.camera.dal.zlm.RtspSessionResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ZLMediaKitService {
|
||||
String startRecord(String app, String stream);
|
||||
void stopRecord(String app, String stream);
|
||||
RtspSessionResponse stopRecord(String app, String stream);
|
||||
void addRtspProxy(CameraDO camera, String zlmApiUrl, String zlmApiSecret);
|
||||
void pic(CameraDO camera, String zlmApiUrl);
|
||||
void zlmConf( List<CameraDO> list);
|
||||
void deleteRecordDirectory(String app, String stream, String period);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue