🎨 产品管理维护功能完善

This commit is contained in:
ronger 2024-03-20 21:43:10 +08:00
parent b3805555fb
commit 823ef3d1c4
2 changed files with 5 additions and 2 deletions

View File

@ -53,6 +53,7 @@ public class ProductServiceImpl extends AbstractService<Product> implements Prod
if (FileDataType.BASE64.equals(product.getProductImgType())) { if (FileDataType.BASE64.equals(product.getProductImgType())) {
String headImgUrl = UploadController.uploadBase64File(product.getProductImgUrl(), FilePath.PRODUCT); String headImgUrl = UploadController.uploadBase64File(product.getProductImgUrl(), FilePath.PRODUCT);
product.setProductImgUrl(headImgUrl); product.setProductImgUrl(headImgUrl);
product.setProductImgType(FileDataType.URL);
} }
Product newProduct; Product newProduct;
if (isUpdate) { if (isUpdate) {
@ -60,7 +61,9 @@ public class ProductServiceImpl extends AbstractService<Product> implements Prod
newProduct.setProductImgUrl(product.getProductImgUrl()); newProduct.setProductImgUrl(product.getProductImgUrl());
newProduct.setProductTitle(product.getProductTitle()); newProduct.setProductTitle(product.getProductTitle());
newProduct.setProductPrice(product.getProductPrice()); newProduct.setProductPrice(product.getProductPrice());
newProduct.setTags(product.getTags());
newProduct.setProductDescription(product.getProductDescription()); newProduct.setProductDescription(product.getProductDescription());
newProduct.setUpdatedTime(new Date());
productMapper.updateByPrimaryKeySelective(newProduct); productMapper.updateByPrimaryKeySelective(newProduct);
// 更新产品详情 // 更新产品详情
productMapper.updateProductContent(newProduct.getIdProduct(), product.getProductContent(), product.getProductContentHtml()); productMapper.updateProductContent(newProduct.getIdProduct(), product.getProductContent(), product.getProductContentHtml());

View File

@ -37,7 +37,7 @@
where id_product = #{idProduct} where id_product = #{idProduct}
</update> </update>
<select id="selectProducts" resultMap="DTOResultMap"> <select id="selectProducts" resultMap="DTOResultMap">
select id, product_title, product_img_url, tags, product_description, product_price, weights, status select id, product_title, product_img_url, tags, product_description, product_price, weights, status, created_time
from forest_product from forest_product
order by weights order by weights
</select> </select>
@ -57,7 +57,7 @@
<select id="selectOnlineProducts" resultMap="DTOResultMap"> <select id="selectOnlineProducts" resultMap="DTOResultMap">
select id, product_title, product_img_url, product_description, product_price select id, product_title, product_img_url, product_description, product_price
from forest_product from forest_product
where status = 1 where status = 0
order by weights order by weights
</select> </select>
</mapper> </mapper>