Browse Source

陆运修改

Signed-off-by: sunhz <mpcoo@foxmail.com>
sunhz 3 years ago
parent
commit
a451ca721e

+ 7 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/CustomOssBuilder.java

@@ -3,9 +3,11 @@ package org.springblade.resource.builder.oss;
 import org.springblade.core.oss.rule.OssRule;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
 
 public class CustomOssBuilder implements OssRule {
 	private final Boolean tenantMode;
+
 	@Override
 	public String bucketName(String bucketName) {
 		String prefix = this.tenantMode ? AuthUtil.getTenantId().concat("-") : "";
@@ -14,8 +16,12 @@ public class CustomOssBuilder implements OssRule {
 
 	@Override
 	public String fileName(String originalFilename) {
-		return SecureUtil.getUser().getTenantId()+"/"+SecureUtil.getUser().getUserId()+"/"+originalFilename;
+		if (ObjectUtil.isNotEmpty(SecureUtil.getUser())) {
+			return SecureUtil.getUser().getTenantId() + "/" + SecureUtil.getUser().getUserId() + "/" + originalFilename;
+		}
+		return "land-ncp-check/" + originalFilename;
 	}
+
 	public CustomOssBuilder(final Boolean tenantMode) {
 		this.tenantMode = tenantMode;
 	}

+ 8 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java

@@ -84,6 +84,14 @@ public class OssBuilder {
 	 */
 	public OssTemplate template(String code) {
 		String tenantId = AuthUtil.getTenantId();
+		return initTemplate(tenantId, code);
+	}
+
+	public OssTemplate initTemplate(String tenantId) {
+		return initTemplate(tenantId, StringPool.EMPTY);
+	}
+
+	private OssTemplate initTemplate(String tenantId, String code) {
 		Oss oss = getOss(tenantId, code);
 		Oss ossCached = ossPool.get(tenantId);
 		OssTemplate template = templatePool.get(tenantId);

+ 16 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java

@@ -154,6 +154,22 @@ public class OssEndpoint {
 	/**
 	 * 上传文件
 	 *
+	 * @param file 文件
+	 * @return ObjectStat
+	 */
+	@SneakyThrows
+	@PostMapping("/put-file-no-login")
+	public R<BladeFile> putFileNoLogin(@RequestParam("file") MultipartFile file, @RequestParam("tenantId") String tenantId) {
+		BladeFile bladeFile = ossBuilder.initTemplate(tenantId).putFile(file.getOriginalFilename(), file.getInputStream());
+		String link = bladeFile.getLink();
+		String replace = link.replace("http://121.37.83.47:9000/", "https://trade.tubaosoft.com/file/");
+		bladeFile.setLink(replace);
+		return R.data(bladeFile);
+	}
+
+	/**
+	 * 上传文件
+	 *
 	 * @param fileName 存储桶对象名称
 	 * @param file     文件
 	 * @return ObjectStat

+ 34 - 0
blade-service-api/blade-land-api/src/main/java/org/springblade/land/dto/NcpCheckDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.land.dto;
+
+import org.springblade.land.entity.NcpCheck;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 陆运疫情审查表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-04-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class NcpCheckDTO extends NcpCheck {
+	private static final long serialVersionUID = 1L;
+
+}

+ 79 - 0
blade-service-api/blade-land-api/src/main/java/org/springblade/land/entity/NcpCheck.java

@@ -0,0 +1,79 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.land.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.client.entity.CommonFile;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 陆运疫情审查表实体类
+ *
+ * @author BladeX
+ * @since 2022-04-28
+ */
+@Data
+@TableName("land_ncp_check")
+@ApiModel(value = "NcpCheck对象", description = "陆运疫情审查表")
+public class NcpCheck implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@TableId
+	@ApiModelProperty(value = "主键")
+	private Long id;
+	/**
+	 * 车牌号
+	 */
+	@ApiModelProperty(value = "车牌号")
+	private String plateNo;
+	/**
+	 * 手机号
+	 */
+	@ApiModelProperty(value = "手机号")
+	private String tel;
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+	/**
+	 * 时间
+	 */
+	@ApiModelProperty(value = "时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date createTime;
+
+	@TableField(exist = false)
+	private List<CommonFile> fileList;
+
+}

+ 4 - 0
blade-service-api/blade-land-api/src/main/java/org/springblade/land/entity/OrderTrack.java

@@ -18,9 +18,11 @@ package org.springblade.land.entity;
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -113,6 +115,8 @@ public class OrderTrack implements Serializable {
 	 * 时间
 	 */
 	@ApiModelProperty(value = "时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	private Date createTime;
 
 

+ 36 - 0
blade-service-api/blade-land-api/src/main/java/org/springblade/land/vo/NcpCheckVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.land.vo;
+
+import org.springblade.land.entity.NcpCheck;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 陆运疫情审查表视图实体类
+ *
+ * @author BladeX
+ * @since 2022-04-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "NcpCheckVO对象", description = "陆运疫情审查表")
+public class NcpCheckVO extends NcpCheck {
+	private static final long serialVersionUID = 1L;
+
+}

+ 5 - 0
blade-service-api/blade-project-api/src/main/java/org/springblade/project/entity/HandoverItem.java

@@ -71,6 +71,11 @@ public class HandoverItem implements Serializable {
 	@ApiModelProperty(value = "单位")
 	private String unit;
 	/**
+	 * 类型
+	 */
+	@ApiModelProperty(value = "类型")
+	private String type;
+	/**
 	 * 金额
 	 */
 	@ApiModelProperty(value = "金额")

+ 143 - 0
blade-service/blade-land/src/main/java/org/springblade/land/controller/NcpCheckController.java

@@ -0,0 +1,143 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.land.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.land.entity.NcpCheck;
+import org.springblade.land.service.INcpCheckService;
+import org.springblade.land.vo.NcpCheckVO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+/**
+ * 陆运疫情审查表 控制器
+ *
+ * @author BladeX
+ * @since 2022-04-28
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/ncp-check")
+@Api(value = "陆运疫情审查表", tags = "陆运疫情审查表接口")
+public class NcpCheckController extends BladeController {
+
+	private final INcpCheckService ncpCheckService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入ncpCheck")
+	public R<NcpCheck> detail(NcpCheck ncpCheck) {
+		NcpCheck detail = ncpCheckService.getOne(Condition.getQueryWrapper(ncpCheck));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 陆运疫情审查表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入ncpCheck")
+	public R<IPage<NcpCheck>> list(NcpCheck ncpCheck, Query query) {
+		LambdaQueryWrapper<NcpCheck> wrapper = new LambdaQueryWrapper<>();
+		wrapper.like(StringUtil.isNotBlank(ncpCheck.getPlateNo()), NcpCheck::getPlateNo, ncpCheck.getPlateNo())
+			.like(StringUtil.isNotBlank(ncpCheck.getTel()), NcpCheck::getTel, ncpCheck.getTel())
+			.eq(NcpCheck::getTenantId, AuthUtil.getTenantId())
+			.orderByDesc(NcpCheck::getCreateTime);
+		IPage<NcpCheck> pages = ncpCheckService.page(Condition.getPage(query), wrapper);
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 陆运疫情审查表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入ncpCheck")
+	public R<IPage<NcpCheckVO>> page(NcpCheckVO ncpCheck, Query query) {
+		IPage<NcpCheckVO> pages = ncpCheckService.selectNcpCheckPage(Condition.getPage(query), ncpCheck);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 陆运疫情审查表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入ncpCheck")
+	public R save(@Valid @RequestBody NcpCheck ncpCheck) {
+		return R.status(ncpCheckService.saveNcpCheck(ncpCheck));
+	}
+
+	/**
+	 * 修改 陆运疫情审查表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入ncpCheck")
+	public R update(@Valid @RequestBody NcpCheck ncpCheck) {
+		return R.status(ncpCheckService.updateById(ncpCheck));
+	}
+
+	/**
+	 * 新增或修改 陆运疫情审查表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入ncpCheck")
+	public R submit(@Valid @RequestBody NcpCheck ncpCheck) {
+		return R.status(ncpCheckService.saveOrUpdate(ncpCheck));
+	}
+
+
+	/**
+	 * 删除 陆运疫情审查表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(ncpCheckService.removeByIds(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 附件列表
+	 */
+	@GetMapping("/file-list")
+	@ApiOperationSupport(order = 16)
+	@ApiOperation(value = "附件列表", notes = "传入id")
+	public R fileList(Long id) {
+		return R.data(ncpCheckService.fileList(id));
+	}
+
+}

+ 42 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/NcpCheckMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.land.mapper;
+
+import org.springblade.land.entity.NcpCheck;
+import org.springblade.land.vo.NcpCheckVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 陆运疫情审查表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-04-28
+ */
+public interface NcpCheckMapper extends BaseMapper<NcpCheck> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ncpCheck
+	 * @return
+	 */
+	List<NcpCheckVO> selectNcpCheckPage(IPage page, NcpCheckVO ncpCheck);
+
+}

+ 18 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/NcpCheckMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.land.mapper.NcpCheckMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ncpCheckResultMap" type="org.springblade.land.entity.NcpCheck">
+        <id column="id" property="id"/>
+        <result column="plate_no" property="plateNo"/>
+        <result column="tel" property="tel"/>
+        <result column="create_time" property="createTime"/>
+    </resultMap>
+
+
+    <select id="selectNcpCheckPage" resultMap="ncpCheckResultMap">
+        select * from land_ncp_check where is_deleted = 0
+    </select>
+
+</mapper>

+ 60 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/INcpCheckService.java

@@ -0,0 +1,60 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.land.service;
+
+import org.springblade.client.entity.CommonFile;
+import org.springblade.land.entity.NcpCheck;
+import org.springblade.land.vo.NcpCheckVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 陆运疫情审查表 服务类
+ *
+ * @author BladeX
+ * @since 2022-04-28
+ */
+public interface INcpCheckService extends IService<NcpCheck> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ncpCheck
+	 * @return
+	 */
+	IPage<NcpCheckVO> selectNcpCheckPage(IPage<NcpCheckVO> page, NcpCheckVO ncpCheck);
+
+	/**
+	 * 保存
+	 *
+	 * @param ncpCheck
+	 * @return
+	 */
+	boolean saveNcpCheck(NcpCheck ncpCheck);
+
+	/**
+	 * 附件列表
+	 *
+	 * @param id
+	 * @return
+	 */
+	List<CommonFile> fileList(Long id);
+
+}

+ 81 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/impl/NcpCheckServiceImpl.java

@@ -0,0 +1,81 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.land.service.impl;
+
+import lombok.AllArgsConstructor;
+import org.springblade.client.constant.LandConstant;
+import org.springblade.client.entity.CommonFile;
+import org.springblade.client.feign.ICommonFileClient;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.land.entity.NcpCheck;
+import org.springblade.land.vo.NcpCheckVO;
+import org.springblade.land.mapper.NcpCheckMapper;
+import org.springblade.land.service.INcpCheckService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 陆运疫情审查表 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-04-28
+ */
+@Service
+@AllArgsConstructor
+public class NcpCheckServiceImpl extends ServiceImpl<NcpCheckMapper, NcpCheck> implements INcpCheckService {
+
+	private final ICommonFileClient commonFileClient;
+
+	@Override
+	public IPage<NcpCheckVO> selectNcpCheckPage(IPage<NcpCheckVO> page, NcpCheckVO ncpCheck) {
+		return page.setRecords(baseMapper.selectNcpCheckPage(page, ncpCheck));
+	}
+
+	@Override
+	public boolean saveNcpCheck(NcpCheck ncpCheck) {
+		ncpCheck.setCreateTime(new Date());
+		baseMapper.insert(ncpCheck);
+
+		List<CommonFile> fileList = ncpCheck.getFileList();
+		fileList.forEach(file -> {
+			if (ObjectUtil.isEmpty(file.getId())) {
+				file.setPid(ncpCheck.getId());
+				file.setSource("LAND_NCP_CHECK");
+			}
+		});
+		commonFileClient.saveList(fileList);
+		return true;
+	}
+
+	@Override
+	public List<CommonFile> fileList(Long id) {
+		R<List<CommonFile>> fileList = commonFileClient.getList(id, "LAND_NCP_CHECK");
+		if (fileList.isSuccess() && fileList.getData() != null) {
+			return fileList.getData();
+		}
+		return Collections.emptyList();
+	}
+
+}

+ 3 - 1
blade-service/trade-purchase/src/main/java/com/trade/purchase/office/service/impl/StockServiceImpl.java

@@ -86,7 +86,9 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
 				.eq(Stock::getIsDeleted, 0)
 				.last("limit 1")
 			);
-			record.setInDate(stock.getInDate());
+			if (ObjectUtil.isNotEmpty(stock)) {
+				record.setInDate(stock.getInDate());
+			}
 
 			if (ObjectUtil.isNotEmpty(record.getGoodsId())) {
 				R<GoodsDescVO> goods = goodsDescClient.selectGoodsMessage(record.getGoodsId());