You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-wms-java/src/main/java/com/glxp/api/controller/inv/BadDbController.java

37 lines
1.4 KiB
Java

package com.glxp.api.controller.inv;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.inv.AnncmntProductEntity;
import com.glxp.api.req.inv.TraceRecordRequest;
import com.glxp.api.service.inv.AnncmntProductService;
import com.glxp.api.util.udi.FilterUdiUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
public class BadDbController extends BaseController {
@Resource
AnncmntProductService anncmntProductService;
/**
* UDI扫码校验不良信息库
*/
@GetMapping("udi/trace/badDb/search")
public BaseResponse badDbSearch(TraceRecordRequest traceRecordRequest) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(traceRecordRequest.getUdiCode());
AnncmntProductEntity anncmntProductEntity = anncmntProductService.getOne(new QueryWrapper<AnncmntProductEntity>().eq("nameCode", udiEntity.getUdi()).last("limit 1"));
if (anncmntProductEntity != null) {
return ResultVOUtils.success(anncmntProductEntity);
}
return ResultVOUtils.error(500, "无异常!");
}
}