mirror of https://github.com/jeecgboot/jeecg-boot
Add generated models, mappers, and services for ShoumanCategory, ShoumanOrder and ShoumanSkuRelation
parent
11867df921
commit
c3407a66e6
|
@ -0,0 +1,103 @@
|
||||||
|
package org.jeecg.modules.business.entity.Shouman;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼产品类别
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-12-01
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "shouman_category对象", description = "首曼产品类别")
|
||||||
|
@Data
|
||||||
|
@TableName("shouman_category")
|
||||||
|
public class ShoumanCategory implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**
|
||||||
|
* 创建日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**
|
||||||
|
* 更新日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "产品名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "产品名称")
|
||||||
|
private java.lang.String productName;
|
||||||
|
/**
|
||||||
|
* 内部名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "内部名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "内部名称")
|
||||||
|
private java.lang.String internalName;
|
||||||
|
/**
|
||||||
|
* 产品款式图链接
|
||||||
|
*/
|
||||||
|
@Excel(name = "产品款式图链接", width = 15)
|
||||||
|
@ApiModelProperty(value = "产品款式图链接")
|
||||||
|
private java.lang.String imageUrl;
|
||||||
|
/**
|
||||||
|
* 首曼内部SKU代码
|
||||||
|
*/
|
||||||
|
@Excel(name = "首曼内部SKU代码", width = 15)
|
||||||
|
@ApiModelProperty(value = "首曼内部SKU代码")
|
||||||
|
private java.lang.String sku;
|
||||||
|
/**
|
||||||
|
* 单价
|
||||||
|
*/
|
||||||
|
@Excel(name = "单价", width = 15)
|
||||||
|
@ApiModelProperty(value = "单价")
|
||||||
|
private java.math.BigDecimal price;
|
||||||
|
/**
|
||||||
|
* 定制内容识别正则式
|
||||||
|
*/
|
||||||
|
@Excel(name = "定制内容识别正则式", width = 15)
|
||||||
|
@ApiModelProperty(value = "定制内容识别正则式")
|
||||||
|
private java.lang.String contentRecRegex;
|
||||||
|
/**
|
||||||
|
* 定制内容提取正则式
|
||||||
|
*/
|
||||||
|
@Excel(name = "定制内容提取正则式", width = 15)
|
||||||
|
@ApiModelProperty(value = "定制内容提取正则式")
|
||||||
|
private java.lang.String contentExtRegex;
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
package org.jeecg.modules.business.entity.Shouman;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼订单
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-12-05
|
||||||
|
* @Version: V1.1
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("shouman_order")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "shouman_order对象", description = "首曼订单")
|
||||||
|
public class ShoumanOrder implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**
|
||||||
|
* 创建日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**
|
||||||
|
* 更新日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
/**
|
||||||
|
* 平台订单ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "平台订单ID", width = 15, dictTable = "platform_order", dicText = "platform_order_id", dicCode = "id")
|
||||||
|
@Dict(dictTable = "platform_order", dicText = "platform_order_id", dicCode = "id")
|
||||||
|
@ApiModelProperty(value = "平台订单ID")
|
||||||
|
private java.lang.String platformOrderId;
|
||||||
|
/**
|
||||||
|
* 订单内容JSON
|
||||||
|
*/
|
||||||
|
@Excel(name = "订单内容JSON", width = 15)
|
||||||
|
@ApiModelProperty(value = "订单内容JSON")
|
||||||
|
private java.lang.String orderJson;
|
||||||
|
/**
|
||||||
|
* 请求成功
|
||||||
|
*/
|
||||||
|
@Excel(name = "请求成功", width = 15, dictTable = "yn", dicText = "", dicCode = "")
|
||||||
|
@Dict(dictTable = "yn", dicText = "", dicCode = "")
|
||||||
|
@ApiModelProperty(value = "请求成功")
|
||||||
|
private java.lang.String success;
|
||||||
|
/**
|
||||||
|
* 签名字符串值
|
||||||
|
*/
|
||||||
|
@Excel(name = "签名字符串值", width = 15)
|
||||||
|
@ApiModelProperty(value = "签名字符串值")
|
||||||
|
private java.lang.String signatureString;
|
||||||
|
/**
|
||||||
|
* 签名MD5值
|
||||||
|
*/
|
||||||
|
@Excel(name = "签名MD5值", width = 15)
|
||||||
|
@ApiModelProperty(value = "签名MD5值")
|
||||||
|
private java.lang.String signatureMd5;
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
package org.jeecg.modules.business.entity.Shouman;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼产品类别与SKU关系
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "shouman_sku_relation对象", description = "首曼产品类别与SKU关系")
|
||||||
|
@Data
|
||||||
|
@TableName("shouman_sku_relation")
|
||||||
|
public class ShoumanSkuRelation implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**
|
||||||
|
* 创建日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**
|
||||||
|
* 更新日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
/**
|
||||||
|
* 首曼产品类别ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "首曼产品类别ID")
|
||||||
|
private java.lang.String shoumanCategoryId;
|
||||||
|
/**
|
||||||
|
* SKU ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "SKU ID", width = 15, dictTable = "sku", dicText = "erp_code", dicCode = "id")
|
||||||
|
@ApiModelProperty(value = "SKU ID")
|
||||||
|
private java.lang.String skuId;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@Excel(name = "备注", width = 15)
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private java.lang.String remark;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.jeecg.modules.business.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanCategory;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼产品类别
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface ShoumanCategoryMapper extends BaseMapper<ShoumanCategory> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.modules.business.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanOrder;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼订单
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface ShoumanOrderMapper extends BaseMapper<ShoumanOrder> {
|
||||||
|
|
||||||
|
List<ShoumanOrder> findShoumanOrderToSend();
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package org.jeecg.modules.business.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanSkuRelation;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼产品类别与SKU关系
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface ShoumanSkuRelationMapper extends BaseMapper<ShoumanSkuRelation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过主表id删除子表数据
|
||||||
|
*
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public boolean deleteByMainId(@Param("mainId") String mainId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过主表id查询子表数据
|
||||||
|
*
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @return List<ShoumanSkuRelation>
|
||||||
|
*/
|
||||||
|
public List<ShoumanSkuRelation> selectByMainId(@Param("mainId") String mainId);
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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.jeecg.modules.business.mapper.ShoumanCategoryMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?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.jeecg.modules.business.mapper.ShoumanOrderMapper">
|
||||||
|
<select id="findShoumanOrderToSend" resultType="org.jeecg.modules.business.entity.Shouman.ShoumanOrder">
|
||||||
|
SELECT *
|
||||||
|
FROM shouman_order
|
||||||
|
WHERE success = 0;
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?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.jeecg.modules.business.mapper.ShoumanSkuRelationMapper">
|
||||||
|
|
||||||
|
<delete id="deleteByMainId" parameterType="java.lang.String">
|
||||||
|
DELETE
|
||||||
|
FROM shouman_sku_relation
|
||||||
|
WHERE
|
||||||
|
shouman_category_id = #{mainId} </delete>
|
||||||
|
|
||||||
|
<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.business.entity.Shouman.ShoumanSkuRelation">
|
||||||
|
SELECT *
|
||||||
|
FROM shouman_sku_relation
|
||||||
|
WHERE
|
||||||
|
shouman_category_id = #{mainId} </select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,49 @@
|
||||||
|
package org.jeecg.modules.business.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanCategory;
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanSkuRelation;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼产品类别
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IShoumanCategoryService extends IService<ShoumanCategory> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加一对多
|
||||||
|
*
|
||||||
|
* @param shoumanCategory
|
||||||
|
* @param shoumanSkuRelationList
|
||||||
|
*/
|
||||||
|
public void saveMain(ShoumanCategory shoumanCategory,List<ShoumanSkuRelation> shoumanSkuRelationList) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改一对多
|
||||||
|
*
|
||||||
|
* @param shoumanCategory
|
||||||
|
* @param shoumanSkuRelationList
|
||||||
|
*/
|
||||||
|
public void updateMain(ShoumanCategory shoumanCategory,List<ShoumanSkuRelation> shoumanSkuRelationList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除一对多
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void delMain (String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除一对多
|
||||||
|
*
|
||||||
|
* @param idList
|
||||||
|
*/
|
||||||
|
public void delBatchMain (Collection<? extends Serializable> idList);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package org.jeecg.modules.business.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanOrder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼订单
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IShoumanOrderService extends IService<ShoumanOrder> {
|
||||||
|
|
||||||
|
List<ShoumanOrder> findShoumanOrderToSend();
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package org.jeecg.modules.business.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanSkuRelation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼产品类别与SKU关系
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IShoumanSkuRelationService extends IService<ShoumanSkuRelation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过主表id查询子表数据
|
||||||
|
*
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @return List<ShoumanSkuRelation>
|
||||||
|
*/
|
||||||
|
public List<ShoumanSkuRelation> selectByMainId(String mainId);
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
package org.jeecg.modules.business.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanCategory;
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanSkuRelation;
|
||||||
|
import org.jeecg.modules.business.mapper.ShoumanCategoryMapper;
|
||||||
|
import org.jeecg.modules.business.mapper.ShoumanSkuRelationMapper;
|
||||||
|
import org.jeecg.modules.business.service.IShoumanCategoryService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼产品类别
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ShoumanCategoryServiceImpl extends ServiceImpl<ShoumanCategoryMapper, ShoumanCategory> implements IShoumanCategoryService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ShoumanCategoryMapper shoumanCategoryMapper;
|
||||||
|
@Autowired
|
||||||
|
private ShoumanSkuRelationMapper shoumanSkuRelationMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void saveMain(ShoumanCategory shoumanCategory, List<ShoumanSkuRelation> shoumanSkuRelationList) {
|
||||||
|
shoumanCategoryMapper.insert(shoumanCategory);
|
||||||
|
if(shoumanSkuRelationList!=null && shoumanSkuRelationList.size()>0) {
|
||||||
|
for(ShoumanSkuRelation entity:shoumanSkuRelationList) {
|
||||||
|
//外键设置
|
||||||
|
entity.setShoumanCategoryId(shoumanCategory.getId());
|
||||||
|
shoumanSkuRelationMapper.insert(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void updateMain(ShoumanCategory shoumanCategory,List<ShoumanSkuRelation> shoumanSkuRelationList) {
|
||||||
|
shoumanCategoryMapper.updateById(shoumanCategory);
|
||||||
|
|
||||||
|
//1.先删除子表数据
|
||||||
|
shoumanSkuRelationMapper.deleteByMainId(shoumanCategory.getId());
|
||||||
|
|
||||||
|
//2.子表数据重新插入
|
||||||
|
if(shoumanSkuRelationList!=null && !shoumanSkuRelationList.isEmpty()) {
|
||||||
|
for(ShoumanSkuRelation entity:shoumanSkuRelationList) {
|
||||||
|
//外键设置
|
||||||
|
entity.setShoumanCategoryId(shoumanCategory.getId());
|
||||||
|
shoumanSkuRelationMapper.insert(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delMain(String id) {
|
||||||
|
shoumanSkuRelationMapper.deleteByMainId(id);
|
||||||
|
shoumanCategoryMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delBatchMain(Collection<? extends Serializable> idList) {
|
||||||
|
for(Serializable id:idList) {
|
||||||
|
shoumanSkuRelationMapper.deleteByMainId(id.toString());
|
||||||
|
shoumanCategoryMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package org.jeecg.modules.business.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanOrder;
|
||||||
|
import org.jeecg.modules.business.mapper.ShoumanOrderMapper;
|
||||||
|
import org.jeecg.modules.business.service.IShoumanOrderService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼订单
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ShoumanOrderServiceImpl extends ServiceImpl<ShoumanOrderMapper, ShoumanOrder> implements IShoumanOrderService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ShoumanOrderMapper shoumanOrderMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ShoumanOrder> findShoumanOrderToSend() {
|
||||||
|
return shoumanOrderMapper.findShoumanOrderToSend();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package org.jeecg.modules.business.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.business.entity.Shouman.ShoumanSkuRelation;
|
||||||
|
import org.jeecg.modules.business.mapper.ShoumanSkuRelationMapper;
|
||||||
|
import org.jeecg.modules.business.service.IShoumanSkuRelationService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 首曼产品类别与SKU关系
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-11-29
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ShoumanSkuRelationServiceImpl extends ServiceImpl<ShoumanSkuRelationMapper, ShoumanSkuRelation> implements IShoumanSkuRelationService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ShoumanSkuRelationMapper shoumanSkuRelationMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ShoumanSkuRelation> selectByMainId(String mainId) {
|
||||||
|
return shoumanSkuRelationMapper.selectByMainId(mainId);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue