编号:ZSSAC-163 描述:修复商品模块不能访问

This commit is contained in:
pengren 2024-04-11 15:54:09 +08:00
parent 53d280edcc
commit d48baa6470
9 changed files with 637 additions and 6 deletions

View File

@ -0,0 +1,104 @@
package com.sf.goods.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.sf.common.annotation.Log;
import com.sf.common.core.controller.BaseController;
import com.sf.common.core.domain.AjaxResult;
import com.sf.common.enums.BusinessType;
import com.sf.goods.domain.GoodsMessages;
import com.sf.goods.service.IGoodsMessagesService;
import com.sf.common.utils.poi.ExcelUtil;
import com.sf.common.core.page.TableDataInfo;
/**
* 商品信息Controller
*
* @author ztzh
* @date 2024-04-11
*/
@RestController
@RequestMapping("/goods/goods")
public class GoodsMessagesController extends BaseController
{
@Autowired
private IGoodsMessagesService goodsMessagesService;
/**
* 查询商品信息列表
*/
@PreAuthorize("@ss.hasPermi('goods:goods:list')")
@GetMapping("/list")
public TableDataInfo list(GoodsMessages goodsMessages)
{
startPage();
List<GoodsMessages> list = goodsMessagesService.selectGoodsMessagesList(goodsMessages);
return getDataTable(list);
}
/**
* 导出商品信息列表
*/
@PreAuthorize("@ss.hasPermi('goods:goods:export')")
@Log(title = "商品信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, GoodsMessages goodsMessages)
{
List<GoodsMessages> list = goodsMessagesService.selectGoodsMessagesList(goodsMessages);
ExcelUtil<GoodsMessages> util = new ExcelUtil<GoodsMessages>(GoodsMessages.class);
util.exportExcel(response, list, "商品信息数据");
}
/**
* 获取商品信息详细信息
*/
@PreAuthorize("@ss.hasPermi('goods:goods:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(goodsMessagesService.selectGoodsMessagesById(id));
}
/**
* 新增商品信息
*/
@PreAuthorize("@ss.hasPermi('goods:goods:add')")
@Log(title = "商品信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody GoodsMessages goodsMessages)
{
return toAjax(goodsMessagesService.insertGoodsMessages(goodsMessages));
}
/**
* 修改商品信息
*/
@PreAuthorize("@ss.hasPermi('goods:goods:edit')")
@Log(title = "商品信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody GoodsMessages goodsMessages)
{
return toAjax(goodsMessagesService.updateGoodsMessages(goodsMessages));
}
/**
* 删除商品信息
*/
@PreAuthorize("@ss.hasPermi('goods:goods:remove')")
@Log(title = "商品信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(goodsMessagesService.deleteGoodsMessagesByIds(ids));
}
}

View File

@ -0,0 +1,216 @@
package com.sf.goods.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.sf.common.annotation.Excel;
import com.sf.common.core.domain.BaseEntity;
/**
* 商品信息对象 GOODS_MESSAGES
*
* @author ztzh
* @date 2024-04-11
*/
public class GoodsMessages extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 商品编号 */
@Excel(name = "商品编号")
private String goodsCode;
/** 库存表编号 */
private Long stockId;
/** 审核状态1通过0未通过 */
private Long reviewStatus;
/** 商品标题 */
@Excel(name = "商品标题")
private String productTitle;
/** 商品图片 */
@Excel(name = "商品图片")
private String productPicture;
/** 原价格 */
@Excel(name = "原价格")
private Long originalPrice;
/** 商品描述 */
@Excel(name = "商品描述")
private String productDesc;
/** 排序 */
@Excel(name = "排序")
private Long orderNum;
/** 逻辑删除,0:未删除,1:删除 */
private Long isDelete;
/** 创建人 */
private String created;
/** 更新人 */
private String modified;
/** 商品类型 */
@Excel(name = "商品类型")
private String goodsType;
/** 商品规格 */
@Excel(name = "商品规格")
private String goodsSpec;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setGoodsCode(String goodsCode)
{
this.goodsCode = goodsCode;
}
public String getGoodsCode()
{
return goodsCode;
}
public void setStockId(Long stockId)
{
this.stockId = stockId;
}
public Long getStockId()
{
return stockId;
}
public void setReviewStatus(Long reviewStatus)
{
this.reviewStatus = reviewStatus;
}
public Long getReviewStatus()
{
return reviewStatus;
}
public void setProductTitle(String productTitle)
{
this.productTitle = productTitle;
}
public String getProductTitle()
{
return productTitle;
}
public void setProductPicture(String productPicture)
{
this.productPicture = productPicture;
}
public String getProductPicture()
{
return productPicture;
}
public void setOriginalPrice(Long originalPrice)
{
this.originalPrice = originalPrice;
}
public Long getOriginalPrice()
{
return originalPrice;
}
public void setProductDesc(String productDesc)
{
this.productDesc = productDesc;
}
public String getProductDesc()
{
return productDesc;
}
public void setOrderNum(Long orderNum)
{
this.orderNum = orderNum;
}
public Long getOrderNum()
{
return orderNum;
}
public void setIsDelete(Long isDelete)
{
this.isDelete = isDelete;
}
public Long getIsDelete()
{
return isDelete;
}
public void setCreated(String created)
{
this.created = created;
}
public String getCreated()
{
return created;
}
public void setModified(String modified)
{
this.modified = modified;
}
public String getModified()
{
return modified;
}
public void setGoodsType(String goodsType)
{
this.goodsType = goodsType;
}
public String getGoodsType()
{
return goodsType;
}
public void setGoodsSpec(String goodsSpec)
{
this.goodsSpec = goodsSpec;
}
public String getGoodsSpec()
{
return goodsSpec;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("goodsCode", getGoodsCode())
.append("stockId", getStockId())
.append("reviewStatus", getReviewStatus())
.append("productTitle", getProductTitle())
.append("productPicture", getProductPicture())
.append("originalPrice", getOriginalPrice())
.append("productDesc", getProductDesc())
.append("orderNum", getOrderNum())
.append("isDelete", getIsDelete())
.append("created", getCreated())
.append("modified", getModified())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("goodsType", getGoodsType())
.append("goodsSpec", getGoodsSpec())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.sf.goods.mapper;
import java.util.List;
import com.sf.goods.domain.GoodsMessages;
/**
* 商品信息Mapper接口
*
* @author ztzh
* @date 2024-04-11
*/
public interface GoodsMessagesMapper
{
/**
* 查询商品信息
*
* @param id 商品信息主键
* @return 商品信息
*/
public GoodsMessages selectGoodsMessagesById(Long id);
/**
* 查询商品信息列表
*
* @param goodsMessages 商品信息
* @return 商品信息集合
*/
public List<GoodsMessages> selectGoodsMessagesList(GoodsMessages goodsMessages);
/**
* 新增商品信息
*
* @param goodsMessages 商品信息
* @return 结果
*/
public int insertGoodsMessages(GoodsMessages goodsMessages);
/**
* 修改商品信息
*
* @param goodsMessages 商品信息
* @return 结果
*/
public int updateGoodsMessages(GoodsMessages goodsMessages);
/**
* 删除商品信息
*
* @param id 商品信息主键
* @return 结果
*/
public int deleteGoodsMessagesById(Long id);
/**
* 批量删除商品信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteGoodsMessagesByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.sf.goods.service;
import java.util.List;
import com.sf.goods.domain.GoodsMessages;
/**
* 商品信息Service接口
*
* @author ztzh
* @date 2024-04-11
*/
public interface IGoodsMessagesService
{
/**
* 查询商品信息
*
* @param id 商品信息主键
* @return 商品信息
*/
public GoodsMessages selectGoodsMessagesById(Long id);
/**
* 查询商品信息列表
*
* @param goodsMessages 商品信息
* @return 商品信息集合
*/
public List<GoodsMessages> selectGoodsMessagesList(GoodsMessages goodsMessages);
/**
* 新增商品信息
*
* @param goodsMessages 商品信息
* @return 结果
*/
public int insertGoodsMessages(GoodsMessages goodsMessages);
/**
* 修改商品信息
*
* @param goodsMessages 商品信息
* @return 结果
*/
public int updateGoodsMessages(GoodsMessages goodsMessages);
/**
* 批量删除商品信息
*
* @param ids 需要删除的商品信息主键集合
* @return 结果
*/
public int deleteGoodsMessagesByIds(Long[] ids);
/**
* 删除商品信息信息
*
* @param id 商品信息主键
* @return 结果
*/
public int deleteGoodsMessagesById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.sf.goods.service.impl;
import java.util.List;
import com.sf.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sf.goods.mapper.GoodsMessagesMapper;
import com.sf.goods.domain.GoodsMessages;
import com.sf.goods.service.IGoodsMessagesService;
/**
* 商品信息Service业务层处理
*
* @author ztzh
* @date 2024-04-11
*/
@Service
public class GoodsMessagesServiceImpl implements IGoodsMessagesService
{
@Autowired
private GoodsMessagesMapper goodsMessagesMapper;
/**
* 查询商品信息
*
* @param id 商品信息主键
* @return 商品信息
*/
@Override
public GoodsMessages selectGoodsMessagesById(Long id)
{
return goodsMessagesMapper.selectGoodsMessagesById(id);
}
/**
* 查询商品信息列表
*
* @param goodsMessages 商品信息
* @return 商品信息
*/
@Override
public List<GoodsMessages> selectGoodsMessagesList(GoodsMessages goodsMessages)
{
return goodsMessagesMapper.selectGoodsMessagesList(goodsMessages);
}
/**
* 新增商品信息
*
* @param goodsMessages 商品信息
* @return 结果
*/
@Override
public int insertGoodsMessages(GoodsMessages goodsMessages)
{
goodsMessages.setCreateTime(DateUtils.getNowDate());
return goodsMessagesMapper.insertGoodsMessages(goodsMessages);
}
/**
* 修改商品信息
*
* @param goodsMessages 商品信息
* @return 结果
*/
@Override
public int updateGoodsMessages(GoodsMessages goodsMessages)
{
goodsMessages.setUpdateTime(DateUtils.getNowDate());
return goodsMessagesMapper.updateGoodsMessages(goodsMessages);
}
/**
* 批量删除商品信息
*
* @param ids 需要删除的商品信息主键
* @return 结果
*/
@Override
public int deleteGoodsMessagesByIds(Long[] ids)
{
return goodsMessagesMapper.deleteGoodsMessagesByIds(ids);
}
/**
* 删除商品信息信息
*
* @param id 商品信息主键
* @return 结果
*/
@Override
public int deleteGoodsMessagesById(Long id)
{
return goodsMessagesMapper.deleteGoodsMessagesById(id);
}
}

View File

@ -0,0 +1,96 @@
package com.sf.index.service.impl;
import java.util.List;
import com.sf.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sf.index.mapper.ApplyListInfoMapper;
import com.sf.index.domain.ApplyListInfo;
import com.sf.index.service.IApplyListInfoService;
/**
* 应用列Service业务层处理
*
* @author ztzh
* @date 2024-04-11
*/
@Service
public class ApplyListInfoServiceImpl implements IApplyListInfoService
{
@Autowired
private ApplyListInfoMapper applyListInfoMapper;
/**
* 查询应用列
*
* @param id 应用列主键
* @return 应用列
*/
@Override
public ApplyListInfo selectApplyListInfoById(Long id)
{
return applyListInfoMapper.selectApplyListInfoById(id);
}
/**
* 查询应用列列表
*
* @param applyListInfo 应用列
* @return 应用列
*/
@Override
public List<ApplyListInfo> selectApplyListInfoList(ApplyListInfo applyListInfo)
{
return applyListInfoMapper.selectApplyListInfoList(applyListInfo);
}
/**
* 新增应用列
*
* @param applyListInfo 应用列
* @return 结果
*/
@Override
public int insertApplyListInfo(ApplyListInfo applyListInfo)
{
applyListInfo.setCreateTime(DateUtils.getNowDate());
return applyListInfoMapper.insertApplyListInfo(applyListInfo);
}
/**
* 修改应用列
*
* @param applyListInfo 应用列
* @return 结果
*/
@Override
public int updateApplyListInfo(ApplyListInfo applyListInfo)
{
applyListInfo.setUpdateTime(DateUtils.getNowDate());
return applyListInfoMapper.updateApplyListInfo(applyListInfo);
}
/**
* 批量删除应用列
*
* @param ids 需要删除的应用列主键
* @return 结果
*/
@Override
public int deleteApplyListInfoByIds(Long[] ids)
{
return applyListInfoMapper.deleteApplyListInfoByIds(ids);
}
/**
* 删除应用列信息
*
* @param id 应用列主键
* @return 结果
*/
@Override
public int deleteApplyListInfoById(Long id)
{
return applyListInfoMapper.deleteApplyListInfoById(id);
}
}

View File

@ -69,7 +69,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService
orderInfo.setOrderNo(snowflakeIdWorker.nextId());
orderInfo.setPayType(0L);
orderInfo.setReceiveType(0L);
orderInfo.setOrderStatus(0l);
orderInfo.setOrderStatus(0L);
orderInfo.setCreateUserId(orderCreateDto.getUserId());
orderInfo.setUpdateUserId(orderCreateDto.getUserId());
orderInfo.setGoodsId(orderCreateDto.getGoodsId());

View File

@ -88,6 +88,7 @@ public class CommonController
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
ajax.put("fileSize", file.getSize());
return ajax;
}
catch (Exception e)

View File

@ -40,10 +40,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectGoodsMessagesVo"/>
where id = #{id}
</select>
<select id="selectGoodsMessagesByCode" parameterType="java.lang.String" resultMap="GoodsMessagesResult">
<include refid="selectGoodsMessagesVo"/>
where goods_code = #{code}
</select>
<insert id="insertGoodsMessages" parameterType="GoodsMessages" useGeneratedKeys="true" keyProperty="id">
insert into GOODS_MESSAGES