Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松
2025-12-01 11:25:47 +08:00
20 changed files with 75 additions and 55 deletions

View File

@@ -18,5 +18,5 @@ public interface BkContactListMapper extends BaseMapper<BkContactList> {
* @param shopId 店铺ID
* @return 通讯录联系人列表
*/
List<BkContactList> getUserList(Long shopId);
List<BkContactList> getUserList(Long shopId, Long mainShopId);
}

View File

@@ -97,10 +97,10 @@ public class AShopUserServiceImpl implements AShopUserService {
Long mainIdByShopId = shopInfoService.getMainIdByShopId(StpKit.USER.getShopId());
PageHelper.startPage(PageUtil.buildPageHelp());
PageInfo<ShopUserDTO> shopUserDTOPageInfo = new PageInfo<>(shopUserMapper.selectPageByKeyAndIsVip(mainIdByShopId, isVip, key, amount));
shopUserDTOPageInfo.getList().forEach(item -> {
item.setNew(consumeDiscountService.isNewUser(item, StpKit.USER.getShopId()));
setUserDiscount(item);
});
// shopUserDTOPageInfo.getList().forEach(item -> {
// item.setNew(consumeDiscountService.isNewUser(item, StpKit.USER.getShopId()));
// setUserDiscount(item);
// });
return PageUtil.convert(shopUserDTOPageInfo);
}

View File

@@ -1,12 +1,13 @@
package com.czg.service.account.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.czg.account.entity.BkContactList;
import com.czg.account.service.BkContactListService;
import com.czg.account.service.ShopInfoService;
import com.czg.service.account.mapper.BkContactListMapper;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -20,12 +21,14 @@ import java.util.stream.Collectors;
* @since 2025-11-27
*/
@Service
public class BkContactListServiceImpl extends ServiceImpl<BkContactListMapper, BkContactList> implements BkContactListService{
public class BkContactListServiceImpl extends ServiceImpl<BkContactListMapper, BkContactList> implements BkContactListService {
@Resource
private ShopInfoService shopInfoService;
@Override
public List<BkContactList> getUserList(Long shopId, Set<String> phones) {
remove(QueryWrapper.create().eq(BkContactList::getShopId, shopId));
saveBatch(phones.stream()
List<BkContactList> collect = phones.stream()
.filter(StrUtil::isNotEmpty)
.map(phone -> {
BkContactList bkContact = new BkContactList();
@@ -33,7 +36,9 @@ public class BkContactListServiceImpl extends ServiceImpl<BkContactListMapper, B
bkContact.setPhone(phone.trim());
return bkContact;
})
.collect(Collectors.toList()));
return mapper.getUserList(shopId);
.collect(Collectors.toList());
mapper.insertBatch(collect, 50);
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
return mapper.getUserList(shopId, mainShopId);
}
}

View File

@@ -1,24 +1,19 @@
package com.czg.service.account.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.czg.account.dto.PageDTO;
import com.czg.account.dto.register.MerchantRegisterDTO;
import com.czg.account.entity.MerchantRegister;
import com.czg.account.service.MerchantRegisterService;
import com.czg.account.vo.MerchantRegisterVO;
import com.czg.service.account.mapper.MerchantRegisterMapper;
import com.czg.utils.PageUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 激活码 服务层实现。
@@ -27,7 +22,7 @@ import java.util.List;
* @since 2025-02-11
*/
@Service
public class MerchantRegisterServiceImpl extends ServiceImpl<MerchantRegisterMapper, MerchantRegister> implements MerchantRegisterService {
public class MerchantRegisterServiceImpl extends ServiceImpl<MerchantRegisterMapper, MerchantRegister> implements MerchantRegisterService {
@Override
public Page<MerchantRegister> get(PageDTO pageDTO, Integer state, String startTime, String endTime) {
@@ -46,6 +41,7 @@ public class MerchantRegisterServiceImpl extends ServiceImpl<MerchantRegisterMap
tbMerchantRegister.setPeriodMonth(merchantRegisterDTO.periodMonth());
registers.add(tbMerchantRegister);
}
return saveBatch(registers);
int i = mapper.insertBatchSelective(registers, 50);
return i > 0;
}
}

View File

@@ -61,7 +61,7 @@ public class ShopExtendServiceImpl extends ServiceImpl<ShopExtendMapper, ShopExt
newRecord.initAutoKey(key, shopId);
newRecords.add(newRecord);
}
saveBatch(newRecords);
mapper.insertBatchSelective(newRecords,50);
return newRecords;
} else {
for (ShopExtend shopExtend : shopExtendList) {
@@ -97,7 +97,7 @@ public class ShopExtendServiceImpl extends ServiceImpl<ShopExtendMapper, ShopExt
newRecords.add(newRecord);
}
saveBatch(newRecords);
mapper.insertBatchSelective(newRecords,50);
shopExtendList.addAll(newRecords);
return shopExtendList;

View File

@@ -103,7 +103,7 @@ public class ShopTableServiceImpl extends ServiceImpl<ShopTableMapper, ShopTable
tableArrayList.add(shopTable);
}
saveBatch(tableArrayList);
mapper.insertBatchSelective(tableArrayList, 50);
if (StrUtil.isNotBlank(msg.toString())) {
msg.append("台桌名已存在,未添加");
throw new CzgException(msg.toString());

View File

@@ -36,7 +36,7 @@ import static com.mybatisflex.core.query.QueryMethods.column;
* @since 2025-02-08
*/
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
@Resource
private SysMenuService sysMenuService;
@Resource
@@ -87,7 +87,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
}
return apiInfoItemDTOS.stream()
.map(pattern -> StrUtil.format("({} LIKE '{}' ESCAPE '\\\\' and method = '{}')" , columnName, toSqlLikePattern(pattern.getUrl()), pattern.getMethod()))
.map(pattern -> StrUtil.format("({} LIKE '{}' ESCAPE '\\\\' and method = '{}')", columnName, toSqlLikePattern(pattern.getUrl()), pattern.getMethod()))
.collect(Collectors.joining(" OR "));
}
@@ -95,7 +95,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
public Page<SysRole> getList(Long shopId, PageDTO pageDTO, String key, String startTime, String endTime) {
QueryWrapper queryWrapper = new QueryWrapper();
// if (!StpKit.USER.isAdmin()) {
queryWrapper.eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong());
queryWrapper.eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong());
// }
if (StrUtil.isNotBlank(key)) {
@@ -180,11 +180,10 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
// Step 4: 批量保存(如有数据)
return rolesMenus.isEmpty() || sysRolesMenusService.saveBatch(rolesMenus);
return rolesMenus.isEmpty() || sysRolesMenusService.getMapper().insertBatchSelective(rolesMenus, 50) > 0;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean editPermission(long userId, RolePermissionDTO rolePermissionDTO) {

View File

@@ -5,16 +5,16 @@
<mapper namespace="com.czg.service.account.mapper.BkContactListMapper">
<select id="getUserList" resultType="com.czg.account.entity.BkContactList">
SELECT
`order`.call_phone AS phone,
count( 1 ) AS orderNum,
sum( CASE `order`.`status` WHEN '已取消' THEN 1 ELSE 0 END ) AS cannelNum,
MAX(`order`.create_time) AS lastBookingTime
FROM
`bk_order` `order`
INNER JOIN bk_contact_list contact ON `order`.call_phone = contact.phone AND contact.shop_id = #{shopId}
WHERE
`order`.shop_id = #{shopId}
SELECT user.nick_name AS nickName,
`order`.call_phone AS phone,
count(1) AS orderNum,
sum(CASE `order`.`status` WHEN '已取消' THEN 1 ELSE 0 END) AS cancelNum,
MAX(`order`.create_time) AS lastBookingTime
FROM `bk_order` `order`
INNER JOIN bk_contact_list contact
ON `order`.call_phone = contact.phone AND contact.shop_id = #{shopId}
LEFT JOIN tb_shop_user user ON `contact`.phone = user.phone and user.main_shop_id = #{mainShopId}
WHERE `order`.shop_id = #{shopId}
GROUP BY `order`.call_phone
</select>
</mapper>