diff --git a/hiver-core/src/main/java/cc/hiver/core/common/sms/SmsUtil.java b/hiver-core/src/main/java/cc/hiver/core/common/sms/SmsUtil.java
index 63d1927a..e4f150b1 100644
--- a/hiver-core/src/main/java/cc/hiver/core/common/sms/SmsUtil.java
+++ b/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));
}
/**
diff --git a/hiver-core/src/main/java/cc/hiver/core/common/utils/JasyptUtil.java b/hiver-core/src/main/java/cc/hiver/core/common/utils/JasyptUtil.java
index 27156aa1..a22ab370 100644
--- a/hiver-core/src/main/java/cc/hiver/core/common/utils/JasyptUtil.java
+++ b/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"));
}
}
diff --git a/hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java b/hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java
index 494f9b53..2e9c7f28 100644
--- a/hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java
+++ b/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 {
diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/common/CaptchaController.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/common/CaptchaController.java
index e28a2afc..d9643cd9 100644
--- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/common/CaptchaController.java
+++ b/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("手机号未注册");
}
}
diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
index 22c432fa..b032ae5d 100644
--- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
+++ b/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);
diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/DictDataController.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/DictDataController.java
index abf8d797..c580d638 100644
--- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/DictDataController.java
+++ b/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("编辑成功");
}
diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java
index 6e9ba0c2..0f409efb 100644
--- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java
+++ b/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;
diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/vo/RegisterShopVo.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/vo/RegisterShopVo.java
index 7248717b..e1439185 100644
--- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/vo/RegisterShopVo.java
+++ b/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;
+
}
diff --git a/hiver-modules/hiver-file/src/main/java/cc/hiver/file/controller/UploadController.java b/hiver-modules/hiver-file/src/main/java/cc/hiver/file/controller/UploadController.java
index 13a6dd88..bbf99430 100644
--- a/hiver-modules/hiver-file/src/main/java/cc/hiver/file/controller/UploadController.java
+++ b/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
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/service/impl/BillServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/service/impl/BillServiceImpl.java
index c0945660..c6755601 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/service/impl/BillServiceImpl.java
+++ b/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);
}
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java
index 8198632e..752699ab 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java
+++ b/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
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 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().setData(productService.getProductSaleCount(id));
+ }
+
/**
* 根据货品id下架货品
*
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java
index 6ad90016..2fbf3fa5 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java
@@ -748,6 +748,46 @@ public class SaleController {
return new ResultUtil().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().setData(categoryNumberVo);
+ }
+
@RequestMapping(value = "/getShopWeek", method = RequestMethod.POST)
@ApiOperation("获取本周利润")
public Result getShopWeek() {
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java
index 71603ec8..66da2e4c 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java
+++ b/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("更新成功");
}
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java
index 9c1c8484..176951e7 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java
@@ -21,6 +21,8 @@ public interface ProductMapper extends BaseMapper {
int deleteByPrimaryKey(String id);
+ Integer getProductSaleCount(String id);
+
int insert(Product record);
int insertSelective(Product record);
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java
index a1a4f0b2..07ee95b7 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java
@@ -173,4 +173,14 @@ public interface SaleMapper extends BaseMapper {
* @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);
}
\ No newline at end of file
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java
index b7d87f14..b155ba59 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java
+++ b/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 stockList;
+ @Transient
+ @TableField(exist = false)
+ @ApiModelProperty(value = "商品拼团信息")
+ private List productGroupBuyPrices;
+
}
\ No newline at end of file
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/PurchaseDetail.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/PurchaseDetail.java
index e01ed87b..ae44e13e 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/PurchaseDetail.java
+++ b/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 = "零售价(单纯用于接收前台传参)")
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java
index c4d0d793..e8a7bd8f 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java
+++ b/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;
}
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductPageVO.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductPageVO.java
index ef6a37b1..c8288eac 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductPageVO.java
+++ b/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;
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductVo.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductVo.java
index 3b857f5e..c5ab6322 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductVo.java
+++ b/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 productGroupBuyPrices;
}
\ No newline at end of file
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java
index 9d645bdb..7d3a4125 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SaleVO.java
+++ b/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;
}
\ No newline at end of file
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java
index 09b2f0f4..3b8000f6 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/service/impl/PurchaseOcrPictureServiceImpl.java
+++ b/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());
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/SalesCalculateService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/SalesCalculateService.java
index 25e400ea..44f19185 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/SalesCalculateService.java
+++ b/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 getShopWeek();
}
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductCategoryService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductCategoryService.java
index 66a8c82d..b52d6b6b 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductCategoryService.java
+++ b/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 {
String batchSaveCategoryAndAttribute(ProductCategoryVo productCategoryVo);
+ String batchEditCategoryAndAttribute(String attrId,ProductCategoryVo productCategoryVo);
/**
* AI入库的时候新增的分类信息,分类Id肯定是有的
*
@@ -46,6 +47,8 @@ public interface ProductCategoryService extends IService {
void deleteCategoryOfProduct(String attrId);
+ void deleteCategoryOfProduct1(String attrId);
+
String addCategoryOfShop();
/**
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java
index 51642c8a..9150f61a 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java
@@ -17,6 +17,8 @@ public interface ProductService extends IService {
List getProductList(List productIdList);
+ Integer getProductSaleCount(String id);
+
CopyOnWriteArrayList getProductByProductSnList(List productSnList, String shopId);
CopyOnWriteArrayList getProductByProductNameList(List productNameList, String shopId);
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java
index 0a13a764..e5f8349d 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java
+++ b/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 getShopWeek() {
final List thisWeekSale = new ArrayList<>();
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/ShopServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/ShopServiceImpl.java
index 8d46308f..9cd91817 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/ShopServiceImpl.java
+++ b/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 root, CriteriaQuery> cq, CriteriaBuilder cb) {
final Path ShopNameField = root.get("shopName");
+ final Path regionField = root.get("regionId");
final List 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()];
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java
index 5f938467..cae4bab5 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java
@@ -141,6 +141,7 @@ public class CustomerServiceImpl extends ServiceImpl 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 {
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java
index caf57c41..1233a960 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java
@@ -64,6 +64,78 @@ public class ProductCategoryServiceImpl extends ServiceImpl productAttributeOfAddVos = productCategoryVo.getProductAttributeOfAddVos();
+ // 需要新增的类别集合
+ final List productAttributes = new ArrayList<>();
+ // 需要新增的属性值集合
+ final List 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 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 productAttributeOfAddVos = productCategoryVo.getProductAttributeOfAddVos();
// 需要新增的类别集合
@@ -72,7 +144,7 @@ public class ProductCategoryServiceImpl extends ServiceImpl 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 productAttributeValueVoList = productAttributeOfAddVo.getProductAttributeValueVoList();
@@ -108,7 +180,7 @@ public class ProductCategoryServiceImpl extends ServiceImpl impl
@Autowired
private CheckStockService checkStockService;
+ @Autowired
+ private ProductGroupBuyPriceService productGroupBuyPriceService;
+
@Override
public IPage getShareList(ProductPageQuery productPageQuery) {
if (StringUtils.isNotEmpty(productPageQuery.getEndDate())) {
@@ -152,6 +156,11 @@ public class ProductServiceImpl extends ServiceImpl impl
return baseMapper.getProductList(productIdList);
}
+ @Override
+ public Integer getProductSaleCount(String id) {
+ return baseMapper.getProductSaleCount(id);
+ }
+
@Override
public CopyOnWriteArrayList getProductByProductSnList(List productSnList, String shopId) {
return baseMapper.getProductByProductSnList(productSnList, shopId);
@@ -216,6 +225,8 @@ public class ProductServiceImpl extends ServiceImpl impl
@Override
public Product getByIdOrBrcode(String id, String customerId) {
final Product byIdOrBrcode = baseMapper.getByIdOrBrcode(id);
+ final List productGroupBuyPriceList = productGroupBuyPriceService.selectByProductId(id);
+ byIdOrBrcode.setProductGroupBuyPrices(productGroupBuyPriceList);
// 如果客户id不为空,查询客户的购买次数
if (StringUtils.isNotEmpty(customerId) && byIdOrBrcode != null) {
final List productIdList = new ArrayList<>();
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java
index 8a93fda6..0e1345b1 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/StockServiceImpl.java
@@ -503,9 +503,10 @@ public class StockServiceImpl extends ServiceImpl 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 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 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 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())) {
diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml
index 078185fc..35071fcf 100644
--- a/hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml
+++ b/hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml
@@ -432,7 +432,7 @@
@@ -266,7 +266,7 @@
\ No newline at end of file
diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml
index 158e8ca5..a27783f5 100644
--- a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml
+++ b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml
@@ -20,6 +20,7 @@
+
@@ -92,7 +93,7 @@
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
@@ -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 @@
purchase_price,
+
+ commission,
+
wholesale_price,
@@ -281,6 +285,9 @@
#{purchasePrice,jdbcType=DECIMAL},
+
+ #{commission},
+
#{wholesalePrice,jdbcType=DECIMAL},
@@ -370,6 +377,9 @@
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
+
+ commission = #{record.commission,jdbcType=DECIMAL},
+
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
@@ -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 @@
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
+
+ commission = #{commission,jdbcType=DECIMAL},
+
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
@@ -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}
+
+
diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml
index 473e9272..0bfc928b 100644
--- a/hiver-modules/hiver-mall/src/main/resources/mapper/SaleMapper.xml
+++ b/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
+
+
+
+
+
+
+
+
+
+