| | |
| | | /** 菜单组 */ |
| | | private Long[] staffMenuIds; |
| | | |
| | | /** 微信部门id */ |
| | | private Long wxDeptId; |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | |
| | | this.staffMenuIds = staffMenuIds; |
| | | } |
| | | |
| | | public Long getWxDeptId() { |
| | | return wxDeptId; |
| | | } |
| | | |
| | | public void setWxDeptId(Long wxDeptId) { |
| | | this.wxDeptId = wxDeptId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("dataScope", getDataScope()) |
| | | .append("wxDeptId", getWxDeptId()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | return R.ok(merVerifyCodeVo); |
| | | } |
| | | |
| | | @RequestMapping(value = "/verifyOrder", method = RequestMethod.POST) |
| | | @ApiOperation(value = "核销code") |
| | | public R<MerVerifyOrderVo> verifyOrder(@RequestBody MerVerifyCodeDto merVerifyCodeDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | merVerifyCodeDto.setUserId(userId); |
| | | String verifyCode = merVerifyCodeDto.getVerifyCode(); |
| | | MerVerifyOrderVo merVerifyOrderVo = orderService.verifyOrder(verifyCode,merVerifyCodeDto.getShopId()); |
| | | return R.ok(merVerifyOrderVo); |
| | | } |
| | | |
| | | @RequestMapping(value = "/sureVerifyOrder", method = RequestMethod.POST) |
| | | @ApiOperation(value = "核销订单") |
| | | public R<MerVerifyOrderVo> sureVerifyOrder(@RequestBody MerVerifyOrderDto merVerifyOrderDto) { |
| | |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private WxPayService wxService; |
| | | @Resource |
| | | private BackMessageService backMessageService; |
| | |
| | | */ |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | /** |
| | | * 主题类型1个人2企业 |
| | | */ |
| | |
| | | */ |
| | | @TableField("bl_registered_address") |
| | | private String blRegisteredAddress; |
| | | |
| | | @TableField("bl_business_start_time") |
| | | private String blBusinessStartTime; |
| | | /** |
| | | * 营业执照期限 |
| | | */ |
| | |
| | | */ |
| | | @TableField("lp_id_card") |
| | | private String lpIdCard; |
| | | |
| | | @TableField("lp_id_address") |
| | | private String lpIdAddress; |
| | | |
| | | /** |
| | | * 法人身份证开始日期 |
| | | */ |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date cooperationEndTime; |
| | | |
| | | |
| | | @ApiModelProperty(value="合作状态0终止1开启") |
| | | private Integer cooperativeFlag; |
| | | } |
| | |
| | | @ApiModelProperty(value="认证类型") |
| | | private String mainType; |
| | | |
| | | @ApiModelProperty(value="审核状态") |
| | | @ApiModelProperty(value="审核状态0待进件1资料校验中2待账户验证3审核中4已驳回5待签约6完成7已冻结8已作废") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value="审核状态描述") |
| | | private String auditStatusDesc; |
| | | |
| | | @ApiModelProperty(value = "签约状态1待签约2已签约3无法签约") |
| | | private Integer signState; |
| | | |
| | | @ApiModelProperty(value = "签约链接") |
| | | private String signUrl; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsResult; |
| | | import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsStatusResult; |
| | | import com.github.binarywang.wxpay.exception.WxPayException; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | |
| | | shopAuthentication.setAuthId(authId); |
| | | shopAuthentication.setDelFlag(0); |
| | | shopAuthentication.setShopId(shop.getShopId()); |
| | | shopAuthentication.setAuditStatus(0); |
| | | shopAuthentication.setSignState(1); |
| | | shopAuthenticationService.save(shopAuthentication); |
| | | //商户分成信息初始化 |
| | | ShopProportion shopProportion = new ShopProportion(); |
| | |
| | | } |
| | | mgtShopInfoVo.setShopTagIds(shopTagJs.toString()); |
| | | } |
| | | //归属员工 |
| | | if(mgtShopInfoVo.getBelongUserId()!=null){ |
| | | SysUser sysUser = sysUserService.getSysUser(mgtShopInfoVo.getBelongUserId()).getData(); |
| | | mgtShopInfoVo.setBelongUserName(sysUser.getNickName()); |
| | | if(sysUser!=null){ |
| | | mgtShopInfoVo.setBelongUserName(sysUser.getNickName()); |
| | | } |
| | | } |
| | | //归属商户 |
| | | if(mgtShopInfoVo.getBelongShopId()!=null){ |
| | | Shop belongShop = this.getByShopId(mgtShopInfoVo.getBelongShopId()); |
| | | mgtShopInfoVo.setBelongShopName(belongShop.getShopName()); |
| | | if(belongShop!=null){ |
| | | mgtShopInfoVo.setBelongShopName(belongShop.getShopName()); |
| | | } |
| | | } |
| | | //商户关联用户 |
| | | List<ShopRelUser> shopRelUserList = shopRelUserService.listByShopId(shopId); |
| | |
| | | Shop shop = this.getByShopId(shopAuthentication.getShopId()); |
| | | String applyNumber = IdUtils.simpleUUID(); |
| | | if(mgtShopAuthDto.getBlBusinessFoeverFlag()!=null&&mgtShopAuthDto.getBlBusinessFoeverFlag()==1){ |
| | | mgtShopAuthDto.setBlBusinessDeanline("长期"); |
| | | mgtShopAuthDto.setBlBusinessDeanline(mgtShopAuthDto.getBlBusinessStartTime()+",长期"); |
| | | } |
| | | if(mgtShopAuthDto.getLpIcForeverFlag()!=null&&mgtShopAuthDto.getLpIcForeverFlag()==1){ |
| | | mgtShopAuthDto.setLpIcEndDate("长期"); |
| | | } |
| | | BeanUtils.copyProperties(mgtShopAuthDto , shopAuthentication); |
| | | shopAuthentication.setApplyNumber(applyNumber); |
| | | ApplymentsResult applymentsResult; |
| | | try { |
| | | applymentsResult = wechatPayUtils.ecommerceApply(shopAuthentication,applyNumber,shop); |
| | | } catch (Exception e) { |
| | | log.debug("-----"+shop.getShopId()+":进件异常-----"); |
| | | throw new RuntimeException(e); |
| | | } |
| | | shopAuthentication.setAuditStatus(3); |
| | | shopAuthenticationService.saveOrUpdate(shopAuthentication); |
| | | //wechatPayUtils.ecommerceApply(shopAuthentication,applyNumber,shop); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.shop.util; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsRequest; |
| | | import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsResult; |
| | | import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsStatusResult; |
| | |
| | | business_license_info.setMerchantName(shopAuthentication.getBlShopName()); |
| | | business_license_info.setLegalPerson(shopAuthentication.getBlCorporateName()); |
| | | business_license_info.setCompanyAddress(shopAuthentication.getBlRegisteredAddress()); |
| | | business_license_info.setBusinessTime("[\"2023-05-08\",\"长期\"]"); |
| | | List<String> businessTimeList = new ArrayList<>(); |
| | | businessTimeList.add(0,shopAuthentication.getBlBusinessStartTime()); |
| | | businessTimeList.add(1,shopAuthentication.getBlBusinessDeanline()); |
| | | if(businessTimeList!=null&&businessTimeList.size()>1){ |
| | | String businessTime = JSONObject.toJSONString(businessTimeList); |
| | | business_license_info.setBusinessTime(businessTime); |
| | | } |
| | | request.setBusinessLicenseInfo(business_license_info); |
| | | //法人证件 |
| | | request.setIdDocType("IDENTIFICATION_TYPE_MAINLAND_IDCARD"); |
| | |
| | | lpIcBackIO.close(); |
| | | id_card_info.setIdCardName(shopAuthentication.getLpCorporateName()); |
| | | id_card_info.setIdCardNumber(shopAuthentication.getLpIdCard()); |
| | | id_card_info.setIdCardAddress("四川省泸州市江阳区桃园路1号2号楼4单元1号"); |
| | | id_card_info.setIdCardAddress(shopAuthentication.getLpIdAddress()); |
| | | id_card_info.setIdCardValidTimeBegin(shopAuthentication.getLpIcStartDate()); |
| | | id_card_info.setIdCardValidTime(shopAuthentication.getLpIcEndDate()); |
| | | request.setIdCardInfo(id_card_info); |
| | |
| | | contactInfo.setContactType("65"); |
| | | contactInfo.setContactName(shopAuthentication.getLpCorporateName()); |
| | | contactInfo.setContactIdCardNumber(shopAuthentication.getLpIdCard()); |
| | | contactInfo.setMobilePhone("13882237106"); |
| | | contactInfo.setContactEmail("343695869@qq.com"); |
| | | contactInfo.setMobilePhone(shopAuthentication.getLpMobilePhone()); |
| | | contactInfo.setContactEmail(shopAuthentication.getLpContactEmail()); |
| | | request.setContactInfo(contactInfo); |
| | | //店铺信息 |
| | | ApplymentsRequest.SalesSceneInfo salesSceneInfo = new ApplymentsRequest.SalesSceneInfo(); |
| | |
| | | InputStream storeQrCodeIO = OBSUploadUtils.getOSSInputStream(shop.getShopCode().replace("https://hongruitang.oss-cn-beijing.aliyuncs.com/","")); |
| | | ImageUploadResult storeQrCodeIR = merchantMediaService.imageUploadV3(storeQrCodeIO,applyNumber+"storeQrCode.jpg"); |
| | | salesSceneInfo.setStoreQrCode(storeQrCodeIR.getMediaId()); |
| | | storeQrCodeIO.close(); |
| | | request.setSalesSceneInfo(salesSceneInfo); |
| | | request.setMerchantShortname(shop.getShopName()); |
| | | request.setBusinessAdditionPics(shopAuthentication.getBaPics()); |
| | |
| | | CONCAT(ts.shop_area_name,ts.shop_address) shopAddress, |
| | | ts.shopowner_name shopownerName, |
| | | ts.shopowner_phone shopownerPhone, |
| | | ts.cooperation_end_time cooperationEndTime |
| | | ts.cooperation_end_time cooperationEndTime, |
| | | ts.cooperative_flag cooperativeFlag |
| | | FROM t_shop ts |
| | | WHERE ts.del_flag = 0 AND ts.belong_shop_id = #{param.shopId} |
| | | <if test="param.shopStatus!=null and param.shopStatus==1"> |
| | |
| | | WHEN 2 THEN '企业' |
| | | END mainType, |
| | | tsa.audit_status auditStatus, |
| | | tsa.sign_state signState, |
| | | tsa.sign_url signUrl, |
| | | CASE tsa.audit_status |
| | | WHEN 0 THEN '待审核' |
| | | WHEN 1 THEN '审核中' |
New file |
| | |
| | | package com.ruoyi.system.config; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import me.chanjar.weixin.common.util.crypto.WxCryptUtil; |
| | | import me.chanjar.weixin.cp.api.WxCpService; |
| | | import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl; |
| | | import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @ClassName WxCpConfiguration |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/8/17 12:42 |
| | | * @Version 1.0 |
| | | */ |
| | | @Configuration |
| | | @ConditionalOnClass(WxCpService.class) |
| | | @EnableConfigurationProperties(WxCpProperties.class) |
| | | @AllArgsConstructor |
| | | public class WxCpConfiguration { |
| | | |
| | | private WxCpProperties properties; |
| | | |
| | | @Bean |
| | | @ConditionalOnMissingBean |
| | | public WxCpService wxService() { |
| | | |
| | | WxCpDefaultConfigImpl wxCpConfigStorage = new WxCpDefaultConfigImpl(); |
| | | wxCpConfigStorage.setCorpId(properties.getCorpId()); |
| | | wxCpConfigStorage.setAgentId(properties.getAgentId()); |
| | | wxCpConfigStorage.setCorpSecret(properties.getAgentSecret()); |
| | | |
| | | WxCpService wxService = new WxCpServiceImpl(); |
| | | wxService.setWxCpConfigStorage(wxCpConfigStorage); |
| | | |
| | | return wxService; |
| | | } |
| | | |
| | | @Bean |
| | | public WxCryptUtil wxCryptUtil() { |
| | | |
| | | WxCryptUtil wxCryptUtil = new WxCryptUtil("", "", properties.getCorpId()); |
| | | |
| | | return wxCryptUtil; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | |
| | | /** |
| | | * @ClassName WxCpProperties |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/8/17 12:43 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | @ConfigurationProperties(prefix = "wx.cp") |
| | | public class WxCpProperties { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String corpId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private Integer agentId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String agentSecret; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String authorizeState; |
| | | } |
| | |
| | | package com.ruoyi.system.controller.conslole; |
| | | |
| | | import com.esotericsoftware.minlog.Log; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.log4j.Log4j2; |
| | | import me.chanjar.weixin.common.util.crypto.WxCryptUtil; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | @Api(value = "企业微信通知控制", tags = "企业微信通知控制", description = "企业微信通知控制") |
| | | @RestController |
| | | @RequestMapping("/qywx") |
| | | @Log4j2 |
| | | public class QYWXCallBackController { |
| | | |
| | | @Autowired |
| | | private WxCryptUtil wxCryptUtil; |
| | | |
| | | @ApiOperation(value = "消息与事件接收配置") |
| | | @RequestMapping(value = "/qywxNotify", |
| | |
| | | String msgSignature = request.getParameter("msg_signature"); |
| | | String encType = request.getParameter("encrypt_type"); |
| | | String xml = IOUtils.toString(request.getReader()); |
| | | Log.info("企业微信回调"+xml); |
| | | log.info("企业微信回调参数nonce"+nonce); |
| | | log.info("企业微信回调参数timestamp"+timestamp); |
| | | log.info("企业微信回调参数signature"+signature); |
| | | log.info("企业微信回调参数msgSignature"+msgSignature); |
| | | log.info("企业微信回调参数encType"+encType); |
| | | log.info("企业微信回调参数xml"+xml); |
| | | String reponseStr = wxCryptUtil.decryptXml(msgSignature,timestamp,nonce,xml); |
| | | log.info("企业微信回调参数xml解析"+reponseStr); |
| | | return "SUCCESS"; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.mapper.sys; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysDept; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 部门管理 数据层 |
| | |
| | | */ |
| | | public SysDept selectDeptById(Long deptId); |
| | | |
| | | |
| | | /** |
| | | * @description 通过微信部门id获取部门 |
| | | * @author jqs |
| | | * @date 2023/8/17 16:21 |
| | | * @param wxDeptId |
| | | * @return SysDept |
| | | */ |
| | | SysDept getByWxDeptId(Long wxDeptId); |
| | | |
| | | /** |
| | | * 根据ID查询所有子部门 |
| | | * |
| | |
| | | package com.ruoyi.system.scheduler; |
| | | |
| | | |
| | | import com.ruoyi.system.service.staff.SysWxCpService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | |
| | | @Autowired |
| | | private SchedulerUtils schedulerUtils; |
| | | |
| | | @Autowired |
| | | private SysWxCpService sysWxCpService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 定时同步企业微信部门 |
| | | */ |
| | | @Scheduled(cron="0 2 * * * ?") |
| | | private void timingCheckMemberCoupon(){ |
| | | if(schedulerUtils.getSchedulerRun()) { |
| | | log.info("定时同步企业微信部门任务开始执行"); |
| | | sysWxCpService.syncDepartment(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl.staff; |
| | | |
| | | import com.ruoyi.system.api.domain.poji.sys.SysDept; |
| | | import com.ruoyi.system.service.staff.SysWxCpService; |
| | | import com.ruoyi.system.service.sys.ISysDeptService; |
| | | import lombok.extern.log4j.Log4j2; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | | import me.chanjar.weixin.cp.api.WxCpDepartmentService; |
| | | import me.chanjar.weixin.cp.api.WxCpService; |
| | | import me.chanjar.weixin.cp.bean.WxCpDepart; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName WxCpServiceImpl |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/8/17 15:25 |
| | | * @Version 1.0 |
| | | */ |
| | | @Service |
| | | @Log4j2 |
| | | public class SysWxCpServiceImpl implements SysWxCpService { |
| | | |
| | | @Resource |
| | | private WxCpService wxCpService; |
| | | |
| | | @Resource |
| | | private ISysDeptService sysDeptService; |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/8/17 15:26 |
| | | * @param |
| | | * @return String |
| | | */ |
| | | @Override |
| | | public String getToken(){ |
| | | String accessToken = null; |
| | | try { |
| | | accessToken = wxCpService.getAccessToken(); |
| | | } catch (WxErrorException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return accessToken; |
| | | } |
| | | |
| | | /** |
| | | * @description 同步部门 |
| | | * @author jqs |
| | | * @date 2023/8/17 15:42 |
| | | * @param |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void syncDepartment(){ |
| | | WxCpDepartmentService wxCpDepartmentService = wxCpService.getDepartmentService(); |
| | | try { |
| | | //从企业微信拉去部门名单 |
| | | List<WxCpDepart> wxCpDepartList = wxCpDepartmentService.list(null); |
| | | if(wxCpDepartList!=null&&wxCpDepartList.size()>0){ |
| | | for(WxCpDepart wxCpDepart : wxCpDepartList){ |
| | | //获取系统内对应部门 |
| | | SysDept sysDept = sysDeptService.getByWxDeptId(wxCpDepart.getId()); |
| | | //判断是否有该部门,没有则新建 |
| | | if(sysDept!=null){ |
| | | //判断是否有变化 |
| | | if(!sysDept.getDeptName().equals(wxCpDepart.getName())||sysDept.getOrderNum()!=wxCpDepart.getOrder().intValue()){ |
| | | sysDept.setDeptName(wxCpDepart.getName()); |
| | | sysDept.setOrderNum(wxCpDepart.getOrder().intValue()); |
| | | sysDept.setUpdateBy("企业微信同步"); |
| | | sysDeptService.updateDept(sysDept); |
| | | log.info("企业微信同步更新部门:"+wxCpDepart.getName()); |
| | | } |
| | | }else{ |
| | | sysDept = new SysDept(); |
| | | sysDept.setDelFlag("0"); |
| | | sysDept.setStatus("0"); |
| | | sysDept.setParentId(100L); |
| | | sysDept.setOrderNum(wxCpDepart.getOrder().intValue()); |
| | | sysDept.setCreateBy("企业微信同步"); |
| | | sysDept.setDeptName(wxCpDepart.getName()); |
| | | sysDeptService.insertDept(sysDept); |
| | | log.info("企业微信同步新增部门:"+wxCpDepart.getName()); |
| | | } |
| | | } |
| | | } |
| | | } catch (WxErrorException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return getChildList(list, t).size() > 0 ? true : false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @description 通过微信部门id获取部门 |
| | | * @author jqs |
| | | * @date 2023/8/17 16:21 |
| | | * @param wxDeptId |
| | | * @return SysDept |
| | | */ |
| | | @Override |
| | | public SysDept getByWxDeptId(Long wxDeptId){ |
| | | return deptMapper.getByWxDeptId(wxDeptId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.staff; |
| | | |
| | | /** |
| | | * @ClassName WxCpService |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/8/17 15:22 |
| | | * @Version 1.0 |
| | | */ |
| | | public interface SysWxCpService { |
| | | |
| | | /** |
| | | * @description 获取token |
| | | * @author jqs |
| | | * @date 2023/8/17 15:26 |
| | | * @param |
| | | * @return String |
| | | */ |
| | | String getToken(); |
| | | |
| | | /** |
| | | * @description 同步部门 |
| | | * @author jqs |
| | | * @date 2023/8/17 15:42 |
| | | * @param |
| | | * @return void |
| | | */ |
| | | void syncDepartment(); |
| | | } |
| | |
| | | package com.ruoyi.system.service.sys; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysDept; |
| | | import com.ruoyi.system.domain.vo.TreeSelect; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 部门管理 服务层 |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteDeptById(Long deptId); |
| | | |
| | | /** |
| | | * @description 通过微信部门id获取部门 |
| | | * @author jqs |
| | | * @date 2023/8/17 16:21 |
| | | * @param wxDeptId |
| | | * @return SysDept |
| | | */ |
| | | SysDept getByWxDeptId(Long wxDeptId); |
| | | } |
| | |
| | | max-request-size: 200MB |
| | | location: /home/temp |
| | | |
| | | wx: |
| | | cp: |
| | | corpId: ww11400938eb1b91bc |
| | | agentId: 1000024 |
| | | agentSecret: -wuQ2EBxNT9BJa40LdpFqyxI_8RqrZTCUNiabzBasi8 |
| | | authorizeState: HONGRUITANG |
| | | suiteSecret: "" |
| | | token: "" |
| | | encodingAESKey: "" |
| | | |
| | | |
| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="dataScope" column="data_scope" /> |
| | | <result property="wxDeptId" column="wx_dept_id" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectDeptVo"> |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time ,d.data_scope |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time ,d.data_scope,d.wx_dept_id |
| | | from sys_dept d |
| | | </sql> |
| | | |
| | |
| | | <include refid="selectDeptVo"/> |
| | | where dept_id = #{deptId} |
| | | </select> |
| | | |
| | | <select id="getByWxDeptId" parameterType="Long" resultMap="SysDeptResult"> |
| | | <include refid="selectDeptVo"/> |
| | | where wx_dept_id = #{wxDeptId} |
| | | </select> |
| | | |
| | | <select id="checkDeptExistUser" parameterType="Long" resultType="int"> |
| | | select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0' |
| | |
| | | package com.ruoyi.system; |
| | | |
| | | |
| | | import com.ruoyi.system.service.staff.SysWxCpService; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @ClassName systemTest |
| | |
| | | @SpringBootTest(classes = RuoYiSystemApplication.class) |
| | | public class systemTest { |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private SysWxCpService sysWxCpService; |
| | | |
| | | } |