luodangjia
2024-08-19 c55d4db0d9e2d3c971ffbda46d7e4f26376822d7
Merge remote-tracking branch 'origin/master'
13个文件已修改
122 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserFallbackFactory.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/config/DataUpdateHandlerConfig.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserAddressController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/config/DataUpdateHandlerConfig.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/config/DataUpdateHandlerConfig.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/DataUpdateHandlerConfig.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEnterpriseUserApplicationController.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/config/DataUpdateHandlerConfig.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java
@@ -29,7 +29,7 @@
    @Override
    public OtherClient create(Throwable throwable) {
        log.error("商品调用失败:{}", throwable.getMessage());
        log.error("单位用失败:{}", throwable.getMessage());
        return new OtherClient() {
            @Override
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserFallbackFactory.java
@@ -92,12 +92,12 @@
    
            @Override
            public R addSysUser(SysUser user) {
                return R.fail("添加用户失败:" + cause.getMessage());
                throw new RuntimeException("添加用户失败:" + cause.getMessage());
            }
            @Override
            public R resetPassword(SysUser user) {
                return R.fail("重置用户密码失败:" + cause.getMessage());
                throw new RuntimeException("重置用户密码失败:" + cause.getMessage());
            }
        };
    }
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/config/DataUpdateHandlerConfig.java
@@ -7,6 +7,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import java.time.LocalDateTime;
import java.util.Date;
/**
@@ -33,8 +34,8 @@
     */
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("createTime", LocalDateTime.now(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
        //  获取登录信息
//        LoginUser loginUser = tokenService.getLoginUser();
//        String userName = loginUser.getUsername();
@@ -59,7 +60,7 @@
    @Override
    public void updateFill(MetaObject metaObject) {
//        this.setFieldValByName("createTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
        //  获取登录信息
//        LoginUser loginUser = tokenService.getLoginUser();
//        System.err.println(loginUser);
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
@@ -113,7 +113,7 @@
     * @return 优惠券ids 查询每个优惠券的发放数量
     */
    @PostMapping("/getCountByCouponIds")
    public R<List<Integer>> getCountByCouponIds(String couponIds) {
    public R<List<Integer>> getCountByCouponIds(@RequestParam("couponIds") String couponIds) {
        // 最终结果 和优惠券id一一对应
        List<Integer> res = new ArrayList<>();
        String[] split = couponIds.split(",");
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserAddressController.java
@@ -6,6 +6,7 @@
import com.ruoyi.account.service.TAppUserAddressService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.service.TokenService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -25,10 +26,12 @@
public class TAppUserAddressController {
    private final TAppUserAddressService appUserAddressService;
    private final TokenService tokenService;
    @Autowired
    public TAppUserAddressController(TAppUserAddressService appUserAddressService) {
    public TAppUserAddressController(TAppUserAddressService appUserAddressService, TokenService tokenService) {
        this.appUserAddressService = appUserAddressService;
        this.tokenService = tokenService;
    }
    /**
@@ -37,8 +40,9 @@
    @ApiOperation(tags = {"小程序-用户地址"},value = "查询用户地址列表")
    @GetMapping(value = "/queryAddress")
    public AjaxResult<List<TAppUserAddress>> queryAddress() {
        // TODO 用户id
        return AjaxResult.ok(appUserAddressService.list(Wrappers.<TAppUserAddress>lambdaQuery().eq(TAppUserAddress::getAppUserId, null)));
        // 用户id
        Long userId = tokenService.getLoginUserApplet().getUserId();
        return AjaxResult.ok(appUserAddressService.list(Wrappers.<TAppUserAddress>lambdaQuery().eq(TAppUserAddress::getAppUserId, userId)));
    }
@@ -48,7 +52,8 @@
    @ApiOperation(tags = {"小程序-用户地址"},value = "添加用户地址")
    @PostMapping(value = "/add")
    public AjaxResult<Boolean> add(@RequestBody TAppUserAddress dto) {
        // TODO 用户id
        // 用户id
        dto.setAppUserId(tokenService.getLoginUserApplet().getUserId());
        // 修改用户默认地址
        appUserAddressService.updateDefaultAddress(dto.getDefaultAddress(),dto.getAppUserId());
        return AjaxResult.ok(appUserAddressService.save(dto));
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -113,33 +113,6 @@
            return AjaxResult.ok(0);
        }
    }
    @ApiOperation(value = "通过code获得openid,  1 --->对应的appid:wx4c405fa42539fc21  2---->对应的appid:wx02d9f6c92e6d3c86")
    @GetMapping("openId-by-jscode2session/{code}")
    public AjaxResult<Map<String, Object>> jscode2session(@PathVariable String code) {
        log.info("<<<<<<<<换取openid开始<<<<<<<<:{}", code);
        WxAppletTools appletTools = new WxAppletTools(wxRestTemplate, wxConfig);
        Code2SessionRespBody body = appletTools.getOpenIdByJscode2session(new Code2SessionResqBody().build(code));
        String openid = body.getOpenid();
        String sessionKey = body.getSessionKey();
        TAppUser appUser = appUserService.getOne(Wrappers.lambdaQuery(TAppUser.class).eq(TAppUser::getWxOpenid, openid).last("limit 1"));
        if (Objects.isNull(appUser)) {
            appUser = new TAppUser();
            appUser.setWxOpenid(openid);
            appUserService.save(appUser);
        }
        // 提前对sessionKey进行删除
        log.info("换取sessionKey:{}", sessionKey);
        // 将sessionKey进行存储,后续获取信息需要
        redisService.setCacheObject(openid, sessionKey);
        LoginUserApplet loginUserApplet = new LoginUserApplet();
        if(ObjectUtils.isNotNull(appUser)){
            loginUserApplet.setUserId(appUser.getId());
        }
        HashMap<String, Object> tokenInfos = new HashMap<>();
        tokenInfos.put("token",tokenService.createTokenApplet(loginUserApplet));
        tokenInfos.put("info",loginUserApplet);
        return AjaxResult.ok(tokenInfos);
    }
    @ApiOperation(value = "管理后台-根据手机号查询用户ids", tags = {"管理后台-活动费用统计"})
    @PostMapping(value = "/user/getUserIdsByPhone")
@@ -182,6 +155,10 @@
       otherClient.unitAddorUpadate(tCompany);
        return R.ok();
    }
    @ApiOperation(value = "单位管理删除", tags = {"用户管理-单位管理"})
    @DeleteMapping(value = "/unit/delete")
    public R add(@RequestParam String ids) {
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java
@@ -5,21 +5,15 @@
import com.ruoyi.chargingPile.api.dto.ApplyChargingQuery;
import com.ruoyi.chargingPile.api.dto.ApplyChargingRemarkDto;
import com.ruoyi.chargingPile.api.model.TApplyChargingPile;
import com.ruoyi.chargingPile.api.model.TCarport;
import com.ruoyi.chargingPile.api.vo.TCarportVO;
import com.ruoyi.chargingPile.dto.ChargeMonitoring;
import com.ruoyi.chargingPile.service.TApplyChargingPileService;
import com.ruoyi.chargingPile.service.TCarportService;
import com.ruoyi.chargingPile.service.TVehicleRampService;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.log.enums.OperatorType;
import com.ruoyi.common.security.service.TokenService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * <p>
@@ -34,10 +28,12 @@
public class TApplyChargingPileController {
    private final TApplyChargingPileService applyChargingPileService;
    private final TokenService tokenService;
    @Autowired
    public TApplyChargingPileController(TApplyChargingPileService applyChargingPileService) {
    public TApplyChargingPileController(TApplyChargingPileService applyChargingPileService, TokenService tokenService) {
        this.applyChargingPileService = applyChargingPileService;
        this.tokenService = tokenService;
    }
    /**
@@ -47,15 +43,15 @@
    @ApiOperation(tags = {"小程序-建桩申请"},value = "建桩申请")
    @PostMapping(value = "/add")
    public AjaxResult<Boolean> add(@RequestBody TApplyChargingPile dto) {
        // TODO 用户id
        dto.setAppUserId(null);
        // 用户id
        Long userId = tokenService.getLoginUserApplet().getUserId();
        dto.setAppUserId(userId);
        return AjaxResult.ok(applyChargingPileService.save(dto));
    }
    @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "列表")
    @PostMapping(value = "/page")
    public AjaxResult<Page<TApplyChargingPile>> page(ApplyChargingQuery applyChargingQuery) {
        // TODO 用户id
        Page<TApplyChargingPile> page = applyChargingPileService.lambdaQuery()
                .like(applyChargingQuery.getName() != null && !applyChargingQuery.getName().equals(""), TApplyChargingPile::getAgentPhone, applyChargingQuery.getName())
                .page(Page.of(applyChargingQuery.getPageCurr(), applyChargingQuery.getPageSize()));
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
@@ -139,10 +139,7 @@
        user.setRoleId(partner.getRoleId().longValue());
        user.setRoleType(2);
        user.setObjectId(partner.getId());
        R r = sysUserClient.addSysUser(user);
        if(200 != r.getCode()){
            throw new RuntimeException(r.getMsg());
        }
        sysUserClient.addSysUser(user);
        return AjaxResult.success();
    }
    
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/config/DataUpdateHandlerConfig.java
@@ -7,6 +7,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import java.time.LocalDateTime;
import java.util.Date;
/**
@@ -33,8 +34,8 @@
     */
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("createTime", LocalDateTime.now(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
    }
    /**
@@ -44,6 +45,6 @@
     */
    @Override
    public void updateFill(MetaObject metaObject) {
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
    }
}
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/config/DataUpdateHandlerConfig.java
@@ -7,6 +7,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import java.time.LocalDateTime;
import java.util.Date;
/**
@@ -33,8 +34,8 @@
     */
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("createTime", LocalDateTime.now(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
    }
    /**
@@ -44,6 +45,6 @@
     */
    @Override
    public void updateFill(MetaObject metaObject) {
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/DataUpdateHandlerConfig.java
@@ -7,6 +7,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
/**
@@ -33,8 +35,8 @@
     */
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("createTime", LocalDateTime.now(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
    }
    /**
@@ -44,6 +46,6 @@
     */
    @Override
    public void updateFill(MetaObject metaObject) {
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEnterpriseUserApplicationController.java
@@ -4,6 +4,7 @@
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.api.domain.TEnterpriseUserApplication;
import com.ruoyi.other.service.TEnterpriseUserApplicationService;
import io.swagger.annotations.ApiOperation;
@@ -27,10 +28,12 @@
public class TEnterpriseUserApplicationController {
    private final TEnterpriseUserApplicationService enterpriseUserApplicationService;
    private final TokenService tokenService;
    @Autowired
    public TEnterpriseUserApplicationController(TEnterpriseUserApplicationService enterpriseUserApplicationService) {
    public TEnterpriseUserApplicationController(TEnterpriseUserApplicationService enterpriseUserApplicationService, TokenService tokenService) {
        this.enterpriseUserApplicationService = enterpriseUserApplicationService;
        this.tokenService = tokenService;
    }
    /**
@@ -40,14 +43,16 @@
    @ApiOperation(tags = {"小程序-计费策略"},value = "添加集团用户申请")
    @PostMapping(value = "/add")
    public AjaxResult<Boolean> add(@Validated @RequestBody TEnterpriseUserApplication dto) {
        // TODO 用户id
        // 用户id
        dto.setAppUserId(tokenService.getLoginUserApplet().getUserId());
        return AjaxResult.ok(enterpriseUserApplicationService.save(dto));
    }
    @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "集团用户列表")
    @PostMapping(value = "/page")
    public AjaxResult<Boolean> page(@RequestBody TEnterpriseUserApplication dto) {
        // TODO 用户id
        // 用户id
        dto.setAppUserId(tokenService.getLoginUserApplet().getUserId());
        return AjaxResult.ok(enterpriseUserApplicationService.save(dto));
    }
ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/config/DataUpdateHandlerConfig.java
@@ -7,6 +7,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import java.time.LocalDateTime;
import java.util.Date;
/**
@@ -33,8 +34,8 @@
     */
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("createTime", LocalDateTime.now(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
    }
    /**
@@ -44,6 +45,6 @@
     */
    @Override
    public void updateFill(MetaObject metaObject) {
        this.setFieldValByName("updateTime", new Date(), metaObject);
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
    }
}