Add generated models, mappers, and services for ShoumanCategory, ShoumanOrder and ShoumanSkuRelation

pull/8040/head
Qiuyi LI 2023-12-07 11:40:02 +01:00
parent 11867df921
commit c3407a66e6
15 changed files with 602 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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> {
}

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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);
}

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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);
}
}
}

View File

@ -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();
}
}

View File

@ -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);
}
}