提交 b9cc4cc3 authored 作者: 张光耀's avatar 张光耀

添加一级分类,并且做了财务统计

上级 440e9ded
# Created by .ignore support plugin (hsz.mobi)
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen
/platform-common/target/
/platform-gen/target/
/platform-restful/target/
/platform-schedule/target/
/platform-admin/target/
......@@ -8,14 +8,10 @@ import com.platform.utils.R;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 财务明细Controller
......@@ -27,7 +23,127 @@ import java.util.Map;
@RequestMapping("tbcffinance")
public class TbCfFinanceController {
@Autowired
private TbCfFinanceService tbCfFinanceService;
private TbCfFinanceService tbCfFinanceService;
/**
* 当天的下单总金额
* @return
*/
@RequestMapping("/findBySumPay")
@RequiresPermissions("tbcffinance:list")
@ResponseBody
public R findBySumPay() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//开始时间
String beginTime = df.format(new Date());
beginTime +=" 00:00:00";
SimpleDateFormat dfs = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//结束时间
String endTime = dfs.format(new Date());
endTime +=" 23:59:59";
Double sumPay = tbCfFinanceService.findBySumPay(beginTime,endTime);
return R.ok().put("sumPay",sumPay);
}
/**
* 当天下单用户数量
* @return
*/
@RequestMapping("/findByCountUser")
@RequiresPermissions("tbcffinance:list")
@ResponseBody
public R findByCountUser() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//开始时间
String beginTime = df.format(new Date());
beginTime +=" 00:00:00";
SimpleDateFormat dfs = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//结束时间
String endTime = dfs.format(new Date());
endTime +=" 23:59:59";
List<TbCfFinanceEntity> countUser = tbCfFinanceService.findByCountUser(beginTime,endTime);
return R.ok().put("countUser",countUser.size());
}
/**
* 今天下单数
* @return
*/
@RequestMapping("/findByCountOrder")
@RequiresPermissions("tbcffinance:list")
@ResponseBody
public R findByCountOrder() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//开始时间
String beginTime = df.format(new Date());
beginTime +=" 00:00:00";
SimpleDateFormat dfs = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//结束时间
String endTime = dfs.format(new Date());
endTime +=" 23:59:59";
Integer countOrder = tbCfFinanceService.findByCountOrder(beginTime,endTime);
return R.ok().put("countOrder",countOrder);
}
/**
* 今天下单商品总数
* @return
*/
@RequestMapping("/findBySumOrder")
@RequiresPermissions("tbcffinance:list")
@ResponseBody
public R findBySumOrder() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//开始时间
String beginTime = df.format(new Date());
beginTime +=" 00:00:00";
SimpleDateFormat dfs = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//结束时间
String endTime = dfs.format(new Date());
endTime +=" 23:59:59";
Integer sumOrder = tbCfFinanceService.findBySumOrder(beginTime,endTime);
return R.ok().put("sumOrder",sumOrder);
}
/**
* 今天下单的商品平均价格
* @return
*/
@RequestMapping("/findByAvgGoodsPrice")
@RequiresPermissions("tbcffinance:list")
@ResponseBody
public R findByAvgGoodsPrice() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//开始时间
String beginTime = df.format(new Date());
beginTime +=" 00:00:00";
SimpleDateFormat dfs = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//结束时间
String endTime = dfs.format(new Date());
endTime +=" 23:59:59";
Double avgGoodsPrice = tbCfFinanceService.findByAvgGoodsPrice(beginTime,endTime);
return R.ok().put("avgGoodsPrice",avgGoodsPrice);
}
/**
* 今天下单的商品平均价格
* @return
*/
@RequestMapping("/findByAvgOrderPrice")
@RequiresPermissions("tbcffinance:list")
@ResponseBody
public R findByAvgOrderPrice() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//开始时间
String beginTime = df.format(new Date());
beginTime +=" 00:00:00";
SimpleDateFormat dfs = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//结束时间
String endTime = dfs.format(new Date());
endTime +=" 23:59:59";
Double avgOrderPrice = tbCfFinanceService.findByAvgOrderPrice(beginTime,endTime);
return R.ok().put("avgOrderPrice",avgOrderPrice);
}
/**
* 查看列表
......
package com.platform.controller;
import com.platform.entity.TbCfGoodstypeEntity;
import com.platform.service.TbCfGoodstypeService;
import com.platform.utils.PageUtils;
import com.platform.utils.Query;
import com.platform.utils.R;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
/**
* Controller
*
* @author lipengjun
* @date 2019-10-08 16:34:40
*/
@Controller
@RequestMapping("tbcfgoodstype")
public class TbCfGoodstypeController {
@Autowired
private TbCfGoodstypeService tbCfGoodstypeService;
/**
* 查看列表
*/
@RequestMapping("/list")
@RequiresPermissions("tbcfgoodstype:list")
@ResponseBody
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
Query query = new Query(params);
List<TbCfGoodstypeEntity> tbCfGoodstypeList = tbCfGoodstypeService.queryList(query);
int total = tbCfGoodstypeService.queryTotal(query);
PageUtils pageUtil = new PageUtils(tbCfGoodstypeList, total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil);
}
/**
* 查看信息
*/
@RequestMapping("/info/{goodstypeId}")
@RequiresPermissions("tbcfgoodstype:info")
@ResponseBody
public R info(@PathVariable("goodstypeId") String goodstypeId) {
TbCfGoodstypeEntity tbCfGoodstype = tbCfGoodstypeService.queryObject(goodstypeId);
return R.ok().put("tbCfGoodstype", tbCfGoodstype);
}
/**
* 保存
*/
@RequestMapping("/save")
@RequiresPermissions("tbcfgoodstype:save")
@ResponseBody
public R save(@RequestBody TbCfGoodstypeEntity tbCfGoodstype) {
tbCfGoodstypeService.save(tbCfGoodstype);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@RequiresPermissions("tbcfgoodstype:update")
@ResponseBody
public R update(@RequestBody TbCfGoodstypeEntity tbCfGoodstype) {
tbCfGoodstypeService.update(tbCfGoodstype);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
@RequiresPermissions("tbcfgoodstype:delete")
@ResponseBody
public R delete(@RequestBody String[] goodstypeIds) {
tbCfGoodstypeService.deleteBatch(goodstypeIds);
return R.ok();
}
/**
* 查看所有列表
*/
@RequestMapping("/queryAll")
@ResponseBody
public R queryAll(@RequestParam Map<String, Object> params) {
List<TbCfGoodstypeEntity> list = tbCfGoodstypeService.queryList(params);
return R.ok().put("list", list);
}
}
package com.platform.dao;
import com.platform.entity.TbCfFinanceEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 财务明细Dao
......@@ -10,4 +13,51 @@ import com.platform.entity.TbCfFinanceEntity;
*/
public interface TbCfFinanceDao extends BaseDao<TbCfFinanceEntity> {
/**
* 今日下单总金额
* @param beginTime
* @param endTime
* @return
*/
Double findBySumPay(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 今日下单总人数
* @param beginTime
* @param endTime
* @return
*/
List<TbCfFinanceEntity> findByCountUser(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 今天下单量
* @param beginTime
* @param endTime
* @return
*/
Integer findByCountOrder(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 今日下单商品数量
* @param beginTime
* @param endTime
* @return
*/
Integer findBySumOrder(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 今天下单的商品平均价格
* @param beginTime
* @param endTime
* @return
*/
Double findByAvgGoodsPrice(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 今天下单的商品平均价格
* @param beginTime
* @param endTime
* @return
*/
Double findByAvgOrderPrice(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
}
package com.platform.dao;
import com.platform.entity.TbCfGoodstypeEntity;
/**
* Dao
*
* @author lipengjun
* @date 2019-10-08 16:34:40
*/
public interface TbCfGoodstypeDao extends BaseDao<TbCfGoodstypeEntity> {
}
package com.platform.entity;
import java.io.Serializable;
/**
* 实体
* 表名 tb_cf_goodstype
*
* @author lipengjun
* @date 2019-10-08 16:34:40
*/
public class TbCfGoodstypeEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 商品分类Id
*/
private String goodstypeId;
/**
* 商品分类标题
*/
private String goodstypeTitle;
/**
* 商品分类排序编号
*/
private Integer goodstypeSort;
/**
* 设置:商品分类Id
*/
public void setGoodstypeId(String goodstypeId) {
this.goodstypeId = goodstypeId;
}
/**
* 获取:商品分类Id
*/
public String getGoodstypeId() {
return goodstypeId;
}
/**
* 设置:商品分类标题
*/
public void setGoodstypeTitle(String goodstypeTitle) {
this.goodstypeTitle = goodstypeTitle;
}
/**
* 获取:商品分类标题
*/
public String getGoodstypeTitle() {
return goodstypeTitle;
}
/**
* 设置:商品分类排序编号
*/
public void setGoodstypeSort(Integer goodstypeSort) {
this.goodstypeSort = goodstypeSort;
}
/**
* 获取:商品分类排序编号
*/
public Integer getGoodstypeSort() {
return goodstypeSort;
}
}
package com.platform.service;
import com.platform.entity.TbCfFinanceEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -68,4 +69,54 @@ public interface TbCfFinanceService {
* @return 删除条数
*/
int deleteBatch(String[] finaceIds);
/**
* 查询今天下单的总金额
* @param beginTime
* @param endTime
* @return
*/
Double findBySumPay(String beginTime, String endTime);
/**
* 进入下单人数
* @param beginTime
* @param endTime
* @return
*/
List<TbCfFinanceEntity> findByCountUser(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 今天下单量
* @param beginTime
* @param endTime
* @return
*/
Integer findByCountOrder(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 今日下单商品数量
* @param beginTime
* @param endTime
* @return
*/
Integer findBySumOrder(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 今天下单的商品平均价格
* @param beginTime
* @param endTime
* @return
*/
Double findByAvgGoodsPrice(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
/**
* 今天下单的商品平均价格
* @param beginTime
* @param endTime
* @return
*/
Double findByAvgOrderPrice(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
}
package com.platform.service;
import com.platform.entity.TbCfGoodstypeEntity;
import java.util.List;
import java.util.Map;
/**
* Service接口
*
* @author lipengjun
* @date 2019-10-08 16:34:40
*/
public interface TbCfGoodstypeService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfGoodstypeEntity queryObject(String goodstypeId);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List<TbCfGoodstypeEntity> queryList(Map<String, Object> map);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int queryTotal(Map<String, Object> map);
/**
* 保存实体
*
* @param tbCfGoodstype 实体
* @return 保存条数
*/
int save(TbCfGoodstypeEntity tbCfGoodstype);
/**
* 根据主键更新实体
*
* @param tbCfGoodstype 实体
* @return 更新条数
*/
int update(TbCfGoodstypeEntity tbCfGoodstype);
/**
* 根据主键删除
*
* @param goodstypeId
* @return 删除条数
*/
int delete(String goodstypeId);
/**
* 根据主键批量删除
*
* @param goodstypeIds
* @return 删除条数
*/
int deleteBatch(String[] goodstypeIds);
}
......@@ -18,6 +18,7 @@ import java.util.Map;
*/
@Service("tbCfFinanceService")
public class TbCfFinanceServiceImpl implements TbCfFinanceService {
@Autowired
private TbCfFinanceDao tbCfFinanceDao;
......@@ -56,4 +57,68 @@ public class TbCfFinanceServiceImpl implements TbCfFinanceService {
public int deleteBatch(String[] finaceIds) {
return tbCfFinanceDao.deleteBatch(finaceIds);
}
/**
* 下单总数
* @param beginTime
* @param endTime
* @return
*/
@Override
public Double findBySumPay(String beginTime,String endTime) {
return tbCfFinanceDao.findBySumPay(beginTime,endTime);
}
/**
* 进入下单人数
* @param beginTime
* @param endTime
* @return
*/
@Override
public List<TbCfFinanceEntity> findByCountUser(String beginTime,String endTime) {
return tbCfFinanceDao.findByCountUser(beginTime,endTime);
}
/**
* 今天下单量
* @param beginTime
* @param endTime
* @return
*/
public Integer findByCountOrder(String beginTime, String endTime) {
return tbCfFinanceDao.findByCountOrder(beginTime,endTime);
}
/**
* 今日下单商品数量
* @param beginTime
* @param endTime
* @return
*/
public Integer findBySumOrder(String beginTime, String endTime) {
return tbCfFinanceDao.findBySumOrder(beginTime,endTime);
}
/**
* 今天下单的商品平均价格
* @param beginTime
* @param endTime
* @return
*/
public Double findByAvgGoodsPrice(String beginTime, String endTime) {
return tbCfFinanceDao.findByAvgGoodsPrice(beginTime,endTime);
}
/**
* 今天下单的商品平均价格
* @param beginTime
* @param endTime
* @return
*/
public Double findByAvgOrderPrice(String beginTime, String endTime) {
return tbCfFinanceDao.findByAvgOrderPrice(beginTime,endTime);
}
}
package com.platform.service.impl;
import com.platform.dao.TbCfGoodstypeDao;
import com.platform.entity.TbCfGoodstypeEntity;
import com.platform.service.TbCfGoodstypeService;
import com.platform.utils.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* Service实现类
*
* @author lipengjun
* @date 2019-10-08 16:34:40
*/
@Service("tbCfGoodstypeService")
public class TbCfGoodstypeServiceImpl implements TbCfGoodstypeService {
@Autowired
private TbCfGoodstypeDao tbCfGoodstypeDao;
@Override
public TbCfGoodstypeEntity queryObject(String goodstypeId) {
return tbCfGoodstypeDao.queryObject(goodstypeId);
}
@Override
public List<TbCfGoodstypeEntity> queryList(Map<String, Object> map) {
return tbCfGoodstypeDao.queryList(map);
}
@Override
public int queryTotal(Map<String, Object> map) {
return tbCfGoodstypeDao.queryTotal(map);
}
@Override
public int save(TbCfGoodstypeEntity tbCfGoodstype) {
tbCfGoodstype.setGoodstypeId(IdUtil.createIdbyUUID());
return tbCfGoodstypeDao.save(tbCfGoodstype);
}
@Override
public int update(TbCfGoodstypeEntity tbCfGoodstype) {
return tbCfGoodstypeDao.update(tbCfGoodstype);
}
@Override
public int delete(String goodstypeId) {
return tbCfGoodstypeDao.delete(goodstypeId);
}
@Override
public int deleteBatch(String[] goodstypeIds) {
return tbCfGoodstypeDao.deleteBatch(goodstypeIds);
}
}
......@@ -14,6 +14,46 @@
<result property="receiptUrl" column="receipt_url"/>
</resultMap>
<!-- 今天下单总金额 -->
<select id="findBySumPay" resultType="Double" >
SELECT SUM(pay_account) FROM tb_cf_finance
WHERE pay_Time BETWEEN #{beginTime} AND #{endTime}
</select>
<!-- 今天下单用户数 -->
<select id="findByCountUser" resultType="com.platform.entity.TbCfFinanceEntity">
SELECT DISTINCT user_id FROM tb_cf_finance
WHERE pay_Time BETWEEN #{beginTime} AND #{endTime}
</select>
<!-- 今天下单量 -->
<select id="findByCountOrder" resultType="java.lang.Integer">
SELECT COUNT(order_id) FROM tb_cf_order
WHERE order_status = 20 AND deal_time BETWEEN #{beginTime} AND #{endTime}
</select>
<!-- 今天下单商品数-->
<select id="findBySumOrder" resultType="java.lang.Integer">
SELECT SUM(item_num) FROM tb_cf_item_order_r r
INNER JOIN tb_cf_item_detail li ON r.`item_id` = li.item_id
INNER JOIN tb_cf_order od ON r.`order_id` = od.`order_id`
WHERE order_status IN (20,40,50,60)
AND deal_time BETWEEN #{beginTime} AND #{endTime}
</select>
<!-- 今天下单的商品平均价格 -->
<select id="findByAvgGoodsPrice" resultType="Double">
SELECT AVG(items_price) FROM tb_cf_order
WHERE order_status IN (20,40,50,60) AND deal_time BETWEEN #{beginTime} AND #{endTime}
</select>
<!-- 今天下单订单平均价格 -->
<select id="findByAvgOrderPrice" resultType="Double">
SELECT AVG(total_price) FROM tb_cf_order
WHERE order_status IN (20,40,50,60) AND deal_time BETWEEN #{beginTime} AND #{endTime}
</select>
<select id="queryObject" resultType="com.platform.entity.TbCfFinanceEntity">
select
`finace_id`,
......
<?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.platform.dao.TbCfGoodstypeDao">
<resultMap type="com.platform.entity.TbCfGoodstypeEntity" id="tbCfGoodstypeMap">
<result property="goodstypeId" column="goodstype_id"/>
<result property="goodstypeTitle" column="goodstype_title"/>
<result property="goodstypeSort" column="goodstype_sort"/>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfGoodstypeEntity">
select
`goodstype_id`,
`goodstype_title`,
`goodstype_sort`
from tb_cf_goodstype
where goodstype_id = #{id}
</select>
<select id="queryList" resultType="com.platform.entity.TbCfGoodstypeEntity">
select
`goodstype_id`,
`goodstype_title`,
`goodstype_sort`
from tb_cf_goodstype
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by goodstype_id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_goodstype
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.platform.entity.TbCfGoodstypeEntity">
insert into tb_cf_goodstype(
`goodstype_id`,
`goodstype_title`,
`goodstype_sort`)
values(
#{goodstypeId},
#{goodstypeTitle},
#{goodstypeSort})
</insert>
<update id="update" parameterType="com.platform.entity.TbCfGoodstypeEntity">
update tb_cf_goodstype
<set>
<if test="goodstypeTitle != null">`goodstype_title` = #{goodstypeTitle}, </if>
<if test="goodstypeSort != null">`goodstype_sort` = #{goodstypeSort}</if>
</set>
where goodstype_id = #{goodstypeId}
</update>
<delete id="delete">
delete from tb_cf_goodstype where goodstype_id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_goodstype where goodstype_id in
<foreach item="goodstypeId" collection="array" open="(" separator="," close=")">
#{goodstypeId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -13,6 +13,7 @@
<i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
</i-col>
<i-button @click="query">查询</i-button>
<i-button @click="a">test</i-button>
<i-button @click="reloadSearch">重置</i-button>
</div>
<div class="buttons-group">
......
<!DOCTYPE html>
<html>
<head>
<title></title>
#parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;">
<Row :gutter="16">
<div class="search-group">
<i-col span="4">
<i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
</i-col>
<i-button @click="query">查询</i-button>
<i-button @click="reloadSearch">重置</i-button>
</div>
<div class="buttons-group">
#if($shiro.hasPermission("tbcfgoodstype:save"))
<i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
#end
#if($shiro.hasPermission("tbcfgoodstype:update"))
<i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
#end
#if($shiro.hasPermission("tbcfgoodstype:delete"))
<i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
#end
</div>
</Row>
<table id="jqGrid"></table>
</div>
<Card v-show="!showList">
<p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfGoodstype" :rules="ruleValidate" :label-width="80">
<Form-item label="商品分类标题" prop="goodstypeTitle">
<i-input v-model="tbCfGoodstype.goodstypeTitle" placeholder="商品分类标题"/>
</Form-item>
<Form-item label="商品分类排序编号" prop="goodstypeSort">
<i-input v-model="tbCfGoodstype.goodstypeSort" placeholder="商品分类排序编号"/>
</Form-item>
<Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script src="${rc.contextPath}/js/sys/tbcfgoodstype.js?_${date.systemTime}"></script>
</body>
</html>
\ No newline at end of file
......@@ -43,7 +43,15 @@
<i-input v-model="tbCfStationItem.itemBrief" placeholder="商品标题简介"/>
</Form-item>
<Form-item label="商品分类" prop="itemCategory">
<i-input v-model="tbCfStationItem.itemCategory" placeholder="商品分类"/>
<i-select placeholder="请选择" v-model="tbCfStationItem.itemCategory">
<i-option
v-for="(el,i) in Goodstype" :key = 'i'
:value="el.goodstypeId">{{el.goodstypeTitle}}</i-option>
<!-- <i-option value="beijing">北京市</i-option>-->
<!-- <i-option value="shanghai">上海市</i-option>-->
<!-- <i-option value="shenzhen">深圳市</i-option>-->
</i-select>
</Form-item>
<Form-item label="商品链接" prop="itemUrl">
<i-input v-model="tbCfStationItem.itemUrl" placeholder="商品链接"/>
......
......@@ -28,6 +28,7 @@ let vm = new Vue({
name: ''
}
},
methods: {
query: function () {
vm.reload();
......@@ -62,6 +63,7 @@ let vm = new Vue({
});
},
del: function (event) {
let finaceIds = getSelectedRows("#jqGrid");
if (finaceIds == null){
return;
......@@ -112,6 +114,28 @@ let vm = new Vue({
},
handleReset: function (name) {
handleResetForm(this, name);
}
},
a(){
console.log('bcs')
$.get('../tbcffinance/findByAvgOrderPrice',function (res) {
console.log(res)
})
// Ajax.request({
// url: "../tbcffinance/findBySumPay",
// type: "GET",
// contentType: "application/json",
// successCallback: function () {
//
// alert('操作成功', function (index) {
// vm.reload();
// });
// }
// });
}
},
mounted(){
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfgoodstype/list',
colModel: [
{label: 'goodstypeId', name: 'goodstypeId', index: 'goodstype_id', key: true, hidden: true},
{label: '商品分类标题', name: 'goodstypeTitle', index: 'goodstype_title', width: 80},
{label: '商品分类排序编号', name: 'goodstypeSort', index: 'goodstype_sort', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfGoodstype: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfGoodstype = {};
},
update: function (event) {
let goodstypeId = getSelectedRow("#jqGrid");
if (goodstypeId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(goodstypeId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfGoodstype.goodstypeId == null ? "../tbcfgoodstype/save" : "../tbcfgoodstype/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfGoodstype),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let goodstypeIds = getSelectedRows("#jqGrid");
if (goodstypeIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfgoodstype/delete",
params: JSON.stringify(goodstypeIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(goodstypeId){
Ajax.request({
url: "../tbcfgoodstype/info/"+goodstypeId,
async: true,
successCallback: function (r) {
vm.tbCfGoodstype = r.tbCfGoodstype;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
......@@ -21,6 +21,7 @@ let vm = new Vue({
data: {
showList: true,
title: null,
Goodstype:null,
tbCfStationItem: {},
ruleValidate: {
name: [
......@@ -115,6 +116,21 @@ let vm = new Vue({
},
handleReset: function (name) {
handleResetForm(this, name);
}
},
// getGoods:function (){
// console.log("bbb");
// $.get('../tbcfgoodstype/queryAll',function (res) {
// console.log(this,"aaa");
// console.log(res,"bbb");
// })
// }
},
created(){
var that = this
$.get('../tbcfgoodstype/queryAll',function (res) {
// console.log(that,"this");
that.Goodstype = JSON.parse(res).list;
// console.log(that.Goodstype);
})
}
});
\ No newline at end of file
......@@ -24,6 +24,11 @@
<artifactId>platform-common</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论