浏览代码

修改商品信息,暂存

1021934019@qq.com 4 年之前
父节点
当前提交
74ba691732

+ 93 - 144
blade-service-api/blade-client-api/src/main/java/org/springblade/client/entity/GoodsDesc.java

@@ -17,15 +17,19 @@
 package org.springblade.client.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 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.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 商品详情表实体类
@@ -39,172 +43,117 @@ import java.util.Date;
 public class GoodsDesc implements Serializable {
 
 	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 主键
-	 */
-	@ApiModelProperty(value = "主键")
+	//主键
+	@TableId
 	private Long id;
-	/**
-	 * 商品编码
-	 */
-	@ApiModelProperty(value = "商品编码")
+	//商品编码
 	private String code;
-	/**
-	 * 商品名称
-	 */
-	@ApiModelProperty(value = "商品名称")
+	//商品名称
 	private String cname;
-	/**
-	 * 规格编码
-	 */
-	@ApiModelProperty(value = "规格编码")
+	//英文名称
+	private String ename;
+	//中文描述
+	private String nameDescription;
+	//英文描述
+	private String cnameDescription;
+	//规格编码
 	private String typeno;
-	/**
-	 * 品牌
-	 */
-	@ApiModelProperty(value = "品牌")
+	//英文规格
+	private String etypeno;
+	//海关编码
+	private String customCode;
+	//海关中文
+	private String customName;
+	//海关英文
+	private String customEname;
+	//退税率
+	private BigDecimal customRate;
+	//轮胎条数
+	private String unit;
+	//品牌
 	private String brand;
-	/**
-	 * 花纹
-	 */
-	@ApiModelProperty(value = "花纹")
+	//花纹
 	private String brandItem;
-	/**
-	 * 规格尺寸
-	 */
-	@ApiModelProperty(value = "规格尺寸")
+	//规格尺寸
 	private String specs;
-	/**
-	 * 产品类别
-	 */
-	@ApiModelProperty(value = "产品类别")
+	//产品类别
 	private String category;
-	/**
-	 * 产品类型
-	 */
-	@ApiModelProperty(value = "产品类型")
-	private Long type;
-	/**
-	 * 供应商
-	 */
-	@ApiModelProperty(value = "供应商")
+	//产品分类
+	private String categoryitem;
+	//备注(收费指示)
 	private String providers;
-	/**
-	 * 计量单位
-	 */
-	@ApiModelProperty(value = "计量单位")
-	private String unit;
-	/**
-	 * 包装单位
-	 */
-	@ApiModelProperty(value = "包装单位")
+	//长度单位
+	private String lengthUnit;
+	//重量单位
+	private String weightUnit;
+	//包装单位
 	private String packgeunit;
-	/**
-	 * 图片
-	 */
-	@ApiModelProperty(value = "图片")
+	//每箱尺寸
+	private BigDecimal cntrSize;
+	//每个体积
+	private BigDecimal singleVolumn;
+	//每个毛重
+	private BigDecimal singleGrossWeight;
+	//每个净重
+	private BigDecimal singleWeight;
+	//每个箱数
+	private BigDecimal singleCntr;
+	//每箱体积
+	private BigDecimal cntrVolumn;
+	//每箱毛重
+	private BigDecimal cntrGrossWeight;
+	//每箱净重
+	private BigDecimal cntrWeight;
+	//每箱数量
+	private BigDecimal cntrQuantity;
+	//包装描述
+	private String packageDescription;
+	//箱轮胎条数
+	private BigDecimal containerQuantity;
+	//图片
 	private String url;
-	/**
-	 * 备注
-	 */
-	@ApiModelProperty(value = "备注")
+	//质保期
+	private BigDecimal warrantyPeriod;
+	//频率
+	private String rate;
+	//单价
+	private BigDecimal price;
+	//工时
+	private BigDecimal workingHours;
+	//备注(收费指示)
 	private String remarks;
-	/**
-	 * 版本
-	 */
-	@ApiModelProperty(value = "版本")
+	//版本
 	private String version;
-	/**
-	 * 租户id
-	 */
-	@ApiModelProperty(value = "租户id")
+	//租户ID
 	private String tenantId;
-	/**
-	 * 创建人
-	 */
-	@ApiModelProperty(value = "创建人")
+	//修改人
+	private Long updateUser;
+	//创建人
 	private Long createUser;
-	/**
-	 * 创建部门
-	 */
-	@ApiModelProperty(value = "创建部门")
+	//创建部门
 	private Long createDept;
-	/**
-	 * 创建时间
-	 */
-	@ApiModelProperty(value = "创建时间")
+	//创建时间
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	private Date createTime;
-	/**
-	 * 修改人
-	 */
-	@ApiModelProperty(value = "修改人")
-	private Long updateUser;
-	/**
-	 * 修改时间
-	 */
-	@ApiModelProperty(value = "修改时间")
+	//修改时间
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	private Date updateTime;
-	/**
-	 * 状态(0 正常 1停用)
-	 */
-	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	//状态(0 正常 1停用)
 	private Integer status;
-	/**
-	 * 是否已删除(0 否 1是)
-	 */
-	//@TableLogic
-	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	//是否已删除(0 否 1是)
+	@TableLogic
 	private Integer isDeleted;
-	/**
-	 * 商品类别
-	 */
-	@ApiModelProperty(value = "商品类别")
-	@TableField(exist = false)
+	//枚举
+	private Long type;
+
 	private String goodsTypeId;
-	/**
-	 * 商品类别名称
-	 */
-	@ApiModelProperty(value = "商品类别名称")
-	@TableField(exist = false)
-	private String goodsTypeName;
-	/**
-	 * 规格型号
-	 */
-	@ApiModelProperty(value = "规格型号")
-	@TableField(exist = false)
-	private String specificationAndModel;
 
+	@TableField(exist = false)
+	private List<GoodsPrice>  saleGoodsPrice;
 
-	/**
-	 * 产品分类
-	 */
-	@ApiModelProperty(value = "产品分类")
-	private String categoryItem;
-	/**
-	 * 轮胎条数
-	 */
-	@ApiModelProperty(value = "轮胎条数")
-	private BigDecimal containerQuantity;
-	/**
-	 * 保质期
-	 */
-	@ApiModelProperty(value = "保质期")
-	private Date warrantyPeriod;
-	/**
-	 * 频率
-	 */
-	@ApiModelProperty(value = "频率")
-	private String rate;
-	/**
-	 * 单价
-	 */
-	@ApiModelProperty(value = "单价")
-	private BigDecimal price;
-	/**
-	 * 工时
-	 */
-	@ApiModelProperty(value = "工时")
-	private BigDecimal workingHours;
+	@TableField(exist = false)
+	private List<GoodsPrice>  bugGoodsPrice;
 
 }

+ 94 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/entity/GoodsPrice.java

@@ -0,0 +1,94 @@
+/*
+ *      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.client.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 商品详情表实体类
+ *
+ * @author BladeX
+ * @since 2021-09-18
+ */
+@Data
+@TableName("basic_goods_price")
+@ApiModel(value = "GoodsDesc对象", description = "商品详情表")
+public class GoodsPrice implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+	//主键
+	@TableId
+	private Long id;
+	//商品编码
+	private Long pid;
+	//单据类型
+	private String billType;
+	//供应商
+	private Long corpId;
+    //币别
+	private String currency;
+    //单价
+	private BigDecimal price;
+    //是否含税
+	private int ifTax;
+	//中文描述
+	private BigDecimal taxRate;
+	//单位
+	private String unit;
+	//备注
+	private String remarks;
+	//版本
+	private String version;
+	//租户
+	private String tenantId;
+	//海关中文
+	private Long updateUser;
+	//创建人
+	private Long createUser;
+	//创建部门
+	private Long createDept;
+	//创建时间
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date createTime;
+	//修改时间
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date updateTime;
+	//状态(0 正常 1停用)
+	private Integer status;
+	//是否已删除(0 否 1是)
+	@TableLogic
+	private Integer isDeleted;
+	//枚举
+	private Long type;
+
+	private String goodsTypeId;
+
+
+}

+ 30 - 6
blade-service/blade-client/src/main/java/org/springblade/client/goods/controller/GoodsDescController.java

@@ -17,6 +17,8 @@
 package org.springblade.client.goods.controller;
 
 import com.alibaba.nacos.api.utils.StringUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -72,14 +74,36 @@ public class GoodsDescController extends BladeController {
 	@GetMapping("/list")
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入goodsDesc")
-	public R<IPage<GoodsDescVO>> list(GoodsDescVO goodsDesc, Query query) {
-		goodsDesc.setTenantId(AuthUtil.getTenantId());
-		goodsDesc.setIsDeleted(0);
-		goodsDesc.setType(GoodsTypeEnum.GOODS.getType());
-		IPage<GoodsDescVO> pages = goodsDescService.selectGoodsDescPage(Condition.getPage(query),goodsDesc);
-		return R.data(pages);
+	public R<?> list(@RequestParam(name = "current", defaultValue = "1") Integer current,
+					 @RequestParam(name = "size", defaultValue = "10") Integer size,
+					 @RequestParam(name = "cname", required = false) String cname,
+					 @RequestParam(name = "code", required = false) String code
+					 )
+	{
+		LambdaQueryWrapper<GoodsDesc> goodsDescLambdaQueryWrapper=new LambdaQueryWrapper<>();
+		goodsDescLambdaQueryWrapper
+			.like(!StringUtils.isBlank(cname),GoodsDesc::getCname,cname)
+			.like(!StringUtils.isBlank(code),GoodsDesc::getCode,code)
+			.eq(GoodsDesc::getTenantId,AuthUtil.getTenantId())
+		    .orderByDesc(GoodsDesc::getCreateTime);
+		Page<GoodsDesc> page=new Page<>(current,size);
+		IPage<GoodsDesc> iPage=goodsDescService.page(page,goodsDescLambdaQueryWrapper);
+		return R.data(iPage);
+	}
+
+	/**
+	 * 分页 商品详情表
+	 */
+	@PostMapping("/modify")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入goodsDesc")
+	public R<?> modify(@RequestBody GoodsDesc goodsDesc)
+	{
+		goodsDescService.modify(goodsDesc);
+		return R.success("操作成功");
 	}
 
+
 	/**
 	 * 自定义分页 商品详情表
 	 */

+ 1 - 1
blade-service/blade-client/src/main/java/org/springblade/client/goods/mapper/GoodsDescMapper.java

@@ -22,7 +22,7 @@ public interface GoodsDescMapper extends BaseMapper<GoodsDesc> {
 	 * @param goodsDesc
 	 * @return
 	 */
-	List<GoodsDescVO> selectGoodsDescPage(IPage page, @Param("GoodsDesc") GoodsDescVO goodsDesc);
+	List<GoodsDescVO> selectGoodsDescPage(IPage page, @Param("GoodsDesc") GoodsDescVO goodsDesc,@Param("tenantId")String tenantId);
 
 	/**
 	 * 查询商品编码

+ 32 - 10
blade-service/blade-client/src/main/java/org/springblade/client/goods/mapper/GoodsDescMapper.xml

@@ -7,24 +7,44 @@
         <id column="id" property="id"/>
         <result column="code" property="code"/>
         <result column="cname" property="cname"/>
+        <result column="cname" property="cname"/>
+        <result column="name_description" property="nameDescription"/>
+        <result column="cname_description" property="cnameDescription"/>
         <result column="typeno" property="typeno"/>
+        <result column="etypeno" property="etypeno"/>
+        <result column="custom_code" property="customCode"/>
+        <result column="custom_name" property="customName"/>
+        <result column="custom_ename" property="customEname"/>
+        <result column="custom_rate" property="customRate"/>
+        <result column="unit" property="unit"/>
         <result column="brand" property="brand"/>
-        <result column="brand_item" property="brandItem"/>
+        <result column="branditem" property="branditem"/>
         <result column="specs" property="specs"/>
         <result column="category" property="category"/>
-        <result column="category_item" property="categoryItem"/>
+        <result column="categoryitem" property="categoryitem"/>
         <result column="providers" property="providers"/>
-        <result column="unit" property="unit"/>
+        <result column="length_unit" property="lengthUnit"/>
+        <result column="weight_unit" property="weightUnit"/>
         <result column="packgeunit" property="packgeunit"/>
-        <result column="container_quantity" property="containerQuantity"/>
+        <result column="cntr_size" property="cntrSize"/>
+        <result column="single_volumn" property="singleVolumn"/>
+        <result column="single_gross_weight" property="singleGrossWeight"/>
+        <result column="single_weight" property="singleWeight"/>
+        <result column="single_cntr" property="singleCntr"/>
+        <result column="cntr_volumn" property="cntrVolumn"/>
+        <result column="cntr_gross_weight" property="cntrGrossWeight"/>
+        <result column="cntr_weight" property="cntrWeight"/>
+        <result column="cntr_quantity" property="cntrQuantity"/>
+        <result column="package_description" property="packageDescription"/>
+        <result column="Container_quantity" property="containerQuantity"/>
+        <result column="url" property="url"/>
         <result column="warranty_period" property="warrantyPeriod"/>
         <result column="rate" property="rate"/>
-        <result column="type" property="type"/>
-        <result column="price" property="price"/>
-        <result column="working_hours" property="workingHours"/>
-        <result column="url" property="url"/>
+        <result column="Price" property="price"/>
+        <result column="Working_hours" property="workingHours"/>
         <result column="remarks" property="remarks"/>
         <result column="version" property="version"/>
+        <result column="tenant_id" property="tenantId"/>
         <result column="create_user" property="createUser"/>
         <result column="create_dept" property="createDept"/>
         <result column="create_time" property="createTime"/>
@@ -32,6 +52,8 @@
         <result column="update_time" property="updateTime"/>
         <result column="status" property="status"/>
         <result column="is_deleted" property="isDeleted"/>
+        <result column="type" property="type"/>
+        <result column="goods_type_id" property="goodsTypeId"/>
     </resultMap>
 
 
@@ -75,8 +97,8 @@
         <if test="GoodsDesc.packgeunit!=null and GoodsDesc.packgeunit != ''">
             and packgeunit = #{GoodsDesc.packgeunit}
         </if>
-        <if test="GoodsDesc.tenantId!=null and GoodsDesc.tenantId != ''">
-            and tenant_id = #{GoodsDesc.tenantId}
+        <if test="tenantId!=null and tenantId != ''">
+            and tenant_id = #{tenantId}
         </if>
         <if test="GoodsDesc.url!=null and GoodsDesc.url != ''">
             and url = #{GoodsDesc.url}

+ 23 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/mapper/GoodsPriceMapper.java

@@ -0,0 +1,23 @@
+package org.springblade.client.goods.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.client.entity.GoodsDesc;
+import org.springblade.client.entity.GoodsPrice;
+import org.springblade.client.vo.GoodsDescVO;
+
+import java.util.List;
+
+/**
+ * 商品详情表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-09-18
+ */
+public interface GoodsPriceMapper extends BaseMapper<GoodsPrice>
+{
+
+
+
+}

+ 7 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/mapper/GoodsPriceMapper.xml

@@ -0,0 +1,7 @@
+<?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.client.goods.mapper.GoodsPriceMapper">
+
+
+
+</mapper>

+ 2 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/service/IGoodsDescService.java

@@ -77,4 +77,6 @@ public interface IGoodsDescService extends IService<GoodsDesc> {
 	 * @return
 	 */
 	GoodsDesc selectGoodsMessage(Long Id);
+
+	void modify(GoodsDesc goodsDesc);
 }

+ 34 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/service/IGoodsPriceService.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.client.goods.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.client.entity.GoodsDesc;
+import org.springblade.client.entity.GoodsPrice;
+import org.springblade.client.vo.GoodsDescVO;
+
+/**
+ * 商品详情表 服务类
+ *
+ * @author BladeX
+ * @since 2021-09-18
+ */
+public interface IGoodsPriceService extends IService<GoodsPrice> {
+
+
+}

+ 7 - 1
blade-service/blade-client/src/main/java/org/springblade/client/goods/service/impl/GoodsDescServiceImpl.java

@@ -58,7 +58,7 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, GoodsDesc
 			List<Long> longList = goodsTypeService.goodTypeIdList(goodsDesc.getGoodsTypeId());
 			goodsDesc.setGoodsTypeIdList(longList);
 		}
-		return page.setRecords(baseMapper.selectGoodsDescPage(page, goodsDesc));
+		return page.setRecords(baseMapper.selectGoodsDescPage(page, goodsDesc,AuthUtil.getTenantId()));
 	}
 
 	@Override
@@ -162,4 +162,10 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, GoodsDesc
 		return baseMapper.selectGoodsMessage(Id);
 	}
 
+	@Override
+	public void modify(GoodsDesc goodsDesc)
+	{
+
+	}
+
 }

+ 56 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/service/impl/GoodsPriceServiceImpl.java

@@ -0,0 +1,56 @@
+/*
+ *      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.client.goods.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.client.entity.GoodsDesc;
+import org.springblade.client.entity.GoodsPrice;
+import org.springblade.client.entity.GoodsTypeDesc;
+import org.springblade.client.goods.mapper.GoodsDescMapper;
+import org.springblade.client.goods.mapper.GoodsPriceMapper;
+import org.springblade.client.goods.service.IGoodsDescService;
+import org.springblade.client.goods.service.IGoodsPriceService;
+import org.springblade.client.vo.GoodsDescVO;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 商品详情表 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-09-18
+ */
+@Service
+@AllArgsConstructor
+public class GoodsPriceServiceImpl extends ServiceImpl<GoodsPriceMapper, GoodsPrice> implements IGoodsPriceService {
+
+
+}