Browse Source

各种优化;

dev
wangfukang 2 years ago
parent
commit
827e858791
  1. 3
      hiver-admin/src/main/resources/application.yml
  2. 16
      hiver-admin/test-output/test-report.html
  3. 27
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/StockController.java
  4. 1
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java
  5. 15
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/debt/controller/DebtController.java
  6. 3
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/debt/mapper/DebtMapper.java
  7. 3
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/debt/service/DebtService.java
  8. 6
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/debt/service/impl/DebtServiceImpl.java
  9. 19
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/debt/vo/DebtOfShopVo.java
  10. 2
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java
  11. 16
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java
  12. 41
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/StockService.java
  13. 6
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java
  14. 16
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java
  15. 4
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/AliOcrUtil.java
  16. 18
      hiver-modules/hiver-mall/src/main/resources/mapper/DebtMapper.xml
  17. 2
      hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml
  18. 17
      hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseDetailMapper.xml
  19. 9
      hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml
  20. 15
      hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml

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

@ -335,7 +335,8 @@ ignored:
# 根据店铺id获取店铺二维码信息 # 根据店铺id获取店铺二维码信息
- /hiver/app/shop/getshopIconById - /hiver/app/shop/getshopIconById
# # 临时增加 # 临时增加
- /hiver/app/debt/getAllDebtByShopId
# 限流及黑名单不拦截的路径 # 限流及黑名单不拦截的路径
limitUrls: limitUrls:
- /**/*.js - /**/*.js

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

@ -35,7 +35,7 @@
<a href="#"><span class="badge badge-primary">Hiver</span></a> <a href="#"><span class="badge badge-primary">Hiver</span></a>
</li> </li>
<li class="m-r-10"> <li class="m-r-10">
<a href="#"><span class="badge badge-primary">八月 04, 2024 18:32:59</span></a> <a href="#"><span class="badge badge-primary">八月 08, 2024 23:26:15</span></a>
</li> </li>
</ul> </ul>
</div> </div>
@ -84,7 +84,7 @@
<div class="test-detail"> <div class="test-detail">
<span class="meta text-white badge badge-sm"></span> <span class="meta text-white badge badge-sm"></span>
<p class="name">passTest</p> <p class="name">passTest</p>
<p class="text-sm"><span>18:32:59 下午</span> / <span>0.026 secs</span></p> <p class="text-sm"><span>23:26:16 下午</span> / <span>0.016 secs</span></p>
</div> </div>
<div class="test-contents d-none"> <div class="test-contents d-none">
<div class="detail-head"> <div class="detail-head">
@ -92,9 +92,9 @@
<div class="info"> <div class="info">
<div class='float-right'><span class='badge badge-default'>#test-id=1</span></div> <div class='float-right'><span class='badge badge-default'>#test-id=1</span></div>
<h5 class="test-status text-pass">passTest</h5> <h5 class="test-status text-pass">passTest</h5>
<span class='badge badge-success'>08.04.2024 18:32:59</span> <span class='badge badge-success'>08.08.2024 23:26:16</span>
<span class='badge badge-danger'>08.04.2024 18:32:59</span> <span class='badge badge-danger'>08.08.2024 23:26:16</span>
<span class='badge badge-default'>0.026 secs</span> <span class='badge badge-default'>0.016 secs</span>
</div> </div>
<div class="m-t-10 m-l-5"></div> <div class="m-t-10 m-l-5"></div>
</div> </div>
@ -104,7 +104,7 @@
<tbody> <tbody>
<tr class="event-row"> <tr class="event-row">
<td><span class="badge log pass-bg">Pass</span></td> <td><span class="badge log pass-bg">Pass</span></td>
<td>18:32:59</td> <td>23:26:16</td>
<td> <td>
Test passed Test passed
</td> </td>
@ -128,13 +128,13 @@
<div class="col-md-3"> <div class="col-md-3">
<div class="card"><div class="card-body"> <div class="card"><div class="card-body">
<p class="m-b-0">Started</p> <p class="m-b-0">Started</p>
<h3>八月 04, 2024 18:32:59</h3> <h3>八月 08, 2024 23:26:15</h3>
</div></div> </div></div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="card"><div class="card-body"> <div class="card"><div class="card-body">
<p class="m-b-0">Ended</p> <p class="m-b-0">Ended</p>
<h3>八月 04, 2024 18:32:59</h3> <h3>八月 08, 2024 23:26:16</h3>
</div></div> </div></div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">

27
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/StockController.java

@ -180,10 +180,11 @@ public class StockController {
/** /**
* 获取店铺所有达到库存预警的商品信息 * 获取店铺所有达到库存预警的商品信息
* @author 王富康 *
* @date 2024/3/18
* @param stockPageQuery * @param stockPageQuery
* @return Result * @return Result
* @author 王富康
* @date 2024/3/18
*/ */
@RequestMapping(value = "/getTailWarnProduct", method = RequestMethod.POST) @RequestMapping(value = "/getTailWarnProduct", method = RequestMethod.POST)
@ApiOperation(value = "获取店铺所有达到库存预警的商品信息") @ApiOperation(value = "获取店铺所有达到库存预警的商品信息")
@ -192,4 +193,26 @@ public class StockController {
return new ResultUtil<List<StockProductVo>>().setData(checkStockList); return new ResultUtil<List<StockProductVo>>().setData(checkStockList);
} }
/**
* 删除库存真删除
*
* @param id
* @return Result
* @author 王富康
* @date 2024/8/8
*/
@RequestMapping(value = "/deleteStockById", method = RequestMethod.POST)
@ApiOperation("删除库存(真删除)")
public Result deleteStockById(String id) {
// 供应商名称
if (StringUtils.isEmpty(id)) {
return ResultUtil.error("id不能为空!");
}
try {
stockService.deleteStockById(id);
return ResultUtil.success("删除成功!");
} catch (Exception e) {
return ResultUtil.error("删除失败!");
}
}
} }

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

@ -114,4 +114,5 @@ public interface SaleMapper extends BaseMapper<Sale> {
*/ */
Page<CustomerSaleDetailVo> customerSaleDetail(Page<CustomerSaleDetailVo> page,@Param("salePageQuery") SalePageQuery salePageQuery); Page<CustomerSaleDetailVo> customerSaleDetail(Page<CustomerSaleDetailVo> page,@Param("salePageQuery") SalePageQuery salePageQuery);
int queryTotalJCount(@Param("shopId") String shopId,@Param("startTime") String startTime, @Param("endTime") String endTime);
} }

15
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/debt/controller/DebtController.java

@ -4,6 +4,7 @@ import cc.hiver.core.common.utils.ResultUtil;
import cc.hiver.core.common.vo.Result; import cc.hiver.core.common.vo.Result;
import cc.hiver.mall.debt.entity.Debt; import cc.hiver.mall.debt.entity.Debt;
import cc.hiver.mall.debt.service.DebtService; import cc.hiver.mall.debt.service.DebtService;
import cc.hiver.mall.debt.vo.DebtOfShopVo;
import cc.hiver.mall.debt.vo.QueryDebtVo; import cc.hiver.mall.debt.vo.QueryDebtVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -100,5 +101,17 @@ public class DebtController {
return new ResultUtil<>().setData(saveOrUpdateDebt); return new ResultUtil<>().setData(saveOrUpdateDebt);
} }
/**
* 查询指定店铺的所有欠款客户/供应商数量及欠款金额
* @author 王富康
* @date 2024/8/8
* @param queryDebtVo
* @return Result
*/
@RequestMapping(value = "/getAllDebtByShopId", method = RequestMethod.POST)
@ApiOperation("查询指定店铺的所有欠款客户/供应商数量及欠款金额")
public Result getAllDebtByShopId(@RequestBody QueryDebtVo queryDebtVo) {
final DebtOfShopVo debtByShopId = debtService.getAllDebtByShopId(queryDebtVo);
return new ResultUtil<>().setData(debtByShopId);
}
} }

3
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/debt/mapper/DebtMapper.java

@ -1,6 +1,7 @@
package cc.hiver.mall.debt.mapper; package cc.hiver.mall.debt.mapper;
import cc.hiver.mall.debt.entity.Debt; import cc.hiver.mall.debt.entity.Debt;
import cc.hiver.mall.debt.vo.DebtOfShopVo;
import cc.hiver.mall.debt.vo.QueryDebtVo; import cc.hiver.mall.debt.vo.QueryDebtVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -14,4 +15,6 @@ public interface DebtMapper extends BaseMapper<Debt> {
Debt selectByUserId(@Param("shopId")String shopId, @Param("userId") String userId); Debt selectByUserId(@Param("shopId")String shopId, @Param("userId") String userId);
List<Debt> getDebtByUserIds(@Param("userIds") List<String> userIds); List<Debt> getDebtByUserIds(@Param("userIds") List<String> userIds);
DebtOfShopVo getAllDebtByShopId(@Param("queryDebtVo") QueryDebtVo queryDebtVo);
} }

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

@ -1,6 +1,7 @@
package cc.hiver.mall.debt.service; package cc.hiver.mall.debt.service;
import cc.hiver.mall.debt.entity.Debt; import cc.hiver.mall.debt.entity.Debt;
import cc.hiver.mall.debt.vo.DebtOfShopVo;
import cc.hiver.mall.debt.vo.QueryDebtVo; import cc.hiver.mall.debt.vo.QueryDebtVo;
import cc.hiver.mall.entity.Purchase; import cc.hiver.mall.entity.Purchase;
import cc.hiver.mall.pojo.dto.SaleQueryDTO; import cc.hiver.mall.pojo.dto.SaleQueryDTO;
@ -78,4 +79,6 @@ public interface DebtService extends IService<Debt> {
Debt selectByUserId(String shopId, String userId); Debt selectByUserId(String shopId, String userId);
Debt recharge(Debt debt); Debt recharge(Debt debt);
DebtOfShopVo getAllDebtByShopId(QueryDebtVo queryDebtVo);
} }

6
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/debt/service/impl/DebtServiceImpl.java

@ -7,6 +7,7 @@ import cc.hiver.mall.debt.constant.DebtConstant;
import cc.hiver.mall.debt.entity.Debt; import cc.hiver.mall.debt.entity.Debt;
import cc.hiver.mall.debt.mapper.DebtMapper; import cc.hiver.mall.debt.mapper.DebtMapper;
import cc.hiver.mall.debt.service.DebtService; import cc.hiver.mall.debt.service.DebtService;
import cc.hiver.mall.debt.vo.DebtOfShopVo;
import cc.hiver.mall.debt.vo.QueryDebtVo; import cc.hiver.mall.debt.vo.QueryDebtVo;
import cc.hiver.mall.entity.Customer; import cc.hiver.mall.entity.Customer;
import cc.hiver.mall.entity.DealingsRecord; import cc.hiver.mall.entity.DealingsRecord;
@ -328,4 +329,9 @@ public class DebtServiceImpl extends ServiceImpl<DebtMapper, Debt> implements De
dealingsRecordService.save(dealingsRecord); dealingsRecordService.save(dealingsRecord);
return debt; return debt;
} }
@Override
public DebtOfShopVo getAllDebtByShopId(QueryDebtVo queryDebtVo) {
return debtMapper.getAllDebtByShopId(queryDebtVo);
}
} }

19
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/debt/vo/DebtOfShopVo.java

@ -0,0 +1,19 @@
package cc.hiver.mall.debt.vo;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class DebtOfShopVo {
/**
* 欠款人数
* */
private Integer personCount;
/**
* 欠款金额
* */
private BigDecimal amountOwed;
}

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

@ -75,4 +75,6 @@ public class SaleVO implements Serializable {
"2:需要根据前台传递的status查询列表:6:待配货列表;7挂单列表") "2:需要根据前台传递的status查询列表:6:待配货列表;7挂单列表")
private String fromWhere; private String fromWhere;
@ApiModelProperty(value = "删除标识")
String delFlag;
} }

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

@ -221,6 +221,7 @@ public class PurchaseOcrPictureServiceImpl implements PurchaseOcrPictureService
productSn = CommonUtil.getProductSn(productSn); productSn = CommonUtil.getProductSn(productSn);
final String productName = object.getString("productName"); final String productName = object.getString("productName");
final String priceStr = object.getString("price"); final String priceStr = object.getString("price");
BigDecimal price = BigDecimal.ZERO; BigDecimal price = BigDecimal.ZERO;
// 使用正则表达式提取数字部分 // 使用正则表达式提取数字部分
final Pattern pattern = Pattern.compile("-?\\d+(\\.\\d+)?"); final Pattern pattern = Pattern.compile("-?\\d+(\\.\\d+)?");
@ -231,7 +232,15 @@ public class PurchaseOcrPictureServiceImpl implements PurchaseOcrPictureService
price = new BigDecimal(numericPart); price = new BigDecimal(numericPart);
} }
final String wholesalePriceStr = object.getString("wholesalePrice");
BigDecimal wholesalePrice = BigDecimal.ZERO;
final Matcher wholesalePriceMatcher = pattern.matcher(wholesalePriceStr);
if (wholesalePriceMatcher.find()) {
// 获取匹配到的数字字符串并转换为BigDecimal
final String numericPart = wholesalePriceMatcher.group();
wholesalePrice = new BigDecimal(numericPart);
}
final String attributeList = object.getString("attributeList"); final String attributeList = object.getString("attributeList");
final JSONArray attributeListJsonArray = JSON.parseArray(attributeList); final JSONArray attributeListJsonArray = JSON.parseArray(attributeList);
// 根据货号去查询商品,如果 // 根据货号去查询商品,如果
@ -264,6 +273,12 @@ public class PurchaseOcrPictureServiceImpl implements PurchaseOcrPictureService
}else{ }else{
purchaseDetail.setPurchasePrice(price); purchaseDetail.setPurchasePrice(price);
} }
// ai语音入库旧商品 如果通义千问返回的价格为0,返回当前批发价 ,批发价:wholesalePrice
if (wholesalePrice.compareTo(BigDecimal.ZERO) == 0) {
purchaseDetail.setWholesalePrice(product.getWholesalePrice());
}else{
purchaseDetail.setWholesalePrice(wholesalePrice);
}
purchaseDetail.setAttrId(product.getAttrId()); purchaseDetail.setAttrId(product.getAttrId());
final List<StockLog> stockLogList = new ArrayList<>(); final List<StockLog> stockLogList = new ArrayList<>();
@ -383,6 +398,7 @@ public class PurchaseOcrPictureServiceImpl implements PurchaseOcrPictureService
purchaseDetail.setProductName(productName); purchaseDetail.setProductName(productName);
purchaseDetail.setProductSn(productSn); purchaseDetail.setProductSn(productSn);
purchaseDetail.setPurchasePrice(price); purchaseDetail.setPurchasePrice(price);
purchaseDetail.setWholesalePrice(wholesalePrice);
purchaseDetail.setProductCount(0); purchaseDetail.setProductCount(0);
// 获取默认分类 // 获取默认分类
final ProductCategoryVo defaultCategory = productCategoryService.getDefaultCategory(shopId); final ProductCategoryVo defaultCategory = productCategoryService.getDefaultCategory(shopId);

41
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/StockService.java

@ -19,26 +19,29 @@ public interface StockService extends IService<Stock> {
/** /**
* 待入库入库,维护价格等相关信息 * 待入库入库,维护价格等相关信息
* @author 王富康 *
* @date 2023/11/21
* @param purchaseVo * @param purchaseVo
* @return Result * @return Result
* @author 王富康
* @date 2023/11/21
*/ */
Result putInPrice(PurchaseVo purchaseVo); Result putInPrice(PurchaseVo purchaseVo);
/** /**
* 获取某店铺的库存管理顶部信息 * 获取某店铺的库存管理顶部信息
*
* @return ShopStockVo
* @author 王富康 * @author 王富康
* @date 2023/11/21 * @date 2023/11/21
* @return ShopStockVo
*/ */
ShopStockVo getShopStock(); ShopStockVo getShopStock();
/** /**
* 获取该店的库存信息 * 获取该店的库存信息
*
* @return List<Stock>
* @author 王富康 * @author 王富康
* @date 2023/11/21 * @date 2023/11/21
* @return List<Stock>
*/ */
List<Stock> stockListOfShop(); List<Stock> stockListOfShop();
@ -52,10 +55,11 @@ public interface StockService extends IService<Stock> {
/** /**
* 根据商品id获取该商品所有规格的库存信息 * 根据商品id获取该商品所有规格的库存信息
* @author 王富康 *
* @date 2024/4/17
* @param productId 商品id * @param productId 商品id
* @return List<Stock> * @return List<Stock>
* @author 王富康
* @date 2024/4/17
*/ */
List<Stock> getProductStock(String productId); List<Stock> getProductStock(String productId);
@ -65,35 +69,48 @@ public interface StockService extends IService<Stock> {
/** /**
* 根据商品属性id获取商品的库存数 * 根据商品属性id获取商品的库存数
* @author 王富康 *
* @date 2024/7/6
* @param attrId * @param attrId
* @return List<Stock> * @return List<Stock>
* @author 王富康
* @date 2024/7/6
*/ */
List<Stock> getProductStockByAttrId(String attrId); List<Stock> getProductStockByAttrId(String attrId);
/** /**
* 根据商品id批量删除库存 * 根据商品id批量删除库存
*
* @param productIds
* @author 王富康 * @author 王富康
* @date 2024/7/27 * @date 2024/7/27
* @param productIds
*/ */
void batchDeleteStockByProductIds(String productIds); void batchDeleteStockByProductIds(String productIds);
/** /**
* 根据入库记录减掉库存数 * 根据入库记录减掉库存数
*
* @param stockLogList
* @author 王富康 * @author 王富康
* @date 2024/7/27 * @date 2024/7/27
* @param stockLogList
*/ */
void batchReduceStockByLog(List<StockLog> stockLogList); void batchReduceStockByLog(List<StockLog> stockLogList);
/** /**
* 获取某些商品均色均码的库存数 * 获取某些商品均色均码的库存数
* @author 王富康 *
* @date 2024/8/4
* @param productIdList * @param productIdList
* @return List<Stock> * @return List<Stock>
* @author 王富康
* @date 2024/8/4
*/ */
List<Stock> getDefaultStockCount(List<String> productIdList); List<Stock> getDefaultStockCount(List<String> productIdList);
/**
* 删除库存真删除
*
* @param id
* @author 王富康
* @date 2024/8/8
*/
void deleteStockById(String id);
} }

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

@ -178,6 +178,12 @@ public class SalesCalculateServiceImpl implements SalesCalculateService {
// 获取今日实收分别从哪几个渠道收入的 // 获取今日实收分别从哪几个渠道收入的
final List<TotalAlreadyEarnDetailVo> totalAlreadyEarnDetailMap = saleMapper.queryTotalAlreadyEarnDetail(shopId,startTime,endTime); final List<TotalAlreadyEarnDetailVo> totalAlreadyEarnDetailMap = saleMapper.queryTotalAlreadyEarnDetail(shopId,startTime,endTime);
saleAllVO.setTotalAlreadyEarnDetail(totalAlreadyEarnDetailMap); saleAllVO.setTotalAlreadyEarnDetail(totalAlreadyEarnDetailMap);
// 20240805 增加需要加一个今日销售总件数:查sale表的prodect_count总和 状态delflag=0;status=4的
//获取今日实收
final int totalJCount = saleMapper.queryTotalJCount(shopId,startTime,endTime);
saleAllVO.setTotalJCount(totalJCount);
return saleAllVO; return saleAllVO;
} }

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

@ -884,7 +884,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
purchaseDetail.setShopId(shopId); purchaseDetail.setShopId(shopId);
purchaseDetail.setPurchaseId(purchaseId); purchaseDetail.setPurchaseId(purchaseId);
// 设置一些商品信息 // 设置一些商品信息
purchaseDetail.setProductName(product.getProductName()); // purchaseDetail.setProductName(product.getProductName());
purchaseDetail.setUnit(product.getUnit()); purchaseDetail.setUnit(product.getUnit());
purchaseDetail.setCategoryId(product.getCategoryId()); purchaseDetail.setCategoryId(product.getCategoryId());
purchaseDetail.setAttrId(product.getAttrId()); purchaseDetail.setAttrId(product.getAttrId());
@ -960,6 +960,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
product.setWholesalePrice(purchaseDetail.getWholesalePrice()); product.setWholesalePrice(purchaseDetail.getWholesalePrice());
// 更新商品的图片 // 更新商品的图片
product.setProductPicture(purchaseDetail.getProductPicture()); product.setProductPicture(purchaseDetail.getProductPicture());
// 更新商品的名称
product.setProductName(purchaseDetail.getProductName());
updateProductList.add(product); updateProductList.add(product);
// 先计算平均采购价、再更新库存数,否则会有问题。 // 先计算平均采购价、再更新库存数,否则会有问题。
@ -1186,4 +1188,16 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
public List<Stock> getDefaultStockCount(List<String> productIdList) { public List<Stock> getDefaultStockCount(List<String> productIdList) {
return stockMapper.getDefaultStockCount(productIdList); return stockMapper.getDefaultStockCount(productIdList);
} }
/**
* 删除库存真删除
*
* @param id
* @author 王富康
* @date 2024/8/8
*/
@Override
public void deleteStockById(String id) {
stockMapper.deleteById(id);
}
} }

4
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/AliOcrUtil.java

@ -888,8 +888,8 @@ public class AliOcrUtil {
final Message systemMsg = final Message systemMsg =
Message.builder().role(Role.SYSTEM.getValue()).content("You are a helpful assistant.").build(); Message.builder().role(Role.SYSTEM.getValue()).content("You are a helpful assistant.").build();
// questionMsg += "请帮我把所有内容封装为JSON,json格式为:[{ \"productSn\": \"货号\", \"productName\": \"名称\" , \"price\":\"单价\",\"attributeList\": [{\"color\":\"颜色\",\"size\":\"尺码\",\"productCount\": \"数量\"}] }]。以下是几点要求: 1.“货号”两个字和\"名称\"两个字中间的内容代表productSn的值,如果没有名称则“货号”两个字和颜色中间的内容代表productSn的值,productSn可能包含\"新\"、\"退\"、\"旧\"、\"换\"、\"补\"。2.\"SYYS色\"代表“所有颜色”,\"color\"字段返回“SYYS色”。 3.\"SYCM码\"代表“所有尺码”,\"size\"字段返回“SYCM码”。4.如果没有名称,productName字段返回\"\"。5.只输出JSON数据即可,不用返回字段描述和解析过程。"; // questionMsg += "请帮我把所有内容封装为JSON,json格式为:[{ \"productSn\": \"货号\", \"productName\": \"名称\" , \"price\":\"单价\",\"attributeList\": [{\"color\":\"颜色\",\"size\":\"尺码\",\"productCount\": \"数量\"}] }]。以下是几点要求: 1.“货号”两个字和\"名称\"两个字中间的内容代表productSn的值,如果没有名称则“货号”两个字和颜色中间的内容代表productSn的值,productSn可能包含\"新\"、\"退\"、\"旧\"、\"换\"、\"补\"。2.\"SYYS色\"代表“所有颜色”,\"color\"字段返回“SYYS色”。 3.\"SYCM码\"代表“所有尺码”,\"size\"字段返回“SYCM码”。4.如果没有名称,productName字段返回\"\"。5.只输出JSON数据即可,不用返回字段描述和解析过程。";
questionMsg += "你是一个服装行业库管专家,请帮我把所有内容封装为JSON,json格式为:[{ \"productSn\": \"货号\", \"productName\": \"名称\" , \"attributeList\": [{\"color\":\"颜色\",\"size\":\"尺码\",\"productCount\": \"数量\"}], \"price\":\"单价\" }],\n" + questionMsg += "你是一个服装行业库管专家,请帮我把所有内容封装为JSON,json格式为:[{ \"productSn\": \"货号\", \"productName\": \"名称\" , \"attributeList\": [{\"color\":\"颜色\",\"size\":\"尺码\",\"productCount\": \"数量\"}], \"price\":\"单价\" , \"wholesalePrice\":\"批发价\" }],\n" +
"1.如果没有识别到\"price\"的内容,则\"price\"赋值\"0\"。\n" + "1.如果没有识别到\"price\"的内容,则\"price\"赋值\"0\"。如果没有识别到\"wholesalePrice\"的内容,则\"wholesalePrice\"赋值\"0\"。\n" +
"2.如果没有识别到\"productSn\"的内容,则\"productSn\"赋值\"\"。\n" + "2.如果没有识别到\"productSn\"的内容,则\"productSn\"赋值\"\"。\n" +
"3.如果没有识别到\"productName\"的内容,则\"productName\"使用\"productSn\"的值填充。\n" + "3.如果没有识别到\"productName\"的内容,则\"productName\"使用\"productSn\"的值填充。\n" +
"4.如果没有识别到\"color\"的内容,则\"color\"赋值“均色”,如果没有识别到\"size\"的内容,则\"size\"赋值“均码”,返回一条JSON数据即可。\n" + "4.如果没有识别到\"color\"的内容,则\"color\"赋值“均色”,如果没有识别到\"size\"的内容,则\"size\"赋值“均码”,返回一条JSON数据即可。\n" +

18
hiver-modules/hiver-mall/src/main/resources/mapper/DebtMapper.xml

@ -51,4 +51,22 @@
#{listItem} #{listItem}
</foreach> </foreach>
</select> </select>
<select id="getAllDebtByShopId" resultType="cc.hiver.mall.debt.vo.DebtOfShopVo">
select
IFNULL(sum(amount_owed),0.00) amount_owed,
count(user_id) person_Count
from t_debt
where
<!-- 欠款金额大于0-->
amount_owed > 0
<if test='queryDebtVo.userType == "1"'>
<!-- 该店铺的供应商-->
and user_id in (select id from t_supplier where shop_id =#{queryDebtVo.shopId,jdbcType=VARCHAR} and del_flag = '0')
</if>
<if test='queryDebtVo.userType == "0"'>
<!-- 该店铺的客户-->
and user_id in (select id from t_customer where shop_id =#{queryDebtVo.shopId,jdbcType=VARCHAR} and del_flag = '0')
</if>
</select>
</mapper> </mapper>

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

@ -619,7 +619,7 @@
<if test='queryParams.sortField!=null and queryParams.sortField.trim() neq "" and queryParams.sortField !=null and queryParams.sort.trim() neq ""'> <if test='queryParams.sortField!=null and queryParams.sortField.trim() neq "" and queryParams.sortField !=null and queryParams.sort.trim() neq ""'>
#{queryParams.sortField} #{queryParams.sort} , #{queryParams.sortField} #{queryParams.sort} ,
</if> </if>
t.in_storage_status asc, t.del_flag desc,t.create_time desc t.in_storage_status asc, t.del_flag desc,t.create_time desc, id
</select> </select>
<select id="getProductList" resultType="cc.hiver.mall.entity.Product"> <select id="getProductList" resultType="cc.hiver.mall.entity.Product">

17
hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseDetailMapper.xml

@ -665,11 +665,18 @@
<select id="getPurchaseDetailListByProductIds" resultMap="BaseResultMap"> <select id="getPurchaseDetailListByProductIds" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> tpd.id, tpd.create_by, tpd.create_time, tpd.del_flag, tpd.update_by, tpd.update_time, tpd.purchase_id, tpd.product_id,
from t_purchase_detail tpd.product_name, tpd.unit, tpd.shop_id, tpd.category_id, tpd.attribute_list, tpd.supplier_id, tpd.supplier_name, tpd.product_sn,
where purchase_id != #{id,jdbcType=VARCHAR} tpd.barcode, tpd.price, tpd.purchase_price, tpd.wholesale_price, tpd.product_picture, tpd.product_video,
and del_flag = '0' tpd.product_intro, tpd.sales_week, tpd.tail_warn, tpd.print_barcode, tpd.product_count,tpd.ocr_picture_path,tpd.sort
and product_id in from t_purchase_detail tpd
left join t_purchase tp on tpd.purchase_id = tp.id
where
<!-- 已入库的-->
tp.in_storage_status = '1'
and tpd.purchase_id != #{id,jdbcType=VARCHAR}
and tpd.del_flag = '0'
and tpd.product_id in
<foreach close=")" collection="productIdList" item="listItem" open="(" separator=","> <foreach close=")" collection="productIdList" item="listItem" open="(" separator=",">
#{listItem} #{listItem}
</foreach> </foreach>

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

@ -442,11 +442,13 @@
<if test="queryParams.startDate != null and queryParams.startDate != '' and queryParams.endDate != null and queryParams.endDate != ''"> <if test="queryParams.startDate != null and queryParams.startDate != '' and queryParams.endDate != null and queryParams.endDate != ''">
and purchase_time BETWEEN #{queryParams.startDate} AND #{queryParams.endDate} and purchase_time BETWEEN #{queryParams.startDate} AND #{queryParams.endDate}
</if> </if>
<if test='queryParams.fromWhere!=null and queryParams.fromWhere.trim() neq ""'> <!-- 删除标识 -->
<if test='queryParams.fromWhere == "0"'> <if test="queryParams.delFlag != null and queryParams.delFlag != ''">
and del_flag = '0' and del_flag = #{queryParams.delFlag}
</if> </if>
<if test='queryParams.delFlag == null or queryParams.delFlag eq "" '>
and del_flag = '0'
</if> </if>
<if test="queryParams.isAiList != null and queryParams.isAiList != ''"> <if test="queryParams.isAiList != null and queryParams.isAiList != ''">
@ -457,6 +459,7 @@
<if test="queryParams.supplierId != null and queryParams.supplierId != ''"> <if test="queryParams.supplierId != null and queryParams.supplierId != ''">
and supplier_id = #{queryParams.supplierId} and supplier_id = #{queryParams.supplierId}
</if> </if>
<if test="queryParams.searchStr != null and queryParams.searchStr != ''"> <if test="queryParams.searchStr != null and queryParams.searchStr != ''">
and (id in( and (id in(
select purchase_id from t_purchase_detail select purchase_id from t_purchase_detail

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

@ -846,7 +846,7 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
1:统计、客户拿货:查询不是2已作废、6待配货、7挂单的; 1:统计、客户拿货:查询不是2已作废、6待配货、7挂单的;
2:需要根据前台传递的status查询列表:6:待配货列表;7挂单列表--> 2:需要根据前台传递的status查询列表:6:待配货列表;7挂单列表-->
<if test='saleVO.fromWhere=="0"'> <if test='saleVO.fromWhere=="0"'>
and ts.status not in ('6','7') and ts.status not in ('2','6','7')
</if> </if>
<if test='saleVO.fromWhere=="1"'> <if test='saleVO.fromWhere=="1"'>
and ts.status not in ('2','6','7') and ts.status not in ('2','6','7')
@ -866,7 +866,10 @@ trans_company, company_name, product_count, remark, sale_name, company_phone, cr
and ts.status not in ('6','7') and ts.status not in ('6','7')
</if> </if>
<if test='saleVO.status!=null'> <if test='saleVO.delFlag!=null and saleVO.delFlag.trim() neq ""'>
and ts.del_flag = #{saleVO.delFlag}
</if>
<if test='saleVO.status!=null and saleVO.delFlag.trim() neq ""'>
and ts.status = #{saleVO.status} and ts.status = #{saleVO.status}
</if> </if>
<if test='saleVO.transportType!=null'> <if test='saleVO.transportType!=null'>
@ -1223,4 +1226,12 @@ GROUP BY
group by user_id,user_name group by user_id,user_name
order by real_amount desc order by real_amount desc
</select> </select>
<select id="queryTotalJCount" resultType="java.lang.Integer">
select IFNULL(Sum(product_count),0) as productCount
from t_sale
where shop_id = #{shopId}
and status = '4'
and create_time BETWEEN #{startTime} AND #{endTime}
</select>
</mapper> </mapper>
Loading…
Cancel
Save