From 5452b71b68e30abed5bd66e3b3d246c7ff008ec0 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 15 一月 2025 10:12:54 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng

---
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java       |    5 ++
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java              |   21 ++++++----
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java                  |    4 +-
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java               |    3 +
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointDetailVO.java                    |    2 +
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java          |    2 
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java |   21 ++++++++--
 ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml                  |    1 
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java               |    8 ++--
 9 files changed, 45 insertions(+), 22 deletions(-)

diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
index 45a72c5..ccef719 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -172,15 +172,18 @@
             }
 
             //添加门店员工关系数据
-            UserShop userShop = new UserShop();
-            userShop.setUserId(one.getUserId());
-            userShop.setShopId(sysUser1.getObjectId());
-            userShop.setRoleType(2);
-            userShop.setRoleId(user.getRoleId());
-            userShop.setDeptId(user.getDeptId());
-            userShop.setNickName(user.getNickName());
-            userShop.setCreateTime(LocalDateTime.now());
-            userShopService.save(userShop);
+            UserShop one1 = userShopService.getOne(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, one.getUserId()).eq(UserShop::getShopId, sysUser1.getObjectId()));
+            if(null == one1){
+                UserShop userShop = new UserShop();
+                userShop.setUserId(one.getUserId());
+                userShop.setShopId(sysUser1.getObjectId());
+                userShop.setRoleType(2);
+                userShop.setRoleId(user.getRoleId());
+                userShop.setDeptId(user.getDeptId());
+                userShop.setNickName(user.getNickName());
+                userShop.setCreateTime(LocalDateTime.now());
+                userShopService.save(userShop);
+            }
         }else{
             user.setCreateBy(SecurityUtils.getUsername());
             user.setPassword(SecurityUtils.encryptPassword("a123456"));
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java
index 063597c..b56c623 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java
@@ -97,6 +97,11 @@
                 userPointDetailVO.setVariablePoint(p.getVariablePoint());
                 String format = p.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
                 userPointDetailVO.setCreateTime(format);
+                Integer historicalPoint = p.getHistoricalPoint();
+                Integer balance = p.getBalance();
+                if (historicalPoint != null && balance != null) {
+                    userPointDetailVO.setFlag(historicalPoint > balance ? 2 : 1);
+                }
                 return userPointDetailVO;
             }).collect(Collectors.toList());
             PageInfo<UserPointDetailVO> pageInfo1 = new PageInfo<>(pageCurr, pageSize);
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointDetailVO.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointDetailVO.java
index 6349bc4..f14d324 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointDetailVO.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointDetailVO.java
@@ -21,4 +21,6 @@
     @ApiModelProperty(value = "变动时间")
     private String createTime;
 
+    @ApiModelProperty(value = "增或减标识: 1-增 2-减")
+    private Integer flag;
 }
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
index 992a1c5..47148b8 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -132,8 +132,8 @@
             @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "String"),
     })
     @GetMapping("/writeOff")
-    public R<Void> writeOff(String id, Integer shopId, String technicianId){
-        orderService.writeOff(id, shopId, technicianId);
+    public R<Void> writeOff(String code, Integer shopId, String technicianId){
+        orderService.writeOff(code, shopId, technicianId);
         return R.ok();
     }
 
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
index 9c40947..579cf54 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -251,7 +251,7 @@
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void writeOff(String id,Integer shopId, String technicianId) {
+    public void writeOff(String id, Integer shopId, String technicianId) {
         LoginUser loginUserApplet = tokenService.getLoginUserApplet();
         Order order = orderMapper.selectById(id);
         boolean check = check(order, shopId, loginUserApplet.getUserid());
@@ -598,6 +598,7 @@
             userPoint.setAppUserId(order.getAppUserId());
             userPoint.setObjectId(order.getId());
             userPointClient.saveUserPoint(userPoint);
+            appUserClient.editAppUserById(appUser);
         }
 
         order.setRefundStatus(2);
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java
index a3cf3d9..a5b2e91 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java
@@ -110,8 +110,8 @@
 		refundPass.setPhone(jsonObject.getString("phone"));
 		refundPass.setAddress(jsonObject.getString("address"));
 		this.save(refundPass);
+		order.setOldOrderStatus(order.getOrderStatus());
 		order.setOrderStatus(7);
-		order.setOldOrderStatus(7);
 		orderService.updateById(order);
 		return R.ok();
 	}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
index 45d27ed..68927ec 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -585,14 +585,14 @@
             if(null == bargainPriceDetail){
                 //没有门店特价,判断地区价格配置
                 LambdaQueryWrapper<GoodsArea> queryWrapper = new LambdaQueryWrapper<GoodsArea>().eq(GoodsArea::getGoodsId, goodsId).eq(GoodsArea::getVip, vip);
-                if(StringUtils.isNotEmpty(districtCode)){
-                    queryWrapper.eq(GoodsArea::getDistrictsCode, districtCode);
+                if(StringUtils.isNotEmpty(provinceCode)){
+                    queryWrapper.eq(GoodsArea::getProvinceCode, provinceCode);
                 }
                 if(StringUtils.isNotEmpty(cityCode)){
                     queryWrapper.and(i -> i.eq(GoodsArea::getCityCode, cityCode).or().isNull(GoodsArea::getCityCode));
                 }
-                if(StringUtils.isNotEmpty(provinceCode)){
-                    queryWrapper.and(i -> i.eq(GoodsArea::getProvinceCode, provinceCode).or().isNull(GoodsArea::getProvinceCode));
+                if(StringUtils.isNotEmpty(districtCode)){
+                    queryWrapper.and(i -> i.eq(GoodsArea::getDistrictsCode, districtCode).or().isNull(GoodsArea::getDistrictsCode));
                 }
                 GoodsArea goodsArea = goodsAreaService.getOne(queryWrapper);
                 if(null == goodsArea){
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
index 193e2f6..951f527 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -1,5 +1,6 @@
 package com.ruoyi.other.service.impl;
 
+import com.alibaba.fastjson2.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -8,6 +9,7 @@
 import com.ruoyi.account.api.feignClient.AppUserShopClient;
 import com.ruoyi.account.api.model.AppUser;
 import com.ruoyi.account.api.model.AppUserShop;
+import com.ruoyi.account.api.model.UserAddress;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.web.page.PageInfo;
 import com.ruoyi.common.security.service.TokenService;
@@ -70,11 +72,15 @@
         Optional<AppUserShop> first = data.stream().filter(s -> s.getShopId() == shopId.intValue() && s.getRoleType() == 3).findFirst();
         Integer technicianId = null;
         if(first.isPresent()){
-            AppUserShop appUserShop = first.get();
-            Technician technician = technicianService.getOne(new LambdaQueryWrapper<Technician>().eq(Technician::getAppUserId, appUserShop.getAppUserId())
-                    .eq(Technician::getShopId, appUserShop.getShopId()).eq(Technician::getDelFlag, 0).eq(Technician::getStatus, 2));
-            if(null != technician){
-                technicianId = technician.getId();
+            //既是店员又是技师,需要取员工身份获取列表数据
+            Optional<AppUserShop> first1 = data.stream().filter(s -> s.getShopId() == shopId.intValue() && s.getRoleType() != 3).findFirst();
+            if(!first1.isPresent()){
+                AppUserShop appUserShop = first.get();
+                Technician technician = technicianService.getOne(new LambdaQueryWrapper<Technician>().eq(Technician::getAppUserId, appUserShop.getAppUserId())
+                        .eq(Technician::getShopId, appUserShop.getShopId()).eq(Technician::getDelFlag, 0).eq(Technician::getStatus, 2));
+                if(null != technician){
+                    technicianId = technician.getId();
+                }
             }
         }
         List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status, technicianId);
@@ -84,6 +90,11 @@
             AppUser appUser = appUserClient.getAppUserById(technicianSubscribe.getAppUserId());
             technicianSubscribeVO.setUserName(appUser.getName());
             technicianSubscribeVO.setPhone(appUser.getPhone());
+            Integer serviceMode = technicianSubscribeVO.getServiceMode();
+            if(1 == serviceMode){
+                UserAddress userAddress = JSON.parseObject(technicianSubscribeVO.getUserAddress(), UserAddress.class);
+                technicianSubscribeVO.setUserAddress(userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getRecieveAddress());
+            }
         }
         return pageInfo.setRecords(list);
     }
diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
index d8da8e6..f94d1c9 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
@@ -13,6 +13,7 @@
             ts.latitude,
             tts.subscribe_time,
             tts.service_mode,
+            tts.user_address,
             tts.status
         FROM
             t_technician_subscribe tts

--
Gitblit v1.7.1