提交 0e10dc5c authored 作者: zgy's avatar zgy

接口优化

上级 99040568
......@@ -204,4 +204,11 @@ public class TbCfStationItemController extends ApiBaseAction {
return R.error();
}
}
@RequestMapping("/importShopifyProducts")
@ResponseBody
public R importShopifyProducts(@RequestParam("file") MultipartFile multipartFile) {
tbCfStationItemService.importShopifyProducts(multipartFile);
return R.ok();
}
}
......@@ -6,6 +6,7 @@ import com.platform.utils.R;
import com.platform.utils.util.UuidUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
......@@ -21,8 +22,8 @@ import java.io.File;
public class uploadController {
@IgnoreAuth
@RequestMapping(value = "/uploadFile", produces = "application/json;charset=UTF-8")
@ResponseBody
@RequestMapping(value = "/uploadFile", produces = "application/json;charset=UTF-8")
public String upload(MultipartFile file) {
try {
String secondaryFolderName = "Afrishop";
......
package com.platform.entity;
import java.io.Serializable;
import java.math.BigDecimal;
public class TbCfStationItemEntityExtends extends TbCfStationItemEntity implements Serializable {
......@@ -9,6 +10,17 @@ public class TbCfStationItemEntityExtends extends TbCfStationItemEntity implemen
private String title;
private String goodtype;
private String itemDesc;
private BigDecimal discountPrice;
@Override
public BigDecimal getDiscountPrice() {
return discountPrice;
}
@Override
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public String getItemDesc() {
return itemDesc;
......
......@@ -94,4 +94,6 @@ public interface TbCfStationItemService {
void exportExcel() throws IOException;
void importExcel(MultipartFile multipartFile);
R importShopifyProducts(MultipartFile multipartFile);
}
......@@ -5,6 +5,7 @@ import com.platform.entity.*;
import com.platform.service.TbCfStationItemService;
import com.platform.utils.IdUtil;
import com.platform.utils.OssUtil;
import com.platform.utils.R;
import com.platform.utils.UuidUtil;
import com.platform.utils.excel.ExcelExport;
import com.platform.utils.excel.ExcelImport;
......@@ -258,7 +259,6 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
tbCfCategoryDao.deleteByItemId(itemId);
tbCfOptionDao.deleteByItemId(itemId);
//商品规格
//商品规格
List<TbCfCategoryEntity> tree = itemSkus.getTree();
for (int i = 0; i < tree.size(); i++) {
String cid = IdUtil.createIdbyUUID();
......@@ -381,6 +381,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
}
}
//"商品编号", "商品名称", "商品标题", "商品标签", "商品价格", "折扣价格", "库存","商品图片", "一级分类", "二级分类", "商品品名", "状态", "创建时间", "商品详情"
public void handleExcel(String[] values) {
//商品信息
......@@ -428,5 +429,12 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
desc.setDelFlag(1);
tbCfItemDescDao.save(desc);
}
@Override
public R importShopifyProducts(MultipartFile multipartFile) {
Map<Integer, List<String[]>> productMap = ExcelImport.getExcelDataAll(multipartFile);
return null;
}
}
......@@ -88,9 +88,9 @@ public class ItemTask {
product.setItemNum(0L);
product.setPlatformCode("afri-eshop");
product.setPlatformName("afri-eshop");
product.setEnableFlag(0);
product.setEnableFlag(3);
product.setCreateTime(new Date());
tbCfStationItemDao.save(product);
// tbCfStationItemDao.save(product);
}
}
......
......@@ -20,6 +20,8 @@
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="username" column="nick"></result>
<result property="orderNo" column="order_no"></result>
<result property="itemName" column="item_name"></result>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfItemCommentEntity">
......@@ -43,7 +45,7 @@
where id = #{id}
</select>
<select id="queryList" resultMap="tbCfItemCommentMap">
<select id="queryList" resultType="com.platform.entity.TbCfItemCommentEntity">
SELECT
c.id,
c.user_id,
......
......@@ -214,26 +214,26 @@
<update id="update" parameterType="com.platform.entity.TbCfStationItemEntity">
update tb_cf_station_item
<set>
<if test="itemCode != null">`item_code` = #{itemCode}, </if>
<if test="itemName != null">`item_name` = #{itemName}, </if>
<if test="itemBrief != null">`item_brief` = #{itemBrief}, </if>
<if test="itemCategory != null">`item_category` = #{itemCategory}, </if>
<if test="itemPrice != null">`item_price` = #{itemPrice}, </if>
<if test="discountPrice != null">`discount_price` = #{discountPrice}, </if>
<if test="itemUrl != null">`item_url` = #{itemUrl}, </if>
<if test="itemImg != null">`item_img` = #{itemImg}, </if>
<if test="itemTags != null">`item_tags` = #{itemTags}, </if>
<if test="itemNum != null">`item_num` = #{itemNum}, </if>
<if test="itemCollectionNum != null">`item_collection_num` = #{itemCollectionNum}, </if>
<if test="itemCount != null">`item_count` = #{itemCount}, </if>
<if test="itemSku != null">`item_sku` = #{itemSku}, </if>
<if test="itemTop != null">`item_top` = #{itemTop}, </if>
<if test="supplier != null">`supplier` = #{supplier}, </if>
<if test="platformCode != null">`platform_code` = #{platformCode}, </if>
<if test="platformName != null">`platform_name` = #{platformName}, </if>
<if test="enableFlag != null">`enable_flag` = #{enableFlag}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="itemCategorytwo != null">`item_categorytwo` = #{itemCategorytwo}, </if>
<if test="itemCode != null">`item_code` = #{itemCode},</if>
<if test="itemName != null">`item_name` = #{itemName},</if>
<if test="itemBrief != null">`item_brief` = #{itemBrief},</if>
<if test="itemCategory != null">`item_category` = #{itemCategory},</if>
`item_price` = #{itemPrice},
<if test="discountPrice != null">`discount_price` = #{discountPrice},</if>
<if test="itemUrl != null">`item_url` = #{itemUrl},</if>
<if test="itemImg != null">`item_img` = #{itemImg},</if>
<if test="itemTags != null">`item_tags` = #{itemTags},</if>
<if test="itemNum != null">`item_num` = #{itemNum},</if>
<if test="itemCollectionNum != null">`item_collection_num` = #{itemCollectionNum},</if>
<if test="itemCount != null">`item_count` = #{itemCount},</if>
<if test="itemSku != null">`item_sku` = #{itemSku},</if>
<if test="itemTop != null">`item_top` = #{itemTop},</if>
<if test="supplier != null">`supplier` = #{supplier},</if>
<if test="platformCode != null">`platform_code` = #{platformCode},</if>
<if test="platformName != null">`platform_name` = #{platformName},</if>
<if test="enableFlag != null">`enable_flag` = #{enableFlag},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="itemCategorytwo != null">`item_categorytwo` = #{itemCategorytwo},</if>
<if test="itemDescritionId != null">`item_descrition_id` = #{itemDescritionId}</if>
</set>
where item_id = #{itemId}
......
......@@ -258,11 +258,11 @@
<Form-item label="商品标签" prop="itemTags" style="width: 800px">
<i-input v-model="tbCfStationItem.itemTags" placeholder="商品标签"/>
</Form-item>
<Form-item label="商品价格" prop="itemPrice" style="width: 800px">
<i-input v-model="tbCfStationItem.itemPrice" placeholder="商品价格"/>
<Form-item label="原价" prop="itemPrice" style="width: 800px">
<i-input v-model="tbCfStationItem.itemPrice" placeholder="原价(可不填)"/>
</Form-item>
<Form-item label="商品折扣价格" prop="discountPrice" style="width: 800px">
<i-input v-model="tbCfStationItem.discountPrice" placeholder="商品折扣价格"/>
<Form-item label="现价" prop="discountPrice" style="width: 800px">
<i-input v-model="tbCfStationItem.discountPrice" placeholder="现价"/>
</Form-item>
<!-- <Form-item label="商品库存" prop="item_count" style="width: 800px">
<i-input v-model="tbCfStationItem.itemCount" placeholder="商品库存"/>
......
......@@ -7,7 +7,7 @@ $(function () {
{label: '货币', name: 'currency', index: 'currency', width: 80},
{label: '兑换货币', name: 'exchangeCurrency', index: 'exchange_currency', width: 80},
{label: '汇率', name: 'exchangeRate', index: 'exchange_rate', width: 80},
{label: '状态', name: 'delFlag', index: 'del_flag', width: 80},
{label: '状态', name: 'delFlag', index: 'del_flag', width: 80, formatter: categoryFormat},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}
],
shrinkToFit: true,
......
......@@ -3,8 +3,8 @@ $(function () {
url: '../tbcfitemcomment/list',
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '评论人', name: 'userName', index: 'username', width: 80},
{label: '订单号', name: 'orderNo', index: 'order_id', width: 80},
{label: '评论人', name: 'userName', index: 'userName', width: 80},
{label: '订单号', name: 'orderNo', index: 'orderNo', width: 80},
{label: '商品名称', name: 'itemName', index: 'item_id', width: 80},
{label: '商品评分', name: 'itemScore', index: 'item_score', width: 80},
{label: '服务评分', name: 'serviceScore', index: 'service_score', width: 80},
......
......@@ -8,8 +8,8 @@ $(function () {
{label: '商品名称', name: 'itemName', index: 'item_name', width: 160},
/* {label: '商品标题', name: 'itemBrief', index: 'item_brief', width: 120},*/
/*{label: '商品链接', name: 'itemUrl', index: 'item_url', width: 80,formatter:linkFormat},*/
{label: '商品价格', name: 'itemPrice', index: 'item_price', width: 45},
{label: '折扣价格', name: 'discountPrice', index: 'discount_price', width: 45},
{label: '商品原价', name: 'itemPrice', index: 'item_price', width: 45},
{label: '商品现价', name: 'discountPrice', index: 'discount_price', width: 45},
{label: '库存', name: 'itemCount', index: 'item_count', width: 45},
{label: '点击量', name: 'itemNum', index: 'item_num', width: 45},
/*{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
......@@ -498,7 +498,7 @@ let vm = new Vue({
}
},
ok() {
this.reloadSearch();
vm.reload();
},
cancel() {
},
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui" charset="UTF-8">
<title>Notice</title>
</head>
<body>
<img src="https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop/Afrishop/year.jpg"/>
</body>
</html>
\ No newline at end of file
......@@ -382,13 +382,13 @@ public class OssUtil {
}
public static void main(String[] args) throws Exception {
File file = new File("C:\\Users\\Administrator\\Pictures\\四等奖_20190918194024.png");
File file = new File("C:\\Users\\Administrator\\Pictures\\year.jpg");
byte[] b = File2byte(file);
System.out.println(b);
boolean flag = deleteFile("https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop/Afrishop/157865444910310855.png");
// String s = upload(b, "hello.png", "hello");
// System.out.println(s);
System.out.println(flag);
// boolean flag = deleteFile("https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop/Afrishop/157865444910310855.png");
String s = upload(b, "year.jpg", "Afrishop");
System.out.println(s);
// System.out.println(flag);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论