调整品牌添加商城开启管理;调整微信支付包存放位置;调整员工信息
This commit is contained in:
parent
299bc55db7
commit
8ec873a2b1
@ -20,4 +20,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@ -36,4 +36,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@ -114,4 +114,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@ -50,7 +50,8 @@ public class LoginFailureHandler implements AuthenticationFailureHandler {
|
||||
loginUser.setUserType((UserType) ((CpopAuthenticationException) e).getParams());
|
||||
errorMessage = e.getMessage();
|
||||
}
|
||||
result = R.fail(errorMessage);
|
||||
//TODO:暂时先这么处理
|
||||
result = R.ok(errorMessage);
|
||||
if (loginUser.getUserType() == UserType.OAM_USER || loginUser.getUserType() == UserType.MINI_USER) {
|
||||
//添加登录失败日志
|
||||
coreService.insertOperationLog(Constants.FAIL, OperationLogEnum.SYSTEM_LOGIN, loginUser, errorMessage);
|
||||
|
||||
@ -90,7 +90,7 @@ public class MiniLoginStrategy implements LoginStrategy {
|
||||
private void changeJamboxUser(MiniUserLoginInfo loginInfo, Map<String, Object> credentials, SourceType sourceType) {
|
||||
//获取品牌表
|
||||
Row brand = DbChain.table("cp_sys_brand")
|
||||
.select("csb.id", "csb.is_open_sharing")
|
||||
.select("csb.id", "csb.is_open_mall")
|
||||
.from("cp_sys_brand").as("csb")
|
||||
.leftJoin("cp_j_brand_extend").as("cjbe").on("cjbe.brand_id = csb.id")
|
||||
.and("cjbe.brand_cloud_id = ?", credentials.get("brandId"))
|
||||
@ -98,7 +98,7 @@ public class MiniLoginStrategy implements LoginStrategy {
|
||||
if (brand == null) {
|
||||
throw new CpopAuthenticationException("用户登陆失败,果酱品牌暂未录入系统");
|
||||
}
|
||||
if (!brand.getBoolean("isOpenSharing")){
|
||||
if (!brand.getBoolean("isOpenMall")){
|
||||
throw new CpopAuthenticationException("用户登陆失败,当前品牌暂未开通分账");
|
||||
}
|
||||
//构建用户信息
|
||||
|
||||
@ -32,4 +32,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@ -27,18 +27,11 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>Cpop-Oam-Web</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@ -25,4 +25,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@ -29,19 +29,11 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>Cpop-Mall-Web</finalName>
|
||||
<finalName>Cpop-Oam-Web</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@ -62,6 +62,10 @@ mybatis-flex:
|
||||
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
username: root
|
||||
password: Customer0401
|
||||
cbc:
|
||||
url: jdbc:mysql://192.168.3.10:3306/cbc_game_prod?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
username: nft
|
||||
password: nft
|
||||
|
||||
# springdoc-openapi项目配置
|
||||
knife4j:
|
||||
|
||||
@ -0,0 +1,151 @@
|
||||
package com.cpop.mall.web;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ContentLoopMerge;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @createTime 2023/11/15 17:15
|
||||
* @description CBC相关测试类
|
||||
*/
|
||||
@SpringBootTest
|
||||
public class CpopCbcTests {
|
||||
|
||||
private final String FILE_NAME = "C:/Users/Administrator/Desktop/常规赛1v1对战信息" + System.currentTimeMillis() + ".xlsx";
|
||||
|
||||
/**
|
||||
* @descriptions 导出比赛结果
|
||||
* @author DB
|
||||
* @date 2023/11/15 17:16
|
||||
* @return: void
|
||||
*/
|
||||
public void exportGameResult() {
|
||||
//TODO:获取数据
|
||||
//EasyExcel.write(FILE_NAME, GameResult.class).sheet("常规赛1v1对战信息").doWrite(data());
|
||||
}
|
||||
|
||||
/**
|
||||
* 比赛结果
|
||||
*/
|
||||
@Data
|
||||
public class GameResult {
|
||||
|
||||
/**
|
||||
* 场次
|
||||
*/
|
||||
@ContentLoopMerge(eachRow = 10)
|
||||
@ExcelProperty("场次")
|
||||
private String session;
|
||||
|
||||
/**
|
||||
* "类型", "常规/OneMore"
|
||||
*/
|
||||
@ExcelProperty({"类型", "常规/OneMore"})
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 舞种
|
||||
*/
|
||||
@ExcelProperty("舞种")
|
||||
private String danceType;
|
||||
|
||||
/**
|
||||
* 轮次
|
||||
*/
|
||||
@ExcelProperty("轮次")
|
||||
private String turn;
|
||||
|
||||
/**
|
||||
* "战队A", "战队"
|
||||
*/
|
||||
@ExcelProperty({"战队A", "战队"})
|
||||
private String teamA;
|
||||
|
||||
/**
|
||||
* "战队A", "舞者"
|
||||
*/
|
||||
@ExcelProperty({"战队A", "舞者"})
|
||||
private String userA;
|
||||
|
||||
/**
|
||||
* "战队B", "战队"
|
||||
*/
|
||||
@ExcelProperty({"战队B", "战队"})
|
||||
private String teamB;
|
||||
|
||||
/**
|
||||
* "战队B", "舞者"
|
||||
*/
|
||||
@ExcelProperty({"战队B", "舞者"})
|
||||
private String userB;
|
||||
|
||||
/**
|
||||
* 胜负
|
||||
*/
|
||||
@ExcelProperty("胜负")
|
||||
private String winUser;
|
||||
|
||||
/**
|
||||
* 主裁
|
||||
*/
|
||||
@ExcelProperty({"主裁", "名称"})
|
||||
private String masterReferee;
|
||||
|
||||
/**
|
||||
* "主裁", "打分"
|
||||
*/
|
||||
@ExcelProperty({"主裁", "打分"})
|
||||
private String masterRefereeMark;
|
||||
|
||||
/**
|
||||
* "副裁一", "名称"
|
||||
*/
|
||||
@ExcelProperty({"副裁一", "名称"})
|
||||
private String slaveRefereeA;
|
||||
|
||||
/**
|
||||
* "副裁一", "打分"
|
||||
*/
|
||||
@ExcelProperty({"副裁一", "打分"})
|
||||
private String slaveRefereeAMark;
|
||||
|
||||
/**
|
||||
* "副裁二", "名称"
|
||||
*/
|
||||
@ExcelProperty({"副裁二", "名称"})
|
||||
private String slaveRefereeB;
|
||||
|
||||
/**
|
||||
* "副裁二", "打分"
|
||||
*/
|
||||
@ExcelProperty({"副裁二", "打分"})
|
||||
private String slaveRefereeBMark;
|
||||
|
||||
/**
|
||||
* "副裁三", "名称"
|
||||
*/
|
||||
@ExcelProperty({"副裁三", "名称"})
|
||||
private String slaveRefereeC;
|
||||
|
||||
/**
|
||||
* "副裁三", "打分"
|
||||
*/
|
||||
@ExcelProperty({"副裁三", "打分"})
|
||||
private String slaveRefereeCMark;
|
||||
|
||||
/**
|
||||
* "副裁四", "名称"
|
||||
*/
|
||||
@ExcelProperty({"副裁四", "名称"})
|
||||
private String slaveRefereeD;
|
||||
|
||||
/**
|
||||
* "副裁四", "打分"
|
||||
*/
|
||||
@ExcelProperty({"副裁四", "打分"})
|
||||
private String slaveRefereeDMark;
|
||||
}
|
||||
}
|
||||
@ -82,10 +82,10 @@ public class CpopWxPayTests {
|
||||
//ProfitSharing profitSharing = SpringUtils.getBean(ProfitSharingService.class).getById("77860920238751744");
|
||||
//profitSharingReturnRequest.setOrderId(profitSharing.getOutProfitSharingId());
|
||||
//profitSharingReturnRequest.setOutReturnNo(profitSharing.getId());
|
||||
profitSharingReturnRequest.setOrderId("30000600822023111456560002430");
|
||||
profitSharingReturnRequest.setOutReturnNo("1724352351424733184");
|
||||
profitSharingReturnRequest.setOrderId("4200002037202311160917055414");
|
||||
profitSharingReturnRequest.setOutReturnNo("1725040884229472256");
|
||||
profitSharingReturnRequest.setDescription("分账退款");
|
||||
profitSharingReturnRequest.setSubMchId("1618925571");
|
||||
profitSharingReturnRequest.setSubMchId("1650816616");
|
||||
profitSharingReturnRequest.setReturnMchid("1618884922");
|
||||
//profitSharingReturnRequest.setAmount(profitSharing.getAmount());
|
||||
profitSharingReturnRequest.setAmount(1L);
|
||||
|
||||
@ -29,4 +29,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@ -21,4 +21,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@ -32,16 +32,7 @@
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
@ -46,7 +46,7 @@ spring:
|
||||
database: rock-blade
|
||||
|
||||
server:
|
||||
port: 9420
|
||||
port: 8420
|
||||
servlet:
|
||||
context-path: /Cpop-Oam
|
||||
|
||||
|
||||
@ -130,16 +130,17 @@ logging:
|
||||
wx:
|
||||
#企业微信
|
||||
cp:
|
||||
corpId: 111
|
||||
corpId: ww9b83a363662f219f
|
||||
appConfigs:
|
||||
# (某一具体应用的AgentId,如果是要配置通讯录同步的应用,可以随便配置一个)
|
||||
- agentId: 1000001
|
||||
- agentId: 1000024
|
||||
#(该应用的Secret)
|
||||
secret: 1111
|
||||
secret: VJFNBvZgK6oNEKpfrb5B9KQcm7yB0CacpWS2BfTln5Q
|
||||
# (应用中的 “接受消息” 部分的 “接收消息服务器配置” 里的Token值)
|
||||
token: 111
|
||||
token: 1i2dz2yxD0Np2xvMYTD
|
||||
# (应用中的 “接受消息” 部分的 “接收消息服务器配置” 里的EncodingAESKey值)
|
||||
aesKey: 111
|
||||
aesKey: DLSzfHVUZN3O9WhtL07RBXUoooqC2bjEJYwep8k8ojt
|
||||
|
||||
#开放平台
|
||||
open:
|
||||
openAppid: wx6e07ba6606e912a5
|
||||
|
||||
@ -43,4 +43,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@ -53,7 +53,6 @@ public class DeptController {
|
||||
* @Date: 2023/5/9 20:47
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('system:dept:insert')")
|
||||
@OperationLog(operationLogEnumType = OperationLogEnum.INSERT_OAM_DEPT)
|
||||
@ApiOperation("新增部门")
|
||||
@PostMapping("/insertDept")
|
||||
public R<Void> insertDept(@Validated @RequestBody DeptBo bo) {
|
||||
@ -69,7 +68,6 @@ public class DeptController {
|
||||
* @Date: 2023/5/9 20:47
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('system:dept:update')")
|
||||
@OperationLog(operationLogEnumType = OperationLogEnum.UPDATE_OAM_DEPT)
|
||||
@ApiOperation("修改部门")
|
||||
@PutMapping("/updateDept")
|
||||
public R<Void> updateDept(@Validated @RequestBody DeptBo bo) {
|
||||
@ -84,7 +82,6 @@ public class DeptController {
|
||||
* @Date: 2023/5/9 20:48
|
||||
*/
|
||||
@PreAuthorize("@aps.hasPermission('system:dept:remove')")
|
||||
@OperationLog(operationLogEnumType = OperationLogEnum.REMOVE_OAM_DEPT)
|
||||
@ApiOperation("删除部门")
|
||||
@DeleteMapping("/removeDept/{id}")
|
||||
public R<Void> removeDept(@PathVariable String id) {
|
||||
@ -92,4 +89,19 @@ public class DeptController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return R<Void>
|
||||
* @Description: 同步企业微信部门
|
||||
* @Author DB
|
||||
* @Date: 2023/5/9 20:47
|
||||
*/
|
||||
@Deprecated
|
||||
@PreAuthorize("@aps.hasPermission('*:*:*')")
|
||||
@ApiOperation("同步企业微信部门")
|
||||
@PostMapping("/syncWxCpDept")
|
||||
public R<Void> syncWxCpDept() {
|
||||
deptService.syncWxCpDept();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -192,5 +192,18 @@ public class StaffController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return R<Void>
|
||||
* @Description: 同步企业微信员工
|
||||
* @Author DB
|
||||
* @Date: 2023/5/9 20:47
|
||||
*/
|
||||
@Deprecated
|
||||
@PreAuthorize("@aps.hasPermission('*:*:*')")
|
||||
@ApiOperation("同步企业微信员工")
|
||||
@PostMapping("/syncWxCpStaff")
|
||||
public R<Void> syncWxCpStaff() {
|
||||
staffService.syncWxCpStaff();
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,4 +47,13 @@ public interface DeptService extends IService<Dept> {
|
||||
* @Date: 2023/5/9 20:48
|
||||
*/
|
||||
void removeDept(String id);
|
||||
|
||||
/**
|
||||
* @descriptions 同步企业微信部门
|
||||
* @author DB
|
||||
* @date 2023/11/15 16:56
|
||||
* @return: void
|
||||
*/
|
||||
void syncWxCpDept();
|
||||
|
||||
}
|
||||
|
||||
@ -119,4 +119,12 @@ public interface StaffService extends IService<Staff> {
|
||||
* @return: void
|
||||
*/
|
||||
void createWxCpUser(WxCpXmlMessage wxMessage, WxCpService cpService);
|
||||
|
||||
/**
|
||||
* @descriptions 同步企业微信员工
|
||||
* @author DB
|
||||
* @date 2023/11/16 17:03
|
||||
* @return: void
|
||||
*/
|
||||
void syncWxCpStaff();
|
||||
}
|
||||
|
||||
@ -12,11 +12,18 @@ import com.cpop.oam.business.mapper.DeptMapper;
|
||||
import com.cpop.oam.business.service.DeptService;
|
||||
import com.cpop.oam.business.service.StaffMidDeptService;
|
||||
import com.cpop.oam.business.vo.DeptVo;
|
||||
import com.cpop.oam.framework.config.wxCp.WxCpConfiguration;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.row.RowUtil;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.cp.api.WxCpService;
|
||||
import me.chanjar.weixin.cp.bean.WxCpDepart;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -44,7 +51,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
||||
return buildDeptTree(this.listAs(QueryWrapper.create()
|
||||
.and(DEPT.NAME.like(bo.getName()))
|
||||
.and(DEPT.STATUS.eq(bo.getStatus()))
|
||||
.orderBy(DEPT.ORDER_NO.asc()), DeptVo.class));
|
||||
.orderBy(DEPT.ORDER_NO.desc()), DeptVo.class));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -204,4 +211,64 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
||||
.collect(Collectors.toList()));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @descriptions 同步企业微信部门
|
||||
* @author DB
|
||||
* @date 2023/11/15 16:56
|
||||
* @return: void
|
||||
*/
|
||||
@Override
|
||||
public void syncWxCpDept() {
|
||||
//企业微信互通应用
|
||||
WxCpService cpService = WxCpConfiguration.getCpService(1000024);
|
||||
try {
|
||||
//获取所有数据
|
||||
List<WxCpDepart> list = cpService.getDepartmentService().list(null);
|
||||
//过滤出最顶级部门
|
||||
WxCpDepart wxCpDepart = list.stream().filter(item -> item.getParentId() == 0).collect(Collectors.toList()).get(0);
|
||||
//先存
|
||||
Dept dept = new Dept();
|
||||
dept.setWxCpId(wxCpDepart.getId()).setWxCpParentId(wxCpDepart.getParentId()).setOrderNo(wxCpDepart.getOrder().intValue()).setName(wxCpDepart.getName());
|
||||
if (wxCpDepart.getDepartmentLeader().length > 0) {
|
||||
dept.setLeader(wxCpDepart.getDepartmentLeader()[0]);
|
||||
}
|
||||
this.save(dept);
|
||||
//递归保存余下部门
|
||||
List<WxCpDepart> filterWxDeptList = list.stream().filter(item -> item.getParentId() != 0).collect(Collectors.toList());
|
||||
recursionSonDept(filterWxDeptList, dept);
|
||||
} catch (WxErrorException e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @descriptions 递归保存子部门
|
||||
* @author DB
|
||||
* @date 2023/11/16 16:06
|
||||
* @param wxCpDepartList 部门id
|
||||
* @param parentDept 父部门
|
||||
* @return: void
|
||||
*/
|
||||
private void recursionSonDept(List<WxCpDepart> wxCpDepartList, Dept parentDept) {
|
||||
List<Dept> deptList = new ArrayList<Dept>();
|
||||
Iterator<WxCpDepart> iterator = wxCpDepartList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
WxCpDepart next = iterator.next();
|
||||
if (next.getParentId().equals(parentDept.getWxCpId())) {
|
||||
//先存
|
||||
Dept dept = new Dept();
|
||||
dept.setWxCpId(next.getId()).setWxCpParentId(next.getParentId()).setOrderNo(next.getOrder().intValue()).setParentId(parentDept.getId()).setName(next.getName());
|
||||
deptList.add(dept);
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
//当子部门不为空的时候保存部门
|
||||
if (!deptList.isEmpty()) {
|
||||
this.saveBatch(deptList);
|
||||
deptList.forEach(item -> {
|
||||
recursionSonDept(wxCpDepartList, item);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ public class OamMallServiceImpl implements OamMallService {
|
||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||
QueryWrapper queryWrapper = QueryWrapper.create();
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
queryWrapper.and("name like ?", "%" + name + "%");
|
||||
queryWrapper.and("name like ?", name + "%");
|
||||
}
|
||||
if (StringUtils.isNotBlank(brandIds)) {
|
||||
queryWrapper.in("cp_mall_role_brand.brand_id", Arrays.asList(brandIds.split(",")));
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.cpop.oam.business.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cpop.common.constant.Constants;
|
||||
import com.cpop.common.utils.StringUtils;
|
||||
@ -10,6 +11,7 @@ import com.cpop.core.base.entity.loginInfo.OamStaffLoginInfo;
|
||||
import com.cpop.core.base.enums.UserType;
|
||||
import com.cpop.core.base.exception.ServiceException;
|
||||
import com.cpop.core.base.table.SysUser;
|
||||
import com.cpop.core.mapper.CoreMapper;
|
||||
import com.cpop.core.service.CoreService;
|
||||
import com.cpop.core.service.RedisService;
|
||||
import com.cpop.core.utils.*;
|
||||
@ -19,13 +21,18 @@ import com.cpop.oam.business.bo.ModifyUserPasswordBo;
|
||||
import com.cpop.oam.business.bo.StaffBo;
|
||||
import com.cpop.oam.business.bo.StaffPageBo;
|
||||
import com.cpop.oam.business.bo.SysUserLogBo;
|
||||
import com.cpop.oam.business.entity.Dept;
|
||||
import com.cpop.oam.business.entity.Staff;
|
||||
import com.cpop.oam.business.entity.StaffMidDept;
|
||||
import com.cpop.oam.business.mapper.StaffMapper;
|
||||
import com.cpop.oam.business.service.DeptService;
|
||||
import com.cpop.oam.business.service.StaffMidDeptService;
|
||||
import com.cpop.oam.business.service.StaffService;
|
||||
import com.cpop.oam.business.vo.StaffInfoVo;
|
||||
import com.cpop.oam.business.vo.StaffPageVo;
|
||||
import com.cpop.oam.business.vo.StaffVo;
|
||||
import com.cpop.oam.business.vo.SysOperationLogVo;
|
||||
import com.cpop.oam.framework.config.wxCp.WxCpConfiguration;
|
||||
import com.cpop.oam.framework.utils.OamUtils;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
@ -33,7 +40,10 @@ import com.mybatisflex.core.row.Db;
|
||||
import com.mybatisflex.core.row.DbChain;
|
||||
import com.mybatisflex.core.row.Row;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.cp.api.WxCpService;
|
||||
import me.chanjar.weixin.cp.bean.WxCpUser;
|
||||
import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage;
|
||||
import org.springframework.security.crypto.bcrypt.BCrypt;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -41,10 +51,15 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cpop.core.base.table.table.SysOperationLogTableDef.SYS_OPERATION_LOG;
|
||||
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
|
||||
import static com.cpop.oam.business.entity.table.DeptTableDef.DEPT;
|
||||
import static com.cpop.oam.business.entity.table.StaffMidDeptTableDef.STAFF_MID_DEPT;
|
||||
import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF;
|
||||
import static com.cpop.system.business.entity.table.RoleTableDef.ROLE;
|
||||
@ -57,6 +72,7 @@ import static com.mybatisflex.core.query.QueryMethods.groupConcat;
|
||||
* @author DB
|
||||
* @since 2023-09-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("oamStaffService")
|
||||
public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements StaffService {
|
||||
|
||||
@ -362,4 +378,58 @@ public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements
|
||||
//TODO:先改造部门
|
||||
//insertStaff(wxCpUserToStaff(wxMessage, cpService));
|
||||
}
|
||||
|
||||
/**
|
||||
* @descriptions 同步企业微信员工
|
||||
* @author DB
|
||||
* @date 2023/11/16 17:04
|
||||
* @return: void
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncWxCpStaff() {
|
||||
WxCpService cpService = WxCpConfiguration.getCpService(1000024);
|
||||
try {
|
||||
List<WxCpUser> wxCpUsers = cpService.getUserService().listByDepartment(1L, true, 0);
|
||||
if (!wxCpUsers.isEmpty()){
|
||||
log.info("部门用户信息:{}", JSONArray.toJSONString(wxCpUsers));
|
||||
//批量插入用户
|
||||
Map<SysUser,WxCpUser> userWxCpUserMap = new HashMap<>();
|
||||
wxCpUsers.forEach(item -> {
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setId(IdUtils.fastSimpleUUID())
|
||||
.setStatus(item.getStatus() == 1)
|
||||
.setUserType(UserType.OAM_USER.toString())
|
||||
.setCreateUserId("1");
|
||||
sysUser.setUpdateUserId("1");
|
||||
userWxCpUserMap.put(sysUser, item);
|
||||
});
|
||||
Db.executeBatch(userWxCpUserMap.keySet(), CoreMapper.class, CoreMapper::insertSysUser);
|
||||
List<Staff> staffList = new ArrayList<>();
|
||||
//批量创建用户
|
||||
userWxCpUserMap.forEach((key, value) -> {
|
||||
Staff staff = new Staff();
|
||||
staff.setName(value.getName()).setUserId(key.getId()).setWxCpUserId(value.getUserId());
|
||||
staffList.add(staff);
|
||||
});
|
||||
this.saveBatch(staffList);
|
||||
//获取所有部门信息
|
||||
List<Dept> deptList = SpringUtils.getBean(DeptService.class).queryChain().where(DEPT.WX_CP_ID.isNotNull()).list();
|
||||
//部门id映射
|
||||
Map<Long, String> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getWxCpId, Dept::getId));
|
||||
List<StaffMidDept> staffMidDeptList = new ArrayList<>();
|
||||
//批量创建用户
|
||||
userWxCpUserMap.forEach((key, value) -> {
|
||||
for (Long wxDeptId : value.getDepartIds()) {
|
||||
StaffMidDept staffMidDept = new StaffMidDept();
|
||||
staffMidDept.setStaffId(key.getId()).setDeptId(deptMap.get(wxDeptId));
|
||||
staffMidDeptList.add(staffMidDept);
|
||||
}
|
||||
});
|
||||
SpringUtils.getBean(StaffMidDeptService.class).saveBatch(staffMidDeptList);
|
||||
}
|
||||
} catch (WxErrorException e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,4 +21,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@ -66,10 +66,10 @@ public class BrandPageVo implements Serializable {
|
||||
private String backgroundUrl;
|
||||
|
||||
/**
|
||||
* 是否开通微信分账
|
||||
* 是否开通商城
|
||||
*/
|
||||
@ApiModelProperty("是否开通微信分账")
|
||||
private Boolean isOpenSharing;
|
||||
@ApiModelProperty("是否开通商城")
|
||||
private Boolean isOpenMall;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
||||
25
pom.xml
25
pom.xml
@ -229,4 +229,29 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<!--be careful 在parent pom 里面一定要加这个属性-->
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user