Browse Source

修改上传文件大小控制

dev
wangfukang 2 months ago
parent
commit
237477780d
  1. 2
      hiver-admin/src/main/resources/application.yml
  2. 16
      hiver-admin/test-output/test-report.html
  3. 2
      hiver-core/src/main/java/cc/hiver/core/common/sms/SmsUtil.java
  4. 4
      hiver-core/src/main/java/cc/hiver/core/common/utils/JasyptUtil.java
  5. 13
      hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java
  6. 4
      hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/common/CaptchaController.java
  7. 9
      hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
  8. 16
      hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/DictDataController.java
  9. 18
      hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java
  10. 16
      hiver-modules/hiver-base/src/main/java/cc/hiver/base/vo/RegisterShopVo.java
  11. 2
      hiver-modules/hiver-file/src/main/java/cc/hiver/file/controller/UploadController.java
  12. 16
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/service/impl/BillServiceImpl.java
  13. 29
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java
  14. 40
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java
  15. 24
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java
  16. 2
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java
  17. 10
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java
  18. 8
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java
  19. 3
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/PurchaseDetail.java
  20. 18
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java
  21. 6
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductPageVO.java
  22. 7
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductVo.java
  23. 3
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java
  24. 1
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java
  25. 3
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/SalesCalculateService.java
  26. 3
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductCategoryService.java
  27. 2
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java
  28. 30
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java
  29. 4
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/ShopServiceImpl.java
  30. 1
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java
  31. 82
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java
  32. 11
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java
  33. 11
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java
  34. 2
      hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml
  35. 12
      hiver-modules/hiver-mall/src/main/resources/mapper/DealingsRecordMapper.xml
  36. 31
      hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml
  37. 2
      hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml
  38. 83
      hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml
  39. 82
      hiver-modules/hiver-mall/src/main/resources/mapper/ShopMapper.xml
  40. 16
      hiver-modules/hiver-social/src/main/java/cc/hiver/social/controller/WechatController.java

2
hiver-admin/src/main/resources/application.yml

@ -458,7 +458,7 @@ logging:
# 最大保存天数
max-history: 7
# 每个文件最大大小
max-file-size: 8MB
max-file-size: 10MB
jpush:
appKey: 130f556e8473c9b558777fe3
masterSecret: 2b4e5196dfc40a78db36480d

16
hiver-admin/test-output/test-report.html

@ -35,7 +35,7 @@
<a href="#"><span class="badge badge-primary">Hiver</span></a>
</li>
<li class="m-r-10">
<a href="#"><span class="badge badge-primary">五月 11, 2025 19:30:10</span></a>
<a href="#"><span class="badge badge-primary">二月 12, 2026 15:24:12</span></a>
</li>
</ul>
</div>
@ -84,7 +84,7 @@
<div class="test-detail">
<span class="meta text-white badge badge-sm"></span>
<p class="name">passTest</p>
<p class="text-sm"><span>19:30:11 下午</span> / <span>0.016 secs</span></p>
<p class="text-sm"><span>15:24:12 下午</span> / <span>0.015 secs</span></p>
</div>
<div class="test-contents d-none">
<div class="detail-head">
@ -92,9 +92,9 @@
<div class="info">
<div class='float-right'><span class='badge badge-default'>#test-id=1</span></div>
<h5 class="test-status text-pass">passTest</h5>
<span class='badge badge-success'>05.11.2025 19:30:11</span>
<span class='badge badge-danger'>05.11.2025 19:30:11</span>
<span class='badge badge-default'>0.016 secs</span>
<span class='badge badge-success'>02.12.2026 15:24:12</span>
<span class='badge badge-danger'>02.12.2026 15:24:12</span>
<span class='badge badge-default'>0.015 secs</span>
</div>
<div class="m-t-10 m-l-5"></div>
</div>
@ -104,7 +104,7 @@
<tbody>
<tr class="event-row">
<td><span class="badge log pass-bg">Pass</span></td>
<td>19:30:11</td>
<td>15:24:12</td>
<td>
Test passed
</td>
@ -128,13 +128,13 @@
<div class="col-md-3">
<div class="card"><div class="card-body">
<p class="m-b-0">Started</p>
<h3>五月 11, 2025 19:30:10</h3>
<h3>二月 12, 2026 15:24:12</h3>
</div></div>
</div>
<div class="col-md-3">
<div class="card"><div class="card-body">
<p class="m-b-0">Ended</p>
<h3>五月 11, 2025 19:30:11</h3>
<h3>二月 12, 2026 15:24:12</h3>
</div></div>
</div>
<div class="col-md-3">

2
hiver-core/src/main/java/cc/hiver/core/common/sms/SmsUtil.java

@ -61,7 +61,7 @@ public class SmsUtil {
* @throws ClientException
*/
public void sendCode(String mobile, String code, String type) {
sendSms(mobile, "{code:" + code + "}", getTemplateCode(type));
sendSms(mobile, "{\"code\":\"" + code + "\"}", getTemplateCode(type));
}
/**

4
hiver-core/src/main/java/cc/hiver/core/common/utils/JasyptUtil.java

@ -55,8 +55,8 @@ public class JasyptUtil {
public static void main(String[] args) {
// 加密 若修改了第一个参数加密password记得在配置文件同步修改
System.out.println(encyptPwd("hiver", "1qazxsw2#"));
System.out.println(encyptPwd("hiver", "Reddoor@168!"));
// 解密
System.out.println(decyptPwd("hiver", "9/BNjuqq4ycEMDxTcUmXan6Ss0/WkO6vPOKO5RF7oDn6TblyVB7PprWM6UnBd1Vr"));
System.out.println(decyptPwd("hiver", "Zla4U4+yRLPhicvuX2TmiEgxEpzP4dk8BHzFDEtiEhwLQIIaftZrrEUJZce6efoe"));
}
}

13
hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java

@ -1,13 +1,13 @@
package cc.hiver.core.serviceimpl;
import cc.hiver.core.service.JPushService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.jpush.api.JPushClient;
import cn.jpush.api.push.PushResult;
import cn.jpush.api.push.model.Message;
import cn.jpush.api.push.model.PushPayload;
import cn.jpush.api.push.model.notification.Notification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class JPushServiceImpl implements JPushService {
@ -27,6 +27,13 @@ public class JPushServiceImpl implements JPushService {
.setPlatform(cn.jpush.api.push.model.Platform.all())
.setAudience(cn.jpush.api.push.model.audience.Audience.registrationId(registrationId))
.setNotification(Notification.alert(message))
.setMessage(Message.newBuilder()
.setMsgContent("消息内容")
.addExtra("custom_key", "custom_value") // 额外参数
.addExtra("type", "订单通知")
.addExtra("order_id", "123456")
.addExtra("timestamp", System.currentTimeMillis())
.build())
.build();
try {

4
hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/common/CaptchaController.java

@ -117,8 +117,8 @@ public class CaptchaController {
public Result sendSms(String mobile,String type, Integer range, String templateType, HttpServletRequest request) {
// 店铺注册不需要校验手机号
if(!MessageConstant.SMS_RANGE_UNREG.equals(range)){
if (MessageConstant.SMS_RANGE_REG.equals(range) && userService.findByMobileAndType(mobile,type) == null) {
if(!MessageConstant.SMS_RANGE_UNREG.equals(range)) {
if (MessageConstant.SMS_RANGE_REG.equals(range) && userService.findByMobileAndType(mobile, type) == null) {
return ResultUtil.error("手机号未注册");
}
}

9
hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java

@ -414,7 +414,12 @@ public class AuthController {
final Shop shop = new Shop();
shop.setShopName(registerShopVo.getShopName());
shop.setShopAddress(registerShopVo.getShopAddress());
shop.setShopIcon(registerShopVo.getShopIcon());
shop.setShopImages(registerShopVo.getShopImages());
shop.setShopLename(registerShopVo.getShopLename());
shop.setShopLecard(registerShopVo.getShopLecard());
shop.setAliAccount(registerShopVo.getAliAccount());
shop.setAliName(registerShopVo.getAliName());
// 店铺店铺名称,店铺地址,与用户(默认店主)的关联
// 设置注册用户为店主
shop.setShopOwnerId(user.getId());
@ -431,7 +436,7 @@ public class AuthController {
inviteLogService.saveInviteLog(inviteLog);
}
// 20240525 新增店铺,默认新增默认分类,颜色-均色;尺码-均码
productCategoryService.addShopDefaultCategory(shop.getId());
//productCategoryService.addShopDefaultCategory(shop.getId());
// 20240525 新增店铺,新增店铺尺码库
final String categoryId = productCategoryService.addCategoryOfShop();
shop.setAttrId(categoryId);

16
hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/DictDataController.java

@ -65,10 +65,12 @@ public class DictDataController {
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ApiOperation(value = "添加")
public Result add(DictData dictData) {
Dict dict = dictService.get(dictData.getDictId());
if(dictData.getSortOrder() != null){
Dict dict = dictService.get(dictData.getDictId());
// 删除缓存
redisTemplate.delete("dictData::" + dict.getType());
}
dictDataService.save(dictData);
// 删除缓存
redisTemplate.delete("dictData::" + dict.getType());
return ResultUtil.success("添加成功");
}
@ -76,9 +78,11 @@ public class DictDataController {
@ApiOperation(value = "编辑")
public Result edit(DictData dictData) {
dictDataService.update(dictData);
// 删除缓存
Dict dict = dictService.get(dictData.getDictId());
redisTemplate.delete("dictData::" + dict.getType());
if(dictData.getSortOrder() != null){
// 删除缓存
Dict dict = dictService.get(dictData.getDictId());
redisTemplate.delete("dictData::" + dict.getType());
}
return ResultUtil.success("编辑成功");
}

18
hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java

@ -22,7 +22,9 @@ import cc.hiver.core.service.mybatis.IUserRoleService;
import cc.hiver.core.vo.RoleDTO;
import cc.hiver.core.vo.WechatVo;
import cc.hiver.mall.entity.Shop;
import cc.hiver.mall.entity.ShopArea;
import cc.hiver.mall.entity.ShopUser;
import cc.hiver.mall.service.ShopAreaService;
import cc.hiver.mall.service.ShopService;
import cc.hiver.mall.service.ShopUserService;
import cc.hiver.mall.service.mybatis.CustomerService;
@ -74,6 +76,9 @@ public class UserController {
@Autowired
private DepartmentService departmentService;
@Autowired
private ShopAreaService shopAreaService;
@Autowired
private DepartmentHeaderService departmentHeaderService;
@ -346,9 +351,10 @@ public class UserController {
final String encryptPass = new BCryptPasswordEncoder().encode(u.getPassword());
u.setPassword(encryptPass);
if (CharSequenceUtil.isNotBlank(u.getDepartmentId())) {
final Department d = departmentService.get(u.getDepartmentId());
if (d != null) {
u.setDepartmentTitle(d.getTitle());
final ShopArea a = shopAreaService.get(u.getDepartmentId());
//final Department d = departmentService.get(u.getDepartmentId());
if (a != null) {
u.setDepartmentTitle(a.getTitle());
}
} else {
u.setDepartmentId(null);
@ -592,7 +598,11 @@ public class UserController {
final JsonObject jsonObject = JsonParser.parseString(result).getAsJsonObject();
final String sessionKey = jsonObject.get("session_key").getAsString();
final String openId = jsonObject.get("openid").getAsString();
final String unionid = jsonObject.get("unionid").getAsString();
//final String unionid = jsonObject.get("unionid").getAsString();
String unionid = null;
if (jsonObject.has("unionid") && !jsonObject.get("unionid").isJsonNull()) {
unionid = jsonObject.get("unionid").getAsString();
}
log.info("微信登录的传参==openId==:{};unionid==:{}",openId,unionid);
// 判断是否绑定用户
User wechatUser = null;

16
hiver-modules/hiver-base/src/main/java/cc/hiver/base/vo/RegisterShopVo.java

@ -21,4 +21,20 @@ public class RegisterShopVo {
private String inviteShopId;
private String shopImages;
private String shopIcon;
private String shopLename;
private String aliAccount;
private String aliName;
private String shopLecard;
private String region;
private String regionId;
}

2
hiver-modules/hiver-file/src/main/java/cc/hiver/file/controller/UploadController.java

@ -43,7 +43,7 @@ import java.io.InputStream;
@RequestMapping("/hiver/upload")
@Transactional
public class UploadController {
@Value("${hiver.maxUploadFile}")
@Value("15")
private Long maxUploadFile;
@Autowired

16
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/service/impl/BillServiceImpl.java

@ -140,13 +140,13 @@ public class BillServiceImpl implements BillService {
}
// 根据时间升序查询的,这里获取第一个的初期欠款当做本次查询的初期欠款
if (i == 0) {
final BigDecimal lastDebtAmount = records.get(0).getLastDebtAmount();
customerBillDataVo.setInitialArrears(lastDebtAmount);
final BigDecimal lastDebtAmount = records.get(0).getBalanceDue();
customerBillDataVo.setEndArrears(lastDebtAmount);
}
}
// 因为记录分页了,所以这里不能获取最后一条数据作为获期末欠款,应该单独查询一下
final BigDecimal arrearsByUserId = dealingsRecordService.getArrearsByUserId(customerBillQueryVo);
customerBillDataVo.setEndArrears(arrearsByUserId);
customerBillDataVo.setInitialArrears(arrearsByUserId);
}
if (!saleIdList.isEmpty()) {
@ -352,15 +352,15 @@ public class BillServiceImpl implements BillService {
if (StringUtils.isNotEmpty(records.get(i).getPurchaseId())) {
purchaseIdList.add(records.get(i).getPurchaseId());
}
// 根据时间升序查询的,这里获取第一个的初期欠款当做本次查询的初期欠款
// 根据时间降序查询的,这里获取第一个的欠款当做本次查询的期末欠款
if (i == 0) {
final BigDecimal lastDebtAmount = records.get(0).getLastDebtAmount();
supplierBillDataVo.setInitialArrears(lastDebtAmount);
final BigDecimal lastDebtAmount = records.get(0).getBalanceDue();
supplierBillDataVo.setEndArrears(lastDebtAmount);
}
}
// 因为记录分页了,所以这里不能获取最后一条数据作为获期欠款,应该单独查询一下
// 因为记录分页了,所以这里不能获取最后一条数据作为获期欠款,应该单独查询一下
final BigDecimal arrearsBySupplierId = dealingsRecordService.getArrearsBySupplierId(supplierBillQueryVo);
supplierBillDataVo.setEndArrears(arrearsBySupplierId);
supplierBillDataVo.setInitialArrears(arrearsBySupplierId);
}

29
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java

@ -8,6 +8,7 @@ import cc.hiver.core.common.utils.ResultUtil;
import cc.hiver.core.common.utils.SecurityUtil;
import cc.hiver.core.common.vo.Result;
import cc.hiver.mall.entity.Product;
import cc.hiver.mall.entity.ProductGroupBuyPrice;
import cc.hiver.mall.pojo.query.ProductPageQuery;
import cc.hiver.mall.pojo.vo.ProductCategoryVo;
import cc.hiver.mall.pojo.vo.ProductLastBuyVo;
@ -16,6 +17,7 @@ import cc.hiver.mall.pojo.vo.ProductVo;
import cc.hiver.mall.productpicture.entity.ProductPicture;
import cc.hiver.mall.productpicture.service.ProductPictureService;
import cc.hiver.mall.service.mybatis.ProductCategoryService;
import cc.hiver.mall.service.mybatis.ProductGroupBuyPriceService;
import cc.hiver.mall.service.mybatis.ProductService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@ -49,6 +51,9 @@ public class ProductController {
@Autowired
private SecurityUtil securityUtil;
@Autowired
private ProductGroupBuyPriceService productGroupBuyPriceService;
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation("新增货品")
public Result save(@RequestBody ProductVo productVo) {
@ -90,6 +95,12 @@ public class ProductController {
}
productPictureService.batchSaveProductPicture(productPictures);
}
// 如果有拼团信息,那么新增拼团信息
final List<ProductGroupBuyPrice> productGroupBuyPrices = productVo.getProductGroupBuyPrices();
if (productGroupBuyPrices != null && !productGroupBuyPrices.isEmpty()) {
productGroupBuyPriceService.saveBatch(productGroupBuyPrices);
}
if (result) {
return ResultUtil.success("添加成功");
} else {
@ -114,11 +125,11 @@ public class ProductController {
final Product product = new Product();
BeanUtils.copyBeanProp(product, productVo);
// 删除商品专属分类信息
productCategoryService.deleteCategoryOfProduct(productVo.getAttrId());
productCategoryService.deleteCategoryOfProduct1(productVo.getAttrId());
// 新增商品专属分类信息
final ProductCategoryVo productCategoryVo = productVo.getProductCategoryVo();
productCategoryVo.setShopId("spfl");
final String attrId = productCategoryService.batchSaveCategoryAndAttribute(productCategoryVo);
final String attrId = productCategoryService.batchEditCategoryAndAttribute(productVo.getAttrId(),productCategoryVo);
// 更新店铺尺码库
productCategoryService.batchSaveCategoryOfShop(productCategoryVo);
if (StringUtils.isNotEmpty(attrId)) {
@ -143,6 +154,11 @@ public class ProductController {
// 然后新增子图信息
productPictureService.batchSaveProductPicture(productPictures);
}
// 如果有拼团信息,那么新增拼团信息
final List<ProductGroupBuyPrice> productGroupBuyPrices = productVo.getProductGroupBuyPrices();
if (productGroupBuyPrices != null && !productGroupBuyPrices.isEmpty()) {
productGroupBuyPriceService.saveBatch(productGroupBuyPrices);
}
if (result) {
return ResultUtil.success("修改成功");
} else {
@ -186,6 +202,15 @@ public class ProductController {
}
}
@RequestMapping(value = "/getProductSaleCount", method = RequestMethod.POST)
@ApiOperation("查询商品销售总量")
public Result getProductSaleCount(String id) {
if (StringUtils.isEmpty(id)) {
return ResultUtil.error("请选择要查询的货品");
}
return new ResultUtil<Integer>().setData(productService.getProductSaleCount(id));
}
/**
* 根据货品id下架货品
*

40
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java

@ -748,6 +748,46 @@ public class SaleController {
return new ResultUtil<SaleAllVO>().setData(saleAllVO);
}
@RequestMapping(value = "/getShopAllByCateId", method = RequestMethod.POST)
@ApiOperation("根据分类id查看数据")
public Result getShopAllByCateId(@RequestBody(required = false) SaleVO saleVO) {
// shopId从缓存中设置
String shopId = "";
try {
// 获取请求token
shopId = securityUtil.getShopId();
} catch (Exception e) {
final String message = e.getMessage();
if ("未检测到登录用户".equals(message)) {
return ResultUtil.error(401, e.getMessage());
}
return ResultUtil.error(500, e.getMessage());
}
final CategoryNumberVo categoryNumberVo;
try {
final String startTime;
final String endTime;
if (saleVO == null) {
saleVO = new SaleVO();
}
final String dateText = DateUtil.COMMON.getDateText(new Date());
startTime = saleVO.getStartTime() == null ? dateText : saleVO.getStartTime();
if (StringUtils.isEmpty(saleVO.getEndTime())) {
// 为空,使用当前日期+1
endTime = DateUtil.addDay(dateText, 1);
} else {
// 不为空,使用传参日期+1
endTime = DateUtil.addDay(saleVO.getEndTime(), 1);
}
categoryNumberVo = salesCalculateService.calculateServiceByIds(startTime,endTime,saleVO.getIds());
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResultUtil.error(500, e.getMessage());
}
return new ResultUtil<CategoryNumberVo>().setData(categoryNumberVo);
}
@RequestMapping(value = "/getShopWeek", method = RequestMethod.POST)
@ApiOperation("获取本周利润")
public Result getShopWeek() {

24
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java

@ -283,7 +283,7 @@ public class ShopController {
}
/**
* 更新店铺图标及备注
* 更新店铺信息
*
* @param shop
* @return Result
@ -291,7 +291,7 @@ public class ShopController {
* @date 2024/7/27
*/
@RequestMapping(value = "/updateShopIconAndRemark", method = RequestMethod.POST)
@ApiOperation("更新店铺图标及备注")
@ApiOperation("更新店铺信息")
public Result updateShopIconAndRemark(@RequestBody Shop shop) {
final String id = shop.getId();
if (StringUtils.isEmpty(id)) {
@ -312,6 +312,26 @@ public class ShopController {
if (shop.getStoreFlag() != null) {
oldShop.setStoreFlag(shop.getStoreFlag());
}
// 新增字段处理
if (shop.getShopImages() != null) {
oldShop.setShopImages(shop.getShopImages());
}
if (shop.getShopLename() != null) {
oldShop.setShopLename(shop.getShopLename());
}
if (shop.getShopLecard() != null) {
oldShop.setShopLecard(shop.getShopLecard());
}
if (shop.getShopScore() != null) {
oldShop.setShopScore(shop.getShopScore());
}
if (shop.getIsbrandflag() != null) {
oldShop.setIsbrandflag(shop.getIsbrandflag());
}
if (shop.getSubtitle() != null) {
oldShop.setSubtitle(shop.getSubtitle());
}
shopService.update(oldShop);
return ResultUtil.success("更新成功");
}

2
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java

@ -21,6 +21,8 @@ public interface ProductMapper extends BaseMapper<Product> {
int deleteByPrimaryKey(String id);
Integer getProductSaleCount(String id);
int insert(Product record);
int insertSelective(Product record);

10
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java

@ -173,4 +173,14 @@ public interface SaleMapper extends BaseMapper<Sale> {
* @param saleId
*/
void updatePrintCount(@Param("saleId") String saleId);
CategoryNumberVo queryTotalAmountByCategory(@Param("shopId") String shopId, @Param("ids") String[] ids, @Param("startTime") String startTime, @Param("endTime") String endTime);
BigDecimal queryTotalProfitByCategory(@Param("shopId") String shopId, @Param("ids") String[] ids, @Param("startTime") String startTime, @Param("endTime") String endTime);
BigDecimal querySaleReturnCost(@Param("shopId") String shopId, @Param("ids") String[] ids, @Param("startTime") String startTime, @Param("endTime") String endTime);
CategoryNumberVo queryTotalPurchaseByCategory(@Param("shopId") String shopId, @Param("ids") String[] ids, @Param("startTime") String startTime, @Param("endTime") String endTime);
CategoryNumberVo queryTotalReturnByCategory(@Param("shopId") String shopId, @Param("ids") String[] ids, @Param("startTime") String startTime, @Param("endTime") String endTime);
}

8
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java

@ -89,6 +89,9 @@ public class Product implements Serializable {
@ApiModelProperty(value = "零售价")
private BigDecimal price;
@ApiModelProperty(value = "佣金")
private BigDecimal commission;
@ApiModelProperty(value = "采购价")
private BigDecimal purchasePrice;
@ -135,4 +138,9 @@ public class Product implements Serializable {
@ApiModelProperty(value = "商品库存信息")
private List<Stock> stockList;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "商品拼团信息")
private List<ProductGroupBuyPrice> productGroupBuyPrices;
}

3
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/PurchaseDetail.java

@ -63,6 +63,9 @@ public class PurchaseDetail extends HiverBaseEntity {
@ApiModelProperty(value = "零售价")
private BigDecimal price;
@ApiModelProperty(value = "佣金")
private BigDecimal commission;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "零售价(单纯用于接收前台传参)")

18
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java

@ -133,4 +133,22 @@ public class Shop extends HiverBaseEntity {
@ApiModelProperty(value = "是否需要入库确认:0:不需要;1:需要(数据库默认为0)")
private String storeFlag;
@ApiModelProperty(value = "营业执照、餐饮许可、店铺环境、主页背景图")
private String shopImages;
@ApiModelProperty(value = "法人")
private String shopLename;
@ApiModelProperty(value = "法人身份证")
private String shopLecard;
@ApiModelProperty(value = "店铺评分")
private BigDecimal shopScore;
@ApiModelProperty(value = "是否为品牌店铺1是 0不是")
private Integer isbrandflag;
@ApiModelProperty(value = "副标题")
private String subtitle;
}

6
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductPageVO.java

@ -81,6 +81,12 @@ public class ProductPageVO {
@ApiModelProperty(value = "批发价")
private BigDecimal wholesalePrice;
@ApiModelProperty(value = "佣金")
private BigDecimal commission;
@ApiModelProperty(value = "创建人")
private BigDecimal createBy;
@ApiModelProperty(value = "货品图片")
private String productPicture;

7
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductVo.java

@ -1,6 +1,7 @@
package cc.hiver.mall.pojo.vo;
import cc.hiver.core.base.HiverBaseEntity;
import cc.hiver.mall.entity.ProductGroupBuyPrice;
import cc.hiver.mall.productpicture.entity.ProductPicture;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -58,6 +59,9 @@ public class ProductVo extends HiverBaseEntity {
@ApiModelProperty(value = "批发价")
private BigDecimal wholesalePrice;
@ApiModelProperty(value = "佣金")
private BigDecimal commission;
@ApiModelProperty(value = "货品图片")
private String productPicture;
@ -87,4 +91,7 @@ public class ProductVo extends HiverBaseEntity {
@ApiModelProperty(value = "客户价格规则")
private String customerCategoryRule;
@ApiModelProperty(value = "商品拼团信息")
private List<ProductGroupBuyPrice> productGroupBuyPrices;
}

3
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java

@ -87,4 +87,7 @@ public class SaleVO extends HiverBasePageQuery implements Serializable {
@ApiModelProperty(value = "是否配货:0:否;1:是")
private String distributionFlag;
@ApiModelProperty(value = "根据分类id查询")
private String[] ids;
}

1
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java

@ -291,6 +291,7 @@ public class PurchaseOcrPictureServiceImpl implements PurchaseOcrPictureService
// purchaseDetail.setPrice(product.getPrice());
// purchaseDetail.setWholesalePrice(product.getWholesalePrice());
purchaseDetail.setProductPicture(product.getProductPicture());
purchaseDetail.setProductVideo(product.getProductVideo());
purchaseDetail.setProductSn(product.getProductSn());
purchaseDetail.setProductCount(0);
purchaseDetail.setSupplierName(product.getSupplierName());

3
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/SalesCalculateService.java

@ -1,5 +1,6 @@
package cc.hiver.mall.service;
import cc.hiver.mall.pojo.vo.CategoryNumberVo;
import cc.hiver.mall.pojo.vo.SaleAllVO;
import java.math.BigDecimal;
@ -10,5 +11,7 @@ public interface SalesCalculateService {
SaleAllVO calculateService(String startTime, String endTime) throws ParseException;
CategoryNumberVo calculateServiceByIds(String startTime, String endTime, String[] ids) throws ParseException;
List<BigDecimal> getShopWeek();
}

3
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductCategoryService.java

@ -12,6 +12,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
public interface ProductCategoryService extends IService<ProductCategory> {
String batchSaveCategoryAndAttribute(ProductCategoryVo productCategoryVo);
String batchEditCategoryAndAttribute(String attrId,ProductCategoryVo productCategoryVo);
/**
* AI入库的时候新增的分类信息分类Id肯定是有的
*
@ -46,6 +47,8 @@ public interface ProductCategoryService extends IService<ProductCategory> {
void deleteCategoryOfProduct(String attrId);
void deleteCategoryOfProduct1(String attrId);
String addCategoryOfShop();
/**

2
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java

@ -17,6 +17,8 @@ public interface ProductService extends IService<Product> {
List<Product> getProductList(List<String> productIdList);
Integer getProductSaleCount(String id);
CopyOnWriteArrayList<Product> getProductByProductSnList(List<String> productSnList, String shopId);
CopyOnWriteArrayList<Product> getProductByProductNameList(List<String> productNameList, String shopId);

30
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java

@ -10,6 +10,7 @@ import cc.hiver.mall.dao.mapper.SaleMapper;
import cc.hiver.mall.entity.ReturnSaleExample;
import cc.hiver.mall.entity.Sale;
import cc.hiver.mall.entity.SaleExample;
import cc.hiver.mall.pojo.vo.CategoryNumberVo;
import cc.hiver.mall.pojo.vo.SaleAllVO;
import cc.hiver.mall.pojo.vo.TotalAlreadyEarnDetailVo;
import cc.hiver.mall.service.SalesCalculateService;
@ -198,6 +199,35 @@ public class SalesCalculateServiceImpl implements SalesCalculateService {
return saleAllVO;
}
public CategoryNumberVo calculateServiceByIds(String startTime, String endTime,String[] ids){
final CategoryNumberVo categoryNumberVo = new CategoryNumberVo();
// 店铺id从缓存中获取,并放到数据中去
final String shopId = securityUtil.getShopId();
CategoryNumberVo totalAmount = new CategoryNumberVo();
totalAmount = saleMapper.queryTotalAmountByCategory(shopId,ids,startTime,endTime);
categoryNumberVo.setTotalAmount(totalAmount.getTotalAmount());
categoryNumberVo.setTotalJCount(totalAmount.getTotalJCount());
BigDecimal totalPrifit = saleMapper.queryTotalProfitByCategory(shopId,ids,startTime,endTime);
categoryNumberVo.setTotalProfit(totalAmount.getTotalAmount().subtract(totalPrifit));
BigDecimal saleReturnCost = saleMapper.querySaleReturnCost(shopId,ids,startTime,endTime);
categoryNumberVo.setSaleReturnCost(saleReturnCost);
CategoryNumberVo totalPurchase = new CategoryNumberVo();
totalPurchase = saleMapper.queryTotalPurchaseByCategory(shopId,ids,startTime,endTime);
categoryNumberVo.setPurchasingCost(totalPurchase.getPurchasingCost());
categoryNumberVo.setPurchasingCount(totalPurchase.getPurchasingCount());
CategoryNumberVo totalReturn = new CategoryNumberVo();
totalReturn = saleMapper.queryTotalReturnByCategory(shopId,ids,startTime,endTime);
categoryNumberVo.setReturnTotalAmount(totalReturn.getReturnTotalAmount());
categoryNumberVo.setReturnTotalCount(totalReturn.getReturnTotalCount());
return categoryNumberVo;
}
@Override
public List<BigDecimal> getShopWeek() {
final List<BigDecimal> thisWeekSale = new ArrayList<>();

4
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/ShopServiceImpl.java

@ -76,12 +76,16 @@ public class ShopServiceImpl implements ShopService {
@Override
public Predicate toPredicate(Root<Shop> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
final Path<String> ShopNameField = root.get("shopName");
final Path<String> regionField = root.get("regionId");
final List<Predicate> list = new ArrayList<>();
if (CharSequenceUtil.isNotBlank(Shop.getShopName())) {
list.add(cb.like(ShopNameField, '%' + Shop.getShopName() + '%'));
}
if (CharSequenceUtil.isNotBlank(Shop.getRegionId())) {
list.add(cb.equal(regionField, Shop.getRegionId()));
}
final Predicate[] arr = new Predicate[list.size()];

1
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java

@ -141,6 +141,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
if (StringUtils.isEmpty(customer.getShopId())) {
shopId = securityUtil.getShopId();
final User user = securityUtil.getCurrUser();
customer.setCreateBy(user.getUsername());
createBy = user.getId();
createByName = user.getNickname();
} else {

82
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java

@ -64,6 +64,78 @@ public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMappe
productCategory.setSort(productCategoryVo.getSort());
productCategoryMapper.insert(productCategory);
if(productCategoryVo.getProductAttributeOfAddVos() != null){
// 新增类别
final List<ProductAttributeOfAddVo> productAttributeOfAddVos = productCategoryVo.getProductAttributeOfAddVos();
// 需要新增的类别集合
final List<ProductAttribute> productAttributes = new ArrayList<>();
// 需要新增的属性值集合
final List<ProductAttributeValue> productAttributeValues = new ArrayList<>();
for (ProductAttributeOfAddVo productAttributeOfAddVo : productAttributeOfAddVos) {
final ProductAttribute productAttribute = new ProductAttribute();
productAttribute.setCategoryId(productCategory.getId());
productAttribute.setAttributeName(productAttributeOfAddVo.getAttributeName());
productAttributes.add(productAttribute);
final List<ProductAttributeValueVo> productAttributeValueVoList = productAttributeOfAddVo.getProductAttributeValueVoList();
for (ProductAttributeValueVo productAttributeValueVo : productAttributeValueVoList) {
final String value = productAttributeValueVo.getValue();
// 20240330 只能新增颜色和尺码,颜色统一改为*色、尺码统一转大写,加‘码’;
// 根据规格id规格是颜色、还是尺码。
if ("颜色".equals(productAttribute.getAttributeName())) {
if (!value.contains("色")) {
productAttributeValueVo.setValue(value + '色');
}
} else if ("尺码".equals(productAttribute.getAttributeName())) {
final String valueUpperCase = value.toUpperCase();
if (value.contains("码")) {
productAttributeValueVo.setValue(valueUpperCase);
} else {
productAttributeValueVo.setValue(valueUpperCase + '码');
}
} else {
// 暂不支持其他规格
}
final ProductAttributeValue productAttributeValue = new ProductAttributeValue();
productAttributeValue.setAttributeId(productAttribute.getId());
productAttributeValue.setValue(productAttributeValueVo.getValue());
productAttributeValues.add(productAttributeValue);
}
}
// 批量插入分类
if (!productAttributes.isEmpty()) {
productAttributeService.saveBatch(productAttributes, productAttributes.size());
}
//批量插入属性值
if (!productAttributeValues.isEmpty()) {
productAttributeValueService.saveBatch(productAttributeValues, productAttributeValues.size());
}
}
return productCategory.getId();
} catch (Exception e) {
log.error(e.getMessage(), e);
return "";
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public String batchEditCategoryAndAttribute(String attrId,ProductCategoryVo productCategoryVo) {
try {
// 新增类别信息
/*final ProductCategory productCategory = new ProductCategory();
// 20240525 注册店铺的时候需要增加默认分类,shopId从注册店铺的那边传过来
if (StringUtils.isEmpty(productCategoryVo.getShopId())) {
final String shopId = securityUtil.getShopId();
productCategory.setShopId(shopId);
} else {
productCategory.setShopId(productCategoryVo.getShopId());
}
productCategory.setCategoryName(productCategoryVo.getCategoryName());
productCategory.setSort(productCategoryVo.getSort());
productCategoryMapper.insert(productCategory);*/
// 新增类别
final List<ProductAttributeOfAddVo> productAttributeOfAddVos = productCategoryVo.getProductAttributeOfAddVos();
// 需要新增的类别集合
@ -72,7 +144,7 @@ public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMappe
final List<ProductAttributeValue> productAttributeValues = new ArrayList<>();
for (ProductAttributeOfAddVo productAttributeOfAddVo : productAttributeOfAddVos) {
final ProductAttribute productAttribute = new ProductAttribute();
productAttribute.setCategoryId(productCategory.getId());
productAttribute.setCategoryId(attrId);
productAttribute.setAttributeName(productAttributeOfAddVo.getAttributeName());
productAttributes.add(productAttribute);
final List<ProductAttributeValueVo> productAttributeValueVoList = productAttributeOfAddVo.getProductAttributeValueVoList();
@ -108,7 +180,7 @@ public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMappe
if (!productAttributeValues.isEmpty()) {
productAttributeValueService.saveBatch(productAttributeValues, productAttributeValues.size());
}
return productCategory.getId();
return attrId;
} catch (Exception e) {
log.error(e.getMessage(), e);
return "";
@ -347,6 +419,12 @@ public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMappe
productAttributeValueService.deleteByCategoryId(attrId);
}
@Override
public void deleteCategoryOfProduct1(String attrId) {
productAttributeService.deleteByCategoryId(attrId);
productAttributeValueService.deleteByCategoryId(attrId);
}
@Override
public String addCategoryOfShop() {
final ProductCategoryVo productCategoryVo = new ProductCategoryVo();

11
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java

@ -13,6 +13,7 @@ import cc.hiver.mall.common.constant.PurchaseConstant;
import cc.hiver.mall.dao.mapper.ProductMapper;
import cc.hiver.mall.entity.Product;
import cc.hiver.mall.entity.ProductAttributeValue;
import cc.hiver.mall.entity.ProductGroupBuyPrice;
import cc.hiver.mall.entity.Stock;
import cc.hiver.mall.pojo.dto.*;
import cc.hiver.mall.pojo.query.ProductPageQuery;
@ -61,6 +62,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
@Autowired
private CheckStockService checkStockService;
@Autowired
private ProductGroupBuyPriceService productGroupBuyPriceService;
@Override
public IPage<ProductPageVO> getShareList(ProductPageQuery productPageQuery) {
if (StringUtils.isNotEmpty(productPageQuery.getEndDate())) {
@ -152,6 +156,11 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
return baseMapper.getProductList(productIdList);
}
@Override
public Integer getProductSaleCount(String id) {
return baseMapper.getProductSaleCount(id);
}
@Override
public CopyOnWriteArrayList<Product> getProductByProductSnList(List<String> productSnList, String shopId) {
return baseMapper.getProductByProductSnList(productSnList, shopId);
@ -216,6 +225,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
@Override
public Product getByIdOrBrcode(String id, String customerId) {
final Product byIdOrBrcode = baseMapper.getByIdOrBrcode(id);
final List<ProductGroupBuyPrice> productGroupBuyPriceList = productGroupBuyPriceService.selectByProductId(id);
byIdOrBrcode.setProductGroupBuyPrices(productGroupBuyPriceList);
// 如果客户id不为空,查询客户的购买次数
if (StringUtils.isNotEmpty(customerId) && byIdOrBrcode != null) {
final List<String> productIdList = new ArrayList<>();

11
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java

@ -503,9 +503,10 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
// 没有库存的时候
product.setPurchasePrice(purchaseDetail.getPurchasePrice());
}
// 设置商品的批发价和零售价
// 设置商品的批发价和零售价和佣金
product.setPrice(purchaseDetail.getLsPrice());
product.setWholesalePrice(purchaseDetail.getWholesalePrice());
product.setCommission(purchaseDetail.getCommission());
if (!"[]".equals(purchaseDetail.getCustomerCategoryRule()) && !"null".equals(purchaseDetail.getCustomerCategoryRule())) {
product.setCustomerCategoryRule(purchaseDetail.getCustomerCategoryRule());
}
@ -817,9 +818,12 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
product.setPrice(purchaseDetail.getPrice());
// 采购价
product.setPurchasePrice(purchaseDetail.getPurchasePrice());
// 佣金
product.setCommission(purchaseDetail.getCommission());
// 批发价
product.setWholesalePrice(purchaseDetail.getWholesalePrice());
product.setProductPicture(purchaseDetail.getProductPicture());
product.setProductVideo(purchaseDetail.getProductVideo());
product.setProductIntro(purchaseDetail.getProductIntro());
product.setSalesWeek(purchaseDetail.getSalesWeek());
product.setPrintBarcode(purchaseDetail.getPrintBarcode());
@ -948,7 +952,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
// 供应商可能更新,这里保存本次前台选择的供应商信息
purchaseDetail.setProductSn(product.getProductSn());
// 条码去掉了,真实的条形码内容为商品的id
purchaseDetail.setProductVideo(product.getProductVideo());
purchaseDetail.setProductIntro(product.getProductIntro());
purchaseDetail.setSalesWeek(product.getSalesWeek());
purchaseDetail.setPrintBarcode(product.getPrintBarcode());
@ -1010,11 +1013,13 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
// 保存商品供应商信息
product.setSupplierId(purchase.getSupplierId());
product.setSupplierName(purchase.getSupplierName());
// 更新商品的批发价和零售价
// 更新商品的批发价和零售价和佣金
product.setPrice(purchaseDetail.getPrice());
product.setWholesalePrice(purchaseDetail.getWholesalePrice());
product.setCommission(purchaseDetail.getCommission());
// 更新商品的图片
product.setProductPicture(purchaseDetail.getProductPicture());
product.setProductVideo(purchaseDetail.getProductVideo());
// 更新商品的名称
product.setProductName(purchaseDetail.getProductName());
if (!"[]".equals(purchaseDetail.getCustomerCategoryRule()) && !"null".equals(purchaseDetail.getCustomerCategoryRule())) {

2
hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml

@ -432,7 +432,7 @@
<select id="getCustomerList" resultType="cc.hiver.mall.entity.Customer">
select
a.id, a.name, a.sex, a.phone, a.address,
a.id, a.name, a.sex, a.phone, a.address,a.create_by,
a.province, a.city, a.area, a.shop_id, a.user_id, a.category_id, a.category_name,a.order_by_field,s.amount_owed as no_earn,t.not_buy_days,
tu.mini_program_openid,tu.unionid,tu.official_account_openid,tu.wechat_name
from t_customer a

12
hiver-modules/hiver-mall/src/main/resources/mapper/DealingsRecordMapper.xml

@ -189,7 +189,7 @@
<if test='customerBillQueryVo.startDate !=null and customerBillQueryVo.endDate !=null'>
and tdr.create_time BETWEEN #{customerBillQueryVo.startDate} AND #{customerBillQueryVo.endDate}
</if>
order by tdr.create_time asc
order by tdr.create_time desc
</select>
<select id="getDealingsRecordPageBySupplierId" resultType="cc.hiver.mall.bill.vo.SupplierBillPurchaseVo">
@ -254,7 +254,7 @@
<if test='supplierBillQueryVo.startDate !=null and supplierBillQueryVo.endDate !=null'>
and tdr.create_time BETWEEN #{supplierBillQueryVo.startDate} AND #{supplierBillQueryVo.endDate}
</if>
order by create_time asc
order by create_time desc
</select>
<!-- cancelRecord-->
@ -266,7 +266,7 @@
<select id="getArrearsByUserId" resultType="java.math.BigDecimal">
select
tdr.balance_due
tdr.last_debt_amount
from
t_dealings_record tdr
left join t_sale ts on ts.id = tdr.sale_id and ts.shop_id = #{customerBillQueryVo.shopId} and ts.status not in ('6', '7' )
@ -288,13 +288,13 @@
<if test='customerBillQueryVo.startDate !=null and customerBillQueryVo.endDate !=null'>
and tdr.create_time BETWEEN #{customerBillQueryVo.startDate} AND #{customerBillQueryVo.endDate}
</if>
order by tdr.create_time desc
order by tdr.create_time asc
limit 1
</select>
<select id="getArrearsBySupplierId" resultType="java.math.BigDecimal">
select
tdr.balance_due
tdr.last_debt_amount
from
t_dealings_record tdr
left join t_purchase ts on ts.id = tdr.sale_id and ts.shop_id = #{supplierBillQueryVo.shopId}
@ -307,7 +307,7 @@
<if test='supplierBillQueryVo.startDate !=null and supplierBillQueryVo.endDate !=null'>
and tdr.create_time BETWEEN #{supplierBillQueryVo.startDate} AND #{supplierBillQueryVo.endDate}
</if>
order by tdr.create_time desc
order by tdr.create_time asc
limit 1
</select>
</mapper>

31
hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml

@ -20,6 +20,7 @@
<result column="barcode" jdbcType="VARCHAR" property="barcode"/>
<result column="price" jdbcType="DECIMAL" property="price"/>
<result column="purchase_price" jdbcType="DECIMAL" property="purchasePrice"/>
<result column="commission" jdbcType="DECIMAL" property="commission"/>
<result column="wholesale_price" jdbcType="DECIMAL" property="wholesalePrice"/>
<result column="product_picture" jdbcType="VARCHAR" property="productPicture"/>
<result column="product_video" jdbcType="VARCHAR" property="productVideo"/>
@ -92,7 +93,7 @@
</sql>
<sql id="Base_Column_List">
id, create_by, create_time, del_flag, update_by, update_time, product_name, unit,
shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,
shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,commission,
wholesale_price, product_picture, product_video, product_intro, sales_week, print_barcode,
tail_warn,in_storage_status,customer_category_rule
</sql>
@ -133,7 +134,7 @@
product_name, unit, shop_id,
category_id,attr_id, attribute_list, supplier_id,
product_sn, barcode, price,
purchase_price, wholesale_price, product_picture,
purchase_price, commission, wholesale_price, product_picture,
product_video, product_intro, sales_week,
print_barcode, tail_warn,in_storage_status,customer_category_rule)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
@ -141,7 +142,7 @@
#{productName,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},
#{categoryId,jdbcType=VARCHAR},#{attrId,jdbcType=VARCHAR}, #{attributeList,jdbcType=VARCHAR}, #{supplierId,jdbcType=VARCHAR},
#{productSn,jdbcType=VARCHAR}, #{barcode,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
#{purchasePrice,jdbcType=DECIMAL}, #{wholesalePrice,jdbcType=DECIMAL},
#{purchasePrice,jdbcType=DECIMAL}, #{commission}, #{wholesalePrice,jdbcType=DECIMAL},
#{productPicture,jdbcType=VARCHAR},
#{productVideo,jdbcType=VARCHAR}, #{productIntro,jdbcType=VARCHAR}, #{salesWeek,jdbcType=TIMESTAMP},
#{printBarcode,jdbcType=VARCHAR}, #{tailWarn,jdbcType=INTEGER}, #{inStorageStatus,jdbcType=INTEGER},
@ -201,6 +202,9 @@
<if test="purchasePrice != null">
purchase_price,
</if>
<if test="commission != null">
commission,
</if>
<if test="wholesalePrice != null">
wholesale_price,
</if>
@ -281,6 +285,9 @@
<if test="purchasePrice != null">
#{purchasePrice,jdbcType=DECIMAL},
</if>
<if test="commission != null">
#{commission},
</if>
<if test="wholesalePrice != null">
#{wholesalePrice,jdbcType=DECIMAL},
</if>
@ -370,6 +377,9 @@
<if test="record.purchasePrice != null">
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
</if>
<if test="record.commission != null">
commission = #{record.commission,jdbcType=DECIMAL},
</if>
<if test="record.wholesalePrice != null">
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
</if>
@ -421,6 +431,7 @@
barcode = #{record.barcode,jdbcType=VARCHAR},
price = #{record.price,jdbcType=DECIMAL},
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
commission = #{record.commission,jdbcType=DECIMAL},
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
product_picture = #{record.productPicture,jdbcType=VARCHAR},
product_video = #{record.productVideo,jdbcType=VARCHAR},
@ -485,6 +496,9 @@
<if test="purchasePrice != null">
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
</if>
<if test="commission != null">
commission = #{commission,jdbcType=DECIMAL},
</if>
<if test="wholesalePrice != null">
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
</if>
@ -533,6 +547,7 @@
barcode = #{barcode,jdbcType=VARCHAR},
price = #{price,jdbcType=DECIMAL},
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
commission = #{commission,jdbcType=DECIMAL},
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
product_picture = #{productPicture,jdbcType=VARCHAR},
product_video = #{productVideo,jdbcType=VARCHAR},
@ -566,6 +581,7 @@
t.barcode,
t.price,
t.purchase_price,
t.commission,
t.wholesale_price,
t.product_picture,
t.product_video,
@ -780,6 +796,11 @@
where id = #{id,jdbcType=VARCHAR} or barcode =#{id,jdbcType=VARCHAR}
</select>
<select id="getProductSaleCount" parameterType="java.lang.String" resultType="java.lang.Integer">
select SUM(dd.product_count) from t_sale_detail dd
right join t_sale aa on aa.id = dd.sale_id and aa.status = 4 where dd.product_id = #{id,jdbcType=VARCHAR}
</select>
<select id="getProductByProductSnList" resultType="cc.hiver.mall.entity.Product">
select
<include refid="Base_Column_List"/>
@ -821,7 +842,7 @@
<!--批量新增商品子图-->
<insert id="batchSaveProduct" parameterType="java.util.List">
insert into t_product (id, create_by, create_time, del_flag, update_by, update_time, product_name, unit,
shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,
shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,commission,
wholesale_price, product_picture, product_video, product_intro, sales_week, print_barcode,
tail_warn,in_storage_status) values
<foreach item="product" collection="addProductList" index="index" separator=",">
@ -830,7 +851,7 @@
#{product.productName,jdbcType=VARCHAR},#{product.unit,jdbcType=VARCHAR},#{product.shopId,jdbcType=VARCHAR},
#{product.categoryId,jdbcType=VARCHAR},#{product.attrId,jdbcType=VARCHAR},#{product.attributeList,jdbcType=VARCHAR},
#{product.supplierId,jdbcType=VARCHAR},#{product.supplierName,jdbcType=VARCHAR},#{product.productSn,jdbcType=VARCHAR},
#{product.barcode,jdbcType=VARCHAR},#{product.price,jdbcType=DECIMAL},#{product.purchasePrice,jdbcType=DECIMAL},
#{product.barcode,jdbcType=VARCHAR},#{product.price,jdbcType=DECIMAL},#{product.purchasePrice,jdbcType=DECIMAL},#{product.commission,jdbcType=DECIMAL},
#{product.wholesalePrice,jdbcType=DECIMAL},#{product.productPicture,jdbcType=VARCHAR},#{product.productVideo,jdbcType=VARCHAR},
#{product.productIntro,jdbcType=VARCHAR},#{product.salesWeek,jdbcType=DATE},#{product.printBarcode,jdbcType=VARCHAR},
#{product.tailWarn,jdbcType=INTEGER},#{product.inStorageStatus,jdbcType=INTEGER})

2
hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml

@ -523,7 +523,7 @@
select
IFNULL(sum(should_pay),0.00) as purchasingCost
from t_purchase
where del_flag = '0'
where del_flag = '0' and in_storage_status = 1
and shop_id = #{shopId}
and create_time BETWEEN #{startTime} AND #{endTime}
</select>

83
hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml

@ -1016,6 +1016,89 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
group by pay_type
</select>
<select id="queryTotalAmountByCategory" resultType="cc.hiver.mall.pojo.vo.CategoryNumberVo">
select IFNULL(sum(discount_amount * product_count),0.00) as totalAmount,IFNULL(sum(product_count),0.00) as totalJCount from t_sale_detail where category_id in
<foreach close=")" collection="ids" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
and sale_id in (
SELECT
id
FROM
t_sale ts
WHERE
ts.del_flag = '0'
AND ts.shop_id = #{shopId}
AND ts.STATUS NOT IN ( '2', '6', '7' )
AND ts.create_time BETWEEN #{startTime} AND #{endTime})
</select>
<select id="queryTotalProfitByCategory" resultType="java.math.BigDecimal">
select IFNULL(sum(ss.product_count * tt.purchase_price),0.00) from t_sale_detail ss
LEFT JOIN t_product tt on ss.product_id = tt.id where ss.category_id in
<foreach close=")" collection="ids" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
and ss.sale_id in (
SELECT
id
FROM
t_sale ts
WHERE
ts.del_flag = '0'
AND ts.shop_id = #{shopId}
AND ts.STATUS NOT IN ( '2', '6', '7' )
AND ts.create_time BETWEEN #{startTime} AND #{endTime})
</select>
<select id="queryTotalPurchaseByCategory" resultType="cc.hiver.mall.pojo.vo.CategoryNumberVo">
select IFNULL(sum(purchase_price * product_count),0.00) as purchasingCost,IFNULL(sum(product_count),0.00) as purchasingCount
from t_purchase_detail where category_id in
<foreach close=")" collection="ids" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
and purchase_id IN
(select id from t_purchase where del_flag = '0' and in_storage_status = 1
and shop_id = #{shopId}
and create_time BETWEEN #{startTime} AND #{endTime})
</select>
<select id="queryTotalReturnByCategory" resultType="cc.hiver.mall.pojo.vo.CategoryNumberVo">
select IFNULL(sum(discount_amount * product_count),0.00) as returnTotalAmount,IFNULL(sum(product_count),0.00) as returnTotalCount
from t_return_detail where category_id in
<foreach close=")" collection="ids" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
and sale_id in
(SELECT
id
FROM
t_sale ts
WHERE
ts.del_flag = '0'
AND ts.shop_id = #{shopId}
AND ts.STATUS NOT IN ( '2', '6', '7' )
AND ts.create_time BETWEEN #{startTime} AND #{endTime})
</select>
<select id="querySaleReturnCost" resultType="java.math.BigDecimal">
select IFNULL(sum(tt.purchase_price * dd.product_count),0.00)
from t_return_detail dd left join t_product tt on dd.product_id = tt.id where dd.category_id in
<foreach close=")" collection="ids" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
and dd.sale_id in
(SELECT
id
FROM
t_sale ts
WHERE
ts.del_flag = '0'
AND ts.shop_id = #{shopId}
AND ts.STATUS NOT IN ( '2', '6', '7' )
AND ts.create_time BETWEEN #{startTime} AND #{endTime})
</select>
<select id="queryTotalAlreadyEarn" resultType="java.math.BigDecimal">
select IFNULL(Sum(already_earn),0.00) as totalAlreadyEarn

82
hiver-modules/hiver-mall/src/main/resources/mapper/ShopMapper.xml

@ -33,6 +33,12 @@
<result column="rebate_amount" property="rebateAmount" jdbcType="VARCHAR" />
<result column="attr_id" property="attrId" jdbcType="VARCHAR" />
<result column="printing_method" property="printingMethod" jdbcType="VARCHAR" />
<result column="shop_images" property="shopImages" jdbcType="VARCHAR" />
<result column="shop_lename" property="shopLename" jdbcType="VARCHAR" />
<result column="shop_lecard" property="shopLecard" jdbcType="VARCHAR" />
<result column="shop_score" property="shopScore" jdbcType="VARCHAR" />
<result column="isbrandflag" property="isbrandflag" jdbcType="INTEGER" />
<result column="subtitle" property="subtitle" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="cc.hiver.mall.entity.Shop" extends="BaseResultMap" >
<result column="remark" property="remark" jdbcType="LONGVARCHAR" />
@ -41,7 +47,7 @@
id, create_by, create_time, del_flag, update_by, update_time, shop_name, shop_owner_id, shop_manger_id, region,
region_id, shop_area, shop_area_title, shop_type, shop_type_title, shop_address, year_fee, charge_time, start_time,
end_time, status, remark, business_district_level, contact_phone, shop_icon, defaulted, ali_account, ali_name,
rebate_amount, attr_id, printing_method
rebate_amount, attr_id, printing_method,shop_images,shop_lename,shop_lecard,shop_score,isbrandflag,subtitle
</sql>
<sql id="Blob_Column_List" >
remark
@ -62,11 +68,11 @@ rebate_amount, attr_id, printing_method
insert into t_shop (id, create_by, create_time, del_flag, update_by, update_time, shop_name, shop_owner_id, shop_manger_id, region,
region_id, shop_area, shop_area_title, shop_type, shop_type_title, shop_address, year_fee, charge_time, start_time,
end_time, status, remark, business_district_level, contact_phone, shop_icon, defaulted, ali_account, ali_name,
rebate_amount, attr_id, printing_method)
rebate_amount, attr_id, printing_method, shop_images, shop_lename, shop_lecard, shop_score, isbrandflag, subtitle)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{shopName,jdbcType=VARCHAR}, #{shopOwnerId,jdbcType=VARCHAR}, #{shopMangerId,jdbcType=VARCHAR}, #{region,jdbcType=VARCHAR},
#{regionId,jdbcType=VARCHAR}, #{shopArea,jdbcType=VARCHAR}, #{shopAreaTitle,jdbcType=VARCHAR}, #{shopType,jdbcType=VARCHAR}, #{shopTypeTitle,jdbcType=VARCHAR}, #{shopAddress,jdbcType=VARCHAR}, #{yearFee,jdbcType=VARCHAR}, #{chargeTime,jdbcType=VARCHAR}, #{startTime,jdbcType=VARCHAR},
#{endTime,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{remark,jdbcType=LONGVARCHAR}, #{businessDistrictLevel,jdbcType=VARCHAR}, #{contactPhone,jdbcType=VARCHAR}, #{shopIcon,jdbcType=VARCHAR}, #{defaulted,jdbcType=INTEGER}, #{aliAccount,jdbcType=VARCHAR}, #{aliName,jdbcType=VARCHAR},
#{rebateAmount,jdbcType=VARCHAR}, #{attrId,jdbcType=VARCHAR}, #{printingMethod,jdbcType=VARCHAR})
#{rebateAmount,jdbcType=VARCHAR}, #{attrId,jdbcType=VARCHAR}, #{printingMethod,jdbcType=VARCHAR}, #{shopImages,jdbcType=VARCHAR}, #{shopLename,jdbcType=VARCHAR}, #{shopLecard,jdbcType=VARCHAR}, #{shopScore,jdbcType=VARCHAR}, #{isbrandflag,jdbcType=INTEGER}, #{subtitle,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.Shop" >
insert into t_shop
@ -140,6 +146,24 @@ rebate_amount, attr_id, printing_method
<if test="remark != null" >
remark,
</if>
<if test="shopImages != null" >
shop_images,
</if>
<if test="shopLename != null" >
shop_lename,
</if>
<if test="shopLecard != null" >
shop_lecard,
</if>
<if test="shopScore != null" >
shop_score,
</if>
<if test="isbrandflag != null" >
isbrandflag,
</if>
<if test="subtitle != null" >
subtitle,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
@ -211,6 +235,24 @@ rebate_amount, attr_id, printing_method
<if test="remark != null" >
#{remark,jdbcType=LONGVARCHAR},
</if>
<if test="shopImages != null" >
#{shopImages,jdbcType=VARCHAR},
</if>
<if test="shopLename != null" >
#{shopLename,jdbcType=VARCHAR},
</if>
<if test="shopLecard != null" >
#{shopLecard,jdbcType=VARCHAR},
</if>
<if test="shopScore != null" >
#{shopScore,jdbcType=VARCHAR},
</if>
<if test="isbrandflag != null" >
#{isbrandflag,jdbcType=INTEGER},
</if>
<if test="subtitle != null" >
#{subtitle,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.mall.entity.Shop" >
@ -282,6 +324,24 @@ rebate_amount, attr_id, printing_method
<if test="remark != null" >
remark = #{remark,jdbcType=LONGVARCHAR},
</if>
<if test="shopImages != null" >
shop_images = #{shopImages,jdbcType=VARCHAR},
</if>
<if test="shopLename != null" >
shop_lename = #{shopLename,jdbcType=VARCHAR},
</if>
<if test="shopLecard != null" >
shop_lecard = #{shopLecard,jdbcType=VARCHAR},
</if>
<if test="shopScore != null" >
shop_score = #{shopScore,jdbcType=VARCHAR},
</if>
<if test="isbrandflag != null" >
isbrandflag = #{isbrandflag,jdbcType=INTEGER},
</if>
<if test="subtitle != null" >
subtitle = #{subtitle,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@ -308,7 +368,13 @@ rebate_amount, attr_id, printing_method
defaulted = #{defaulted,jdbcType=INTEGER},
region = #{region,jdbcType=VARCHAR},
shop_area_title = #{shopAreaTitle,jdbcType=VARCHAR},
remark = #{remark,jdbcType=LONGVARCHAR}
remark = #{remark,jdbcType=LONGVARCHAR},
shop_images = #{shopImages,jdbcType=VARCHAR},
shop_lename = #{shopLename,jdbcType=VARCHAR},
shop_lecard = #{shopLecard,jdbcType=VARCHAR},
shop_score = #{shopScore,jdbcType=VARCHAR},
isbrandflag = #{isbrandflag,jdbcType=INTEGER},
subtitle = #{subtitle,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="cc.hiver.mall.entity.Shop" >
@ -342,7 +408,13 @@ rebate_amount, attr_id, printing_method
ali_name = #{aliName,jdbcType=VARCHAR},
rebate_amount = #{rebateAmount,jdbcType=DECIMAL},
attr_id = #{attrId,jdbcType=VARCHAR},
printing_method = #{printingMethod,jdbcType=VARCHAR}
printing_method = #{printingMethod,jdbcType=VARCHAR},
shop_images = #{shopImages,jdbcType=VARCHAR},
shop_lename = #{shopLename,jdbcType=VARCHAR},
shop_lecard = #{shopLecard,jdbcType=VARCHAR},
shop_score = #{shopScore,jdbcType=VARCHAR},
isbrandflag = #{isbrandflag,jdbcType=INTEGER},
subtitle = #{subtitle,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<select id="findByUserId" resultType="cc.hiver.mall.entity.Shop">

16
hiver-modules/hiver-social/src/main/java/cc/hiver/social/controller/WechatController.java

@ -11,6 +11,7 @@ import cc.hiver.core.common.vo.Result;
import cc.hiver.mall.service.mybatis.CustomerService;
import cc.hiver.social.entity.Social;
import cc.hiver.social.service.SocialService;
import cc.hiver.social.serviceimpl.WechatPhoneService;
import cc.hiver.social.vo.WeChatServerMsgVo;
import cc.hiver.social.vo.WechatUserInfo;
import cn.hutool.core.text.CharSequenceUtil;
@ -88,6 +89,9 @@ public class WechatController {
@Autowired
private CustomerService customerService;
@Autowired
private WechatPhoneService wechatPhoneService;
/**
* 微信认证服务器地址
*/
@ -118,6 +122,18 @@ public class WechatController {
return ResultUtil.data(url);
}
@PostMapping("/getPhone")
@ResponseBody
public Result getUserPhone(@RequestParam(required = false) String code) {
String phoneNumber = wechatPhoneService.getPhoneNumber(code);
if (phoneNumber != null) {
return ResultUtil.data(phoneNumber);
} else {
return ResultUtil.error(401,"获取手机号失败");
}
}
@RequestMapping(value = "/callback", method = RequestMethod.GET)
@ApiOperation("获取accessToken")
@SystemLog(description = "微信关联登录", type = LogType.LOGIN)

Loading…
Cancel
Save