店铺二维码海报及商铺支持管理员配置功能

This commit is contained in:
chenbo 2020-12-02 14:58:51 +08:00
parent b50c1fbb6b
commit 3ab6c71811
43 changed files with 1318 additions and 139 deletions

5
.gitignore vendored
View File

@ -1 +1,6 @@
/.idea/
/dts-admin-api/dts-admin-api.iml
/dts-core/dts-core.iml
/dts-dao/dts-dao.iml
/dts-wx-api/dts-wx-api.iml
/logs/

View File

@ -6,7 +6,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication(scanBasePackages = { "com.qiguliuxing.dts.db", "com.qiguliuxing.dts.core","com.qiguliuxing.dts.admin" })
@SpringBootApplication(scanBasePackages = { "com.qiguliuxing.dts.db", "com.qiguliuxing.dts.core",
"com.qiguliuxing.dts.admin" })
@MapperScan({ "com.qiguliuxing.dts.db.dao", "com.qiguliuxing.dts.db.dao.ex" })
@EnableTransactionManagement
@EnableScheduling

View File

@ -0,0 +1,73 @@
package com.qiguliuxing.dts.admin.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qiguliuxing.dts.admin.util.CatVo;
import com.qiguliuxing.dts.core.util.ResponseUtil;
import com.qiguliuxing.dts.db.domain.DtsAdmin;
import com.qiguliuxing.dts.db.domain.DtsCategory;
import com.qiguliuxing.dts.db.service.DtsAdminService;
import com.qiguliuxing.dts.db.service.DtsCategoryService;
@Service
public class AdminBrandService {
private static final Logger logger = LoggerFactory.getLogger(AdminBrandService.class);
@Autowired
private DtsCategoryService categoryService;
@Autowired
private DtsAdminService adminService;
/**
* 获取分类和管理用户
* @return
*/
public Object catAndAdmin() {
List<DtsCategory> l1CatList = categoryService.queryL1();
List<CatVo> categoryList = new ArrayList<CatVo>(l1CatList == null ? 0 : l1CatList.size());
for (DtsCategory l1 : l1CatList) {
CatVo l1CatVo = new CatVo();
l1CatVo.setValue(l1.getId());
l1CatVo.setLabel(l1.getName());
List<DtsCategory> l2CatList = categoryService.queryByPid(l1.getId());
List<CatVo> children = new ArrayList<CatVo>(l2CatList == null ? 0 : l2CatList.size());
for (DtsCategory l2 : l2CatList) {
CatVo l2CatVo = new CatVo();
l2CatVo.setValue(l2.getId());
l2CatVo.setLabel(l2.getName());
children.add(l2CatVo);
}
l1CatVo.setChildren(children);
categoryList.add(l1CatVo);
}
//系统用户
List<DtsAdmin> list = adminService.allAdmin();
List<Map<String, Object>> adminList = new ArrayList<Map<String, Object>>(list == null ? 0 : list.size());
for (DtsAdmin admin : list) {
Map<String, Object> b = new HashMap<>(2);
b.put("value", admin.getId());
b.put("label", admin.getUsername());
adminList.add(b);
}
Map<String, Object> data = new HashMap<>();
data.put("categoryList", categoryList);
data.put("adminList", adminList);
logger.info("品牌入驻获取的总一级目录数:{},总会员数:{}",categoryList.size(),adminList.size());
return ResponseUtil.ok(data);
}
}

View File

@ -281,7 +281,7 @@ public class AdminGoodsService {
return ResponseUtil.ok();
}
public Object list2() {
public Object catAndBrand() {
// http://element-cn.eleme.io/#/zh-CN/component/cascader
// 管理员设置所属分类
List<DtsCategory> l1CatList = categoryService.queryL1();
@ -304,11 +304,8 @@ public class AdminGoodsService {
categoryList.add(l1CatVo);
}
// http://element-cn.eleme.io/#/zh-CN/component/select
// 管理员设置所属品牌商
List<DtsBrand> list = brandService.all();
List<Map<String, Object>> brandList = new ArrayList<>(l1CatList.size());
List<Map<String, Object>> brandList = new ArrayList<>(list.size());
for (DtsBrand brand : list) {
Map<String, Object> b = new HashMap<>(2);
b.put("value", brand.getId());
@ -328,6 +325,7 @@ public class AdminGoodsService {
List<DtsGoodsSpecification> specifications = specificationService.queryByGid(id);
List<DtsGoodsAttribute> attributes = attributeService.queryByGid(id);
//用于展示商品归属的类目页面级联下拉控件数据展示
Integer categoryId = goods.getCategoryId();
DtsCategory category = categoryService.findById(categoryId);
Integer[] categoryIds = new Integer[] {};

View File

@ -6,6 +6,7 @@ import static com.qiguliuxing.dts.admin.util.AdminResponseCode.ORDER_REPLY_EXIST
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -21,6 +22,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
import com.github.pagehelper.PageInfo;
import com.qiguliuxing.dts.admin.util.AdminResponseUtil;
import com.qiguliuxing.dts.core.express.ExpressService;
import com.qiguliuxing.dts.core.notify.NotifyService;
import com.qiguliuxing.dts.core.notify.NotifyType;
import com.qiguliuxing.dts.core.util.JacksonUtil;
@ -50,6 +52,8 @@ public class AdminOrderService {
private DtsUserService userService;
@Autowired
private DtsCommentService commentService;
@Autowired
private ExpressService expressService;
/*
* @Autowired private WxPayService wxPayService;
*/
@ -248,4 +252,24 @@ public class AdminOrderService {
return ResponseUtil.ok();
}
/**
* 快递公司列表
* @return
*/
public Object listShipChannel() {
List<Map<String, String>> vendorMaps = expressService.getAllVendor();
List<Map<String, Object>> shipChannelList = new ArrayList<Map<String, Object>>(vendorMaps == null ? 0 : vendorMaps.size());
for (Map<String, String> map : vendorMaps) {
Map<String, Object> b = new HashMap<>(2);
b.put("value", map.get("code"));
b.put("label", map.get("name"));
shipChannelList.add(b);
}
Map<String, Object> data = new HashMap<>();
data.put("shipChannelList", shipChannelList);
logger.info("获取已配置的快递公司总数:{}",shipChannelList.size());
return ResponseUtil.ok(data);
}
}

View File

@ -0,0 +1,23 @@
package com.qiguliuxing.dts.admin.util;
import java.io.Serializable;
import com.qiguliuxing.dts.db.domain.DtsBrand;
public class DtsBrandVo extends DtsBrand implements Serializable{
private static final long serialVersionUID = 6530090986580196500L;
private Integer[] categoryIds;
public Integer[] getCategoryIds() {
return categoryIds;
}
public void setCategoryIds(Integer[] categoryIds) {
this.categoryIds = categoryIds;
}
}

View File

@ -1,6 +1,7 @@
package com.qiguliuxing.dts.admin.web;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -10,6 +11,7 @@ import javax.validation.constraints.NotNull;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
@ -23,11 +25,16 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
import com.qiguliuxing.dts.admin.service.AdminBrandService;
import com.qiguliuxing.dts.admin.util.DtsBrandVo;
import com.qiguliuxing.dts.core.qcode.QCodeService;
import com.qiguliuxing.dts.core.util.ResponseUtil;
import com.qiguliuxing.dts.core.validator.Order;
import com.qiguliuxing.dts.core.validator.Sort;
import com.qiguliuxing.dts.db.domain.DtsBrand;
import com.qiguliuxing.dts.db.domain.DtsCategory;
import com.qiguliuxing.dts.db.service.DtsBrandService;
import com.qiguliuxing.dts.db.service.DtsCategoryService;
@RestController
@RequestMapping("/admin/brand")
@ -37,6 +44,15 @@ public class AdminBrandController {
@Autowired
private DtsBrandService brandService;
@Autowired
private DtsCategoryService categoryService;
@Autowired
private AdminBrandService adminBrandService;
@Autowired
private QCodeService qCodeService;
@RequiresPermissions("admin:brand:list")
@RequiresPermissionsDesc(menu = { "商场管理", "品牌管理" }, button = "查询")
@ -50,8 +66,25 @@ public class AdminBrandController {
List<DtsBrand> brandList = brandService.querySelective(id, name, page, limit, sort, order);
long total = PageInfo.of(brandList).getTotal();
Map<String, Object> data = new HashMap<>();
List<DtsBrandVo> brandVoList = new ArrayList<DtsBrandVo> (brandList == null ? 0 : brandList.size());
for(DtsBrand brand : brandList) {
DtsBrandVo brandVo = new DtsBrandVo();
BeanUtils.copyProperties(brand, brandVo);//对象属性的复制
// 用于展示商品归属的类目页面级联下拉控件数据展示
Integer categoryId = brand.getDefaultCategoryId();
DtsCategory category = categoryService.findById(categoryId);
Integer[] categoryIds = new Integer[] {};
if (category != null) {
Integer parentCategoryId = category.getPid();
categoryIds = new Integer[] { parentCategoryId, categoryId };
brandVo.setCategoryIds(categoryIds);
}
brandVoList.add(brandVo);
}
data.put("total", total);
data.put("items", brandList);
data.put("items", brandVoList);
logger.info("【请求结束】商场管理->品牌管理->查询:total:{}", total);
return ResponseUtil.ok(data);
@ -84,6 +117,17 @@ public class AdminBrandController {
if (error != null) {
return error;
}
try {
//生成店铺的分享URL
String defaultCategory = brandService.getBrandCategory(brand.getDefaultCategoryId());
String shareUrl = qCodeService.createBrandImage(brand.getId(), brand.getPicUrl(), brand.getName(),defaultCategory);
brand.setShareUrl(shareUrl);
} catch (Exception e) {
logger.error("生成品牌商铺分享图URL出错{}",e.getMessage());
e.printStackTrace();
}
brandService.add(brand);
logger.info("【请求结束】商场管理->品牌管理->添加:响应结果:{}", JSONObject.toJSONString(brand));
return ResponseUtil.ok(brand);
@ -111,6 +155,15 @@ public class AdminBrandController {
if (error != null) {
return error;
}
try {
//生成店铺的分享URL
String defaultCategory = brandService.getBrandCategory(brand.getDefaultCategoryId());
String shareUrl = qCodeService.createBrandImage(brand.getId(), brand.getPicUrl(), brand.getName(),defaultCategory);
brand.setShareUrl(shareUrl);
} catch (Exception e) {
logger.error("生成品牌商铺分享图URL出错{}",e.getMessage());
e.printStackTrace();
}
if (brandService.updateById(brand) == 0) {
logger.error("商场管理->品牌管理->编辑 失败,更新数据失败!");
return ResponseUtil.updatedDataFailed();
@ -135,5 +188,12 @@ public class AdminBrandController {
logger.info("【请求结束】商场管理->品牌管理->删除,响应结果:{}", "成功!");
return ResponseUtil.ok();
}
@GetMapping("/catAndAdmin")
public Object catAndAdmin() {
logger.info("【请求开始】商场管理->品牌管理->获取目录与管理用户");
return adminBrandService.catAndAdmin();
}
}

View File

@ -0,0 +1,60 @@
package com.qiguliuxing.dts.admin.web;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.github.pagehelper.PageInfo;
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
import com.qiguliuxing.dts.core.util.ResponseUtil;
import com.qiguliuxing.dts.core.validator.Order;
import com.qiguliuxing.dts.core.validator.Sort;
import com.qiguliuxing.dts.db.domain.DtsAccountTrace;
import com.qiguliuxing.dts.db.service.DtsAccountService;
/**
* 佣金业务接口
*
* @since 1.0.0
* @author CHENBO
* @QQ 623659388
*/
@RestController
@RequestMapping("/admin/brokerage")
@Validated
public class AdminBrokerageController {
private static final Logger logger = LoggerFactory.getLogger(AdminBrokerageController.class);
@Autowired
private DtsAccountService accountService;
@RequiresPermissions("admin:brokerage:list")
@RequiresPermissionsDesc(menu = { "用户管理", "佣金管理" }, button = "查询")
@GetMapping("/list")
public Object list(String username, String mobile,String type,@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "trace_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) {
logger.info("【请求开始】用户管理->佣金管理->查询,请求参数,username:{},mobile:{},type:{},page:{}", username, mobile, type,page);
List<DtsAccountTrace> traceList = accountService.querySelective(username, mobile, type, page, limit, sort, order);
long total = PageInfo.of(traceList).getTotal();
Map<String, Object> data = new HashMap<>();
data.put("total", total);
data.put("traceList", traceList);
logger.info("【请求结束】用户管理->佣金管理->查询:记录数:{}", traceList == null ? 0 : traceList.size());
return ResponseUtil.ok(data);
}
}

View File

@ -55,8 +55,8 @@ public class AdminGoodsController {
}
@GetMapping("/catAndBrand")
public Object list2() {
return adminGoodsService.list2();
public Object catAndBrand() {
return adminGoodsService.catAndBrand();
}
/**

View File

@ -63,7 +63,7 @@ public class AdminGrouponController {
Map<String, Object> RecordData = new HashMap<>();
List<DtsGroupon> subGrouponList = grouponService.queryJoinRecord(groupon.getId());
DtsGrouponRules rules = rulesService.queryById(groupon.getRulesId());
DtsGoods goods = goodsService.findById(rules.getGoodsId());
DtsGoods goods = goodsService.findById(rules.getGoodsId().intValue());
RecordData.put("groupon", groupon);
RecordData.put("subGroupons", subGrouponList);
@ -104,7 +104,7 @@ public class AdminGrouponController {
}
private Object validate(DtsGrouponRules grouponRules) {
Integer goodsId = grouponRules.getGoodsId();
Long goodsId = grouponRules.getGoodsId();
if (goodsId == null) {
return ResponseUtil.badArgument();
}
@ -135,7 +135,7 @@ public class AdminGrouponController {
return error;
}
Integer goodsId = grouponRules.getGoodsId();
Integer goodsId = grouponRules.getGoodsId().intValue();
DtsGoods goods = goodsService.findById(goodsId);
if (goods == null) {
return ResponseUtil.badArgumentValue();
@ -163,13 +163,24 @@ public class AdminGrouponController {
if (error != null) {
return error;
}
Integer goodsId = grouponRules.getGoodsId();
DtsGoods goods = goodsService.findById(goodsId);
Long goodsId = grouponRules.getGoodsId();
DtsGoods goods = null;
/**
* 如果输入的值为INT范围内则先用goodsId找,如果超出范围
* 如果未找到则转换为goodsSn找再找商品
*/
if ( goodsId.intValue() < Integer.MAX_VALUE) {
goods = goodsService.findById(goodsId.intValue());
}
if (goods == null) {
goods = goodsService.findByGoodsSn(goodsId.toString());
}
if (goods == null) {
return ResponseUtil.badArgumentValue();
}
grouponRules.setGoodsId(goods.getId().longValue());//最终存库只存商品id
grouponRules.setGoodsName(goods.getName());
grouponRules.setPicUrl(goods.getPicUrl());

View File

@ -114,4 +114,18 @@ public class AdminOrderController {
return adminOrderService.reply(body);
}
/**
* 回复订单商品
*
* @param body 订单信息{ orderIdxxx }
* @return 订单操作结果
*/
@RequiresPermissions("admin:order:list")
@RequiresPermissionsDesc(menu = { "商场管理", "订单管理" }, button = "查询")
@GetMapping("/listShipChannel")
public Object listShipChannel() {
logger.info("【请求开始】商场管理->订单管理->快递信息加载");
return adminOrderService.listShipChannel();
}
}

View File

@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
import com.qiguliuxing.dts.core.qcode.QCodeService;
import com.qiguliuxing.dts.core.util.ResponseUtil;
import com.qiguliuxing.dts.core.validator.Order;
import com.qiguliuxing.dts.core.validator.Sort;
@ -38,6 +39,9 @@ public class AdminTopicController {
@Autowired
private DtsTopicService topicService;
@Autowired
private QCodeService qCodeService;
@RequiresPermissions("admin:topic:list")
@RequiresPermissionsDesc(menu = { "推广管理", "专题管理" }, button = "查询")
@GetMapping("/list")
@ -83,6 +87,15 @@ public class AdminTopicController {
if (error != null) {
return error;
}
try {
//生成主题的分享URL
String shareUrl = qCodeService.createShareTopicImage(topic.getId(), topic.getPicUrl(), topic.getSubtitle(),topic.getPrice());
topic.setShareUrl(shareUrl);
} catch (Exception e) {
logger.error("专题生成分享图URL出错{}",e.getMessage());
e.printStackTrace();
}
topicService.add(topic);
logger.info("【请求结束】推广管理->专题管理->添加:响应结果:{}", JSONObject.toJSONString(topic));
@ -111,6 +124,15 @@ public class AdminTopicController {
if (error != null) {
return error;
}
try {
//生成主题的分享URL
String shareUrl = qCodeService.createShareTopicImage(topic.getId(), topic.getPicUrl(), topic.getSubtitle(),topic.getPrice());
topic.setShareUrl(shareUrl);
} catch (Exception e) {
logger.error("专题生成分享图URL出错{}",e.getMessage());
e.printStackTrace();
}
if (topicService.updateById(topic) == 0) {
logger.error("推广管理->专题管理->编辑 错误:{}", "更新数据失败!");
return ResponseUtil.updatedDataFailed();

View File

@ -3,6 +3,7 @@ package com.qiguliuxing.dts.core.express;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.util.Base64Utils;
@ -30,6 +31,16 @@ public class ExpressService {
public void setProperties(ExpressProperties properties) {
this.properties = properties;
}
/**
* 获取所有物流供应商信息
*
* @param vendorCode
* @return
*/
public List<Map<String, String>> getAllVendor() {
return properties.getVendors();
}
/**
* 获取物流供应商名

View File

@ -100,9 +100,6 @@ public class QCodeService {
return "";
}
private String getKeyName(String goodId) {
return "GOOD_QCODE_" + goodId + ".jpg";
}
/**
* 将商品图片商品名字画到模版图中
@ -129,7 +126,6 @@ public class QCodeService {
BufferedImage qrCodeImage = ImageIO.read(qrCodeImg);
// --- 画图 ---
// 底层空白 bufferedImage
BufferedImage baseImage = new BufferedImage(red.getWidth(), red.getHeight(), BufferedImage.TYPE_4BYTE_ABGR_PRE);
@ -251,9 +247,17 @@ public class QCodeService {
e.printStackTrace();
}
return url;
}
/**
* 分享商品二维码图片在OSS上面的名称
* @param goodId
* @return
*/
private String getKeyName(String goodId) {
return "GOOD_QCODE_" + goodId + ".jpg";
}
/**
* 分享代理用户二维码图片在OSS上面的名称
* @param userId
@ -262,4 +266,170 @@ public class QCodeService {
private String getShareUserKey(Integer userId) {
return "USER_QCODE_" + userId + ".jpg";
}
/**
* 分享代理用户二维码图片在OSS上面的名称
* @param topicId
* @return
*/
private String getTopicKey(Integer topicId) {
return "TOPIC_QCODE_" + topicId + ".jpg";
}
private String getBrandKey(Integer brandId) {
return "BRAND_QCODE_" + brandId + ".jpg";
}
/**
* 活动主题的二维码图片生成
* @param string
* @param picUrl
* @param subtitle
* @param price
* @return
*/
public String createShareTopicImage(Integer topicId, String picUrl, String subtitle, BigDecimal price) {
if (!SystemConfig.isAutoCreateShareImage())
return "";
try {
// 创建该商品的二维码
File file = wxMaService.getQrcodeService().createWxaCodeUnlimit("topic," + topicId, "pages/index/index");
FileInputStream inputStream = new FileInputStream(file);
// 将商品图片商品名字,商城名字画到模版图中
byte[] imageData = drawTopicPicture(inputStream, picUrl,subtitle,price);
ByteArrayInputStream inputStream2 = new ByteArrayInputStream(imageData);
// 存储分享图
String url = storageService.store(inputStream2, imageData.length, "image/jpeg", getTopicKey(topicId));
logger.info("创建活动主题分享图 URL:{}",url);
return url;
} catch (WxErrorException e) {
logger.error("创建活动主题分享二维码 错误:{}",e.getMessage());
e.printStackTrace();
} catch (Exception e) {
logger.error("创建活动主题分享二维码 错误:{}",e.getMessage());
e.printStackTrace();
}
return "";
}
private byte[] drawTopicPicture(FileInputStream qrCodeImg, String picUrl, String subtitle, BigDecimal price) throws IOException {
// 底图
ClassPathResource redResource = new ClassPathResource("back.png");
BufferedImage red = ImageIO.read(redResource.getInputStream());
// 商品图片
URL goodPic = new URL(picUrl);
BufferedImage goodImage = ImageIO.read(goodPic);
// 小程序二维码
BufferedImage qrCodeImage = ImageIO.read(qrCodeImg);
// --- 画图 ---
// 底层空白 bufferedImage
BufferedImage baseImage = new BufferedImage(red.getWidth(), red.getHeight(), BufferedImage.TYPE_4BYTE_ABGR_PRE);
// 画上图片
drawImgInImg(baseImage, red, 0, 0, red.getWidth(), red.getHeight());
// 画上商品图片
drawImgInImg(baseImage, goodImage, 71, 69, 660, 660);
// 画上小程序二维码
drawImgInImg(baseImage, qrCodeImage, 448, 767, 300, 300);
// 写上商品名称,截取前面的12个字符长度
if (subtitle.length() > 12) {
subtitle = subtitle.substring(0, 12) + "...";
}
Color colorComm = new Color(60, 60, 60);
drawTextInImg(baseImage, subtitle, 65, 867, colorComm, 28);
Color priceColor = new Color(240, 20, 20);
drawTextInImg(baseImage, "活动价 ", 65, 787, colorComm, 24);
drawTextInImg(baseImage, "", 140, 787, priceColor, 24);
drawTextInImg(baseImage, price.toString(), 165, 787, priceColor, 34);
drawTextInImg(baseImage, "", 295, 787, colorComm, 24);
// 转JPG
BufferedImage result = new BufferedImage(baseImage.getWidth(), baseImage.getHeight(),
BufferedImage.TYPE_3BYTE_BGR);
result.getGraphics().drawImage(baseImage, 0, 0, null);
ByteArrayOutputStream bs = new ByteArrayOutputStream();
ImageIO.write(result, "jpg", bs);
// 最终byte数组
return bs.toByteArray();
}
public String createBrandImage(Integer brandId, String picUrl, String name, String defaultCategory) {
if (!SystemConfig.isAutoCreateShareImage())
return "";
try {
// 创建该商品的二维码
File file = wxMaService.getQrcodeService().createWxaCodeUnlimit("brand," + brandId, "pages/index/index");
FileInputStream inputStream = new FileInputStream(file);
// 将商品图片商品名字,商城名字画到模版图中
byte[] imageData = drawBrandPicture(inputStream, picUrl,name,defaultCategory);
ByteArrayInputStream inputStream2 = new ByteArrayInputStream(imageData);
// 存储分享图
String url = storageService.store(inputStream2, imageData.length, "image/jpeg", getBrandKey(brandId));
logger.info("创建品牌商铺主题分享图 URL:{}",url);
return url;
} catch (WxErrorException e) {
logger.error("创建品牌商铺分享二维码 错误:{}",e.getMessage());
e.printStackTrace();
} catch (Exception e) {
logger.error("创建品牌商铺分享二维码 错误:{}",e.getMessage());
e.printStackTrace();
}
return "";
}
private byte[] drawBrandPicture(FileInputStream qrCodeImg, String picUrl, String name, String defaultCategory) throws IOException {
// 底图
ClassPathResource redResource = new ClassPathResource("back.png");
BufferedImage red = ImageIO.read(redResource.getInputStream());
// 商品图片
URL goodPic = new URL(picUrl);
BufferedImage goodImage = ImageIO.read(goodPic);
// 小程序二维码
BufferedImage qrCodeImage = ImageIO.read(qrCodeImg);
// --- 画图 ---
// 底层空白 bufferedImage
BufferedImage baseImage = new BufferedImage(red.getWidth(), red.getHeight(), BufferedImage.TYPE_4BYTE_ABGR_PRE);
// 画上图片
drawImgInImg(baseImage, red, 0, 0, red.getWidth(), red.getHeight());
// 画上商品图片
drawImgInImg(baseImage, goodImage, 71, 69, 660, 660);
// 画上小程序二维码
drawImgInImg(baseImage, qrCodeImage, 448, 767, 300, 300);
// 写上商品名称,截取前面的12个字符长度
if (name.length() > 12) {
name = name.substring(0, 12) + "...";
}
Color colorComm = new Color(60, 60, 60);
drawTextInImg(baseImage, name, 65, 867, colorComm, 28);
Color priceColor = new Color(240, 20, 20);
drawTextInImg(baseImage, "主营【 "+defaultCategory+"】 等商品类目", 65, 787, priceColor, 24);
// 转JPG
BufferedImage result = new BufferedImage(baseImage.getWidth(), baseImage.getHeight(),
BufferedImage.TYPE_3BYTE_BGR);
result.getGraphics().drawImage(baseImage, 0, 0, null);
ByteArrayOutputStream bs = new ByteArrayOutputStream();
ImageIO.write(result, "jpg", bs);
// 最终byte数组
return bs.toByteArray();
}
}

View File

@ -0,0 +1,48 @@
package com.qiguliuxing.dts.core.type;
/**
* 佣金类型的枚举类
*
* @author CHENBO
* @QQ 623659388
* @since 1.0.0
*/
public enum BrokerageTypeEnum {
SYS_APPLY((byte) 0, "系统结算自动申请"), USER_APPLY((byte) 1, "用户手工申请"), APPLY_FINISH((byte) 2, "审批通过或完成"), APPLY_FAIL((byte) 2, "审批不通过");
private Byte type;
private String desc;
private BrokerageTypeEnum(Byte type, String desc) {
this.type = type;
this.desc = desc;
}
public static BrokerageTypeEnum getInstance(Byte type2) {
if (type2 != null) {
for (BrokerageTypeEnum tmp : BrokerageTypeEnum.values()) {
if (tmp.type.intValue() == type2.intValue()) {
return tmp;
}
}
}
return null;
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

View File

@ -0,0 +1,15 @@
package com.qiguliuxing.dts.dao.app;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication(scanBasePackages = { "com.qiguliuxing.dts.db" })
@MapperScan("com.qiguliuxing.dts.db.dao")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

View File

@ -113,6 +113,24 @@ public class DtsAdmin {
*/
private Integer[] roleIds;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dts_admin.desc
*
* @mbg.generated
*/
private String desc;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dts_admin.tel
*
* @mbg.generated
*/
private String tel;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dts_admin.id
@ -353,6 +371,54 @@ public class DtsAdmin {
this.roleIds = roleIds;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dts_admin.desc
*
* @return the value of dts_admin.desc
*
* @mbg.generated
*/
public String getDesc() {
return desc;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dts_admin.desc
*
* @param desc the value for dts_admin.desc
*
* @mbg.generated
*/
public void setDesc(String desc) {
this.desc = desc;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dts_admin.tel
*
* @return the value of dts_admin.tel
*
* @mbg.generated
*/
public String getTel() {
return tel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dts_admin.tel
*
* @param tel the value for dts_admin.tel
*
* @mbg.generated
*/
public void setTel(String tel) {
this.tel = tel;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
@ -375,6 +441,8 @@ public class DtsAdmin {
sb.append(", updateTime=").append(updateTime);
sb.append(", deleted=").append(deleted);
sb.append(", roleIds=").append(roleIds);
sb.append(", desc=").append(desc);
sb.append(", tel=").append(tel);
sb.append("]");
return sb.toString();
}
@ -406,7 +474,9 @@ public class DtsAdmin {
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
&& (Arrays.equals(this.getRoleIds(), other.getRoleIds()));
&& (Arrays.equals(this.getRoleIds(), other.getRoleIds()))
&& (this.getDesc() == null ? other.getDesc() == null : this.getDesc().equals(other.getDesc()))
&& (this.getTel() == null ? other.getTel() == null : this.getTel().equals(other.getTel()));
}
/**
@ -429,6 +499,8 @@ public class DtsAdmin {
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
result = prime * result + (Arrays.hashCode(getRoleIds()));
result = prime * result + ((getDesc() == null) ? 0 : getDesc().hashCode());
result = prime * result + ((getTel() == null) ? 0 : getTel().hashCode());
return result;
}
@ -460,7 +532,9 @@ public class DtsAdmin {
addTime("add_time", "addTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
deleted("deleted", "deleted", "BIT", false),
roleIds("role_ids", "roleIds", "VARCHAR", false);
roleIds("role_ids", "roleIds", "VARCHAR", false),
desc("desc", "desc", "VARCHAR", true),
tel("tel", "tel", "VARCHAR", false);
/**
* This field was generated by MyBatis Generator.

View File

@ -1641,6 +1641,290 @@ public class DtsAdminExample {
addRoleIdsCriterion("role_ids not between", value1, value2, "roleIds");
return (Criteria) this;
}
public Criteria andDescIsNull() {
addCriterion("`desc` is null");
return (Criteria) this;
}
public Criteria andDescIsNotNull() {
addCriterion("`desc` is not null");
return (Criteria) this;
}
public Criteria andDescEqualTo(String value) {
addCriterion("`desc` =", value, "desc");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDescEqualToColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("`desc` = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDescNotEqualTo(String value) {
addCriterion("`desc` <>", value, "desc");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDescNotEqualToColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("`desc` <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDescGreaterThan(String value) {
addCriterion("`desc` >", value, "desc");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDescGreaterThanColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("`desc` > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDescGreaterThanOrEqualTo(String value) {
addCriterion("`desc` >=", value, "desc");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDescGreaterThanOrEqualToColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("`desc` >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDescLessThan(String value) {
addCriterion("`desc` <", value, "desc");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDescLessThanColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("`desc` < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDescLessThanOrEqualTo(String value) {
addCriterion("`desc` <=", value, "desc");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDescLessThanOrEqualToColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("`desc` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDescLike(String value) {
addCriterion("`desc` like", value, "desc");
return (Criteria) this;
}
public Criteria andDescNotLike(String value) {
addCriterion("`desc` not like", value, "desc");
return (Criteria) this;
}
public Criteria andDescIn(List<String> values) {
addCriterion("`desc` in", values, "desc");
return (Criteria) this;
}
public Criteria andDescNotIn(List<String> values) {
addCriterion("`desc` not in", values, "desc");
return (Criteria) this;
}
public Criteria andDescBetween(String value1, String value2) {
addCriterion("`desc` between", value1, value2, "desc");
return (Criteria) this;
}
public Criteria andDescNotBetween(String value1, String value2) {
addCriterion("`desc` not between", value1, value2, "desc");
return (Criteria) this;
}
public Criteria andTelIsNull() {
addCriterion("tel is null");
return (Criteria) this;
}
public Criteria andTelIsNotNull() {
addCriterion("tel is not null");
return (Criteria) this;
}
public Criteria andTelEqualTo(String value) {
addCriterion("tel =", value, "tel");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTelEqualToColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("tel = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTelNotEqualTo(String value) {
addCriterion("tel <>", value, "tel");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTelNotEqualToColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("tel <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTelGreaterThan(String value) {
addCriterion("tel >", value, "tel");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTelGreaterThanColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("tel > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTelGreaterThanOrEqualTo(String value) {
addCriterion("tel >=", value, "tel");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTelGreaterThanOrEqualToColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("tel >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTelLessThan(String value) {
addCriterion("tel <", value, "tel");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTelLessThanColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("tel < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTelLessThanOrEqualTo(String value) {
addCriterion("tel <=", value, "tel");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTelLessThanOrEqualToColumn(DtsAdmin.Column column) {
addCriterion(new StringBuilder("tel <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTelLike(String value) {
addCriterion("tel like", value, "tel");
return (Criteria) this;
}
public Criteria andTelNotLike(String value) {
addCriterion("tel not like", value, "tel");
return (Criteria) this;
}
public Criteria andTelIn(List<String> values) {
addCriterion("tel in", values, "tel");
return (Criteria) this;
}
public Criteria andTelNotIn(List<String> values) {
addCriterion("tel not in", values, "tel");
return (Criteria) this;
}
public Criteria andTelBetween(String value1, String value2) {
addCriterion("tel between", value1, value2, "tel");
return (Criteria) this;
}
public Criteria andTelNotBetween(String value1, String value2) {
addCriterion("tel not between", value1, value2, "tel");
return (Criteria) this;
}
}
/**

View File

@ -105,6 +105,15 @@ public class DtsBrand {
*/
private String shareUrl;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dts_brand.admin_id
*
* @mbg.generated
*/
private Integer adminId;
/**
*
* This field was generated by MyBatis Generator.
@ -384,6 +393,30 @@ public class DtsBrand {
this.shareUrl = shareUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dts_brand.admin_id
*
* @return the value of dts_brand.admin_id
*
* @mbg.generated
*/
public Integer getAdminId() {
return adminId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dts_brand.admin_id
*
* @param adminId the value for dts_brand.admin_id
*
* @mbg.generated
*/
public void setAdminId(Integer adminId) {
this.adminId = adminId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dts_brand.deleted
@ -573,6 +606,7 @@ public class DtsBrand {
sb.append(", addTime=").append(addTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", shareUrl=").append(shareUrl);
sb.append(", adminId=").append(adminId);
sb.append(", deleted=").append(deleted);
sb.append(", commpany=").append(commpany);
sb.append(", autoUpdateGood=").append(autoUpdateGood);
@ -611,6 +645,7 @@ public class DtsBrand {
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getShareUrl() == null ? other.getShareUrl() == null : this.getShareUrl().equals(other.getShareUrl()))
&& (this.getAdminId() == null ? other.getAdminId() == null : this.getAdminId().equals(other.getAdminId()))
&& (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
&& (this.getCommpany() == null ? other.getCommpany() == null : this.getCommpany().equals(other.getCommpany()))
&& (this.getAutoUpdateGood() == null ? other.getAutoUpdateGood() == null : this.getAutoUpdateGood().equals(other.getAutoUpdateGood()))
@ -639,6 +674,7 @@ public class DtsBrand {
result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getShareUrl() == null) ? 0 : getShareUrl().hashCode());
result = prime * result + ((getAdminId() == null) ? 0 : getAdminId().hashCode());
result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
result = prime * result + ((getCommpany() == null) ? 0 : getCommpany().hashCode());
result = prime * result + ((getAutoUpdateGood() == null) ? 0 : getAutoUpdateGood().hashCode());
@ -677,6 +713,7 @@ public class DtsBrand {
addTime("add_time", "addTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
shareUrl("share_url", "shareUrl", "VARCHAR", false),
adminId("admin_id", "adminId", "INTEGER", false),
deleted("deleted", "deleted", "BIT", false),
commpany("commpany", "commpany", "VARCHAR", false),
autoUpdateGood("auto_update_good", "autoUpdateGood", "BIT", false),

View File

@ -1467,6 +1467,138 @@ public class DtsBrandExample {
return (Criteria) this;
}
public Criteria andAdminIdIsNull() {
addCriterion("admin_id is null");
return (Criteria) this;
}
public Criteria andAdminIdIsNotNull() {
addCriterion("admin_id is not null");
return (Criteria) this;
}
public Criteria andAdminIdEqualTo(Integer value) {
addCriterion("admin_id =", value, "adminId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_brand
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAdminIdEqualToColumn(DtsBrand.Column column) {
addCriterion(new StringBuilder("admin_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAdminIdNotEqualTo(Integer value) {
addCriterion("admin_id <>", value, "adminId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_brand
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAdminIdNotEqualToColumn(DtsBrand.Column column) {
addCriterion(new StringBuilder("admin_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAdminIdGreaterThan(Integer value) {
addCriterion("admin_id >", value, "adminId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_brand
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAdminIdGreaterThanColumn(DtsBrand.Column column) {
addCriterion(new StringBuilder("admin_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAdminIdGreaterThanOrEqualTo(Integer value) {
addCriterion("admin_id >=", value, "adminId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_brand
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAdminIdGreaterThanOrEqualToColumn(DtsBrand.Column column) {
addCriterion(new StringBuilder("admin_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAdminIdLessThan(Integer value) {
addCriterion("admin_id <", value, "adminId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_brand
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAdminIdLessThanColumn(DtsBrand.Column column) {
addCriterion(new StringBuilder("admin_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAdminIdLessThanOrEqualTo(Integer value) {
addCriterion("admin_id <=", value, "adminId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_brand
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAdminIdLessThanOrEqualToColumn(DtsBrand.Column column) {
addCriterion(new StringBuilder("admin_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAdminIdIn(List<Integer> values) {
addCriterion("admin_id in", values, "adminId");
return (Criteria) this;
}
public Criteria andAdminIdNotIn(List<Integer> values) {
addCriterion("admin_id not in", values, "adminId");
return (Criteria) this;
}
public Criteria andAdminIdBetween(Integer value1, Integer value2) {
addCriterion("admin_id between", value1, value2, "adminId");
return (Criteria) this;
}
public Criteria andAdminIdNotBetween(Integer value1, Integer value2) {
addCriterion("admin_id not between", value1, value2, "adminId");
return (Criteria) this;
}
public Criteria andDeletedIsNull() {
addCriterion("deleted is null");
return (Criteria) this;

View File

@ -40,7 +40,7 @@ public class DtsGrouponRules {
*
* @mbg.generated
*/
private Integer goodsId;
private Long goodsId;
/**
*
@ -146,7 +146,7 @@ public class DtsGrouponRules {
*
* @mbg.generated
*/
public Integer getGoodsId() {
public Long getGoodsId() {
return goodsId;
}
@ -158,7 +158,7 @@ public class DtsGrouponRules {
*
* @mbg.generated
*/
public void setGoodsId(Integer goodsId) {
public void setGoodsId(Long goodsId) {
this.goodsId = goodsId;
}
@ -453,7 +453,7 @@ public class DtsGrouponRules {
*/
public enum Column {
id("id", "id", "INTEGER", false),
goodsId("goods_id", "goodsId", "INTEGER", false),
goodsId("goods_id", "goodsId", "BIGINT", false),
goodsName("goods_name", "goodsName", "VARCHAR", false),
picUrl("pic_url", "picUrl", "VARCHAR", false),
discount("discount", "discount", "DECIMAL", false),

View File

@ -381,7 +381,7 @@ public class DtsGrouponRulesExample {
return (Criteria) this;
}
public Criteria andGoodsIdEqualTo(Integer value) {
public Criteria andGoodsIdEqualTo(Long value) {
addCriterion("goods_id =", value, "goodsId");
return (Criteria) this;
}
@ -398,7 +398,7 @@ public class DtsGrouponRulesExample {
return (Criteria) this;
}
public Criteria andGoodsIdNotEqualTo(Integer value) {
public Criteria andGoodsIdNotEqualTo(Long value) {
addCriterion("goods_id <>", value, "goodsId");
return (Criteria) this;
}
@ -415,7 +415,7 @@ public class DtsGrouponRulesExample {
return (Criteria) this;
}
public Criteria andGoodsIdGreaterThan(Integer value) {
public Criteria andGoodsIdGreaterThan(Long value) {
addCriterion("goods_id >", value, "goodsId");
return (Criteria) this;
}
@ -432,7 +432,7 @@ public class DtsGrouponRulesExample {
return (Criteria) this;
}
public Criteria andGoodsIdGreaterThanOrEqualTo(Integer value) {
public Criteria andGoodsIdGreaterThanOrEqualTo(Long value) {
addCriterion("goods_id >=", value, "goodsId");
return (Criteria) this;
}
@ -449,7 +449,7 @@ public class DtsGrouponRulesExample {
return (Criteria) this;
}
public Criteria andGoodsIdLessThan(Integer value) {
public Criteria andGoodsIdLessThan(Long value) {
addCriterion("goods_id <", value, "goodsId");
return (Criteria) this;
}
@ -466,7 +466,7 @@ public class DtsGrouponRulesExample {
return (Criteria) this;
}
public Criteria andGoodsIdLessThanOrEqualTo(Integer value) {
public Criteria andGoodsIdLessThanOrEqualTo(Long value) {
addCriterion("goods_id <=", value, "goodsId");
return (Criteria) this;
}
@ -483,22 +483,22 @@ public class DtsGrouponRulesExample {
return (Criteria) this;
}
public Criteria andGoodsIdIn(List<Integer> values) {
public Criteria andGoodsIdIn(List<Long> values) {
addCriterion("goods_id in", values, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotIn(List<Integer> values) {
public Criteria andGoodsIdNotIn(List<Long> values) {
addCriterion("goods_id not in", values, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdBetween(Integer value1, Integer value2) {
public Criteria andGoodsIdBetween(Long value1, Long value2) {
addCriterion("goods_id between", value1, value2, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotBetween(Integer value1, Integer value2) {
public Criteria andGoodsIdNotBetween(Long value1, Long value2) {
addCriterion("goods_id not between", value1, value2, "goodsId");
return (Criteria) this;
}

View File

@ -94,7 +94,7 @@ public class DtsTopic {
*
* @mbg.generated
*/
private Integer[] goods;
private String[] goods;
/**
*
@ -317,7 +317,7 @@ public class DtsTopic {
*
* @mbg.generated
*/
public Integer[] getGoods() {
public String[] getGoods() {
return goods;
}
@ -329,7 +329,7 @@ public class DtsTopic {
*
* @mbg.generated
*/
public void setGoods(Integer[] goods) {
public void setGoods(String[] goods) {
this.goods = goods;
}

View File

@ -219,15 +219,15 @@ public class DtsTopicExample {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
goodsCriteria.add(new Criterion(condition, value, "com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler"));
goodsCriteria.add(new Criterion(condition, value, "com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler"));
allCriteria = null;
}
protected void addGoodsCriterion(String condition, Integer[] value1, Integer[] value2, String property) {
protected void addGoodsCriterion(String condition, String[] value1, String[] value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
goodsCriteria.add(new Criterion(condition, value1, value2, "com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler"));
goodsCriteria.add(new Criterion(condition, value1, value2, "com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler"));
allCriteria = null;
}
@ -1247,7 +1247,7 @@ public class DtsTopicExample {
return (Criteria) this;
}
public Criteria andGoodsEqualTo(Integer[] value) {
public Criteria andGoodsEqualTo(String[] value) {
addGoodsCriterion("goods =", value, "goods");
return (Criteria) this;
}
@ -1264,7 +1264,7 @@ public class DtsTopicExample {
return (Criteria) this;
}
public Criteria andGoodsNotEqualTo(Integer[] value) {
public Criteria andGoodsNotEqualTo(String[] value) {
addGoodsCriterion("goods <>", value, "goods");
return (Criteria) this;
}
@ -1281,7 +1281,7 @@ public class DtsTopicExample {
return (Criteria) this;
}
public Criteria andGoodsGreaterThan(Integer[] value) {
public Criteria andGoodsGreaterThan(String[] value) {
addGoodsCriterion("goods >", value, "goods");
return (Criteria) this;
}
@ -1298,7 +1298,7 @@ public class DtsTopicExample {
return (Criteria) this;
}
public Criteria andGoodsGreaterThanOrEqualTo(Integer[] value) {
public Criteria andGoodsGreaterThanOrEqualTo(String[] value) {
addGoodsCriterion("goods >=", value, "goods");
return (Criteria) this;
}
@ -1315,7 +1315,7 @@ public class DtsTopicExample {
return (Criteria) this;
}
public Criteria andGoodsLessThan(Integer[] value) {
public Criteria andGoodsLessThan(String[] value) {
addGoodsCriterion("goods <", value, "goods");
return (Criteria) this;
}
@ -1332,7 +1332,7 @@ public class DtsTopicExample {
return (Criteria) this;
}
public Criteria andGoodsLessThanOrEqualTo(Integer[] value) {
public Criteria andGoodsLessThanOrEqualTo(String[] value) {
addGoodsCriterion("goods <=", value, "goods");
return (Criteria) this;
}
@ -1349,32 +1349,32 @@ public class DtsTopicExample {
return (Criteria) this;
}
public Criteria andGoodsLike(Integer[] value) {
public Criteria andGoodsLike(String[] value) {
addGoodsCriterion("goods like", value, "goods");
return (Criteria) this;
}
public Criteria andGoodsNotLike(Integer[] value) {
public Criteria andGoodsNotLike(String[] value) {
addGoodsCriterion("goods not like", value, "goods");
return (Criteria) this;
}
public Criteria andGoodsIn(List<Integer[]> values) {
public Criteria andGoodsIn(List<String[]> values) {
addGoodsCriterion("goods in", values, "goods");
return (Criteria) this;
}
public Criteria andGoodsNotIn(List<Integer[]> values) {
public Criteria andGoodsNotIn(List<String[]> values) {
addGoodsCriterion("goods not in", values, "goods");
return (Criteria) this;
}
public Criteria andGoodsBetween(Integer[] value1, Integer[] value2) {
public Criteria andGoodsBetween(String[] value1, String[] value2) {
addGoodsCriterion("goods between", value1, value2, "goods");
return (Criteria) this;
}
public Criteria andGoodsNotBetween(Integer[] value1, Integer[] value2) {
public Criteria andGoodsNotBetween(String[] value1, String[] value2) {
addGoodsCriterion("goods not between", value1, value2, "goods");
return (Criteria) this;
}

View File

@ -4,6 +4,7 @@ import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -25,6 +26,7 @@ import com.qiguliuxing.dts.db.dao.ex.AccountMapperEx;
import com.qiguliuxing.dts.db.domain.DtsAccountTrace;
import com.qiguliuxing.dts.db.domain.DtsAccountTraceExample;
import com.qiguliuxing.dts.db.domain.DtsOrder;
import com.qiguliuxing.dts.db.domain.DtsUser;
import com.qiguliuxing.dts.db.domain.DtsUserAccount;
import com.qiguliuxing.dts.db.domain.DtsUserAccountExample;
import com.qiguliuxing.dts.db.domain.DtsUserExample;
@ -229,4 +231,29 @@ public class DtsAccountService {
userAccountMapper.insert(userAccount);
}
/**
* 根据账号和状态查询提现记录
* @param userId
* @param types
* @return
*/
public List<DtsAccountTrace> getAccountTraceList(Integer userId, Byte... types) {
if(userId == null || types == null || types.length < 1) {
return null;
}
DtsAccountTraceExample example = new DtsAccountTraceExample();
List<Integer> typeInts = new ArrayList<Integer>();
for (Byte type : types) {
typeInts.add(type.intValue());
}
example.or().andUserIdEqualTo(userId).andTypeIn(typeInts);
return accountTraceMapper.selectByExample(example);
}
public List<DtsAccountTrace> querySelective(String username, String mobile, String type, Integer page,
Integer limit, String sort, String order) {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -64,4 +64,10 @@ public class DtsAdminService {
public DtsAdmin findById(Integer id) {
return adminMapper.selectByPrimaryKeySelective(id, result);
}
public List<DtsAdmin> allAdmin() {
DtsAdminExample example = new DtsAdminExample();
example.or().andDeletedEqualTo(false);
return adminMapper.selectByExample(example);
}
}

View File

@ -1,20 +1,26 @@
package com.qiguliuxing.dts.db.service;
import com.github.pagehelper.PageHelper;
import com.qiguliuxing.dts.db.dao.DtsBrandMapper;
import com.qiguliuxing.dts.db.domain.DtsBrand;
import com.qiguliuxing.dts.db.domain.DtsBrandExample;
import com.qiguliuxing.dts.db.domain.DtsBrand.Column;
import java.time.LocalDateTime;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
import com.github.pagehelper.PageHelper;
import com.qiguliuxing.dts.db.dao.DtsBrandMapper;
import com.qiguliuxing.dts.db.dao.DtsCategoryMapper;
import com.qiguliuxing.dts.db.domain.DtsBrand;
import com.qiguliuxing.dts.db.domain.DtsBrand.Column;
import com.qiguliuxing.dts.db.domain.DtsBrandExample;
import com.qiguliuxing.dts.db.domain.DtsCategory;
@Service
public class DtsBrandService {
@Resource
private DtsCategoryMapper categoryMapper;
@Resource
private DtsBrandMapper brandMapper;
private Column[] columns = new Column[] { Column.id, Column.name, Column.desc, Column.picUrl, Column.floorPrice };
@ -78,4 +84,14 @@ public class DtsBrandService {
example.or().andDeletedEqualTo(false);
return brandMapper.selectByExample(example);
}
/**
* 根据分类id获取分类名
* @param categoryId
* @return
*/
public String getBrandCategory(Integer categoryId) {
DtsCategory dtsCategory = categoryMapper.selectByPrimaryKey(categoryId);
return dtsCategory == null ? "综合" : dtsCategory.getName();
}
}

View File

@ -193,17 +193,4 @@ public class DtsCouponService {
.andEndTimeLessThan(LocalDate.now()).andDeletedEqualTo(false);
return couponMapper.selectByExample(example);
}
/**
* 查询用户的优惠券
* @param userId
* @return
*/
public int queryUserCouponCnt(Integer userId) {
DtsCouponUserExample example = new DtsCouponUserExample();
DtsCouponUserExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andDeletedEqualTo(false);
return (int) couponUserMapper.countByExample(example);
}
}

View File

@ -159,6 +159,17 @@ public class DtsGoodsService {
example.or().andIdEqualTo(id).andDeletedEqualTo(false);
return goodsMapper.selectOneByExampleWithBLOBs(example);
}
/**
* 根据序列码找到商品
* @param goodsSn
* @return
*/
public DtsGoods findByGoodsSn(String goodsSn) {
DtsGoodsExample example = new DtsGoodsExample();
example.or().andGoodsSnEqualTo(goodsSn).andDeletedEqualTo(false);
return goodsMapper.selectOneByExampleWithBLOBs(example);
}
/**
* 获取某个商品信息仅展示相关内容
@ -171,6 +182,12 @@ public class DtsGoodsService {
example.or().andIdEqualTo(id).andIsOnSaleEqualTo(true).andDeletedEqualTo(false);
return goodsMapper.selectOneByExampleSelective(example, columns);
}
public DtsGoods findBySnVO(String sn) {
DtsGoodsExample example = new DtsGoodsExample();
example.or().andGoodsSnEqualTo(sn).andIsOnSaleEqualTo(true).andDeletedEqualTo(false);
return goodsMapper.selectOneByExampleSelective(example, columns);
}
/**
* 获取所有在售物品总数

View File

@ -50,7 +50,7 @@ public class DtsGrouponRulesService {
* @param goodsId
* @return
*/
public List<DtsGrouponRules> queryByGoodsId(Integer goodsId) {
public List<DtsGrouponRules> queryByGoodsId(Long goodsId) {
DtsGrouponRulesExample example = new DtsGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andDeletedEqualTo(false);
return mapper.selectByExample(example);
@ -76,7 +76,7 @@ public class DtsGrouponRulesService {
List<Map<String, Object>> grouponList = new ArrayList<>(grouponRules.size());
for (DtsGrouponRules rule : grouponRules) {
Integer goodsId = rule.getGoodsId();
Integer goodsId = rule.getGoodsId().intValue();
DtsGoods goods = goodsMapper.selectByPrimaryKeySelective(goodsId, goodsColumns);
if (goods == null)
continue;
@ -117,7 +117,7 @@ public class DtsGrouponRulesService {
DtsGrouponRulesExample.Criteria criteria = example.createCriteria();
if (!StringUtils.isEmpty(goodsId)) {
criteria.andGoodsIdEqualTo(Integer.parseInt(goodsId));
criteria.andGoodsIdEqualTo(Long.parseLong(goodsId));
}
criteria.andDeletedEqualTo(false);

View File

@ -16,6 +16,8 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="role_ids" jdbcType="VARCHAR" property="roleIds" typeHandler="com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler" />
<result column="desc" jdbcType="VARCHAR" property="desc" />
<result column="tel" jdbcType="VARCHAR" property="tel" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
@ -127,7 +129,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, username, `password`, last_login_ip, last_login_time, avatar, add_time, update_time,
deleted, role_ids
deleted, role_ids, `desc`, tel
</sql>
<select id="selectByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAdminExample" resultMap="BaseResultMap">
<!--
@ -165,7 +167,7 @@
</when>
<otherwise>
id, username, `password`, last_login_ip, last_login_time, avatar, add_time, update_time,
deleted, role_ids
deleted, role_ids, `desc`, tel
</otherwise>
</choose>
from dts_admin
@ -225,7 +227,7 @@
</when>
<otherwise>
id, username, `password`, last_login_ip, last_login_time, avatar, add_time, update_time,
deleted, role_ids
deleted, role_ids, `desc`, tel
</otherwise>
</choose>
from dts_admin
@ -259,12 +261,12 @@
</selectKey>
insert into dts_admin (username, `password`, last_login_ip,
last_login_time, avatar, add_time,
update_time, deleted, role_ids
)
update_time, deleted, role_ids,
`desc`, tel)
values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{lastLoginIp,jdbcType=VARCHAR},
#{lastLoginTime,jdbcType=TIMESTAMP}, #{avatar,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, #{roleIds,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler}
)
#{updateTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, #{roleIds,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
#{desc,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.qiguliuxing.dts.db.domain.DtsAdmin">
<!--
@ -303,6 +305,12 @@
<if test="roleIds != null">
role_ids,
</if>
<if test="desc != null">
`desc`,
</if>
<if test="tel != null">
tel,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="username != null">
@ -332,6 +340,12 @@
<if test="roleIds != null">
#{roleIds,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
</if>
<if test="desc != null">
#{desc,jdbcType=VARCHAR},
</if>
<if test="tel != null">
#{tel,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAdminExample" resultType="java.lang.Long">
@ -381,6 +395,12 @@
<if test="record.roleIds != null">
role_ids = #{record.roleIds,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
</if>
<if test="record.desc != null">
`desc` = #{record.desc,jdbcType=VARCHAR},
</if>
<if test="record.tel != null">
tel = #{record.tel,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -401,7 +421,9 @@
add_time = #{record.addTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
deleted = #{record.deleted,jdbcType=BIT},
role_ids = #{record.roleIds,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler}
role_ids = #{record.roleIds,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
`desc` = #{record.desc,jdbcType=VARCHAR},
tel = #{record.tel,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -440,6 +462,12 @@
<if test="roleIds != null">
role_ids = #{roleIds,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
</if>
<if test="desc != null">
`desc` = #{desc,jdbcType=VARCHAR},
</if>
<if test="tel != null">
tel = #{tel,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
@ -457,7 +485,9 @@
add_time = #{addTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=BIT},
role_ids = #{roleIds,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler}
role_ids = #{roleIds,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
`desc` = #{desc,jdbcType=VARCHAR},
tel = #{tel,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAdminExample" resultMap="BaseResultMap">
@ -492,7 +522,7 @@
</when>
<otherwise>
id, username, `password`, last_login_ip, last_login_time, avatar, add_time, update_time,
deleted, role_ids
deleted, role_ids, `desc`, tel
</otherwise>
</choose>
from dts_admin

View File

@ -15,6 +15,7 @@
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="share_url" jdbcType="VARCHAR" property="shareUrl" />
<result column="admin_id" jdbcType="INTEGER" property="adminId" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="commpany" jdbcType="VARCHAR" property="commpany" />
<result column="auto_update_good" jdbcType="BIT" property="autoUpdateGood" />
@ -95,7 +96,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, `name`, `desc`, pic_url, sort_order, floor_price, add_time, update_time, share_url,
deleted, commpany, auto_update_good, shop_url, default_category_id, default_pages,
admin_id, deleted, commpany, auto_update_good, shop_url, default_category_id, default_pages,
add_precent
</sql>
<select id="selectByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsBrandExample" resultMap="BaseResultMap">
@ -134,7 +135,7 @@
</when>
<otherwise>
id, `name`, `desc`, pic_url, sort_order, floor_price, add_time, update_time, share_url,
deleted, commpany, auto_update_good, shop_url, default_category_id, default_pages,
admin_id, deleted, commpany, auto_update_good, shop_url, default_category_id, default_pages,
add_precent
</otherwise>
</choose>
@ -195,7 +196,7 @@
</when>
<otherwise>
id, `name`, `desc`, pic_url, sort_order, floor_price, add_time, update_time, share_url,
deleted, commpany, auto_update_good, shop_url, default_category_id, default_pages,
admin_id, deleted, commpany, auto_update_good, shop_url, default_category_id, default_pages,
add_precent
</otherwise>
</choose>
@ -230,16 +231,16 @@
</selectKey>
insert into dts_brand (`name`, `desc`, pic_url,
sort_order, floor_price, add_time,
update_time, share_url, deleted,
commpany, auto_update_good, shop_url,
default_category_id, default_pages, add_precent
)
update_time, share_url, admin_id,
deleted, commpany, auto_update_good,
shop_url, default_category_id, default_pages,
add_precent)
values (#{name,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR},
#{sortOrder,jdbcType=TINYINT}, #{floorPrice,jdbcType=DECIMAL}, #{addTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{shareUrl,jdbcType=VARCHAR}, #{deleted,jdbcType=BIT},
#{commpany,jdbcType=VARCHAR}, #{autoUpdateGood,jdbcType=BIT}, #{shopUrl,jdbcType=VARCHAR},
#{defaultCategoryId,jdbcType=INTEGER}, #{defaultPages,jdbcType=INTEGER}, #{addPrecent,jdbcType=INTEGER}
)
#{updateTime,jdbcType=TIMESTAMP}, #{shareUrl,jdbcType=VARCHAR}, #{adminId,jdbcType=INTEGER},
#{deleted,jdbcType=BIT}, #{commpany,jdbcType=VARCHAR}, #{autoUpdateGood,jdbcType=BIT},
#{shopUrl,jdbcType=VARCHAR}, #{defaultCategoryId,jdbcType=INTEGER}, #{defaultPages,jdbcType=INTEGER},
#{addPrecent,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.qiguliuxing.dts.db.domain.DtsBrand">
<!--
@ -275,6 +276,9 @@
<if test="shareUrl != null">
share_url,
</if>
<if test="adminId != null">
admin_id,
</if>
<if test="deleted != null">
deleted,
</if>
@ -322,6 +326,9 @@
<if test="shareUrl != null">
#{shareUrl,jdbcType=VARCHAR},
</if>
<if test="adminId != null">
#{adminId,jdbcType=INTEGER},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
@ -389,6 +396,9 @@
<if test="record.shareUrl != null">
share_url = #{record.shareUrl,jdbcType=VARCHAR},
</if>
<if test="record.adminId != null">
admin_id = #{record.adminId,jdbcType=INTEGER},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted,jdbcType=BIT},
</if>
@ -430,6 +440,7 @@
add_time = #{record.addTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
share_url = #{record.shareUrl,jdbcType=VARCHAR},
admin_id = #{record.adminId,jdbcType=INTEGER},
deleted = #{record.deleted,jdbcType=BIT},
commpany = #{record.commpany,jdbcType=VARCHAR},
auto_update_good = #{record.autoUpdateGood,jdbcType=BIT},
@ -472,6 +483,9 @@
<if test="shareUrl != null">
share_url = #{shareUrl,jdbcType=VARCHAR},
</if>
<if test="adminId != null">
admin_id = #{adminId,jdbcType=INTEGER},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
@ -510,6 +524,7 @@
add_time = #{addTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
share_url = #{shareUrl,jdbcType=VARCHAR},
admin_id = #{adminId,jdbcType=INTEGER},
deleted = #{deleted,jdbcType=BIT},
commpany = #{commpany,jdbcType=VARCHAR},
auto_update_good = #{autoUpdateGood,jdbcType=BIT},
@ -551,7 +566,7 @@
</when>
<otherwise>
id, `name`, `desc`, pic_url, sort_order, floor_price, add_time, update_time, share_url,
deleted, commpany, auto_update_good, shop_url, default_category_id, default_pages,
admin_id, deleted, commpany, auto_update_good, shop_url, default_category_id, default_pages,
add_precent
</otherwise>
</choose>

View File

@ -7,7 +7,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="goods_id" jdbcType="INTEGER" property="goodsId" />
<result column="goods_id" jdbcType="BIGINT" property="goodsId" />
<result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
<result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
<result column="discount" jdbcType="DECIMAL" property="discount" />
@ -223,7 +223,7 @@
discount, discount_member, add_time,
update_time, expire_time, deleted
)
values (#{goodsId,jdbcType=INTEGER}, #{goodsName,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR},
values (#{goodsId,jdbcType=BIGINT}, #{goodsName,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR},
#{discount,jdbcType=DECIMAL}, #{discountMember,jdbcType=INTEGER}, #{addTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{expireTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}
)
@ -268,7 +268,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="goodsId != null">
#{goodsId,jdbcType=INTEGER},
#{goodsId,jdbcType=BIGINT},
</if>
<if test="goodsName != null">
#{goodsName,jdbcType=VARCHAR},
@ -317,7 +317,7 @@
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.goodsId != null">
goods_id = #{record.goodsId,jdbcType=INTEGER},
goods_id = #{record.goodsId,jdbcType=BIGINT},
</if>
<if test="record.goodsName != null">
goods_name = #{record.goodsName,jdbcType=VARCHAR},
@ -355,7 +355,7 @@
-->
update dts_groupon_rules
set id = #{record.id,jdbcType=INTEGER},
goods_id = #{record.goodsId,jdbcType=INTEGER},
goods_id = #{record.goodsId,jdbcType=BIGINT},
goods_name = #{record.goodsName,jdbcType=VARCHAR},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
discount = #{record.discount,jdbcType=DECIMAL},
@ -376,7 +376,7 @@
update dts_groupon_rules
<set>
<if test="goodsId != null">
goods_id = #{goodsId,jdbcType=INTEGER},
goods_id = #{goodsId,jdbcType=BIGINT},
</if>
<if test="goodsName != null">
goods_name = #{goodsName,jdbcType=VARCHAR},
@ -411,7 +411,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dts_groupon_rules
set goods_id = #{goodsId,jdbcType=INTEGER},
set goods_id = #{goodsId,jdbcType=BIGINT},
goods_name = #{goodsName,jdbcType=VARCHAR},
pic_url = #{picUrl,jdbcType=VARCHAR},
discount = #{discount,jdbcType=DECIMAL},

View File

@ -13,7 +13,7 @@
<result column="read_count" jdbcType="VARCHAR" property="readCount" />
<result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
<result column="sort_order" jdbcType="INTEGER" property="sortOrder" />
<result column="goods" jdbcType="VARCHAR" property="goods" typeHandler="com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler" />
<result column="goods" jdbcType="VARCHAR" property="goods" typeHandler="com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler" />
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="share_url" jdbcType="VARCHAR" property="shareUrl" />
@ -60,15 +60,15 @@
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler}
and ${criterion.condition} #{criterion.value,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler} and #{criterion.secondValue,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler}
and ${criterion.condition} #{criterion.value,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler} and #{criterion.secondValue,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler}
#{listItem,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler}
</foreach>
</when>
</choose>
@ -112,15 +112,15 @@
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler}
and ${criterion.condition} #{criterion.value,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler} and #{criterion.secondValue,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler}
and ${criterion.condition} #{criterion.value,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler} and #{criterion.secondValue,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler}
#{listItem,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler}
</foreach>
</when>
</choose>
@ -304,7 +304,7 @@
deleted, content)
values (#{title,jdbcType=VARCHAR}, #{subtitle,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
#{readCount,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR}, #{sortOrder,jdbcType=INTEGER},
#{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
#{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler},
#{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{shareUrl,jdbcType=VARCHAR},
#{deleted,jdbcType=BIT}, #{content,jdbcType=LONGVARCHAR})
</insert>
@ -375,7 +375,7 @@
#{sortOrder,jdbcType=INTEGER},
</if>
<if test="goods != null">
#{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
#{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler},
</if>
<if test="addTime != null">
#{addTime,jdbcType=TIMESTAMP},
@ -433,7 +433,7 @@
sort_order = #{record.sortOrder,jdbcType=INTEGER},
</if>
<if test="record.goods != null">
goods = #{record.goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
goods = #{record.goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler},
</if>
<if test="record.addTime != null">
add_time = #{record.addTime,jdbcType=TIMESTAMP},
@ -468,7 +468,7 @@
read_count = #{record.readCount,jdbcType=VARCHAR},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
sort_order = #{record.sortOrder,jdbcType=INTEGER},
goods = #{record.goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
goods = #{record.goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler},
add_time = #{record.addTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
share_url = #{record.shareUrl,jdbcType=VARCHAR},
@ -491,7 +491,7 @@
read_count = #{record.readCount,jdbcType=VARCHAR},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
sort_order = #{record.sortOrder,jdbcType=INTEGER},
goods = #{record.goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
goods = #{record.goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler},
add_time = #{record.addTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
share_url = #{record.shareUrl,jdbcType=VARCHAR},
@ -526,7 +526,7 @@
sort_order = #{sortOrder,jdbcType=INTEGER},
</if>
<if test="goods != null">
goods = #{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
goods = #{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler},
</if>
<if test="addTime != null">
add_time = #{addTime,jdbcType=TIMESTAMP},
@ -558,7 +558,7 @@
read_count = #{readCount,jdbcType=VARCHAR},
pic_url = #{picUrl,jdbcType=VARCHAR},
sort_order = #{sortOrder,jdbcType=INTEGER},
goods = #{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
goods = #{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler},
add_time = #{addTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
share_url = #{shareUrl,jdbcType=VARCHAR},
@ -578,7 +578,7 @@
read_count = #{readCount,jdbcType=VARCHAR},
pic_url = #{picUrl,jdbcType=VARCHAR},
sort_order = #{sortOrder,jdbcType=INTEGER},
goods = #{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonIntegerArrayTypeHandler},
goods = #{goods,jdbcType=VARCHAR,typeHandler=com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler},
add_time = #{addTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
share_url = #{shareUrl,jdbcType=VARCHAR},

View File

@ -12,7 +12,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
* @author CHENBO
* @QQ:623659388
*/
@SpringBootApplication(scanBasePackages = { "com.qiguliuxing.dts.db", "com.qiguliuxing.dts.core","com.qiguliuxing.dts.wx" })
@SpringBootApplication(scanBasePackages = { "com.qiguliuxing.dts.db", "com.qiguliuxing.dts.core",
"com.qiguliuxing.dts.wx" })
@MapperScan({ "com.qiguliuxing.dts.db.dao", "com.qiguliuxing.dts.db.dao.ex" })
@EnableTransactionManagement
@EnableScheduling

View File

@ -21,9 +21,9 @@ public class BrandCartGoods implements Serializable {
private static final Integer DEFAULT_BRAND_ID = 1001000;
private static final String DEFAULT_BRAND_COMMPANY = "长沙聚惠星自营店";
private static final String DEFAULT_BRAND_COMMPANY = "聚惠星自营店";
private static final String DEFAULT_BRAND_NAME = "长沙聚惠星自营店";
private static final String DEFAULT_BRAND_NAME = "聚惠星自营店";
private Integer brandId;

View File

@ -25,7 +25,7 @@ public enum WxResponseCode {
"优惠券券码不正确"), COUPON_EXPIRED(743, "优惠券已经过期"), COUPON_NOT_CHANGE(744, "非兑换优惠券"),
// 提现错误
APPLY_WITHDRAWAL_FAIL(850, "申请提现金额不能大于可提现金额"), INVALID_COUPON(851, "无效购物券"), INVALID_USER(852, "无效用户");
APPLY_WITHDRAWAL_FAIL(750, "申请提现金额不能大于可提现金额"), APPLY_WITHDRAWAL_EXIST(751, "已存在提现申请"),INVALID_COUPON(752, "无效购物券"), INVALID_USER(753, "无效用户");
private final Integer code;
private final String desc;

View File

@ -7,6 +7,7 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
@ -22,14 +23,17 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.qiguliuxing.dts.core.consts.CommConsts;
import com.qiguliuxing.dts.core.type.BrokerageTypeEnum;
import com.qiguliuxing.dts.core.util.DateTimeUtil;
import com.qiguliuxing.dts.core.util.JacksonUtil;
import com.qiguliuxing.dts.core.util.ResponseUtil;
import com.qiguliuxing.dts.db.domain.DtsAccountTrace;
import com.qiguliuxing.dts.db.domain.DtsUserAccount;
import com.qiguliuxing.dts.db.service.DtsAccountService;
import com.qiguliuxing.dts.wx.annotation.LoginUser;
import com.qiguliuxing.dts.wx.service.CaptchaCodeManager;
import com.qiguliuxing.dts.wx.service.WxOrderService;
import com.qiguliuxing.dts.wx.util.WxResponseCode;
import com.qiguliuxing.dts.wx.util.WxResponseUtil;
/**
@ -178,7 +182,12 @@ public class WxBrokerageController {
logger.error("提现申请失败:{}", APPLY_WITHDRAWAL_FAIL.desc());
return WxResponseUtil.fail(APPLY_WITHDRAWAL_FAIL);
}
//验证是否存在未审批通过的申请单需完成上一个申请才能继续申请下一个提现
List<DtsAccountTrace> traceList = accountService.getAccountTraceList(userId,BrokerageTypeEnum.SYS_APPLY.getType(),BrokerageTypeEnum.USER_APPLY.getType());
if (traceList.size() > 0 ) {
logger.error("提现申请失败:{}", WxResponseCode.APPLY_WITHDRAWAL_EXIST.desc());
return WxResponseUtil.fail(WxResponseCode.APPLY_WITHDRAWAL_EXIST);
}
// 生成提现申请记录到账户跟踪表
try {
accountService.addExtractRecord(userId, applyAmt, mobile, code, remainAmount);

View File

@ -9,7 +9,6 @@ import java.util.Map;
import javax.validation.constraints.NotNull;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -111,8 +110,7 @@ public class WxCouponController {
List<DtsCouponUser> couponUserList = couponUserService.queryList(userId, null, status, page, size, sort, order);
List<CouponVo> couponVoList = change(couponUserList);
long total = PageInfo.of(couponUserList).getTotal();
//int total = couponService.queryTotal();
int total = couponService.queryTotal();
Map<String, Object> data = new HashMap<String, Object>();
data.put("data", couponVoList);
data.put("count", total);

View File

@ -171,7 +171,7 @@ public class WxGoodsController {
};
// 团购信息
Callable<List> grouponRulesCallable = () -> rulesService.queryByGoodsId(id);
Callable<List> grouponRulesCallable = () -> rulesService.queryByGoodsId(id.longValue());
// 用户收藏
int userHasCollect = 0;

View File

@ -223,7 +223,7 @@ public class WxGrouponController {
return ResponseUtil.badArgumentValue();
}
DtsGoods goods = goodsService.findById(rules.getGoodsId());
DtsGoods goods = goodsService.findById(rules.getGoodsId().intValue());
if (goods == null) {
return ResponseUtil.badArgumentValue();
}
@ -336,7 +336,7 @@ public class WxGrouponController {
return WxResponseUtil.fail(GOODS_UNKNOWN);
}
List<DtsGrouponRules> rules = rulesService.queryByGoodsId(goodsId);
List<DtsGrouponRules> rules = rulesService.queryByGoodsId(goodsId.longValue());
logger.info("【请求结束】商品所对应的团购规则,响应结果:{}", JSONObject.toJSONString(rules));
return ResponseUtil.ok(rules);

View File

@ -79,10 +79,21 @@ public class WxTopicController {
DtsTopic topic = topicService.findById(id);
data.put("topic", topic);
List<DtsGoods> goods = new ArrayList<>();
for (Integer i : topic.getGoods()) {
DtsGoods good = goodsService.findByIdVO(i);
if (null != good)
goods.add(good);
for (String idOrSn : topic.getGoods()) {
try {
Long sn = Long.parseLong(idOrSn);
DtsGoods good = null;
if (sn.intValue() < Integer.MAX_VALUE) {
good = goodsService.findByIdVO(sn.intValue());
}
if (good == null) {//如果配置的不是id,则可能是SN
good = goodsService.findBySnVO(idOrSn);
}
if (null != good) goods.add(good);
} catch (Exception e) {
logger.info("获取专题详情,根据配置的商品id或sn获取商品详情出错:{}", e.getMessage());
e.printStackTrace();
}
}
data.put("goods", goods);

View File

@ -78,7 +78,7 @@ public class WxUserController {
data.put("remainAmount", remainAmount);
// 查询用户的优惠券
int total = couponService.queryUserCouponCnt(userId);
int total = couponService.queryTotal();
data.put("couponCount", total);
logger.info("【请求结束】用户个人页面数据,响应结果:{}", JSONObject.toJSONString(data));