dev798
parent
9eb681ad67
commit
963dacbfe2
|
@ -0,0 +1,101 @@
|
|||
package com.nuyu.product.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 1对象 Jutsus
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Data
|
||||
public class Jutsus extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 忍术ID */
|
||||
private Long jutsuId;
|
||||
|
||||
/** 忍术名称 */
|
||||
@Excel(name = "忍术名称")
|
||||
private String name;
|
||||
|
||||
/** 忍术类型 */
|
||||
@Excel(name = "忍术类型")
|
||||
private String type;
|
||||
|
||||
private Integer pageSize = 10;
|
||||
|
||||
private Integer pageNum = 1;
|
||||
|
||||
/** 所属人物ID */
|
||||
@Excel(name = "所属人物ID")
|
||||
private Long characterId;
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Integer getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public void setJutsuId(Long jutsuId)
|
||||
{
|
||||
this.jutsuId = jutsuId;
|
||||
}
|
||||
|
||||
public Long getJutsuId()
|
||||
{
|
||||
return jutsuId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setCharacterId(Long characterId)
|
||||
{
|
||||
this.characterId = characterId;
|
||||
}
|
||||
|
||||
public Long getCharacterId()
|
||||
{
|
||||
return characterId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("jutsuId", getJutsuId())
|
||||
.append("name", getName())
|
||||
.append("type", getType())
|
||||
.append("characterId", getCharacterId())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.web.domain.AjaxResult;
|
||||
import com.muyu.product.service.JutsusService;
|
||||
import com.nuyu.product.pojo.Characters;
|
||||
import com.nuyu.product.pojo.Jutsus;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 1Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Jutsus")
|
||||
public class JutsusController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private JutsusService jutsusService;
|
||||
|
||||
/**
|
||||
* 查询1列表
|
||||
*/
|
||||
@RequiresPermissions("product:Jutsus:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(Jutsus jutsus){
|
||||
PageInfo<Jutsus> info=jutsusService.list(jutsus);
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出1列表
|
||||
*/
|
||||
@RequiresPermissions("product:Jutsus:export")
|
||||
@Log(title = "1", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Jutsus jutsus)
|
||||
{
|
||||
List<Jutsus> list = jutsusService.selectJutsusList(jutsus);
|
||||
ExcelUtil<Jutsus> util = new ExcelUtil<Jutsus>(Jutsus.class);
|
||||
util.exportExcel(response, list, "1数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取1详细信息
|
||||
*/
|
||||
@RequiresPermissions("product:Jutsus:query")
|
||||
@GetMapping(value = "/{jutsuId}")
|
||||
public Result getInfo(@PathVariable("jutsuId") Long jutsuId)
|
||||
{
|
||||
return success(jutsusService.selectJutsusByJutsuId(jutsuId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增1
|
||||
*/
|
||||
@RequiresPermissions("product:Jutsus:add")
|
||||
@Log(title = "1", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody Jutsus jutsus)
|
||||
{
|
||||
return toAjax(jutsusService.insertJutsus(jutsus));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改1
|
||||
*/
|
||||
@RequiresPermissions("product:Jutsus:edit")
|
||||
@Log(title = "1", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody Jutsus jutsus)
|
||||
{
|
||||
return toAjax(jutsusService.updateJutsus(jutsus));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除1
|
||||
*/
|
||||
@RequiresPermissions("product:Jutsus:remove")
|
||||
@Log(title = "1", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{jutsuIds}")
|
||||
public Result remove(@PathVariable Long[] jutsuIds)
|
||||
{
|
||||
return toAjax(jutsusService.deleteJutsusByJutsuIds(jutsuIds));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.nuyu.product.pojo.Jutsus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 1Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Mapper
|
||||
public interface JutsusMapper
|
||||
{
|
||||
/**
|
||||
* 查询1
|
||||
*
|
||||
* @param jutsuId 1主键
|
||||
* @return 1
|
||||
*/
|
||||
public Jutsus selectJutsusByJutsuId(Long jutsuId);
|
||||
|
||||
/**
|
||||
* 查询1列表
|
||||
*
|
||||
* @param jutsus 1
|
||||
* @return 1集合
|
||||
*/
|
||||
public List<Jutsus> selectJutsusList(Jutsus jutsus);
|
||||
|
||||
/**
|
||||
* 新增1
|
||||
*
|
||||
* @param jutsus 1
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJutsus(Jutsus jutsus);
|
||||
|
||||
/**
|
||||
* 修改1
|
||||
*
|
||||
* @param jutsus 1
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateJutsus(Jutsus jutsus);
|
||||
|
||||
/**
|
||||
* 删除1
|
||||
*
|
||||
* @param jutsuId 1主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJutsusByJutsuId(Long jutsuId);
|
||||
|
||||
/**
|
||||
* 批量删除1
|
||||
*
|
||||
* @param jutsuIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJutsusByJutsuIds(Long[] jutsuIds);
|
||||
|
||||
List<Jutsus> list(Jutsus jutsus);
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package com.muyu.product.service.Impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.product.mapper.JutsusMapper;
|
||||
import com.muyu.product.service.JutsusService;
|
||||
import com.nuyu.product.pojo.Characters;
|
||||
import com.nuyu.product.pojo.Jutsus;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 1Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Service
|
||||
public class JutsusServiceImpl implements JutsusService
|
||||
{
|
||||
@Autowired
|
||||
private JutsusMapper jutsusMapper;
|
||||
|
||||
/**
|
||||
* 查询1
|
||||
*
|
||||
* @param jutsuId 1主键
|
||||
* @return 1
|
||||
*/
|
||||
@Override
|
||||
public Jutsus selectJutsusByJutsuId(Long jutsuId)
|
||||
{
|
||||
return jutsusMapper.selectJutsusByJutsuId(jutsuId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询1列表
|
||||
*
|
||||
* @param jutsus 1
|
||||
* @return 1
|
||||
*/
|
||||
@Override
|
||||
public List<Jutsus> selectJutsusList(Jutsus jutsus)
|
||||
{
|
||||
return jutsusMapper.selectJutsusList(jutsus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增1
|
||||
*
|
||||
* @param jutsus 1
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertJutsus(Jutsus jutsus)
|
||||
{
|
||||
return jutsusMapper.insertJutsus(jutsus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改1
|
||||
*
|
||||
* @param jutsus 1
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateJutsus(Jutsus jutsus)
|
||||
{
|
||||
return jutsusMapper.updateJutsus(jutsus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除1
|
||||
*
|
||||
* @param jutsuIds 需要删除的1主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteJutsusByJutsuIds(Long[] jutsuIds)
|
||||
{
|
||||
return jutsusMapper.deleteJutsusByJutsuIds(jutsuIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除1信息
|
||||
*
|
||||
* @param jutsuId 1主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteJutsusByJutsuId(Long jutsuId)
|
||||
{
|
||||
return jutsusMapper.deleteJutsusByJutsuId(jutsuId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<Jutsus> list(Jutsus jutsus) {
|
||||
PageHelper.startPage(jutsus.getPageNum(),jutsus.getPageSize());
|
||||
List<Jutsus>list=jutsusMapper.list(jutsus);
|
||||
PageInfo<Jutsus>pageInfo=new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
}
|
|
@ -109,13 +109,16 @@ public class MallProductInfoServiceImpl implements MallProductInfoService
|
|||
switch (step) {
|
||||
case ProductConstant.STEP_ONE:
|
||||
Long productInfoId = mallProductInfo.getId();
|
||||
// 处理步骤一:清除当前产品的SKU信息
|
||||
mallProductInfo.setSkuInfoList(null);
|
||||
mallProductSkuInfoService.deleteMallProductSkuInfoId(productInfoId);
|
||||
break;
|
||||
case ProductConstant.STEP_THREE:
|
||||
case ProductConstant.STEP_TWO:
|
||||
// 处理步骤二:清空产品描述
|
||||
mallProductInfo.setProductDesc("");
|
||||
break;
|
||||
default:
|
||||
// 对于未知步骤,不做任何处理
|
||||
break;
|
||||
}
|
||||
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||
|
|
|
@ -80,10 +80,13 @@ public class MallProductRuleInfoServiceImpl implements MallProductRuleInfoServic
|
|||
|
||||
mallProductRuleInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
mallProductRuleInfo.setCreateTime(DateUtils.getNowDate());
|
||||
// 调用mapper插入商城产品规则信息
|
||||
int i = mallProductRuleInfoMapper.insertMallProductRuleInfo(mallProductRuleInfo);
|
||||
if(i > 0){
|
||||
// 如果插入成功,处理规则属性信息
|
||||
Long ruleId = mallProductRuleInfo.getId();
|
||||
String ruleAttr = mallProductRuleInfo.getRuleAttr();
|
||||
// 解析规则属性,并转换为规则属性信息列表
|
||||
List<MallProductRuleAttrInfo>ruleAttrInfoList = new ArrayList<>();
|
||||
List<MallProductAttrInfoModel>mallProductAttrInfoModels= JSON.parseArray(ruleAttr, MallProductAttrInfoModel.class);
|
||||
if(CollectionUtils.isNotEmpty(mallProductAttrInfoModels)){
|
||||
|
@ -91,6 +94,7 @@ public class MallProductRuleInfoServiceImpl implements MallProductRuleInfoServic
|
|||
String ruleType = mallProductAttrInfoModel.getRuleType();
|
||||
List<String> ruleAttrList= mallProductAttrInfoModel.getRuleAttrList();
|
||||
for (String ruleAttrString : ruleAttrList) {
|
||||
// 组装规则属性信息
|
||||
MallProductRuleAttrInfo mallProductRuleAttrInfo = new MallProductRuleAttrInfo();
|
||||
mallProductRuleAttrInfo.setAttrValue(ruleAttrString);
|
||||
mallProductRuleAttrInfo.setName(ruleType);
|
||||
|
@ -101,9 +105,6 @@ public class MallProductRuleInfoServiceImpl implements MallProductRuleInfoServic
|
|||
mallProductRuleAttrInfoService.deleteMallProductRuleAttrInfByRuleId(ruleId);
|
||||
mallProductRuleAttrInfoService.insertMallProductRuleAttrInfoList(ruleAttrInfoList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.nuyu.product.pojo.Characters;
|
||||
import com.nuyu.product.pojo.Jutsus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 1Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
public interface JutsusService
|
||||
{
|
||||
/**
|
||||
* 查询1
|
||||
*
|
||||
* @param jutsuId 1主键
|
||||
* @return 1
|
||||
*/
|
||||
public Jutsus selectJutsusByJutsuId(Long jutsuId);
|
||||
|
||||
/**
|
||||
* 查询1列表
|
||||
*
|
||||
* @param jutsus 1
|
||||
* @return 1集合
|
||||
*/
|
||||
public List<Jutsus> selectJutsusList(Jutsus jutsus);
|
||||
|
||||
/**
|
||||
* 新增1
|
||||
*
|
||||
* @param jutsus 1
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertJutsus(Jutsus jutsus);
|
||||
|
||||
/**
|
||||
* 修改1
|
||||
*
|
||||
* @param jutsus 1
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateJutsus(Jutsus jutsus);
|
||||
|
||||
/**
|
||||
* 批量删除1
|
||||
*
|
||||
* @param jutsuIds 需要删除的1主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJutsusByJutsuIds(Long[] jutsuIds);
|
||||
|
||||
/**
|
||||
* 删除1信息
|
||||
*
|
||||
* @param jutsuId 1主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteJutsusByJutsuId(Long jutsuId);
|
||||
|
||||
PageInfo<Jutsus> list(Jutsus jutsus);
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
<?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="com.muyu.product.mapper.JutsusMapper">
|
||||
|
||||
<resultMap type="com.nuyu.product.pojo.Jutsus" id="JutsusResult">
|
||||
<result property="jutsuId" column="jutsu_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="characterId" column="character_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectJutsusVo">
|
||||
select jutsu_id, name, type, character_id from Jutsus
|
||||
</sql>
|
||||
|
||||
<select id="selectJutsusList" parameterType="com.nuyu.product.pojo.Jutsus" resultMap="JutsusResult">
|
||||
<include refid="selectJutsusVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="characterId != null "> and character_id = #{characterId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectJutsusByJutsuId" parameterType="Long" resultMap="JutsusResult">
|
||||
<include refid="selectJutsusVo"/>
|
||||
where jutsu_id = #{jutsuId}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.nuyu.product.pojo.Jutsus">
|
||||
<include refid="selectJutsusVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="characterId != null "> and character_id = #{characterId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertJutsus" parameterType="com.nuyu.product.pojo.Jutsus" useGeneratedKeys="true" keyProperty="jutsuId">
|
||||
insert into Jutsus
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="characterId != null">character_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="characterId != null">#{characterId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateJutsus" parameterType="com.nuyu.product.pojo.Jutsus">
|
||||
update Jutsus
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="characterId != null">character_id = #{characterId},</if>
|
||||
</trim>
|
||||
where jutsu_id = #{jutsuId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteJutsusByJutsuId" parameterType="Long">
|
||||
delete from Jutsus where jutsu_id = #{jutsuId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteJutsusByJutsuIds" parameterType="String">
|
||||
delete from Jutsus where jutsu_id in
|
||||
<foreach item="jutsuId" collection="array" open="(" separator="," close=")">
|
||||
#{jutsuId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue