diff --git a/hiver-admin/test-output/test-report.html b/hiver-admin/test-output/test-report.html index b015fda8..62b0dfa8 100644 --- a/hiver-admin/test-output/test-report.html +++ b/hiver-admin/test-output/test-report.html @@ -35,7 +35,7 @@ Hiver
  • -一月 09, 2025 17:32:09 +一月 22, 2025 18:29:49
  • @@ -84,7 +84,7 @@

    passTest

    -

    17:32:10 下午 / 0.028 secs

    +

    18:29:50 下午 / 0.015 secs

    @@ -92,9 +92,9 @@
    #test-id=1
    passTest
    -01.09.2025 17:32:10 -01.09.2025 17:32:10 -0.028 secs +01.22.2025 18:29:50 +01.22.2025 18:29:50 +0.015 secs
    @@ -104,7 +104,7 @@ Pass - 17:32:10 + 18:29:50 Test passed @@ -128,13 +128,13 @@

    Started

    -

    一月 09, 2025 17:32:09

    +

    一月 22, 2025 18:29:49

    Ended

    -

    一月 09, 2025 17:32:10

    +

    一月 22, 2025 18:29:50

    diff --git a/hiver-core/src/main/java/cc/hiver/core/service/UserService.java b/hiver-core/src/main/java/cc/hiver/core/service/UserService.java index 5130b68e..1dbf9c69 100644 --- a/hiver-core/src/main/java/cc/hiver/core/service/UserService.java +++ b/hiver-core/src/main/java/cc/hiver/core/service/UserService.java @@ -3,7 +3,6 @@ package cc.hiver.core.service; import cc.hiver.core.base.HiverBaseService; import cc.hiver.core.common.vo.SearchVo; import cc.hiver.core.entity.User; -import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; import me.chanjar.weixin.mp.bean.result.WxMpUser; import org.springframework.cache.annotation.CacheConfig; import org.springframework.data.domain.Page; @@ -129,7 +128,7 @@ public interface UserService extends HiverBaseService { * @author 鐜嬪瘜搴 * @date 2024/12/29 */ - void unSubscribeWxServer(WxMpXmlMessage wxMessage); + void unSubscribeWxServer(WxMpUser user); User findByUnionid(String unionid); diff --git a/hiver-core/src/main/java/cc/hiver/core/serviceimpl/UserServiceImpl.java b/hiver-core/src/main/java/cc/hiver/core/serviceimpl/UserServiceImpl.java index df482615..dc008bae 100644 --- a/hiver-core/src/main/java/cc/hiver/core/serviceimpl/UserServiceImpl.java +++ b/hiver-core/src/main/java/cc/hiver/core/serviceimpl/UserServiceImpl.java @@ -22,7 +22,6 @@ import cc.hiver.core.vo.RoleDTO; import cn.hutool.core.date.DateUtil; import cn.hutool.core.text.CharSequenceUtil; import lombok.extern.slf4j.Slf4j; -import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; import me.chanjar.weixin.mp.bean.result.WxMpUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -319,9 +318,19 @@ public class UserServiceImpl implements UserService { save(wechatUser); } + /** + * 鍙栨秷鍏虫敞鍏紬鍙凤紝鎺ヨЕuser缁戝畾 + * @author 鐜嬪瘜搴 + * @date 2025/1/17 + * @param user + */ @Override - public void unSubscribeWxServer(WxMpXmlMessage wxMessage) { - + public void unSubscribeWxServer(WxMpUser user) { + final String unionid = user.getUnionId(); + User wechatUser = findByUnionid(unionid); + // 鎺ヨЕ寰俊鍏紬鍙风殑openId + wechatUser.setOfficialAccountOpenid(""); + save(wechatUser); } @Override diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CustomerController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CustomerController.java index b2c2f048..9db3cabf 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CustomerController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CustomerController.java @@ -131,7 +131,10 @@ public class CustomerController { final User user = userService.get(userId); user.setNickname(customer.getName()); user.setSex(customer.getSex()); - user.setMobile(customer.getPhone()); + // 2025-01-16 app/customer/edit杩欎釜鎺ュ彛鎵嬫満鍙 绌夸簡涓┖锛屾姤閿欙細"mobile-11浣嶆墜鏈哄彿鏍煎紡涓嶆纭" + if(StringUtils.isNotEmpty(customer.getPhone())){ + user.setMobile(customer.getPhone()); + } user.setAddress(customer.getAddress()); userService.update(user); } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesAndDetailsServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesAndDetailsServiceImpl.java index f57f9e17..4aaa2d38 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesAndDetailsServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesAndDetailsServiceImpl.java @@ -3,14 +3,13 @@ package cc.hiver.mall.serviceimpl; import cc.hiver.core.common.constant.CommonConstant; import cc.hiver.core.common.constant.DealingsRecordConstant; import cc.hiver.core.common.constant.SaleConstant; -import cc.hiver.core.common.constant.UserConstant; import cc.hiver.core.common.sms.SmsUtil; -import cc.hiver.core.common.utils.*; -import cc.hiver.core.common.vo.PageVo; +import cc.hiver.core.common.utils.BeanUtils; +import cc.hiver.core.common.utils.SecurityUtil; +import cc.hiver.core.common.utils.SnowFlakeUtil; +import cc.hiver.core.common.utils.StringUtils; import cc.hiver.core.entity.LogiticsCompany; -import cc.hiver.core.entity.Role; import cc.hiver.core.entity.User; -import cc.hiver.core.entity.UserRole; import cc.hiver.core.service.LogiticsCompanyService; import cc.hiver.core.service.RoleService; import cc.hiver.core.service.UserRoleService; @@ -29,8 +28,6 @@ import cc.hiver.mall.service.mybatis.*; import cn.hutool.core.text.CharSequenceUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import java.math.BigDecimal; @@ -453,10 +450,10 @@ public class SalesAndDetailsServiceImpl implements SalesAndDetailsService { // 鍒嗕韩椤垫彁浜よ鍗曠殑鏃跺欙紝鏍规嵁鎵嬫満鍙锋煡璇笅娓稿鎴蜂俊鎭紝濡傛灉鏌ヤ笉鍒帮紝鍒欐柊澧炰笅娓稿鎴 User byMobile; String customerId = ""; - if (StringUtils.isNotEmpty(saleQueryDTO.getMobile())) { + // if (StringUtils.isNotEmpty(saleQueryDTO.getMobile())) { // 20240906濡傛灉鍓嶅彴浼犱簡瀹㈡埛id浜嗭紝涓嶈鏂板瀹㈡埛浜嗗氨 if(StringUtils.isEmpty(saleQueryDTO.getUserId())){ - byMobile = userService.findByMobile(saleQueryDTO.getMobile()); + /*byMobile = userService.findByMobile(saleQueryDTO.getMobile()); if (byMobile == null) { //榛樿瀵嗙爜 final String encryptPass = new BCryptPasswordEncoder().encode("123456"); @@ -495,9 +492,9 @@ public class SalesAndDetailsServiceImpl implements SalesAndDetailsService { } byMobile = userService.save(byMobile); } - } + }*/ - customer.setUserId(byMobile.getId()); + // customer.setUserId(byMobile.getId()); customer.setCreateTime(new Date()); customer.setDelFlag(CommonConstant.DEL_FLAG_FALSE); customer.setName(saleQueryDTO.getUsername()); @@ -545,10 +542,10 @@ public class SalesAndDetailsServiceImpl implements SalesAndDetailsService { // 瀹㈡埛id鎷垮墠鍙颁紶鐨 customerId = saleQueryDTO.getUserId(); } - } else { + /*} else { log.error("涓嬫父瀹㈡埛鏈~鍐欐墜鏈哄彿锛"); return null; - } + }*/ // 鍒嗕韩椤垫彁浜よ鍗曡繖閲岃偗瀹氭槸锛氭湭鏀舵 sale.setPayStatus("0"); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SupplierServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SupplierServiceImpl.java index 441249d2..996799af 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SupplierServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SupplierServiceImpl.java @@ -83,12 +83,14 @@ public class SupplierServiceImpl implements SupplierService { final Predicate[] arr = new Predicate[list.size()]; cq.where(list.toArray(arr)); final Expression orderByExpression = root.get("orderByField"); + final Expression orderById = root.get("id"); final Expression orderCase = cb.selectCase() .when(cb.isNull(orderByExpression), 1) // 濡傛灉鏄 null, 缁欎竴涓緝澶х殑鍊 .otherwise(0); // 濡傛灉涓嶆槸 null, 缁欎竴涓緝灏忕殑鍊 cq.orderBy( cb.asc(orderCase), // 鍏堟寜鏄惁涓 null 鎺掑簭 - cb.asc(orderByExpression) // 鍐嶆寜瀹為檯鍊兼帓搴 + cb.asc(orderByExpression), // 鍐嶆寜瀹為檯鍊兼帓搴 + cb.asc(orderById) // 鎸夌収id鎺掑簭 ); return null; } 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 71fe0954..bfff6906 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 @@ -1211,7 +1211,7 @@ public class StockServiceImpl extends ServiceImpl implements if (CollUtil.isNotEmpty(purchaseVo.getPurchaseDetails()) && purchaseVo.getPurchaseDetails().get(0).getPurchasePrice() != null && Objects.equals(shopUser.getType(), ShopUserConstant.SHOP_ADMIN_COST[0])) { debtService.purchaseToDebt(purchase); } - return ResultUtil.success("娣诲姞鎴愬姛"); + return new ResultUtil<>().setData(purchaseId, "鍏ュ簱鎴愬姛"); } else { return ResultUtil.error("娣诲姞鍏ュ簱鍗曞晢鍝佽鏍间俊鎭け璐"); } 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 b954e5f8..078185fc 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml @@ -472,7 +472,8 @@ name WHEN '鏁e' THEN 1 ELSE CONVERT( name USING gbk ) - END COLLATE gbk_chinese_ci ASC + END COLLATE gbk_chinese_ci ASC, + a.id asc @@ -542,23 +543,25 @@ FROM t_user WHERE - id IN ( - SELECT - user_id - FROM - t_customer - WHERE - shop_id = #{shopId} - - and category_id = #{categoryId} - - - and user_id = #{userId} - - - and category_id is null - - ) + official_account_openid is not null + and official_account_openid != '' + and id IN ( + SELECT + user_id + FROM + t_customer + WHERE + shop_id = #{shopId} + + and category_id = #{categoryId} + + + and user_id = #{userId} + + + and (category_id is null or category_id = '') + + ) diff --git a/hiver-modules/hiver-social/src/main/java/cc/hiver/social/controller/WechatController.java b/hiver-modules/hiver-social/src/main/java/cc/hiver/social/controller/WechatController.java index a1a9f9a2..9c5dff90 100644 --- a/hiver-modules/hiver-social/src/main/java/cc/hiver/social/controller/WechatController.java +++ b/hiver-modules/hiver-social/src/main/java/cc/hiver/social/controller/WechatController.java @@ -174,6 +174,43 @@ public class WechatController { return "redirect:" + url; } + /** + * 鍏紬鍙峰洖璋冩帴鍙o紙楠岃瘉鏈嶅姟鍣 锛 + * @author 鐜嬪瘜搴 + * @date 2025/1/15 + * @param signature + * @param timestamp + * @param nonce + * @param echostr + * @param response + */ + /*@RequestMapping("echo") + @GetMapping + public void get(@RequestParam(required = false) String signature, + @RequestParam(required = false) String timestamp, + @RequestParam(required = false) String nonce, + @RequestParam(required = false) String echostr, + HttpServletResponse response) throws IOException { + if (!wxMpService.checkSignature(timestamp, nonce, signature)) { + log.warn("鎺ユ敹鍒颁簡鏈氳繃鏍¢獙鐨勫井淇℃秷鎭紝杩欏彲鑳芥槸token閰嶇疆閿欎簡锛屾垨鏄帴鏀朵簡闈炲井淇″畼鏂圭殑璇锋眰"); + return; + } + response.setCharacterEncoding("UTF-8"); + response.getWriter().write(echostr); + response.getWriter().flush(); + response.getWriter().close(); + }*/ + + /** + * 鍏紬鍙峰洖璋冩帴鍙o紙楠岃瘉鎴愬姛涔嬪悗锛 + * @author 鐜嬪瘜搴 + * @date 2025/1/15 + * @param requestBody + * @param signature + * @param timestamp + * @param nonce + * @return String + */ @RequestMapping("echo") @ResponseBody public String configAccess(@RequestBody String requestBody, @RequestParam("signature") String signature, @RequestParam("timestamp") String timestamp, @RequestParam("nonce") String nonce) { diff --git a/hiver-modules/hiver-social/src/main/java/cc/hiver/social/handler/WxServerMsgHandler.java b/hiver-modules/hiver-social/src/main/java/cc/hiver/social/handler/WxServerMsgHandler.java index 762b6f6c..f90ed3e8 100644 --- a/hiver-modules/hiver-social/src/main/java/cc/hiver/social/handler/WxServerMsgHandler.java +++ b/hiver-modules/hiver-social/src/main/java/cc/hiver/social/handler/WxServerMsgHandler.java @@ -31,16 +31,16 @@ public class WxServerMsgHandler implements WxMpMessageHandler { //鍒ゆ柇鏄惁鏄簨浠剁被鍨 if(wxMessage.getMsgType().equals(WxConsts.XmlMsgType.EVENT)){ //璁㈤槄 + final String lang = "zh_CN"; //璇█ + final WxMpUser user = wxMpService.getUserService().userInfo(wxMessage.getFromUser(),lang); if(wxMessage.getEvent().equals(WxConsts.EventType.SUBSCRIBE)){ outContent = "銆愬揩琛e簵淇℃伅鎺ㄩ併戞杩庢偍锛佽嚧鍔涗簬甯姪鏈嶈搴椾富浠洿濂藉湴杩涜鍟嗗搧绠$悊鍜岃惀閿鎺ㄥ箍锛屾垜浠細鎸佺画鍙戝竷瀹炵敤鎶宸с佹垚鍔熸渚嬪垎鏋愮瓑鍐呭銆傛湡寰呬笌鎮ㄥ叡鍚屾垚闀匡紝鍏卞垱杈夌厡涓氱哗锛"; - final String lang = "zh_CN"; //璇█ - final WxMpUser user = wxMpService.getUserService().userInfo(wxMessage.getFromUser(),lang); log.info("鍏虫敞鍏紬鍙风殑鐢ㄦ埛淇℃伅锛歶ser====:{}",user); userService.subscribeWxServer(user); } //鍙栨秷璁㈤槄 if(wxMessage.getEvent().equals(WxConsts.EventType.UNSUBSCRIBE)){ - + userService.unSubscribeWxServer(user); } } else if (wxMessage.getMsgType().equals(WxConsts.XmlMsgType.TEXT)){ //鍒ゆ柇涓烘枃鏈秷鎭