提交 5bc3b7d3 authored 作者: luojie's avatar luojie

修改订单物流信息订单状态更新,优化优惠券功能,新增优惠券类型管理

上级 1add0534
...@@ -18,13 +18,13 @@ import java.util.List; ...@@ -18,13 +18,13 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 优惠券类型表Controller * Controller
* *
* @author lipengjun * @author lipengjun
* @date 2019-10-22 10:23:49 * @date 2019-12-02 18:44:13
*/ */
@Controller @Controller
@RequestMapping(value = "tbcfcouponcategory",produces = "application/json; charset=utf-8") @RequestMapping("tbcfcouponcategory")
public class TbCfCouponCategoryController { public class TbCfCouponCategoryController {
@Autowired @Autowired
private TbCfCouponCategoryService tbCfCouponCategoryService; private TbCfCouponCategoryService tbCfCouponCategoryService;
...@@ -94,18 +94,7 @@ public class TbCfCouponCategoryController { ...@@ -94,18 +94,7 @@ public class TbCfCouponCategoryController {
return R.ok(); return R.ok();
} }
/**
*
* @param categoryId
* @return
*/
@RequestMapping("/queryByCouponCategoryId")
@ResponseBody
public R queryByItemType(@RequestParam("categoryId") String categoryId){
List<TbCfCouponCategoryEntity> list = tbCfCouponCategoryService.queryByCouponCategoryId(categoryId);
System.out.println(list.toArray());
return R.ok().put("list",list);
}
/** /**
* 查看所有列表 * 查看所有列表
*/ */
......
...@@ -5,16 +5,11 @@ import com.platform.entity.TbCfCouponCategoryEntity; ...@@ -5,16 +5,11 @@ import com.platform.entity.TbCfCouponCategoryEntity;
import java.util.List; import java.util.List;
/** /**
* 优惠券发放Dao * Dao
* *
* @author lipengjun * @author lipengjun
* @date 2019-10-22 10:23:49 * @date 2019-12-02 18:44:13
*/ */
public interface TbCfCouponCategoryDao extends BaseDao<TbCfCouponCategoryEntity> { public interface TbCfCouponCategoryDao extends BaseDao<TbCfCouponCategoryEntity> {
/**
* 获取优惠券类型
* @param categoryId
* @return
*/
List<TbCfCouponCategoryEntity> queryByCouponCategoryId(String categoryId);
} }
...@@ -4,6 +4,9 @@ import com.platform.entity.TbCfItemDetailEntity; ...@@ -4,6 +4,9 @@ import com.platform.entity.TbCfItemDetailEntity;
import com.platform.entity.TbCfItemOrderREntity; import com.platform.entity.TbCfItemOrderREntity;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/** /**
* 订单商品对应表Dao * 订单商品对应表Dao
* *
...@@ -26,4 +29,8 @@ public interface TbCfItemOrderRDao extends BaseDao<TbCfItemOrderREntity> { ...@@ -26,4 +29,8 @@ public interface TbCfItemOrderRDao extends BaseDao<TbCfItemOrderREntity> {
TbCfItemOrderREntity getOrderItemId(String orderId, String itemId); TbCfItemOrderREntity getOrderItemId(String orderId, String itemId);
Integer getItemNum(String ordersId); Integer getItemNum(String ordersId);
int getOrderStatus(String ordersId);
Set<Integer> findOrderStatus(String orderId);
} }
...@@ -55,5 +55,7 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> { ...@@ -55,5 +55,7 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
BigDecimal getPrice(String ordersId); BigDecimal getPrice(String ordersId);
void updateOrderStatus(TbCfOrderEntity tbCfOrderEntity); int updateOrderStatus(TbCfOrderEntity tbCfOrderEntity);
int updateStatus(TbCfOrderEntity tbCfOrderEntity);
} }
package com.platform.dao; package com.platform.dao;
import com.platform.entity.SysLogEntity; import com.platform.entity.SysLogEntity;
import com.platform.entity.TbCfItemOrderREntity;
import com.platform.entity.TbCfPlatformOrderEntity; import com.platform.entity.TbCfPlatformOrderEntity;
import com.platform.vo.PlatformOrderVo; import com.platform.vo.PlatformOrderVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -21,4 +22,8 @@ public interface TbCfPlatformOrderDao extends BaseDao<PlatformOrderVo> { ...@@ -21,4 +22,8 @@ public interface TbCfPlatformOrderDao extends BaseDao<PlatformOrderVo> {
int updates( PlatformOrderVo tbCfPlatformOrder); int updates( PlatformOrderVo tbCfPlatformOrder);
int getOrderId(String sid);
TbCfItemOrderREntity getOrdersId(String sid);
} }
...@@ -4,11 +4,11 @@ import java.io.Serializable; ...@@ -4,11 +4,11 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* 优惠券类型表实体 * 实体
* 表名 tb_cf_coupon_category * 表名 tb_cf_coupon_category
* *
* @author lipengjun * @author lipengjun
* @date 2019-10-22 10:23:49 * @date 2019-12-02 18:44:13
*/ */
public class TbCfCouponCategoryEntity implements Serializable { public class TbCfCouponCategoryEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -21,6 +21,14 @@ public class TbCfCouponCategoryEntity implements Serializable { ...@@ -21,6 +21,14 @@ public class TbCfCouponCategoryEntity implements Serializable {
* 优惠券类型名称 * 优惠券类型名称
*/ */
private String couponCategoryName; private String couponCategoryName;
/**
* 创建时间
*/
private Date createTime;
/**
* 是否有效(0无效,1有效)
*/
private Integer enableFlag;
/** /**
* 设置:优惠券类型id * 设置:优惠券类型id
...@@ -48,4 +56,30 @@ public class TbCfCouponCategoryEntity implements Serializable { ...@@ -48,4 +56,30 @@ public class TbCfCouponCategoryEntity implements Serializable {
public String getCouponCategoryName() { public String getCouponCategoryName() {
return couponCategoryName; return couponCategoryName;
} }
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:是否有效(0无效,1有效)
*/
public void setEnableFlag(Integer enableFlag) {
this.enableFlag = enableFlag;
}
/**
* 获取:是否有效(0无效,1有效)
*/
public Integer getEnableFlag() {
return enableFlag;
}
} }
...@@ -21,14 +21,31 @@ public class TbCfToiCouponEntity implements Serializable { ...@@ -21,14 +21,31 @@ public class TbCfToiCouponEntity implements Serializable {
* 优惠券id * 优惠券id
*/ */
private String couponId; private String couponId;
/**
* 优惠券id
*/
private String couponTitle;
/** /**
* 用户id * 用户id
*/ */
private String userId; private String userId;
/**
* 用户id
*/
private String userInfo;
/** /**
* 创建时间 * 创建时间
*/ */
private Date createTime; private Date createTime;
/**
* 创建时间
*/
private Date startTime;
/**
* 创建时间
*/
private Date endTime;
/** /**
* 标识(1发放,2领取,3注册) * 标识(1发放,2领取,3注册)
*/ */
...@@ -116,4 +133,36 @@ public class TbCfToiCouponEntity implements Serializable { ...@@ -116,4 +133,36 @@ public class TbCfToiCouponEntity implements Serializable {
public Integer getEnableFlag() { public Integer getEnableFlag() {
return enableFlag; return enableFlag;
} }
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getCouponTitle() {
return couponTitle;
}
public void setCouponTitle(String couponTitle) {
this.couponTitle = couponTitle;
}
public String getUserInfo() {
return userInfo;
}
public void setUserInfo(String userInfo) {
this.userInfo = userInfo;
}
} }
...@@ -6,17 +6,15 @@ import java.util.List; ...@@ -6,17 +6,15 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 优惠券类型表Service接口 * Service接口
* *
* @author lipengjun * @author lipengjun
* @date 2019-10-22 10:23:49 * @date 2019-12-02 18:44:13
*/ */
public interface TbCfCouponCategoryService { public interface TbCfCouponCategoryService {
/** /**
* 根据主键查询实体 * 根据主键查询实体
*
* @param
* @return 实体 * @return 实体
*/ */
TbCfCouponCategoryEntity queryObject(String couponCategoryId); TbCfCouponCategoryEntity queryObject(String couponCategoryId);
...@@ -68,11 +66,4 @@ public interface TbCfCouponCategoryService { ...@@ -68,11 +66,4 @@ public interface TbCfCouponCategoryService {
* @return 删除条数 * @return 删除条数
*/ */
int deleteBatch(String[] couponCategoryIds); int deleteBatch(String[] couponCategoryIds);
/**
* 根据优惠券类型id查询
* @param categoryId
* @return
*/
List<TbCfCouponCategoryEntity> queryByCouponCategoryId(String categoryId);
} }
...@@ -5,6 +5,7 @@ import com.platform.entity.TbCfItemOrderREntity; ...@@ -5,6 +5,7 @@ import com.platform.entity.TbCfItemOrderREntity;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* 订单商品对应表Service接口 * 订单商品对应表Service接口
...@@ -92,4 +93,8 @@ public interface TbCfItemOrderRService { ...@@ -92,4 +93,8 @@ public interface TbCfItemOrderRService {
int updateExpressStatusDelivery(String[] sids); int updateExpressStatusDelivery(String[] sids);
Integer getItemNum(String ordersId); Integer getItemNum(String ordersId);
int getOrderStatus(String ordersId);
Set<Integer> findOrderStatus(String orderId);
} }
...@@ -99,4 +99,5 @@ public interface TbCfOrderService { ...@@ -99,4 +99,5 @@ public interface TbCfOrderService {
List<TbCfOrderEntity> queryOrderDetail(String ordersId); List<TbCfOrderEntity> queryOrderDetail(String ordersId);
int updateStatus(TbCfOrderEntity tbCfOrderEntity);
} }
package com.platform.service; package com.platform.service;
import com.platform.entity.TbCfItemOrderREntity;
import com.platform.vo.PlatformOrderVo; import com.platform.vo.PlatformOrderVo;
import java.util.List; import java.util.List;
...@@ -67,4 +68,8 @@ public interface TbCfPlatformOrderService { ...@@ -67,4 +68,8 @@ public interface TbCfPlatformOrderService {
*/ */
int deleteBatch(String[] relativeIds); int deleteBatch(String[] relativeIds);
int getOrderId(String sid);
TbCfItemOrderREntity getOrdersId(String sid);
} }
...@@ -7,14 +7,15 @@ import com.platform.utils.IdUtil; ...@@ -7,14 +7,15 @@ import com.platform.utils.IdUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 优惠券类型Service实现类 * Service实现类
* *
* @author lipengjun * @author lipengjun
* @date 2019-10-22 10:23:49 * @date 2019-12-02 18:44:13
*/ */
@Service("tbCfCouponCategoryService") @Service("tbCfCouponCategoryService")
public class TbCfCouponCategoryServiceImpl implements TbCfCouponCategoryService { public class TbCfCouponCategoryServiceImpl implements TbCfCouponCategoryService {
...@@ -28,6 +29,7 @@ public class TbCfCouponCategoryServiceImpl implements TbCfCouponCategoryService ...@@ -28,6 +29,7 @@ public class TbCfCouponCategoryServiceImpl implements TbCfCouponCategoryService
@Override @Override
public List<TbCfCouponCategoryEntity> queryList(Map<String, Object> map) { public List<TbCfCouponCategoryEntity> queryList(Map<String, Object> map) {
return tbCfCouponCategoryDao.queryList(map); return tbCfCouponCategoryDao.queryList(map);
} }
...@@ -39,11 +41,13 @@ public class TbCfCouponCategoryServiceImpl implements TbCfCouponCategoryService ...@@ -39,11 +41,13 @@ public class TbCfCouponCategoryServiceImpl implements TbCfCouponCategoryService
@Override @Override
public int save(TbCfCouponCategoryEntity tbCfCouponCategory) { public int save(TbCfCouponCategoryEntity tbCfCouponCategory) {
tbCfCouponCategory.setCouponCategoryId(IdUtil.createIdbyUUID()); tbCfCouponCategory.setCouponCategoryId(IdUtil.createIdbyUUID());
tbCfCouponCategory.setCreateTime(new Date());
return tbCfCouponCategoryDao.save(tbCfCouponCategory); return tbCfCouponCategoryDao.save(tbCfCouponCategory);
} }
@Override @Override
public int update(TbCfCouponCategoryEntity tbCfCouponCategory) { public int update(TbCfCouponCategoryEntity tbCfCouponCategory) {
tbCfCouponCategory.setCreateTime(new Date());
return tbCfCouponCategoryDao.update(tbCfCouponCategory); return tbCfCouponCategoryDao.update(tbCfCouponCategory);
} }
...@@ -56,9 +60,4 @@ public class TbCfCouponCategoryServiceImpl implements TbCfCouponCategoryService ...@@ -56,9 +60,4 @@ public class TbCfCouponCategoryServiceImpl implements TbCfCouponCategoryService
public int deleteBatch(String[] couponCategoryIds) { public int deleteBatch(String[] couponCategoryIds) {
return tbCfCouponCategoryDao.deleteBatch(couponCategoryIds); return tbCfCouponCategoryDao.deleteBatch(couponCategoryIds);
} }
@Override
public List<TbCfCouponCategoryEntity> queryByCouponCategoryId(String categoryId) {
return tbCfCouponCategoryDao.queryByCouponCategoryId(categoryId);
}
} }
...@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service; ...@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* 订单商品对应表Service实现类 * 订单商品对应表Service实现类
...@@ -85,4 +86,15 @@ public class TbCfItemOrderRServiceImpl implements TbCfItemOrderRService { ...@@ -85,4 +86,15 @@ public class TbCfItemOrderRServiceImpl implements TbCfItemOrderRService {
return tbCfItemOrderRDao.getItemNum(ordersId); return tbCfItemOrderRDao.getItemNum(ordersId);
} }
@Override
public int getOrderStatus(String ordersId) {
return tbCfItemOrderRDao.getOrderStatus(ordersId);
}
@Override
public Set<Integer> findOrderStatus(String orderId) {
return tbCfItemOrderRDao.findOrderStatus(orderId);
}
} }
...@@ -123,7 +123,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService { ...@@ -123,7 +123,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
TbCfOrderEntity tbCfOrderEntity=new TbCfOrderEntity(); TbCfOrderEntity tbCfOrderEntity=new TbCfOrderEntity();
tbCfOrderEntity.setOrderId(tbCfPlatformOrder.getOrderId()); tbCfOrderEntity.setOrderId(tbCfPlatformOrder.getOrderId());
tbCfOrderEntity.setOrderStatus(OrderStatusEnum.SHIPPED.getValue()); tbCfOrderEntity.setOrderStatus(OrderStatusEnum.SHIPPED.getValue());
tbCfOrderDao.updateOrderStatus(tbCfOrderEntity); tbCfOrderDao.update(tbCfOrderEntity);
} }
} }
...@@ -147,6 +147,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService { ...@@ -147,6 +147,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
return tbCfOrderDao.queryOrderDetail(ordersId); return tbCfOrderDao.queryOrderDetail(ordersId);
} }
@Override
public int updateStatus(TbCfOrderEntity tbCfOrderEntity) {
return tbCfOrderDao.updateStatus(tbCfOrderEntity);
}
} }
...@@ -4,6 +4,7 @@ import com.platform.dao.SysUserDao; ...@@ -4,6 +4,7 @@ import com.platform.dao.SysUserDao;
import com.platform.dao.TbCfPlatformOrderDao; import com.platform.dao.TbCfPlatformOrderDao;
import com.platform.entity.SysLogEntity; import com.platform.entity.SysLogEntity;
import com.platform.entity.SysUserEntity; import com.platform.entity.SysUserEntity;
import com.platform.entity.TbCfItemOrderREntity;
import com.platform.service.TbCfPlatformOrderService; import com.platform.service.TbCfPlatformOrderService;
import com.platform.utils.IdUtil; import com.platform.utils.IdUtil;
import com.platform.utils.ShiroUtils; import com.platform.utils.ShiroUtils;
...@@ -66,4 +67,15 @@ public class TbCfPlatformOrderServiceImpl implements TbCfPlatformOrderService { ...@@ -66,4 +67,15 @@ public class TbCfPlatformOrderServiceImpl implements TbCfPlatformOrderService {
public int deleteBatch(String[] relativeIds) { public int deleteBatch(String[] relativeIds) {
return tbCfPlatformOrderDao.deleteBatch(relativeIds); return tbCfPlatformOrderDao.deleteBatch(relativeIds);
} }
@Override
public int getOrderId(String sid) {
return tbCfPlatformOrderDao.getOrderId(sid);
}
@Override
public TbCfItemOrderREntity getOrdersId(String sid) {
return tbCfPlatformOrderDao.getOrdersId(sid);
}
} }
package com.platform.task; package com.platform.task;
import com.platform.dao.TbCfOrderDao;
import com.platform.entity.TbCfItemDetailEntity;
import com.platform.entity.TbCfItemOrderREntity;
import com.platform.entity.TbCfOrderEntity;
import com.platform.enums.OrderStatusEnum;
import com.platform.service.TbCfItemOrderRService; import com.platform.service.TbCfItemOrderRService;
import com.platform.service.TbCfOrderService; import com.platform.service.TbCfOrderService;
import com.platform.service.TbCfPlatformOrderService;
import com.platform.utils.util.HttpUtils; import com.platform.utils.util.HttpUtils;
import io.swagger.models.auth.In;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -12,10 +19,17 @@ import org.springframework.stereotype.Component; ...@@ -12,10 +19,17 @@ import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
/**
* 物流状态定时修改
*/
@Component("ExpressStatusTask") @Component("ExpressStatusTask")
public class ExpressStatusTask { public class ExpressStatusTask {
@Autowired @Autowired
private TbCfItemOrderRService tbCfItemOrderRService; private TbCfItemOrderRService tbCfItemOrderRService;
@Autowired
private TbCfPlatformOrderService tbCfPlatformOrderService;
@Autowired
private TbCfOrderService tbCfOrderService;
@Scheduled(cron = "0 15 0/2 * * ? ") @Scheduled(cron = "0 15 0/2 * * ? ")
public void expressStatusTaskForStorageC() { public void expressStatusTaskForStorageC() {
...@@ -105,6 +119,17 @@ public class ExpressStatusTask { ...@@ -105,6 +119,17 @@ public class ExpressStatusTask {
} }
if (sids.length != 0) { if (sids.length != 0) {
tbCfItemOrderRService.updateExpressStatusDelivery(sids); tbCfItemOrderRService.updateExpressStatusDelivery(sids);
for(int i=0;i<sids.length;i++){
TbCfItemOrderREntity tbCfItemOrderREntity=tbCfPlatformOrderService.getOrdersId(sids[i]);
Set<Integer> statusSet= tbCfItemOrderRService.findOrderStatus(tbCfItemOrderREntity.getOrderId());
if(statusSet.size()==1&&statusSet.contains("50")){
TbCfOrderEntity tbCfOrderEntity=new TbCfOrderEntity();
tbCfOrderEntity.setOrderId(tbCfItemOrderREntity.getOrderId());
tbCfOrderEntity.setOrderStatus(OrderStatusEnum.SUCCESS.getValue());
tbCfOrderEntity.setCloseTime(new Date());
tbCfOrderService.updateStatus(tbCfOrderEntity);
}
}
System.out.println("修改了:"+sids.length+"条数据"); System.out.println("修改了:"+sids.length+"条数据");
} }
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
......
...@@ -6,26 +6,26 @@ ...@@ -6,26 +6,26 @@
<resultMap type="com.platform.entity.TbCfCouponCategoryEntity" id="tbCfCouponCategoryMap"> <resultMap type="com.platform.entity.TbCfCouponCategoryEntity" id="tbCfCouponCategoryMap">
<result property="couponCategoryId" column="coupon_category_id"/> <result property="couponCategoryId" column="coupon_category_id"/>
<result property="couponCategoryName" column="coupon_category_name"/> <result property="couponCategoryName" column="coupon_category_name"/>
<result property="createTime" column="create_time"/>
<result property="enableFlag" column="enable_flag"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfCouponCategoryEntity"> <select id="queryObject" resultType="com.platform.entity.TbCfCouponCategoryEntity">
select select
`coupon_category_id`, `coupon_category_id`,
`coupon_category_name` `coupon_category_name`,
from tb_cf_coupon_category `create_time`,
where coupon_category_id = #{id} `enable_flag`
</select>
<select id="queryByCouponCategoryId" resultType="com.platform.entity.TbCfCouponCategoryEntity">
select
`coupon_category_id`,
`coupon_category_name`
from tb_cf_coupon_category from tb_cf_coupon_category
where coupon_category_id = #{id} where coupon_category_id = #{id}
</select> </select>
<select id="queryList" resultType="com.platform.entity.TbCfCouponCategoryEntity"> <select id="queryList" resultType="com.platform.entity.TbCfCouponCategoryEntity">
select select
`coupon_category_id`, `coupon_category_id`,
`coupon_category_name` `coupon_category_name`,
`create_time`,
`enable_flag`
from tb_cf_coupon_category from tb_cf_coupon_category
WHERE 1=1 WHERE 1=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
...@@ -55,16 +55,22 @@ ...@@ -55,16 +55,22 @@
<insert id="save" parameterType="com.platform.entity.TbCfCouponCategoryEntity"> <insert id="save" parameterType="com.platform.entity.TbCfCouponCategoryEntity">
insert into tb_cf_coupon_category( insert into tb_cf_coupon_category(
`coupon_category_id`, `coupon_category_id`,
`coupon_category_name`) `coupon_category_name`,
`create_time`,
`enable_flag`)
values( values(
#{couponCategoryId}, #{couponCategoryId},
#{couponCategoryName}) #{couponCategoryName},
#{createTime},
#{enableFlag})
</insert> </insert>
<update id="update" parameterType="com.platform.entity.TbCfCouponCategoryEntity"> <update id="update" parameterType="com.platform.entity.TbCfCouponCategoryEntity">
update tb_cf_coupon_category update tb_cf_coupon_category
<set> <set>
<if test="couponCategoryName != null">`coupon_category_name` = #{couponCategoryName}</if> <if test="couponCategoryName != null">`coupon_category_name` = #{couponCategoryName}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="enableFlag != null">`enable_flag` = #{enableFlag}</if>
</set> </set>
where coupon_category_id = #{couponCategoryId} where coupon_category_id = #{couponCategoryId}
</update> </update>
......
...@@ -57,7 +57,8 @@ ...@@ -57,7 +57,8 @@
<select id="queryList" resultType="com.platform.entity.TbCfCouponEntity"> <select id="queryList" resultType="com.platform.entity.TbCfCouponEntity">
select select
a.coupon_id, a.coupon_id,
a.coupon_category_id , b.coupon_category_id couponCategoryId,
b.coupon_category_name couponCategoryName,
a.coupon_use, a.coupon_use,
a.coupon_title, a.coupon_title,
a.coupon_icon, a.coupon_icon,
...@@ -77,8 +78,8 @@ ...@@ -77,8 +78,8 @@
a.update_user_id, a.update_user_id,
a.update_time, a.update_time,
a.coupon_vaild a.coupon_vaild
from tb_cf_coupon a from tb_cf_coupon a left join tb_cf_coupon_category b on a.coupon_category_id=b.coupon_category_id
WHERE 1=1 WHERE 1=1 and b.enable_flag=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%') AND name LIKE concat('%',#{name},'%')
</if> </if>
...@@ -98,7 +99,7 @@ ...@@ -98,7 +99,7 @@
<select id="queryLists" resultType="com.platform.entity.TbCfCouponEntity"> <select id="queryLists" resultType="com.platform.entity.TbCfCouponEntity">
select select
a.coupon_id, a.coupon_id,
a.coupon_category_id , t.coupon_category_id ,
a.coupon_use, a.coupon_use,
a.coupon_title, a.coupon_title,
a.coupon_icon, a.coupon_icon,
...@@ -118,7 +119,7 @@ ...@@ -118,7 +119,7 @@
a.update_user_id, a.update_user_id,
a.update_time, a.update_time,
a.coupon_vaild a.coupon_vaild
from tb_cf_coupon a from tb_cf_coupon a left join tb_cf_coupon_category t on t.coupon_category_id=a.coupon_category_id
WHERE 1=1 and a.coupon_vaild=0 WHERE 1=1 and a.coupon_vaild=0
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%') AND name LIKE concat('%',#{name},'%')
...@@ -247,7 +248,7 @@ ...@@ -247,7 +248,7 @@
<select id="getCouponIssueList" resultType="com.platform.vo.CouponIssueVo"> <select id="getCouponIssueList" resultType="com.platform.vo.CouponIssueVo">
select select
t2.coupon_id, t2.coupon_id,
t2.create_time, t2.start_time createTime,
t2.enable_flag, t2.enable_flag,
t1.coupon_category_id, t1.coupon_category_id,
t1.coupon_title, t1.coupon_title,
...@@ -258,6 +259,6 @@ ...@@ -258,6 +259,6 @@
left join tb_cf_toicoupon t2 on t1.coupon_id=t2.coupon_id left join tb_cf_toicoupon t2 on t1.coupon_id=t2.coupon_id
left join tb_cf_user_info t3 on t2.user_id=t3.user_id left join tb_cf_user_info t3 on t2.user_id=t3.user_id
where where
t2.coupon_id=#{couponId} t2.coupon_id=#{couponId} and t3.nick is not null and t3.account is not null
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -139,6 +139,13 @@ ...@@ -139,6 +139,13 @@
select * from tb_cf_item_order_r where order_id=#{orderId} and item_id=#{itemId} select * from tb_cf_item_order_r where order_id=#{orderId} and item_id=#{itemId}
</select> </select>
<select id="getOrderStatus">
select order_status from tb_cf_item_order_r where order_item_id=#{ordersId}
</select>
<select id="findOrderStatus" >
select order_status from tb_cf_item_order_r where order_id=#{orderId}
</select>
<!--根据快递单号id,修改物流状态为已入中国仓库 --> <!--根据快递单号id,修改物流状态为已入中国仓库 -->
<update id="updateExpressStatus"> <update id="updateExpressStatus">
...@@ -163,7 +170,7 @@ ...@@ -163,7 +170,7 @@
<!--根据快递单号id,修改物流状态为已签收 --> <!--根据快递单号id,修改物流状态为已签收 -->
<update id="updateExpressStatusDelivery"> <update id="updateExpressStatusDelivery">
UPDATE tb_cf_order o,tb_cf_platform_order p,tb_cf_item_order_r i UPDATE tb_cf_order o,tb_cf_platform_order p,tb_cf_item_order_r i
SET i.delivery_flag = 50,o.order_status=50 SET i.delivery_flag = 50,i.order_status=50
WHERE o.order_id=p.order_id and i.order_id=o.order_id and i.delivery_flag=40 and p.p_express_number in WHERE o.order_id=p.order_id and i.order_id=o.order_id and i.delivery_flag=40 and p.p_express_number in
<foreach collection="array" item="sids" open="(" separator="," close=")"> <foreach collection="array" item="sids" open="(" separator="," close=")">
#{sids} #{sids}
......
...@@ -291,6 +291,15 @@ ...@@ -291,6 +291,15 @@
</foreach> </foreach>
</delete> </delete>
<update id="updateStatus">
update tb_cf_order
<set>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="closeTime != null">o.close_time = #{closeTime} </if>
</set>
where order_id = #{orderId}
</update>
<!--根据订单id,获取订单内商品详情--> <!--根据订单id,获取订单内商品详情-->
<select id="getOrderItemList" resultType="com.platform.entity.TbCfItemDetailEntity"> <select id="getOrderItemList" resultType="com.platform.entity.TbCfItemDetailEntity">
select t2.* from tb_cf_item_order_r t1,tb_cf_item_detail t2 where t1.order_item_id =#{ordersId} select t2.* from tb_cf_item_order_r t1,tb_cf_item_detail t2 where t1.order_item_id =#{ordersId}
......
...@@ -180,4 +180,12 @@ ...@@ -180,4 +180,12 @@
where i.order_item_id =#{ordersId} and p.relative_id=#{ordersId}; where i.order_item_id =#{ordersId} and p.relative_id=#{ordersId};
</select> </select>
<select id="getOrdersId" resultType="com.platform.entity.TbCfItemOrderREntity">
select relative_id from tb_cf_platform_order where p_express_number=#{sid}
</select>
<select id="getOrderId" resultType="com.platform.vo.PlatformOrderVo">
select order_id from tb_cf_platform_order where p_express_number=#{sid}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
<result property="couponId" column="coupon_id"/> <result property="couponId" column="coupon_id"/>
<result property="userId" column="user_id"/> <result property="userId" column="user_id"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="identification" column="identification"/> <result property="identification" column="identification"/>
<result property="enableFlag" column="enable_flag"/> <result property="enableFlag" column="enable_flag"/>
</resultMap> </resultMap>
...@@ -26,14 +28,18 @@ ...@@ -26,14 +28,18 @@
<select id="queryList" resultType="com.platform.entity.TbCfToiCouponEntity"> <select id="queryList" resultType="com.platform.entity.TbCfToiCouponEntity">
select select
`toitable_id`, t.toitable_id,
`coupon_id`, c.coupon_title couponTitle,
`user_id`, CONCAT_WS("_",u.nick,u.user_no) userInfo,
`create_time`, t.start_time,
`identification`, t.end_time,
`enable_flag` t.identification,
from tb_cf_toicoupon t.enable_flag
WHERE 1=1 from tb_cf_toicoupon t
left join tb_cf_user_info u on t.user_id=u.user_id
left join tb_cf_coupon c on c.coupon_id=t.coupon_id
left join tb_cf_coupon_category y on y.coupon_category_id=c.coupon_category_id
WHERE 1=1 and u.nick is not null and u.account is not null
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%') AND name LIKE concat('%',#{name},'%')
</if> </if>
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
#jdbc.username=root #jdbc.username=root
#jdbc.password=root #jdbc.password=root
#jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8 jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
#jdbc.username=root jdbc.username=root
#jdbc.password=diaoyun666 jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false #jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root #jdbc.username: root
jdbc.password: Diaoyunnuli.8 #jdbc.password: Diaoyunnuli.8
jdbc.initialSize=5 jdbc.initialSize=5
jdbc.maxActive=30 jdbc.maxActive=30
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
#jdbc.username=root #jdbc.username=root
#jdbc.password=root #jdbc.password=root
#jdbc.url=jdbc:mysql://47.106.242.175:3306/platform?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8 jdbc.url=jdbc:mysql://47.106.242.175:3306/platform?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
#jdbc.username=root jdbc.username=root
#jdbc.password=diaoyun666 jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false #jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root #jdbc.username: root
jdbc.password: Diaoyunnuli.8 #jdbc.password: Diaoyunnuli.8
jdbc.initialSize=5 jdbc.initialSize=5
jdbc.maxActive=30 jdbc.maxActive=30
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
<Form-item label="优惠券类型" prop="couponCategoryId"> <Form-item label="优惠券类型" prop="couponCategoryId">
<i-select placeholder="优惠券类型" v-model="tbCfCoupon.couponCategoryId"> <i-select placeholder="优惠券类型" v-model="tbCfCoupon.couponCategoryId">
<i-option <i-option
v-for="(el,i) in cateGoryOptions" :key = 'i' v-for="(el,i) in CouponCategory" :key = 'i'
:value="el.value">{{el.label}}</i-option> :value="el.couponCategoryId">{{el.couponCategoryName}}</i-option>
</i-select> </i-select>
</Form-item> </Form-item>
<Form-item label="设置是否为注册就送该优惠券" prop="couponVaild"> <Form-item label="设置是否为注册就送该优惠券" prop="couponVaild">
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<i-form ref="formValidate1" :model="tbCfCoupon" :rules="ruleValidate" :label-width="80"> <i-form ref="formValidate1" :model="tbCfCoupon" :rules="ruleValidate" :label-width="80">
<Form-item label="优惠券名称:" prop="couponId" > <Form-item label="优惠券名称:" prop="couponId" >
<!--<i-input v-model="tbCfCoupon.couponCategory" placeholder="优惠券类型"/>--> <!--<i-input v-model="tbCfCoupon.couponCategory" placeholder="优惠券类型"/>-->
<i-select placeholder="请选择优惠券" v-model="tbCfCoupon.couponId" > <i-select placeholder="请选择优惠券" v-model="tbCfCoupon.Coupon" >
<i-option <i-option
v-for="(el,i) in Coupon" :key = 'i' v-for="(el,i) in Coupon" :key = 'i'
:value="el.couponId">{{el.couponTitle}} :value="el.couponId">{{el.couponTitle}}
...@@ -199,22 +199,8 @@ ...@@ -199,22 +199,8 @@
</Form-item> </Form-item>
</i-form> </i-form>
</Card> </Card>
<!--优惠券类型添加界面-->
<Card v-show="!showCategory" style="width:100vw;height: 100vh;position: absolute;top: 0;left: 0;">
<p slot="title">{{title}}</p>
<i-form ref="formValidate2" :model="tbCfCoupon" :rules="ruleValidate" :label-width="80">
<Form-item label="优惠券类型名称" prop="couponCategoryName">
<i-input v-model="tbCfCoupon.couponCategoryName" placeholder="优惠券类型名称"/>
</Form-item>
<Form-item>
<i-button type="primary" @click="handleSubmit2('formValidate2')">提交</i-button>
<i-button type="warning" @click="showCategory=!showCategory" style="margin-left: 8px"/>返回</i-button>
<i-button type="ghost" @click="handleReset2('formValidate2')" style="margin-left: 8px">重置</i-button>
</Form-item>
</i-form>
</Card>
<!-- 领取详情 --> <!-- 领取详情 -->
<el-dialog :title="takeTitle" :visible.sync="takeVisible" width="80%"> <!-- <el-dialog :title="takeTitle" :visible.sync="takeVisible" width="80%">
<el-table :data="takeData"> <el-table :data="takeData">
<el-table-column property="couponTitle" label="标题" width="200"></el-table-column> <el-table-column property="couponTitle" label="标题" width="200"></el-table-column>
<el-table-column property="nick" label="用户昵称"></el-table-column> <el-table-column property="nick" label="用户昵称"></el-table-column>
...@@ -222,14 +208,14 @@ ...@@ -222,14 +208,14 @@
<el-table-column property="createTime" label="领取时间"></el-table-column> <el-table-column property="createTime" label="领取时间"></el-table-column>
<el-table-column property="enableFlag" label="是否已经使用"></el-table-column> <el-table-column property="enableFlag" label="是否已经使用"></el-table-column>
</el-table> </el-table>
</el-dialog> </el-dialog>-->
<!-- 发放详情 --> <!-- 发放详情 -->
<el-dialog :title="toiTitle" :visible.sync="toiVisible" width="80%"> <el-dialog :title="toiTitle" :visible.sync="toiVisible" width="80%">
<el-table :data="toiData"> <el-table :data="toiData">
<el-table-column property="couponTitle" label="标题" width="200"></el-table-column> <el-table-column property="couponTitle" label="标题" width="200"></el-table-column>
<el-table-column property="nick" label="用户昵称"></el-table-column> <el-table-column property="nick" label="用户昵称"></el-table-column>
<el-table-column property="account" label="用户账号"></el-table-column> <el-table-column property="account" label="用户账号"></el-table-column>
<el-table-column property="createTime" label="领取时间"></el-table-column> <el-table-column property="createTime" label="有效开始时间"></el-table-column>
<el-table-column property="enableFlag" label="是否已经使用(0已使用,1未使用)"></el-table-column> <el-table-column property="enableFlag" label="是否已经使用(0已使用,1未使用)"></el-table-column>
<el-table-column property="identification" label="1发放,2领取,3注册)"></el-table-column> <el-table-column property="identification" label="1发放,2领取,3注册)"></el-table-column>
</el-table> </el-table>
......
...@@ -3,11 +3,6 @@ ...@@ -3,11 +3,6 @@
<head> <head>
<title></title> <title></title>
#parse("sys/header.html") #parse("sys/header.html")
<style>
.ui-jqgrid .ui-jqgrid-bdiv{
height:auto!important;
}
</style>
</head> </head>
<body> <body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);"> <div id="rrapp" v-cloak style="height: calc(100% - 15px);">
...@@ -41,6 +36,15 @@ ...@@ -41,6 +36,15 @@
<Form-item label="优惠券类型名称 " prop="couponCategoryName"> <Form-item label="优惠券类型名称 " prop="couponCategoryName">
<i-input v-model="tbCfCouponCategory.couponCategoryName" placeholder="优惠券类型名称 "/> <i-input v-model="tbCfCouponCategory.couponCategoryName" placeholder="优惠券类型名称 "/>
</Form-item> </Form-item>
<Form-item label="创建时间" prop="createTime">
<i-input v-model="tbCfCouponCategory.createTime" placeholder="创建时间" disabled="true"/>
</Form-item>
<Form-item label="是否有效(0无效,1有效)" prop="enableFlag">
<i-select placeholder="是否有效(0无效,1有效)" v-model="tbCfCouponCategory.enableFlag">
<i-option value="0"></i-option>
<i-option value="1"></i-option>
</i-select>
</Form-item>
<Form-item> <Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button> <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button> <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
......
<!DOCTYPE html>
<html>
<head>
<title></title>
#parse("sys/header.html")
<style>
.ui-jqgrid .ui-jqgrid-bdiv{
height:auto!important;
}
</style>
</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("tbcftoicoupon:save"))
<i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
#end
#if($shiro.hasPermission("tbcftoicoupon:update"))
<i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
#end
#if($shiro.hasPermission("tbcftoicoupon: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="tbCfToicoupon" :rules="ruleValidate" :label-width="80">
<Form-item label="优惠券id" prop="couponId">
<i-input v-model="tbCfToicoupon.couponId" placeholder="优惠券id"/>
</Form-item>
<Form-item label="用户id" prop="userId">
<i-input v-model="tbCfToicoupon.userId" placeholder="用户id"/>
</Form-item>
<Form-item label="开始时间" prop="startTime">
<i-input v-model="tbCfToicoupon.startTime" placeholder="开始时间"/>
</Form-item>
<Form-item label="结束时间" prop="endTime">
<i-input v-model="tbCfToicoupon.endTime" placeholder="结束时间"/>
</Form-item>
<Form-item label="标识(1发放,2领取,3注册)" prop="identification">
<i-input v-model="tbCfToicoupon.identification" placeholder="标识(1发放,2领取,3注册)"/>
</Form-item>
<Form-item label="是否已使用(0已使用,1未使用)" prop="enableFlag">
<i-input v-model="tbCfToicoupon.enableFlag" placeholder="是否已使用(0已使用,1未使用)"/>
</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/tbcftoicoupon.js?_${date.systemTime}"></script>
</body>
</html>
\ No newline at end of file
...@@ -573,6 +573,34 @@ validFormat = function (cellvalue) { ...@@ -573,6 +573,34 @@ validFormat = function (cellvalue) {
} }
return returnStr; return returnStr;
}; };
/**
* 是否为注册就送优惠券
* @param cellvalue
* @returns {string}
*/
enableFormat = function (cellvalue) {
let returnStr = "未知"
if (!!cellvalue||cellvalue == '0') {
if (cellvalue == '1') {
returnStr = "发放";
} else if (cellvalue == '2') {
returnStr = "领取";
} else if (cellvalue == '3') {
returnStr = "注册";
}
}
return returnStr;
};
/**
* 是否为注册就送优惠券
* @param cellvalue
* @returns {string}
*/
useFormat = function (cellvalue) {
return cellvalue == 0 ? '已使用' : '未使用';
};
/** /**
* 订单状态翻译 (0取消,10未付款,20已付款,40已发货,50交易成功,60交易关闭) * 订单状态翻译 (0取消,10未付款,20已付款,40已发货,50交易成功,60交易关闭)
* @param cellvalue * @param cellvalue
......
...@@ -3,7 +3,8 @@ $(function () { ...@@ -3,7 +3,8 @@ $(function () {
url: '../tbcfcoupon/list', url: '../tbcfcoupon/list',
colModel: [ colModel: [
{label: 'couponId', name: 'couponId', index: 'coupon_id', key: true, hidden: true}, {label: 'couponId', name: 'couponId', index: 'coupon_id', key: true, hidden: true},
{label: '优惠券类型 ', name: 'couponCategoryId', index: 'coupon_category_d', width: 60,formatter: "select", editoptions:{value:"10:购物返券;20:注册返券;30:邀请返券;40:用户领券"}}, {label: '优惠券类型 ', name: 'couponCategoryId', index: 'couponCategoryId', width: 60, hidden: true},
{label: '优惠券类型 ', name: 'couponCategoryName', index: 'couponCategoryName', width: 60},
{label: '可用于类目', name: 'couponUse', index: 'coupon_use', width: 80, hidden: true}, {label: '可用于类目', name: 'couponUse', index: 'coupon_use', width: 80, hidden: true},
{label: '优惠券标题', name: 'couponTitle', index: 'coupon_title', width: 80}, {label: '优惠券标题', name: 'couponTitle', index: 'coupon_title', width: 80},
{label: '优惠券图片地址', name: 'couponIcon', index: 'coupon_icon', width: 70, hidden: true}, {label: '优惠券图片地址', name: 'couponIcon', index: 'coupon_icon', width: 70, hidden: true},
...@@ -44,6 +45,7 @@ $(function () { ...@@ -44,6 +45,7 @@ $(function () {
{label: '用户等级', name: 'userLevel', index: 'user_level', width: 80,formatter:userLevelFormat}] {label: '用户等级', name: 'userLevel', index: 'user_level', width: 80,formatter:userLevelFormat}]
}); });
}); });
/*
$(function () { $(function () {
$("#jqGrid2").Grid({ $("#jqGrid2").Grid({
url: '../tbCfCouponCategory/list', url: '../tbCfCouponCategory/list',
...@@ -52,6 +54,7 @@ $(function () { ...@@ -52,6 +54,7 @@ $(function () {
{label: '优惠券类型名称 ', name: 'couponCategoryName', index: 'coupon_category_name', width: 80}] {label: '优惠券类型名称 ', name: 'couponCategoryName', index: 'coupon_category_name', width: 80}]
}); });
}); });
*/
let vm = new Vue({ let vm = new Vue({
...@@ -65,19 +68,6 @@ let vm = new Vue({ ...@@ -65,19 +68,6 @@ let vm = new Vue({
//领取优惠券情况 //领取优惠券情况
takeData:[], takeData:[],
toiData:[], toiData:[],
cateGoryOptions:[{
value:'10',
label:'购物返券'
},{
value:'20',
label:'注册返券'
},{
value:'30',
label:'邀请返券'
},{
value:'40',
label:'用户领券'
}],
userStatusOptions:[{ userStatusOptions:[{
value:'10', value:'10',
label:'未下单的用户' label:'未下单的用户'
...@@ -309,9 +299,9 @@ let vm = new Vue({ ...@@ -309,9 +299,9 @@ let vm = new Vue({
vm.tbCfCouponCategory={}; vm.tbCfCouponCategory={};
}, },
edit: function(){ edit: function(){
vm.reload();
this.showEdit=false this.showEdit=false
vm.title = "设置优惠券发放"; vm.title = "设置优惠券发放";
vm.reload();
vm.tbCfCoupon = {}; vm.tbCfCoupon = {};
}, },
......
...@@ -2,8 +2,10 @@ $(function () { ...@@ -2,8 +2,10 @@ $(function () {
$("#jqGrid").Grid({ $("#jqGrid").Grid({
url: '../tbcfcouponcategory/list', url: '../tbcfcouponcategory/list',
colModel: [ colModel: [
{label: 'couponCategoryId', name: 'couponCategoryId', index: 'coupon_category_id', key: true, hidden: true}, {label: '优惠券类型ID', name: 'couponCategoryId', index: 'coupon_category_id', key: true},
{label: '优惠券类型名称 ', name: 'couponCategoryName', index: 'coupon_category_name', width: 80}] {label: '优惠券类型名称 ', name: 'couponCategoryName', index: 'coupon_category_name', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80},
{label: '是否有效(0无效,1有效)', name: 'enableFlag', index: 'enable_flag', width: 80,formatter:validFormat}]
}); });
}); });
...@@ -23,9 +25,6 @@ let vm = new Vue({ ...@@ -23,9 +25,6 @@ let vm = new Vue({
} }
}, },
methods: { methods: {
handleSubmit2(){
console.log(111)
},
query: function () { query: function () {
vm.reload(); vm.reload();
}, },
......
$(function () {
$("#jqGrid").Grid({
url: '../tbcftoicoupon/list',
colModel: [
{label: 'toitableId', name: 'toitableId', index: 'toitable_id', key: true, hidden: true},
{label: '优惠券名称', name: 'couponTitle', index: 'couponTitle', width: 80},
{label: '用户', name: 'userInfo', index: 'userInfo', width: 120},
{label: '有效开始时间', name: 'startTime', index: 'start_time', width: 80},
{label: '有效结束时间', name: 'endTime', index: 'end_time', width: 80},
{label: '标识(1发放,2领取,3注册)', name: 'identification', index: 'identification', width: 80,formatter:enableFormat},
{label: '是否已使用(0已使用,1未使用)', name: 'enableFlag', index: 'enable_flag', width: 80,formatter:useFormat}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfToicoupon: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfToicoupon = {};
},
update: function (event) {
let toitableId = getSelectedRow("#jqGrid");
if (toitableId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(toitableId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfToicoupon.toitableId == null ? "../tbcftoicoupon/save" : "../tbcftoicoupon/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfToicoupon),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let toitableIds = getSelectedRows("#jqGrid");
if (toitableIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcftoicoupon/delete",
params: JSON.stringify(toitableIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(toitableId){
Ajax.request({
url: "../tbcftoicoupon/info/"+toitableId,
async: true,
successCallback: function (r) {
vm.tbCfToicoupon = r.tbCfToicoupon;
}
});
},
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
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论