| | |
| | | import com.dsh.activity.feignclient.course.model.CoursePackagePaymentConfig; |
| | | import com.dsh.activity.feignclient.model.*; |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.model.Store; |
| | | import com.dsh.activity.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.activity.model.PointMerchandiseVo; |
| | | import com.dsh.activity.model.request.*; |
| | | import com.dsh.activity.model.response.GoodsInfoOneVo; |
| | | import com.dsh.activity.model.response.StoreVos; |
| | | import com.dsh.activity.service.*; |
| | | import com.dsh.activity.util.GDMapGeocodingUtil; |
| | | import com.dsh.activity.util.StrUtils; |
| | |
| | | |
| | | @Resource |
| | | private CouponCityService ccityService; |
| | | |
| | | |
| | | @Resource |
| | | private PointsMerchandiseCityService pmdsCityService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return mapList; |
| | | } |
| | | |
| | | @PostMapping("/base/pointMerchars/queryPointMerchaseById") |
| | | public PointsMerchandise queryPointMerchaseById(@RequestBody Integer id){ |
| | | return pmdsService.getById(id); |
| | | } |
| | | |
| | | @PostMapping("/base/pointMerchars/getshopName") |
| | | public Integer getshopName(@RequestBody Integer id){ |
| | | List<PointsMerchandiseStore> list = pmdstoService.list(new LambdaQueryWrapper<PointsMerchandiseStore>().eq(PointsMerchandiseStore::getPointsMerchandiseId, id)); |
| | | PointsMerchandiseStore pointsMerchandiseStore = list.get(0); |
| | | Integer storeId = pointsMerchandiseStore.getStoreId(); |
| | | return storeId; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/queryDetailsOfGoods") |
| | | public GoodsInfoOneVo queryDetailsOfGoods(@RequestBody Integer id){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | GoodsInfoOneVo infoOneVo = new GoodsInfoOneVo(); |
| | | PointsMerchandise byId = pmdsService.getById(id); |
| | | |
| | | if (ToolUtil.isNotEmpty(byId)){ |
| | | infoOneVo.setName(byId.getName()); |
| | | infoOneVo.setCover(byId.getCover()); |
| | | infoOneVo.setPics(byId.getProductImages()); |
| | | infoOneVo.setPrice(byId.getPrice()); |
| | | infoOneVo.setExchangeMethod(byId.getRedemptionMethod()); |
| | | switch (byId.getRedemptionMethod()){ |
| | | case 1: |
| | | infoOneVo.setIntegral(byId.getIntegral()); |
| | | break; |
| | | case 2: |
| | | infoOneVo.setIntegral(byId.getIntegral()); |
| | | infoOneVo.setCash(byId.getCash()); |
| | | break; |
| | | case 3: |
| | | infoOneVo.setCash(byId.getCash()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | switch (byId.getUserPopulation()){ |
| | | case 1: |
| | | infoOneVo.setUserPopulation("全部用户"); |
| | | break; |
| | | case 2: |
| | | infoOneVo.setUserPopulation("年度会员"); |
| | | break; |
| | | case 3: |
| | | infoOneVo.setUserPopulation("已有学员用户"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | infoOneVo.setQuantityIssued(byId.getQuantityIssued()); |
| | | List<UserPointsMerchandise> list = upmseService.list(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId,byId.getId())); |
| | | infoOneVo.setUseScope(byId.getUseScope()); |
| | | switch (byId.getUseScope()){ |
| | | case 1: |
| | | infoOneVo.setExchangeArea("全国通用"); |
| | | break; |
| | | case 2: |
| | | infoOneVo.setExchangeArea("指定城市"); |
| | | break; |
| | | case 3: |
| | | infoOneVo.setExchangeArea("指定门店"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | infoOneVo.setHasPicked(list.size()); |
| | | infoOneVo.setPickUpQuantity(byId.getPickUpQuantity()); |
| | | infoOneVo.setValidTime(simpleDateFormat.format(byId.getStartTime())+"至"+ simpleDateFormat.format(byId.getEndTime())); |
| | | infoOneVo.setRedemptionInstructions(byId.getRedemptionInstructions()); |
| | | infoOneVo.setSort(byId.getSort()); |
| | | } |
| | | return infoOneVo; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getProvinces") |
| | | public List<StoreVos> getProvinces(@RequestBody Integer id){ |
| | | List<StoreVos> storeVos = new ArrayList<>(); |
| | | List<PointsMerchandiseCity> list = pmdsCityService.list(new LambdaQueryWrapper<PointsMerchandiseCity>() |
| | | .eq(PointsMerchandiseCity::getPointsMerchandiseId,id)); |
| | | if (list.size() > 0 ){ |
| | | for (PointsMerchandiseCity pointsMerchandiseCity : list) { |
| | | StoreVos storeVos1 = new StoreVos(); |
| | | storeVos1.setNum1(pointsMerchandiseCity.getProvince()); |
| | | storeVos1.setNum2(pointsMerchandiseCity.getCity()); |
| | | storeVos.add(storeVos1); |
| | | } |
| | | } |
| | | return storeVos; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getStoreList") |
| | | public List<StoreVos> getStoreList(@RequestBody Integer id){ |
| | | List<StoreVos> storeVos = new ArrayList<>(); |
| | | List<PointsMerchandiseStore> list = pmdstoService.list(new QueryWrapper<PointsMerchandiseStore>() |
| | | .eq("pointsMerchandiseId",id)); |
| | | if (list.size() > 0 ){ |
| | | List<Integer> collect = list.stream().map(PointsMerchandiseStore::getStoreId).collect(Collectors.toList()); |
| | | List<Store> stores = stoClient.queryStoreByIds(collect); |
| | | if (stores.size() > 0 ){ |
| | | for (Store store : stores) { |
| | | StoreVos storeVos1 = new StoreVos(); |
| | | storeVos1.setNum1(store.getProvince() +"省"+ store.getCity() +"市"); |
| | | storeVos1.setNum2(store.getName()); |
| | | storeVos.add(storeVos1); |
| | | } |
| | | } |
| | | } |
| | | return storeVos; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/updateGoodsDetail") |
| | | public boolean updateGoodsDetail(@RequestBody Map<String, Object> map){ |
| | | try { |
| | | Integer pointMerchandiseId = (Integer) map.get("pointMerchandiseId"); |
| | | PointsMerchandise byId1 = pmdsService.getById(pointMerchandiseId); |
| | | |
| | | Integer quantityIssued = (Integer) map.get("quantityIssued"); |
| | | Integer pickUpQuantity = (Integer) map.get("pickUpQuantity"); |
| | | String redemptionInstructions = (String) map.get("redemptionInstructions"); |
| | | String cover = (String) map.get("cover"); |
| | | String productImages = (String) map.get("productImages"); |
| | | Integer sort = (Integer) map.get("sort"); |
| | | |
| | | byId1.setQuantityIssued(quantityIssued); |
| | | byId1.setPickUpQuantity(pickUpQuantity); |
| | | byId1.setRedemptionInstructions(redemptionInstructions); |
| | | if (ToolUtil.isNotEmpty(cover)){ |
| | | byId1.setCover(cover); |
| | | } |
| | | if (ToolUtil.isNotEmpty(productImages)){ |
| | | byId1.setProductImages(productImages); |
| | | } |
| | | byId1.setSort(sort); |
| | | pmdsService.updateById(byId1); |
| | | return true; |
| | | }catch (Exception e){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/add") |
| | | public Integer add(@RequestBody PointsMerchandise pointsMerchandise){ |
| | | Integer storeId = pointsMerchandise.getShelves(); |
| | | pointsMerchandise.setShelves(2); |
| | | boolean save = pmdsService.save(pointsMerchandise); |
| | | if(save && ToolUtil.isNotEmpty(storeId) && pointsMerchandise.getType()==2){ |
| | | PointsMerchandiseStore pointsMerchandiseStore = new PointsMerchandiseStore(); |
| | | pointsMerchandiseStore.setPointsMerchandiseId(pointsMerchandise.getId()); |
| | | pointsMerchandiseStore.setStoreId(storeId); |
| | | save = pmdstoService.save(pointsMerchandiseStore); |
| | | } |
| | | if(save && pointsMerchandise.getType()==2 && ToolUtil.isNotEmpty(pointsMerchandise.getProvinceCode())){ |
| | | pmdsService.saveCity(pointsMerchandise.getId(),pointsMerchandise.getProvince(),pointsMerchandise.getProvinceCode(),pointsMerchandise.getCity(),pointsMerchandise.getCityCode()); |
| | | } |
| | | if(save){ |
| | | return pointsMerchandise.getId(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/addOther") |
| | | public Boolean addOther(@RequestBody String pam){ |
| | | Boolean save =false; |
| | | String[] split = pam.split("_"); |
| | | for (String s : split[1].split(",")) { |
| | | PointsMerchandiseStore pointsMerchandiseStore = new PointsMerchandiseStore(); |
| | | pointsMerchandiseStore.setPointsMerchandiseId(Integer.valueOf(split[0])); |
| | | pointsMerchandiseStore.setStoreId(Integer.valueOf(s)); |
| | | save = pmdstoService.save(pointsMerchandiseStore); |
| | | } |
| | | return save; |
| | | } |
| | | |
| | | @PostMapping("/base/pointMerchars/addCitys") |
| | | public Boolean addCitys(@RequestBody ArrayList<Map<String, String>> objects){ |
| | | try { |
| | | for (Map<String, String> object : objects) { |
| | | pmdsService.saveCity(Integer.valueOf(object.get("id")),object.get("pName"),object.get("pCode"),object.get("cName"),object.get("cCode")); |
| | | } |
| | | return true; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/writeOffGoodsStatus") |
| | | public boolean writeOffGoodsStatus(@RequestBody Map<String, Object> map){ |
| | | try { |
| | | String o = (String) map.get("goodsId"); |
| | | Integer managerId = (Integer) map.get("managerId"); |
| | | UserPointsMerchandise byId = upmseService.getOne(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getId,Long.parseLong(o) )); |
| | | if (byId.getStatus() == 2){ |
| | | return false; |
| | | } |
| | | byId.setStatus(2); |
| | | byId.setVerificationUserId(managerId); |
| | | byId.setVerificationTime(new Date()); |
| | | upmseService.update(byId,new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getUserId,byId.getUserId()) |
| | | .eq(UserPointsMerchandise::getId,byId.getId())); |
| | | System.out.println(byId); |
| | | return true; |
| | | }catch (Exception e){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | |
| | | * 开始时间 |
| | | */ |
| | | @TableField("startTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @TableField("endTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | /** |
| | | * 使用范围(1=全国,2=指定城市,3=指定门店) |
| | |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | /** |
| | | * 课包支付配置id |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 积分商品使用门店关系数据 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-12 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_points_merchandise_city") |
| | | public class PointsMerchandiseCity extends Model<PointsMerchandiseCity> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 积分商品id |
| | | */ |
| | | @TableField("pointsMerchandiseId") |
| | | private Integer pointsMerchandiseId; |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.PointsMerchandiseCity; |
| | | |
| | | /** |
| | | * <p> |
| | | * 积分商品使用门店关系数据 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-12 |
| | | */ |
| | | public interface PointsMerchandiseCityMapper extends BaseMapper<PointsMerchandiseCity> { |
| | | |
| | | } |
| | |
| | | @Param("state") Integer state, |
| | | @Param("page") Page<Map<String, Object>> page); |
| | | |
| | | |
| | | void saveCity(@Param("id") Integer id, @Param("province") String province, @Param("provinceCode") String provinceCode, @Param("city") String city, @Param("cityCode") String cityCode); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.model.response; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class GoodsInfoOneVo { |
| | | |
| | | |
| | | String name; |
| | | /** |
| | | * 封面图 |
| | | */ |
| | | String cover; |
| | | /** |
| | | * 原价 |
| | | */ |
| | | BigDecimal price; |
| | | /** |
| | | * 兑换方式(1=积分,2=现金+积分, 3=现金) |
| | | */ |
| | | Integer exchangeMethod; |
| | | /** |
| | | * 现金 |
| | | */ |
| | | BigDecimal cash; |
| | | /** |
| | | * 积分 |
| | | */ |
| | | Integer integral; |
| | | /** |
| | | * 图片 |
| | | */ |
| | | String pics; |
| | | /** |
| | | * 用户人群 |
| | | */ |
| | | String userPopulation; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | Integer quantityIssued; |
| | | /** |
| | | * 已领数量 |
| | | */ |
| | | Integer hasPicked; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | Integer pickUpQuantity; |
| | | /** |
| | | * 有效期 |
| | | */ |
| | | String validTime; |
| | | /** |
| | | * 兑换地点 |
| | | */ |
| | | String exchangeArea; |
| | | /** |
| | | * 兑换地点 (1=全国,2=指定城市,3=指定门店) |
| | | */ |
| | | Integer useScope; |
| | | /** |
| | | * 商品说明 |
| | | */ |
| | | String redemptionInstructions; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | Integer sort; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.model.response; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class StoreVos { |
| | | |
| | | String num1; |
| | | |
| | | String num2; |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.PointsMerchandiseCity; |
| | | |
| | | /** |
| | | * <p> |
| | | * 积分商品使用门店关系数据 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-12 |
| | | */ |
| | | public interface PointsMerchandiseCityService extends IService<PointsMerchandiseCity> { |
| | | |
| | | } |
| | |
| | | |
| | | List<Map<String, Object>> queryGoodsListOfSearch(IntegralGoodsOfSearch ofSearch); |
| | | |
| | | void saveCity(Integer id, String province, String provinceCode, String city, String cityCode); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.PointsMerchandiseCity; |
| | | import com.dsh.activity.mapper.PointsMerchandiseCityMapper; |
| | | import com.dsh.activity.service.PointsMerchandiseCityService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 积分商品使用门店关系数据 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-12 |
| | | */ |
| | | @Service |
| | | public class PointsMerchandiseCityServiceImpl extends ServiceImpl<PointsMerchandiseCityMapper, PointsMerchandiseCity> implements PointsMerchandiseCityService { |
| | | |
| | | } |
| | |
| | | return this.baseMapper.queryGoodsListOfSearch(ofSearch.getName(),ofSearch.getType(),ofSearch.getRedemptionMethod(), |
| | | ofSearch.getUserPopulation(),ofSearch.getActiveStatus(),ofSearch.getState(),ofSearch.getPage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveCity(Integer id, String province, String provinceCode, String city, String cityCode) { |
| | | this.baseMapper.saveCity(id,province,provinceCode,city,cityCode); |
| | | } |
| | | } |
New file |
| | |
| | | <?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.dsh.activity.mapper.PointsMerchandiseCityMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | order by insertTime desc |
| | | </select> |
| | | |
| | | |
| | | <insert id="saveCity"> |
| | | insert into t_points_merchandise_city (id,pointsMerchandiseId,city,cityCode,province,provinceCode) value (null ,#{id},#{city},#{cityCode},#{province},#{provinceCode}) |
| | | </insert> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | import cn.mb.cloud.common.data.controller.BaseController; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.TCourse; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.entity.TCoursePackageType; |
| | | import com.dsh.course.feignclient.model.ExerciseVideo; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/course/getPageageType") |
| | | public List<Map<String, Object>> getPageageType(){ |
| | | List<TCoursePackageType> list = coursePackageTypeService.list(new LambdaQueryWrapper<TCoursePackageType>().eq(TCoursePackageType::getState, 1)); |
| | | ArrayList<Map<String, Object>> objects = new ArrayList<>(); |
| | | for (TCoursePackageType tCoursePackageType : list) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("id",tCoursePackageType.getId()); |
| | | map.put("name",tCoursePackageType.getName()); |
| | | objects.add(map); |
| | | } |
| | | return objects; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课程管理列表数据 |
| | | * @param queryCourseList |
| | |
| | | public List<TCourse> queryCourseByType(@RequestBody Integer type){ |
| | | return courseService.list(new QueryWrapper<TCourse>().eq("type", type).eq("state", 1)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/course/queryPackageById") |
| | | public List<String> queryPackageById(@RequestBody Integer coursePackageId){ |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | TCoursePackage byId = coursePackageService.getById(coursePackageId); |
| | | Integer coursePackageTypeId = byId.getCoursePackageTypeId(); |
| | | strings.add(coursePackageTypeService.getById(coursePackageTypeId).getName()); |
| | | strings.add(byId.getName()); |
| | | |
| | | return strings; |
| | | |
| | | } |
| | | |
| | | @PostMapping("/course/getHours") |
| | | public String getHours(@RequestBody Integer coursePackageId1){ |
| | | return coursePackageService.getHours(coursePackageId1); |
| | | } |
| | | } |
| | |
| | | import com.dsh.course.feignClient.activity.model.IntegralGoodsOfSearch; |
| | | import com.dsh.course.feignClient.activity.model.PointMercharsPayedVo; |
| | | import com.dsh.course.feignClient.activity.model.PointMercharsVo; |
| | | import com.dsh.course.feignClient.activity.model.PointsMerchandise; |
| | | import com.dsh.guns.modular.system.model.GoodsInfoOneVo; |
| | | import com.dsh.guns.modular.system.model.StoreVos; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @PostMapping("/base/pointMerchars/queryUserPayedGoodsList") |
| | | List<Map<String, Object>> queryUserPayedGoodsList(@RequestBody PointMercharsPayedVo pointMercharsPayedVo); |
| | | |
| | | @PostMapping("/base/pointMerchars/queryPointMerchaseById") |
| | | PointsMerchandise queryPointMerchaseById(Integer id); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/getshopName") |
| | | Integer getshopName(Integer id); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/queryDetailsOfGoods") |
| | | GoodsInfoOneVo queryDetailsOfGoods(@RequestBody Integer id); |
| | | |
| | | @PostMapping("/base/pointMerchars/getProvinces") |
| | | List<StoreVos> getProvinces(@RequestBody Integer id); |
| | | |
| | | @PostMapping("/base/pointMerchars/getStoreList") |
| | | List<StoreVos> getStoreList(@RequestBody Integer id); |
| | | |
| | | @PostMapping("/base/pointMerchars/updateGoodsDetail") |
| | | boolean updateGoodsDetail(@RequestBody Map<String, Object> stringObjectHashMap); |
| | | |
| | | @PostMapping("/base/pointMerchars/add") |
| | | Integer add(PointsMerchandise pointsMerchandise); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/addOther") |
| | | Boolean addOther(@RequestBody String pam); |
| | | |
| | | @PostMapping("/base/pointMerchars/addCitys") |
| | | Boolean addCitys(@RequestBody List<Map<String, String>> objects); |
| | | |
| | | @PostMapping("/base/pointMerchars/writeOffGoodsStatus") |
| | | boolean writeOffGoodsStatus(@RequestBody Map<String, Object> map); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.activity.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 积分商品 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_points_merchandise") |
| | | public class PointsMerchandise extends Model<PointsMerchandise> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 类型(1=实体商品,2=课包商品,3=门票商品 4=优惠券) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | @TableField("coursePackageId") |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 原价 |
| | | */ |
| | | @TableField("price") |
| | | private BigDecimal price; |
| | | /** |
| | | * 兑换方式(1=积分,2=现金+积分) |
| | | */ |
| | | @TableField("redemptionMethod") |
| | | private Integer redemptionMethod; |
| | | /** |
| | | * 所需现金 |
| | | */ |
| | | @TableField("cash") |
| | | private BigDecimal cash; |
| | | /** |
| | | * 所属积分 |
| | | */ |
| | | @TableField("integral") |
| | | private Integer integral; |
| | | /** |
| | | * 商品封面 |
| | | */ |
| | | @TableField("cover") |
| | | private String cover; |
| | | /** |
| | | * 商品图片 |
| | | */ |
| | | @TableField("productImages") |
| | | private String productImages; |
| | | /** |
| | | * 用户人群(1=全部用户,2=年度会员,3=已有学员用户) |
| | | */ |
| | | @TableField("userPopulation") |
| | | private Integer userPopulation; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | @TableField("quantityIssued") |
| | | private Integer quantityIssued; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | @TableField("pickUpQuantity") |
| | | private Integer pickUpQuantity; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @TableField("startTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @TableField("endTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | /** |
| | | * 使用范围(1=全国,2=指定城市,3=指定门店) |
| | | */ |
| | | @TableField("useScope") |
| | | private Integer useScope; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * 兑换说明 |
| | | */ |
| | | @TableField("redemptionInstructions") |
| | | private String redemptionInstructions; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | @TableField("sort") |
| | | private Integer sort; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | /** |
| | | * 课包支付配置id |
| | | */ |
| | | @TableField("coursePackageConfigId") |
| | | private Integer coursePackageConfigId; |
| | | /** |
| | | * 1=上架 2=下架 |
| | | */ |
| | | @TableField("shelves") |
| | | private Integer shelves; |
| | | @TableField("cardType") |
| | | private Integer cardType; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/course/queryCourseByType") |
| | | List<TCourse> queryCourseByType(Integer type); |
| | | |
| | | |
| | | @PostMapping("/course/getPageageType") |
| | | List<Map<String, Object>> getPageageType(); |
| | | |
| | | |
| | | |
| | | @PostMapping("/course/queryPackageById") |
| | | List<String> queryPackageById(Integer coursePackageId); |
| | | |
| | | @PostMapping("/course/getHours") |
| | | String getHours(Integer coursePackageId1); |
| | | } |
| | |
| | | import com.dsh.course.feignClient.activity.CouponClient; |
| | | import com.dsh.course.feignClient.activity.PointMercharsClient; |
| | | import com.dsh.course.feignClient.activity.model.*; |
| | | import com.dsh.course.feignClient.course.CourseClient; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.ErrorTip; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.CouponDataVo; |
| | | import com.dsh.guns.modular.system.model.Region; |
| | | import com.dsh.guns.modular.system.model.TCity; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IRegionService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | |
| | | |
| | | @Controller |
| | | @RequestMapping("/tGoods") |
| | | public class TGoodsController { |
| | | public class TGoodsController extends BaseController { |
| | | |
| | | |
| | | |
| | |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Autowired |
| | | private CourseClient courseClient; |
| | | |
| | | @Resource |
| | | private PointMercharsClient pointMercharsClient; |
| | |
| | | model.addAttribute("userType",objectType); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | List<Map<String,Object>> listOne = courseClient.getPageageType(); |
| | | model.addAttribute("courseType",listOne); |
| | | |
| | | |
| | | return PREFIX + "TGoods_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/tGoods_info") |
| | | public String tGoodsInfo(Model model) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | System.out.println(objectType); |
| | | model.addAttribute("userType",objectType); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TGoods_detail_one.html"; |
| | | } |
| | | |
| | | @RequestMapping("/goods_info/{id}") |
| | | public String memberCouponInfo(@PathVariable Integer id, Model model) { |
| | | PointsMerchandise pointMercharsVo = pointMercharsClient.queryPointMerchaseById(id); |
| | | model.addAttribute("item",pointMercharsVo); |
| | | if(pointMercharsVo.getType()==2){ |
| | | Date startTime = pointMercharsVo.getStartTime(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | model.addAttribute("sTime",format.format(startTime)); |
| | | model.addAttribute("eTime",format.format(pointMercharsVo.getEndTime())); |
| | | Integer shopId = pointMercharsClient.getshopName(id); |
| | | TStore byId = storeService.getById(shopId); |
| | | model.addAttribute("shopName",byId.getName()); |
| | | Integer coursePackageId = pointMercharsVo.getCoursePackageId(); |
| | | List<String> name = courseClient.queryPackageById(coursePackageId); |
| | | Integer coursePackageId1 = pointMercharsVo.getCoursePackageId(); |
| | | String classHours = courseClient.getHours(coursePackageId1); |
| | | model.addAttribute("typeName",name.get(0)); |
| | | model.addAttribute("pageName",name.get(1)); |
| | | model.addAttribute("classHours",classHours); |
| | | String productImages = pointMercharsVo.getProductImages(); |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | for (String s : productImages.split(",")) { |
| | | strings.add(s); |
| | | } |
| | | model.addAttribute("pictures",strings); |
| | | return PREFIX + "TGoods_detail_two.html"; |
| | | }else { |
| | | GoodsInfoOneVo infoOneVo = pointMercharsClient.queryDetailsOfGoods(id); |
| | | System.out.println("pointMercharsVo:"+infoOneVo); |
| | | model.addAttribute("item",infoOneVo); |
| | | String[] split = infoOneVo.getPics().split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | if (infoOneVo.getUseScope() == 2){ |
| | | List<StoreVos> provinces = pointMercharsClient.getProvinces(id); |
| | | model.addAttribute("city",provinces); |
| | | } |
| | | if (infoOneVo.getUseScope() == 2){ |
| | | List<StoreVos> storeVos = pointMercharsClient.getStoreList(id); |
| | | model.addAttribute("store",storeVos); |
| | | } |
| | | model.addAttribute("pictures",list); |
| | | model.addAttribute("exchangeMethod",infoOneVo.getExchangeMethod()); |
| | | return PREFIX + "TGoods_detail_one.html"; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | client.insertIntoData(dataVo); |
| | | return new SuccessTip<>(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 商品详情 |
| | | * @param pointMerchandiseId 商品Id |
| | | * @param quantityIssued 发放数量 |
| | | * @param pickUpQuantity 限领数量 |
| | | * @param redemptionInstructions 说明 |
| | | * @param cover 封面图 |
| | | * @param productImages 商品图片 |
| | | * @param sort 排序 |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update( Integer id,Integer num,Integer num1,String text){ |
| | | Coupon coupon = client.queryCouponById(id); |
| | | coupon.setQuantityIssued(num); |
| | | coupon.setPickUpQuantity(num1); |
| | | coupon.setIllustrate(text); |
| | | client.updateCouponData(coupon); |
| | | public Object update( Integer pointMerchandiseId,Integer quantityIssued,Integer pickUpQuantity,String redemptionInstructions,String cover,String productImages,Integer sort){ |
| | | Map<String, Object> stringObjectHashMap = new HashMap<>(); |
| | | stringObjectHashMap.put("pointMerchandiseId",pointMerchandiseId); |
| | | stringObjectHashMap.put("quantityIssued",quantityIssued); |
| | | stringObjectHashMap.put("pickUpQuantity",pickUpQuantity); |
| | | stringObjectHashMap.put("redemptionInstructions",redemptionInstructions); |
| | | stringObjectHashMap.put("cover",cover); |
| | | stringObjectHashMap.put("productImages",productImages); |
| | | stringObjectHashMap.put("sort",sort); |
| | | System.out.println(stringObjectHashMap); |
| | | pointMercharsClient.updateGoodsDetail(stringObjectHashMap); |
| | | return new SuccessTip<>(); |
| | | } |
| | | /* |
| | | ajax.set("typeAll",typeAll); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("storeId",storeId); |
| | | ajax.set("coursePackageTypeId",coursePackageTypeId); |
| | | ajax.set("coursePackageId",coursePackageId); |
| | | ajax.set("coursePackageConfigId",coursePackageConfigId); |
| | | ajax.set("price",price); |
| | | ajax.set("type",type); |
| | | ajax.set("integral",integral); |
| | | ajax.set("cash",cash); |
| | | ajax.set("cover",cover1); |
| | | ajax.set("imgOne",imgOne); |
| | | ajax.set("userPopulation",userPopulation); |
| | | ajax.set("quantityIssued",quantityIssued); |
| | | ajax.set("pickUpQuantity",pickUpQuantity); |
| | | ajax.set("startTime",startTime); |
| | | ajax.set("text",text); |
| | | ajax.set("sort",sort); |
| | | ajax.set("useScope",company); |
| | | ajax.set("cityIds",cts); |
| | | ajax.set("storeIds",stores); |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add( Integer typeAll,String provinceCode,String cityCode,Integer storeId,Integer coursePackageTypeId,Integer coursePackageId,Integer coursePackageConfigId, |
| | | Double price,Integer type,Integer integral,Double cash,String cover,String imgOne,Integer userPopulation,Integer quantityIssued,Integer pickUpQuantity, |
| | | String startTime,String text,Integer sort,String name,Integer useScope,String cityIds,String storeIds,Integer cardType |
| | | ) throws ParseException { |
| | | PointsMerchandise pointsMerchandise = new PointsMerchandise(); |
| | | pointsMerchandise.setType(typeAll); |
| | | pointsMerchandise.setName(name); |
| | | pointsMerchandise.setCoursePackageId(coursePackageId); |
| | | pointsMerchandise.setPrice(new BigDecimal(price)); |
| | | pointsMerchandise.setRedemptionMethod(type); |
| | | if(type==2 || type==3){ |
| | | pointsMerchandise.setCash(new BigDecimal(cash)); |
| | | } |
| | | if(type==1 || type==2){ |
| | | pointsMerchandise.setIntegral(integral); |
| | | } |
| | | pointsMerchandise.setCover(cover); |
| | | pointsMerchandise.setProductImages(imgOne); |
| | | pointsMerchandise.setUserPopulation(userPopulation); |
| | | pointsMerchandise.setCardType(cardType); |
| | | pointsMerchandise.setQuantityIssued(quantityIssued); |
| | | pointsMerchandise.setPickUpQuantity(pickUpQuantity); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | pointsMerchandise.setStartTime(format.parse(startTime.split(" - ")[0])); |
| | | pointsMerchandise.setEndTime(format.parse(startTime.split(" - ")[1])); |
| | | pointsMerchandise.setUseScope(useScope); |
| | | if(ToolUtil.isNotEmpty(provinceCode)){ |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, provinceCode)); |
| | | pointsMerchandise.setProvinceCode(provinceCode); |
| | | pointsMerchandise.setProvince(one.getName()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(cityCode)){ |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, cityCode)); |
| | | pointsMerchandise.setCityCode(cityCode); |
| | | pointsMerchandise.setCity(one.getName()); |
| | | } |
| | | pointsMerchandise.setRedemptionInstructions(text); |
| | | pointsMerchandise.setSort(sort); |
| | | pointsMerchandise.setState(1); |
| | | pointsMerchandise.setInsertTime(new Date()); |
| | | pointsMerchandise.setCoursePackageConfigId(coursePackageConfigId); |
| | | // 代替storeId |
| | | pointsMerchandise.setShelves(storeId); |
| | | Integer id = pointMercharsClient.add(pointsMerchandise); |
| | | if(typeAll!=2){ |
| | | if(useScope==2){ |
| | | ArrayList<Map<String,String>> objects = new ArrayList<>(); |
| | | for (String s : cityIds.split(",")) { |
| | | TCity tCity = cityService.getById(Integer.valueOf(s)); |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | TCity pCity = cityService.getById(tCity.getParentId()); |
| | | map.put("pName",pCity.getName()); |
| | | map.put("pCode",pCity.getCode()); |
| | | map.put("cName",tCity.getName()); |
| | | map.put("cCode",tCity.getCode()); |
| | | map.put("id",id.toString()); |
| | | objects.add(map); |
| | | } |
| | | pointMercharsClient.addCitys(objects); |
| | | }else if(useScope==3){ |
| | | String pam = id+"_"+storeIds; |
| | | // 添加多个城市 门店 |
| | | try{ |
| | | pointMercharsClient.addOther(pam); |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | return new SuccessTip<>(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | * 跳转到修改商品详情 |
| | | */ |
| | | @RequestMapping("/tGoods_update/{id}") |
| | | public String tCityUpdate(@PathVariable Integer id, Model model) { |
| | |
| | | PointMercharsVo pointMercharsVo = pointMercharsClient.queryPointMerchaseDetailOfId(id); |
| | | System.out.println("pointMercharsVo:"+pointMercharsVo); |
| | | String[] split = pointMercharsVo.getPics().split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | model.addAttribute("id",id); |
| | | model.addAttribute("item",pointMercharsVo); |
| | | model.addAttribute("pictures",split); |
| | | model.addAttribute("pictures",list); |
| | | System.out.println(list); |
| | | return PREFIX + "TGoods_edit.html"; |
| | | } |
| | | |
| | |
| | | */ |
| | | @RequestMapping("/write_off") |
| | | @ResponseBody |
| | | public Object GoodsWriteOff(Integer id){ |
| | | System.out.println(id); |
| | | // TODO: 2023/8/15 核销操作 |
| | | public Object GoodsWriteOff(String id){ |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Map<String, Object> stringObjectHashMap = new HashMap<>(); |
| | | stringObjectHashMap.put("goodsId",id); |
| | | stringObjectHashMap.put("managerId",objectType); |
| | | boolean b = pointMercharsClient.writeOffGoodsStatus(stringObjectHashMap); |
| | | System.out.println(b); |
| | | if (b){ |
| | | return new SuccessTip<>(); |
| | | }else { |
| | | return ERROR; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class GoodsInfoOneVo { |
| | | |
| | | |
| | | String name; |
| | | /** |
| | | * 封面图 |
| | | */ |
| | | String cover; |
| | | /** |
| | | * 原价 |
| | | */ |
| | | BigDecimal price; |
| | | /** |
| | | * 兑换方式(1=积分,2=现金+积分, 3=现金) |
| | | */ |
| | | Integer exchangeMethod; |
| | | /** |
| | | * 现金 |
| | | */ |
| | | BigDecimal cash; |
| | | /** |
| | | * 积分 |
| | | */ |
| | | Integer integral; |
| | | /** |
| | | * 图片 |
| | | */ |
| | | String pics; |
| | | /** |
| | | * 用户人群 |
| | | */ |
| | | String userPopulation; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | Integer quantityIssued; |
| | | /** |
| | | * 已领数量 |
| | | */ |
| | | Integer hasPicked; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | Integer pickUpQuantity; |
| | | /** |
| | | * 有效期 |
| | | */ |
| | | String validTime; |
| | | /** |
| | | * 兑换点 |
| | | */ |
| | | String exchangeArea; |
| | | /** |
| | | * 兑换地点 (1=全国,2=指定城市,3=指定门店) |
| | | */ |
| | | Integer useScope; |
| | | /** |
| | | * 商品说明 |
| | | */ |
| | | String redemptionInstructions; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | Integer sort; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class StoreVos { |
| | | |
| | | String num1; |
| | | |
| | | String num2; |
| | | |
| | | String num3; |
| | | } |
| | |
| | | </div> |
| | | <div id="b1"> |
| | | <#input id="name" name="商品名称" type="text"/> |
| | | <div class="form-group" id="ticket" hidden> |
| | | <label class="col-sm-3 control-label">门票类型:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="cardType" value="1" checked> 日卡 |
| | | <input type="radio" name="cardType" value="2"> 月卡 |
| | | <input type="radio" name="cardType" value="3" > 季卡 |
| | | <input type="radio" name="cardType" value="4" > 年卡 |
| | | </div> |
| | | </div> |
| | | <#input id="price" name="原价" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">兑换方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="redemptionMethod" value="1" checked> 积分 |
| | | <input type="radio" name="redemptionMethod" value="2" > 现金+积分 |
| | | <input type="radio" name="redemptionMethod" value="3" > 现金 |
| | | <input type="radio" name="redemptionMethod" value="1" onclick="updateMethod(3)" checked> 积分 |
| | | <input type="radio" name="redemptionMethod" value="2" onclick="updateMethod(4)"> 现金+积分 |
| | | <input type="radio" name="redemptionMethod" value="3" onclick="updateMethod(5)"> 现金 |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | |
| | | <#avatar id="cover" name="商品封面" /> |
| | | <div class="row" id="app" style="margin-left: 225px;" > |
| | | <div class="col-sm-6"> |
| | | |
| | | <div class="row" id="app" > |
| | | <div class="col-sm-6" style="width: 100%"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">商品图片: </label> |
| | | <div class="col-sm-2" style="margin-top: 2%"> |
| | | <label class="col-sm-3 control-label" style="width: 15%;margin-left: 7%">*商品图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 12%;margin-top: 1%"> |
| | | <el-upload |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | :on-success="handleAvatarSuccess" |
| | | list-type="picture-card" |
| | | accept=".jpg,.jpeg,.png,.JPG,.JPEG" |
| | | :on-remove="handleRemove" |
| | | :before-upload="beforeAvatarUpload"> |
| | | <img v-if="imageUrl" :src="imageUrl" class="avatar"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="imageUrl1" alt=""></el-dialog> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <label class="col-sm-3">*适用范围: </label> |
| | | <div class="col-sm-2" id="belongsNationwide" > |
| | | <input class="col-sm-1" onclick="scopeOfApplication1()" name="company" type="radio" |
| | | value="0" checked style="margin-top: 10px"/> |
| | | value="1" checked style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="width: 38%;margin-top: 7px">全国通用</label> |
| | | </div> |
| | | <div class="col-sm-2" id="belongsCity" > |
| | | <input class="col-sm-1" name="company" onclick="scopeOfApplication2()" type="radio" |
| | | value="1" style="margin-top: 10px"/> |
| | | value="2" style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="width: 38%;margin-top: 7px">指定城市</label> |
| | | </div> |
| | | <div class="col-sm-2" id="belongsStore" > |
| | | <input class="col-sm-1" name="company" onclick="scopeOfApplication3()" type="radio" |
| | | value="1" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 38%;margin-top: 6px;">指定门店</label> |
| | | </div> |
| | | </div> |
| | |
| | | <option value="">请选择</option> |
| | | </select> |
| | | <label class="col-sm-1" style="width: 7%;margin-top: 7px">市</label> |
| | | <label name="addBranch" class="col-sm-1" onclick="TCarInfoDlg.addBranch()" style="border: 0px;cursor: pointer;margin-top: 1%"><i class="fa fa-plus-circle"></i></label> |
| | | <label name="addBranch" class="col-sm-1" onclick="TGoodsInfoDlg.addBranch()" style="border: 0px;cursor: pointer;margin-top: 1%"><i class="fa fa-plus-circle"></i></label> |
| | | </div> |
| | | <div id="cityDemo"></div> |
| | | </div> |
| | |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TGoodsInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode"> |
| | | <select class="form-control" id="cCode" name="cCode" onchange="TGoodsInfoDlg.storeChange(this)"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">所属门店:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="storeId" name="storeId"> |
| | | <option value="">选择门店</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">课包类型:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="coursePackageTypeId" name="pCode" onchange="TGoodsInfoDlg.packageChange(this)"> |
| | | <option value="">选择课包类型</option> |
| | | @for(obj in courseType){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">课包名称:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="coursePackageId" name="coursePackageId" onchange="TGoodsInfoDlg.timeChange(this)"> |
| | | <option value="">选择课包</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">课时数:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="coursePackageConfigId" name="coursePackageConfigId"> |
| | | <option value="">选择课时数</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">原价:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="price1" name="price" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">兑换方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="redemptionMethod" value="1" checked onclick="updateMethod(1)" > 积分 |
| | | <input type="radio" name="redemptionMethod" value="2" onclick="updateMethod(2)"> 现金+积分 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="y3" hidden> |
| | | <label class="col-sm-3 control-label">所需现金:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="cash1" name="cash" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="y4"> |
| | | <label class="col-sm-3 control-label">所需积分:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="integral1" name="integral" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <#avatar id="cover1" name="*商品封面" /> |
| | | <div class="row" id="app1" > |
| | | <div class="col-sm-6" style="width: 100%"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label" style="width: 15%;margin-left: 7%">*商品图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 12%;margin-top: 1%"> |
| | | <el-upload |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | list-type="picture-card" |
| | | accept=".jpg,.jpeg,.png,.JPG,.JPEG" |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="imageUrl1" alt=""></el-dialog> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">用户人群:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="userPopulation" value="1" checked> 全部用户 |
| | | <input type="radio" name="userPopulation" value="2" > 年度会员 |
| | | <input type="radio" name="userPopulation" value="3" > 已有学员用户 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">发放数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="quantityIssued1" name="quantityIssued" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">限领数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="pickUpQuantity1" name="pickUpQuantity" type="text"> |
| | | </div> |
| | | </div> |
| | | <#input id="startTime1" name="有效期" type="text"/> |
| | | |
| | | <div class="form-group" style="margin-left:262px"> |
| | | <label class="col-sm-1 control-label">兑换说明:</label> |
| | | <div class="col-sm-5"> |
| | | <textarea type="text/plain" id="editor1" style="height: 300px;width: 800px;"></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort1" name="sort" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TGoodsInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TGoodsInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/tGoods/TStoreInfo.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#startTime', |
| | | range: true |
| | | }); |
| | | laydate.render({ |
| | | elem: '#startTime1', |
| | | range: true |
| | | }); |
| | | function updateMethod(e) { |
| | | console.log(e) |
| | | if(e==1){ |
| | | $("#y3").hide() |
| | | $("#y4").show() |
| | | }else if(e==2){ |
| | | $("#y4").show() |
| | | $("#y3").show() |
| | | }else if(e==3){ |
| | | $("#y1").hide() |
| | | $("#y2").show() |
| | | }else if(e==4){ |
| | | $("#y1").show() |
| | | $("#y2").show() |
| | | }else if(e==5) { |
| | | $("#y2").hide() |
| | | $("#y1").show() |
| | | } |
| | | |
| | | } |
| | | let i =1; |
| | | function updateType(e) { |
| | | |
| | | if(e==2){ |
| | | $("#b1").hide() |
| | | $("#b2").show() |
| | | if(i==1){ |
| | | var drivingLicensePhoto = new $WebUpload("cover1"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | i++; |
| | | } |
| | | $("#ticket").hide() |
| | | }else { |
| | | $("#b2 ").hide() |
| | | $("#b1").show() |
| | | $("#ticket").show() |
| | | } |
| | | } |
| | | |
| | |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TCarInfoDlg.goodsPicArray.push(file); |
| | | TGoodsInfoDlg.goodsPicArray.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | couponInfoDlg.goodsPicArray = couponInfoDlg.goodsPicArray.filter(item => { |
| | | TGoodsInfoDlg.goodsPicArray = TGoodsInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TGoodsInfoDlg.goodsPicArray1.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TGoodsInfoDlg.goodsPicArray = TGoodsInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409eff; |
| | | } |
| | | |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 100px; |
| | | height: 100px; |
| | | line-height: 110px; |
| | | margin-top: 40px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div id="b1"> |
| | | <#input id="name" name="*商品名称:" type="text" value="${item.name}" readonly="true" /> |
| | | |
| | | <#input id="cover" name="*原价:" avatarImg="${item.price}" readonly="true" /> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*兑换方式:</label> |
| | | <div class="col-sm-4"> |
| | | @if(exchangeMethod == 1){ |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="1" checked style="margin-top: 10px" disabled/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全部用户</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 18%;margin-top: 5px">已有学员用户</label> |
| | | @} |
| | | |
| | | @if(exchangeMethod == 2){ |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="1" style="margin-top: 10px" disabled/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全部用户</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 18%;margin-top: 5px">已有学员用户</label> |
| | | @} |
| | | |
| | | @if(exchangeMethod == 3){ |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="1" style="margin-top: 10px" disabled/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全部用户</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="3" checked style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 18%;margin-top: 5px">已有学员用户</label> |
| | | @} |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <#input id="cover" name="*所需现金:" avatarImg="${item.cash}" readonly="true" /> |
| | | <#input id="cover" name="*所需积分:" avatarImg="${item.integral}" readonly="true" /> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*商品封面:</label> |
| | | <div class="col-sm-4"> |
| | | <img height="100px" width="100px" src="${item.cover}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*商品图片:</label> |
| | | <div class="col-sm-4"> |
| | | @if(pictures != null){ |
| | | @for(im in pictures){ |
| | | <img height="100px" width="100px" src="${im}"> |
| | | @} |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | <#input id="quantityIssued" name="*用户人群:" type="text" value="${item.userPopulation}" readonly="true" /> |
| | | <#input id="quantityIssued" name="*发放数量:" type="text" value="${item.quantityIssued}" readonly="true" /> |
| | | <#input id="quantityIssued" name="*限领数量:" type="text" value="${item.pickUpQuantity}" readonly="true" /> |
| | | <#input id="quantityIssued" name="*已兑换数量:" type="text" value="${item.hasPicked}" readonly="true" /> |
| | | <#input id="quantityIssued" name="*有效期:" type="text" value="${item.validTime}" readonly="true" /> |
| | | |
| | | <#input id="quantityIssued" name="*兑换地点:" type="text" value="${item.exchangeArea}" readonly="true" /> |
| | | |
| | | @if(item.useScope == 2){ |
| | | <table class="table table-bordered" style="width: 70%;margin-left: 228px;" > |
| | | <thead> |
| | | <tr> |
| | | <td>所在省市</td> |
| | | <td>所属账号</td> |
| | | <td>门店名称</td> |
| | | </tr> |
| | | </thead> |
| | | @for(s in store){ |
| | | <td>${s.num1}</td> |
| | | <td>${s.num2}</td> |
| | | <td>${s.num3}</td> |
| | | @} |
| | | </table> |
| | | @} |
| | | |
| | | @if(item.useScope == 3){ |
| | | <table class="table table-bordered" style="width: 70%;margin-left: 228px;" > |
| | | <thead> |
| | | <tr> |
| | | <td>所在省市</td> |
| | | <td>所属账号</td> |
| | | <td>门店名称</td> |
| | | </tr> |
| | | </thead> |
| | | @for(c in city){ |
| | | <td>${c.num1}</td> |
| | | <td>${c.num2}</td> |
| | | @} |
| | | </table> |
| | | @} |
| | | <div class="form-group" style="margin-left:262px"> |
| | | <label class="col-sm-3 control-label">兑换说明:</label> |
| | | <div class="col-sm-4"> |
| | | <textarea type="text/plain" id="editor" style="height: 300px;width: 800px;" readonly>${item.redemptionInstructions}</textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="quantityIssued" name="*排序:" type="text" value="${item.sort}" readonly="true" /> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TGoodsInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script> |
| | | <script> |
| | | var vue2 = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TGoodsInfoDlg.goodsPicArray.push(file.response); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TGoodsInfoDlg.goodsPicArray = TGoodsInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div id="b1"> |
| | | |
| | | <input id="goodsId" value="${id}" hidden="hidden"> |
| | | <#input id="name" name="商品名称" type="text" value="${item.name}" readonly="true" /> |
| | | |
| | | <#avatar id="cover" name="商品封面:" avatarImg="${item.cover}" /> |
| | |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">商品图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 12%;margin-top: 1%"> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 24%;margin-top: 1%"> |
| | | <div class="avatar-uploader" style="display: flex;"> |
| | | @for(im in pictures){ |
| | | <div style="margin-right: 16px;position: relative"> |
| | | <img height="100px" width="100px" src="${im}"> |
| | | <i class="el-icon-delete" onclick="delImg(this)" style="color: red;font-size: 18px;position: absolute;left: 0;right: 0;top: 0;bottom: 0"></i> |
| | | </div> |
| | | @} |
| | | <el-upload |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <!-- <img width="100%" :src="imageUrl1" alt="">--> |
| | | @for(im in pictures){ |
| | | <img width="100%" src="${im}"> |
| | | @} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">发放数量:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TGoodsInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TGoodsInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TCarInfoDlg.goodsPicArray.push(file); |
| | | TGoodsInfoDlg.goodsPicArray.push(file.response); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TCarInfoDlg.goodsPicArray = TCarInfoDlg.goodsPicArray.filter(item => { |
| | | TGoodsInfoDlg.goodsPicArray = TGoodsInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tGoods/tCity_update/' + TPointProducts.seItem.id |
| | | content: Feng.ctxPath + '/tGoods/goods_info/' + TPointProducts.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | tCarInfoData : {}, |
| | | var TGoodsInfoDlg = { |
| | | tGoodsInfoData : {}, |
| | | validateFields: { |
| | | }, |
| | | goodsPicArray:[], |
| | | goodsPicArray1:[], |
| | | storeIds: [], |
| | | |
| | | }; |
| | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | TGoodsInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | TGoodsInfoDlg.clearData = function() { |
| | | this.tGoodsInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | TGoodsInfoDlg.set = function(key, val) { |
| | | this.tGoodsInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | TGoodsInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | TGoodsInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TPointProducts.layerIndex); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.collectData = function() { |
| | | TGoodsInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('isPlatCar') |
| | |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | TCarInfoDlg.selecUserOpt = function (arrays){ |
| | | TGoodsInfoDlg.selecUserOpt = function (arrays){ |
| | | console.log(arrays) |
| | | //获取所有的值 |
| | | var subArr= this.storeIds; |
| | |
| | | console.log(e); |
| | | var row = $(e).closest('tr'); |
| | | var value = row.find('#id').val(); |
| | | TCarInfoDlg.storeIds.splice(TCarInfoDlg.storeIds.indexOf(parseInt(value)), 1) |
| | | TGoodsInfoDlg.storeIds.splice(TGoodsInfoDlg.storeIds.indexOf(parseInt(value)), 1) |
| | | $(e).parent().parent().remove(); |
| | | console.log('storeIds',TCarInfoDlg.storeIds) |
| | | console.log('storeIds',TGoodsInfoDlg.storeIds) |
| | | } |
| | | TCarInfoDlg.delete = function (o) { |
| | | TGoodsInfoDlg.delete = function (o) { |
| | | $(o).parent("div").remove() |
| | | } |
| | | var num = 0; |
| | | TCarInfoDlg.addBranch = function () { |
| | | TGoodsInfoDlg.addBranch = function () { |
| | | num=num+1; |
| | | var a= ""; |
| | | a = "<div style=\'margin-left: 25%\' class=\"col-sm-9 control-label\">\n" + |
| | |
| | | " <option value=\"\">请选择</option>\n" + |
| | | " </select>\n" + |
| | | " <label class=\"col-sm-1\" style=\"width: 7%;margin-top: 7px\">市</label>\n" + |
| | | " <label name=\"addBranch\" class=\"col-sm-1\" onclick=\"TCarInfoDlg.delete(this)\" style=\"border: 0px;cursor: pointer;margin-top: 1%\"><i class=\"fa fa-trash\"></i></label>"+ |
| | | " <label name=\"addBranch\" class=\"col-sm-1\" onclick=\"TGoodsInfoDlg.delete(this)\" style=\"border: 0px;cursor: pointer;margin-top: 1%\"><i class=\"fa fa-trash\"></i></label>"+ |
| | | " </div>"; |
| | | $("#cityDemo").append($(a)); |
| | | getProvince(num); |
| | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | TGoodsInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | |
| | | return ; |
| | | } |
| | | |
| | | let typeAll = document.querySelector('input[name="type"]:checked').value; |
| | | if(typeAll==2){ |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | let storeId = $("#storeId").val() |
| | | if(storeId==''){ |
| | | Feng.info("请选择门店") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | let coursePackageTypeId = $("#coursePackageTypeId").val() |
| | | if(coursePackageTypeId==''){ |
| | | Feng.info("请选择课包类型") |
| | | return; |
| | | } |
| | | let coursePackageId = $("#coursePackageId").val() |
| | | if(coursePackageId==''){ |
| | | Feng.info("请选择课包") |
| | | return; |
| | | } |
| | | let coursePackageConfigId = $("#coursePackageConfigId").val() |
| | | if(coursePackageConfigId==''){ |
| | | Feng.info("请选择课时数") |
| | | return; |
| | | } |
| | | let price = $("#price1").val() |
| | | if(price==''){ |
| | | Feng.info("请填写原价") |
| | | return; |
| | | } |
| | | let type = document.querySelector('input[name="redemptionMethod"]:checked').value; |
| | | if(type==''){ |
| | | Feng.info("请选择兑换方式") |
| | | return; |
| | | } |
| | | let integral=''; |
| | | let cash=''; |
| | | if(type==1){ |
| | | integral = $("#integral1").val() |
| | | if(integral==''){ |
| | | Feng.info("请填写所需积分") |
| | | return; |
| | | } |
| | | } |
| | | if(type==2){ |
| | | integral = $("#integral1").val() |
| | | if(integral==''){ |
| | | Feng.info("请填写所需积分") |
| | | return; |
| | | } |
| | | cash = $("#cash1").val() |
| | | if(cash==''){ |
| | | Feng.info("请填写所需现金") |
| | | return; |
| | | } |
| | | } |
| | | |
| | | let cover1 = $("#cover1").val() |
| | | // if(cover1==''){ |
| | | // Feng.info("请上传封面") |
| | | // return; |
| | | // } |
| | | var goodImgs = this.goodsPicArray1; |
| | | var imgOne =""; |
| | | if(goodImgs.length==0){ |
| | | }else { |
| | | for (let i = 0; i <goodImgs.length; i++) { |
| | | if(i==goodImgs.length-1){ |
| | | imgOne += (goodImgs[i].response) |
| | | }else { |
| | | imgOne+=(goodImgs[i].response+",") |
| | | } |
| | | } |
| | | } |
| | | |
| | | let userPopulation = document.querySelector('input[name="userPopulation"]:checked').value; |
| | | if(userPopulation==''){ |
| | | Feng.info("请选择用户人群") |
| | | return; |
| | | } |
| | | |
| | | let quantityIssued = $("#quantityIssued1").val() |
| | | if(quantityIssued==''){ |
| | | Feng.info("请填写发放数量") |
| | | return; |
| | | } |
| | | let pickUpQuantity = $("#pickUpQuantity1").val() |
| | | if(pickUpQuantity==''){ |
| | | Feng.info("请填写限领数量") |
| | | return; |
| | | } |
| | | let startTime = $("#startTime1").val() |
| | | if(startTime==''){ |
| | | Feng.info("请选择有效期") |
| | | return; |
| | | } |
| | | let text = TGoodsInfoDlg.editor1.getContent(); |
| | | console.log(text) |
| | | if(text==""){ |
| | | Feng.info("请输入兑换说明") |
| | | return; |
| | | } |
| | | |
| | | let sort = $("#sort1").val() |
| | | if(sort==''){ |
| | | Feng.info("请填写排序") |
| | | return; |
| | | } |
| | | |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/add", function(data){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/add", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | window.parent.TPointProducts.table.refresh(); |
| | | TGoodsInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("typeAll",typeAll); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("storeId",storeId); |
| | | ajax.set("coursePackageTypeId",coursePackageTypeId); |
| | | ajax.set("coursePackageId",coursePackageId); |
| | | ajax.set("coursePackageConfigId",coursePackageConfigId); |
| | | ajax.set("price",price); |
| | | ajax.set("type",type); |
| | | ajax.set("integral",integral); |
| | | ajax.set("cash",cash); |
| | | ajax.set("cover",cover1); |
| | | ajax.set("imgOne",imgOne); |
| | | ajax.set("userPopulation",userPopulation); |
| | | ajax.set("quantityIssued",quantityIssued); |
| | | ajax.set("pickUpQuantity",pickUpQuantity); |
| | | ajax.set("startTime",startTime); |
| | | ajax.set("text",text); |
| | | ajax.set("sort",sort); |
| | | ajax.start(); |
| | | |
| | | }else { |
| | | let name = $("#name").val() |
| | | if(name==''){ |
| | | Feng.info("请填写商品名称") |
| | | return; |
| | | } |
| | | let price = $("#price").val() |
| | | if(price==''){ |
| | | Feng.info("请填写原价") |
| | | return; |
| | | } |
| | | let type = document.querySelector('input[name="redemptionMethod"]:checked').value; |
| | | if(type==''){ |
| | | Feng.info("请选择兑换方式") |
| | | return; |
| | | } |
| | | |
| | | let integral=''; |
| | | let cash=''; |
| | | if(type==1){ |
| | | integral = $("#integral").val() |
| | | if(integral==''){ |
| | | Feng.info("请填写所需积分") |
| | | return; |
| | | } |
| | | } |
| | | if(type==2){ |
| | | integral = $("#integral").val() |
| | | if(integral==''){ |
| | | Feng.info("请填写所需积分") |
| | | return; |
| | | } |
| | | cash = $("#cash").val() |
| | | if(cash==''){ |
| | | Feng.info("请填写所需现金") |
| | | return; |
| | | } |
| | | } |
| | | if(type==3){ |
| | | cash = $("#cash").val() |
| | | if(cash==''){ |
| | | Feng.info("请填写所需现金") |
| | | return; |
| | | } |
| | | } |
| | | |
| | | let cover1 = $("#cover").val() |
| | | var goodImgs = this.goodsPicArray; |
| | | var imgOne =""; |
| | | if(goodImgs.length==0){ |
| | | }else { |
| | | for (let i = 0; i <goodImgs.length; i++) { |
| | | if(i==goodImgs.length-1){ |
| | | imgOne += (goodImgs[i].response) |
| | | }else { |
| | | imgOne+=(goodImgs[i].response+",") |
| | | } |
| | | } |
| | | } |
| | | |
| | | let userPopulation = document.querySelector('input[name="userPopulation"]:checked').value; |
| | | if(userPopulation==''){ |
| | | Feng.info("请选择用户人群") |
| | | return; |
| | | } |
| | | |
| | | let quantityIssued = $("#quantityIssued").val() |
| | | if(quantityIssued==''){ |
| | | Feng.info("请填写发放数量") |
| | | return; |
| | | } |
| | | let pickUpQuantity = $("#pickUpQuantity").val() |
| | | if(pickUpQuantity==''){ |
| | | Feng.info("请填写限领数量") |
| | | return; |
| | | } |
| | | let startTime = $("#startTime").val() |
| | | if(startTime==''){ |
| | | Feng.info("请选择有效期") |
| | | return; |
| | | } |
| | | |
| | | let company = document.querySelector('input[name="company"]:checked').value; |
| | | |
| | | var cityIds = []; |
| | | var cts = ""; |
| | | if (company === '2'){ |
| | | var myselect=document.getElementById('cityData'); |
| | | var seCity = myselect.options[myselect.selectedIndex].value; |
| | | if (seCity === null || seCity === undefined || seCity === ''){ |
| | | return Feng.error('请选中一个省市'); |
| | | } |
| | | cityIds.push(seCity); |
| | | if (num > 0){ |
| | | for (let i = 1; i <= num; i++) { |
| | | var insSelect=document.getElementById('cityData'+i); |
| | | var inData = insSelect.options[insSelect.selectedIndex].value; |
| | | if (inData !== undefined || inData !== null || inData !== ''){ |
| | | cityIds.push(inData); |
| | | } |
| | | } |
| | | cts = cityIds.join(','); |
| | | }else { |
| | | cts = cityIds |
| | | } |
| | | } |
| | | |
| | | const commaSeparatedString = this.goodsPicArray.join(','); |
| | | |
| | | var stores = ""; |
| | | if (company === '3'){ |
| | | console.log('3---this.storeIds',this.storeIds); |
| | | if (TGoodsInfoDlg.storeIds.length === 0 ){ |
| | | return Feng.error('请至少选择一个门店'); |
| | | } |
| | | stores = this.storeIds.join(','); |
| | | console.log('stores--===--',stores) |
| | | } |
| | | |
| | | let text = TGoodsInfoDlg.editor.getContent(); |
| | | console.log(text) |
| | | if(text==""){ |
| | | Feng.info("请输入兑换说明") |
| | | return; |
| | | } |
| | | |
| | | let sort = $("#sort").val() |
| | | if(sort==''){ |
| | | Feng.info("请填写排序") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/add", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Successfully added!"); |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TPointProducts.table.refresh(); |
| | | TGoodsInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("typeAll",typeAll); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("price",price); |
| | | ajax.set("type",type); |
| | | ajax.set("integral",integral); |
| | | ajax.set("cash",cash); |
| | | ajax.set("cover",cover1); |
| | | ajax.set("imgOne",imgOne); |
| | | ajax.set("userPopulation",userPopulation); |
| | | ajax.set("quantityIssued",quantityIssued); |
| | | ajax.set("pickUpQuantity",pickUpQuantity); |
| | | ajax.set("startTime",startTime); |
| | | ajax.set("useScope",company); |
| | | ajax.set("cityIds",cts); |
| | | ajax.set("storeIds",stores); |
| | | ajax.set("text",text); |
| | | ajax.set("sort",sort); |
| | | ajax.set("cardType",document.querySelector('input[name="cardType"]:checked').value); |
| | | ajax.start(); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除图片的函数 |
| | | * @param e |
| | | */ |
| | | function delImg(e){ |
| | | |
| | | $(e).parent().remove(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | TGoodsInfoDlg.editSubmit = function() { |
| | | let cover = $("#cover").val(); |
| | | let goodsId = $("#goodsId").val(); |
| | | var productImages = ""; |
| | | if (TGoodsInfoDlg.goodsPicArray.length > 0){ |
| | | productImages = TGoodsInfoDlg.goodsPicArray.join(','); |
| | | } |
| | | let quantityIssued = $("#quantityIssued").val(); |
| | | let pickUpQuantity = $("#pickUpQuantity").val(); |
| | | let editor = jQuery.trim(TGoodsInfoDlg.editor.getContent()); |
| | | console.log('editor:',editor) |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | let sort = $("#sort").val(); |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | if (quantityIssued === undefined || quantityIssued === null || quantityIssued === ''){ |
| | | return Feng.error('发放数量不能为空!'); |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | if (pickUpQuantity === undefined || pickUpQuantity === null || pickUpQuantity === ''){ |
| | | return Feng.error('限领数量不能为空!'); |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | let quantityHas = $("#quantityHas").val(); |
| | | if (quantityIssued <= quantityHas){ |
| | | return Feng.error('发放数量小于已领数量!'); |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | |
| | | |
| | | if (editor === undefined || editor === null || editor === ''){ |
| | | return Feng.error('兑换说明不能为空!'); |
| | | } |
| | | if (sort === undefined || sort === null || sort === ''){ |
| | | return Feng.error('排序不能为空!'); |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/update", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | window.parent.TPointProducts.table.refresh(); |
| | | TGoodsInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.set("pointMerchandiseId",goodsId); |
| | | ajax.set("quantityIssued",quantityIssued); |
| | | ajax.set("pickUpQuantity",pickUpQuantity); |
| | | ajax.set("redemptionInstructions",editor); |
| | | ajax.set("cover",cover); |
| | | ajax.set("productImages",productImages); |
| | | ajax.set("sort",sort); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | |
| | | getProvince(null); |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | Feng.initValidator("carInfoForm", TGoodsInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("cover"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | TCarInfoDlg.editor = UE.getEditor('editor'); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | TGoodsInfoDlg.editor = UE.getEditor('editor'); |
| | | TGoodsInfoDlg.editor1 = UE.getEditor('editor1'); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | TGoodsInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){ |
| | | if(data!=null){ |
| | |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TGoodsInfoDlg.storeChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/storeChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择门店</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#storeId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TGoodsInfoDlg.packageChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/packageChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择课包</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#coursePackageId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TGoodsInfoDlg.timeChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/timeChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择课时数</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.classHours+"</option>"; |
| | | }); |
| | | $("#coursePackageConfigId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | TGoodsInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.brandChange = function (e) { |
| | | TGoodsInfoDlg.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | if(data!=null){ |
| | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | TGoodsInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | TGoodsInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | |
| | | {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '使用状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "未使用", 2: "待核销"}[value] |
| | | return {1: "未使用", 2: "已核销"}[value] |
| | | } |
| | | }, |
| | | ]; |
| | |
| | | * @constructor |
| | | */ |
| | | TPayInfo.WriteOff = function (){ |
| | | if (this.check()) { |
| | | if (TPayInfo.check()) { |
| | | if (TPayInfo.seItem.status === 2){ |
| | | return Feng.error("重复核销!"); |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/write_off", function (data) { |
| | | Feng.success("核销成功!"); |
| | | TPayInfo.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("核销失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.set("id",TPayInfo.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | } |