提交 c7620757 authored 作者: zgy's avatar zgy

商品管理功能优化

上级 c1c2fc75
......@@ -211,4 +211,11 @@ public class TbCfStationItemController extends ApiBaseAction {
tbCfStationItemService.importShopifyProducts(multipartFile);
return R.ok();
}
@RequestMapping("/queryCreator")
@ResponseBody
public R queryCreator() {
List<SysUserEntity> userList = tbCfStationItemService.queryCreator();
return R.ok().put("list", userList);
}
}
package com.platform.controller.test;
import com.platform.utils.IdUtil;
/**
* @Auther: wudepeng
* @Date: 2020/04/08
* @Description:
*/
public class MainTest {
public static void main(String[] args) {
for (int i = 0; i <10 ; i++) {
Thread thread=new Thread(()->{
String uuid = IdUtil.createIdbyUUID();
System.out.println(uuid);
});
thread.start();
}
}
}
......@@ -5,11 +5,11 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* 实体
* 商品规格表实体
* 表名 tb_cf_item_skus
*
* @author lipengjun
* @date 2019-12-26 20:47:21
* @date 2020-04-08 13:45:07
*/
public class TbCfItemSkusEntity implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -22,14 +22,18 @@ public class TbCfItemSkusEntity implements Serializable {
* 商品ID
*/
private String itemId;
/**
* 数量
*/
private Integer skuCount;
/**
* 规格名称
*/
private String skuName;
/**
* 商品规格图片
*/
private String skuImg;
/**
* 商品规格编码
*/
private String skuCode;
/**
* 规格描述
*/
......@@ -42,6 +46,10 @@ public class TbCfItemSkusEntity implements Serializable {
* 属性IDS
*/
private String optionIds;
/**
* 数量
*/
private Integer skuCount;
/**
* 排序号
*/
......@@ -72,7 +80,6 @@ public class TbCfItemSkusEntity implements Serializable {
public String getId() {
return id;
}
/**
* 设置:商品ID
*/
......@@ -86,7 +93,6 @@ public class TbCfItemSkusEntity implements Serializable {
public String getItemId() {
return itemId;
}
/**
* 设置:规格名称
*/
......@@ -100,7 +106,32 @@ public class TbCfItemSkusEntity implements Serializable {
public String getSkuName() {
return skuName;
}
/**
* 设置:商品规格图片
*/
public void setSkuImg(String skuImg) {
this.skuImg = skuImg;
}
/**
* 获取:商品规格图片
*/
public String getSkuImg() {
return skuImg;
}
/**
* 设置:商品规格编码
*/
public void setSkuCode(String skuCode) {
this.skuCode = skuCode;
}
/**
* 获取:商品规格编码
*/
public String getSkuCode() {
return skuCode;
}
/**
* 设置:规格描述
*/
......@@ -114,7 +145,6 @@ public class TbCfItemSkusEntity implements Serializable {
public String getSkuDesc() {
return skuDesc;
}
/**
* 设置:价格
*/
......@@ -128,7 +158,6 @@ public class TbCfItemSkusEntity implements Serializable {
public BigDecimal getSkuPrice() {
return skuPrice;
}
/**
* 设置:属性IDS
*/
......@@ -142,7 +171,6 @@ public class TbCfItemSkusEntity implements Serializable {
public String getOptionIds() {
return optionIds;
}
/**
* 设置:数量
*/
......@@ -156,7 +184,6 @@ public class TbCfItemSkusEntity implements Serializable {
public Integer getSkuCount() {
return skuCount;
}
/**
* 设置:排序号
*/
......@@ -170,7 +197,6 @@ public class TbCfItemSkusEntity implements Serializable {
public Integer getOrderNum() {
return orderNum;
}
/**
* 设置:删除标记
*/
......@@ -184,7 +210,6 @@ public class TbCfItemSkusEntity implements Serializable {
public Integer getDelFlag() {
return delFlag;
}
/**
* 设置:创建时间
*/
......@@ -198,7 +223,6 @@ public class TbCfItemSkusEntity implements Serializable {
public Date getCreateTime() {
return createTime;
}
/**
* 设置:更新时间
*/
......
......@@ -11,6 +11,15 @@ public class TbCfStationItemEntityExtends extends TbCfStationItemEntity implemen
private String goodtype;
private String itemDesc;
private BigDecimal discountPrice;
private String uname;
public String getUname() {
return uname;
}
public void setUname(String uname) {
this.uname = uname;
}
@Override
public BigDecimal getDiscountPrice() {
......
......@@ -2,6 +2,7 @@ package com.platform.service;
import com.platform.entity.ItemDescSkus;
import com.platform.entity.ItemInfo;
import com.platform.entity.SysUserEntity;
import com.platform.entity.TbCfStationItemEntity;
import com.platform.utils.R;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -96,4 +97,5 @@ public interface TbCfStationItemService {
void importExcel(MultipartFile multipartFile);
R importShopifyProducts(MultipartFile multipartFile);
List<SysUserEntity> queryCreator();
}
......@@ -46,6 +46,8 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
@Autowired
private TbCfOptionDao tbCfOptionDao;
@Autowired
private SysUserDao sysUserDao;
@Override
public ItemInfo queryItemInfoById(String itemId) {
//查询商品主体信息
......@@ -438,5 +440,10 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
return null;
}
@Override
public List<SysUserEntity> queryCreator() {
return sysUserDao.queryList(null);
}
}
......@@ -7,6 +7,8 @@
<result property="id" column="id"/>
<result property="itemId" column="item_id"/>
<result property="skuName" column="sku_name"/>
<result property="skuImg" column="sku_img"/>
<result property="skuCode" column="sku_code"/>
<result property="skuDesc" column="sku_desc"/>
<result property="skuPrice" column="sku_price"/>
<result property="optionIds" column="option_ids"/>
......@@ -18,10 +20,12 @@
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfItemSkusEntity">
select
select
`id`,
`item_id`,
`sku_name`,
`sku_img`,
`sku_code`,
`sku_desc`,
`sku_price`,
`option_ids`,
......@@ -39,6 +43,8 @@
`id`,
`item_id`,
`sku_name`,
`sku_img`,
`sku_code`,
`sku_desc`,
`sku_price`,
`option_ids`,
......@@ -83,6 +89,8 @@
`id`,
`item_id`,
`sku_name`,
`sku_img`,
`sku_code`,
`sku_desc`,
`sku_price`,
`option_ids`,
......@@ -95,6 +103,8 @@
#{id},
#{itemId},
#{skuName},
#{skuImg},
#{skuCode},
#{skuDesc},
#{skuPrice},
#{optionIds},
......@@ -108,15 +118,17 @@
<update id="update" parameterType="com.platform.entity.TbCfItemSkusEntity">
update tb_cf_item_skus
<set>
<if test="itemId != null">`item_id` = #{itemId},</if>
<if test="skuName != null">`sku_name` = #{skuName},</if>
<if test="skuDesc != null">`sku_desc` = #{skuDesc},</if>
<if test="skuPrice != null">`sku_price` = #{skuPrice},</if>
<if test="optionIds != null">`option_ids` = #{optionIds},</if>
<if test="skuCount != null">`sku_count` = #{skuCount},</if>
<if test="orderNum != null">`order_num` = #{orderNum},</if>
<if test="delFlag != null">`del_flag` = #{delFlag},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="itemId != null">`item_id` = #{itemId}, </if>
<if test="skuName != null">`sku_name` = #{skuName}, </if>
<if test="skuImg != null">`sku_img` = #{skuImg}, </if>
<if test="skuCode != null">`sku_code` = #{skuCode}, </if>
<if test="skuDesc != null">`sku_desc` = #{skuDesc}, </if>
<if test="skuPrice != null">`sku_price` = #{skuPrice}, </if>
<if test="optionIds != null">`option_ids` = #{optionIds}, </if>
<if test="skuCount != null">`sku_count` = #{skuCount}, </if>
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
<if test="delFlag != null">`del_flag` = #{delFlag}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
......
......@@ -130,13 +130,15 @@
i.creator,
d.descripition_name dname,
t.goodstwotype_title title,
o.goodstype_title goodtype
o.goodstype_title goodtype,
u.user_name uname
FROM
tb_cf_station_item i
left JOIN tb_cf_goodstype o ON o.goodstype_id = i.item_category
left JOIN tb_cf_goodstwotype t ON i.item_categorytwo=t.goodstwotype_id
left JOIN tb_cf_descripiton d ON i.item_descrition_id=d.descripition_id
left JOIN tb_cf_express_template e ON i.item_descrition_id = e.template_id
left join sys_user u on i.creator=u.user_id
WHERE 1=1 and i.enable_flag!=0
<if test="name != null and name.trim() != ''">
AND item_name LIKE concat('%',#{name},'%') or item_id LIKE concat('%',#{name},'%')
......@@ -156,6 +158,12 @@
<if test="typeThree != null and typeThree.trim() != ''">
AND item_descrition_id=#{typeThree}
</if>
<if test="supplier != null and supplier.trim() != ''">
AND supplier=#{supplier}
</if>
<if test="creator != null and creator.trim() != ''">
AND creator=#{creator}
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
......@@ -203,6 +211,12 @@
<if test="typeThree != null and typeThree.trim() != ''">
AND item_descrition_id=#{typeThree}
</if>
<if test="supplier != null and supplier.trim() != ''">
AND supplier=#{supplier}
</if>
<if test="creator != null and creator.trim() != ''">
AND creator=#{creator}
</if>
</select>
<insert id="save" parameterType="com.platform.entity.TbCfStationItemEntity">
......@@ -269,7 +283,7 @@
<if test="itemCategory != null">`item_category` = #{itemCategory},</if>
`item_price` = #{itemPrice},
<if test="discountPrice != null">`discount_price` = #{discountPrice},</if>
<if test="costPrice != null">`cost_price` = #{costPrice}, </if>
<if test="costPrice != null">`cost_price` = #{costPrice},</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>
......
package test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.concurrent.*;
/**
* 并发测试
*
* @author 爱酱油不爱醋
* @version 1.0
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:/applicationContext-test.xml"})
public class ConcurrencyApi {
private final int corePoolSize = 15;
private final int maximumPoolSize = 35;
@Test
public void test() {
ExecutorService executor = Executors.newCachedThreadPool();
int i = 0;
while (true) {
RunningTest test = new RunningTest(i);
executor.submit(test);
System.out.println("正在执行的线程编号:" + i);
i++;
}
}
}
//package test;
//
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.test.context.ContextConfiguration;
//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
//
//import java.util.concurrent.*;
//
///**
// * 并发测试
// *
// * @author 爱酱油不爱醋
// * @version 1.0
// */
//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = {"classpath*:/applicationContext-test.xml"})
//public class ConcurrencyApi {
//
// private final int corePoolSize = 15;
//
// private final int maximumPoolSize = 35;
//
// @Test
// public void test() {
// ExecutorService executor = Executors.newCachedThreadPool();
// int i = 0;
// while (true) {
// test.RunningTest test = new test.RunningTest(i);
// executor.submit(test);
// System.out.println("正在执行的线程编号:" + i);
// i++;
// }
//
// }
//
//
//}
......@@ -289,13 +289,29 @@
<i-input v-model="q.code" @on-enter="query" placeholder="商品编号" style="width:160px">
</i-input>
</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<span>
商品名称:
<i-input v-model="q.name" @on-enter="query" placeholder="商品名称" style="width:160px">
</i-input>
</span> &nbsp;&nbsp;
<span>
供应商:
<i-input v-model="q.supplier" @on-enter="query" placeholder="供应商" style="width:160px">
</i-input>
</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
<span>
创建人:
<i-select v-model="q.creator" @on-enter="query"
placeholder="创建人" style="width:160px">
<i-option v-for="(el,i) in creatorList" :key='i'
:value="el.userId">{{el.userName}}
</i-option>
</i-select>
</span>
&nbsp;&nbsp;&nbsp;
<span>
一级分类:
<i-select v-model="q.itemCategory" @on-enter="query"
......
......@@ -19,7 +19,8 @@ $(function () {
{label: '商品二级分类', name: 'title', index: 'title', width: 80},
{label: '商品三级分类', name: 'dname', index: 'itemDescritionId', width: 80},
{label: '状态', name: 'enableFlag', index: 'enable_flag', width: 60, formatter: itemStatusFormat},
{label: '创建日期', name: 'createTime', index: 'create_time', width: 80}
{label: '创建日期', name: 'createTime', index: 'create_time', width: 80},
{label: '创建人', name: 'uname', index: 'uname', width: 80}
]
});
});
......@@ -34,6 +35,8 @@ let vm = new Vue({
Goodstype: null,
Goodstype2: null,
uploadList: [],
uploadList1: [],
creatorList: [],
Goodstype3: null,
handleCreateSelect: null,
ruleValidate: {
......@@ -45,7 +48,9 @@ let vm = new Vue({
name: '',
code: '',
status: '',
itemCategory: ''
supplier: '',
itemCategory: '',
creator:''
},
......@@ -144,7 +149,6 @@ let vm = new Vue({
this.$set(vm.tbCfStationItem, 'tree', this.attrItem)
let _this = this
vm.tbCfStationItem.itemImg = vm.uploadList.map(res => res).join(';');
;
vm.tbCfStationItem.itemDesc = encodeURI(UE.getEditor('itemDesc').getContent()); // 富文本取值
vm.tbCfStationItem.itemDesc = vm.tbCfStationItem.itemDesc.replace(/&nbsp;/g, " ");
......@@ -288,7 +292,9 @@ let vm = new Vue({
'name': vm.q.name.trim(),
'code': vm.q.code.trim(),
'status': vm.q.status.trim(),
'itemCategory': vm.q.itemCategory.trim()
'supplier': vm.q.supplier.trim(),
'itemCategory': vm.q.itemCategory.trim(),
'creator': vm.q.creator.trim(),
},
page: page
}).trigger("reloadGrid");
......@@ -299,7 +305,9 @@ let vm = new Vue({
name: '',
code: '',
status: '',
itemCategory: ''
supplier: '',
itemCategory: '',
creator: ''
};
vm.reload();
},
......@@ -600,9 +608,12 @@ let vm = new Vue({
}
$.get('../tbcfgoodstype/queryAll', res => {
this.Goodstype = res.list;
console.log('一级分类', this.Goodstype)
})
$.get('../tbcfstationitem/queryCreator', res => {
let parse = JSON.parse(res);
this.creatorList = parse.list;
console.log('用户', this.creatorList)
})
//获取默认规格
$.get('../tbcategorytemplate/queryAll', res => {
let _res = JSON.parse(res)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论