Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | @Override |
| | | public OtherClient create(Throwable throwable) { |
| | | log.error("商品调用失败:{}", throwable.getMessage()); |
| | | log.error("单位用失败:{}", throwable.getMessage()); |
| | | return new OtherClient() { |
| | | |
| | | @Override |
| | |
| | | |
| | | @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()); |
| | | } |
| | | }; |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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(); |
| | |
| | | @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); |
| | |
| | | * @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(","); |
| | |
| | | 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.*; |
| | |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | @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))); |
| | | } |
| | | |
| | | |
| | |
| | | @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)); |
| | |
| | | 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") |
| | |
| | | otherClient.unitAddorUpadate(tCompany); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "单位管理删除", tags = {"用户管理-单位管理"}) |
| | | @DeleteMapping(value = "/unit/delete") |
| | | public R add(@RequestParam String ids) { |
| | |
| | | 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> |
| | |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | @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())); |
| | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | @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)); |
| | | } |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | } |