main
parent
00bb91a508
commit
79c17ce7a9
@ -0,0 +1,26 @@
|
||||
package UnitTest;
|
||||
// 引入需要的类
|
||||
import cn.hutool.core.img.ImgUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import com.aspose.words.*;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class UpdateImage {
|
||||
public static void main(String[] args) throws Exception {
|
||||
String MyDir="C:\\Users\\Administrator\\Desktop\\";
|
||||
Document doc = new Document(MyDir + "看图写话分类别.docx");
|
||||
NodeCollection shapes = doc.getChildNodes(NodeType.SHAPE, true);
|
||||
for (Shape shape : (Iterable<Shape>) shapes) {
|
||||
if (shape.hasImage()) {
|
||||
// Resize the shape to the desired dimensions
|
||||
shape.setWidth(180);
|
||||
shape.setHeight(120);
|
||||
// Set the layout of the image to "in-line with text" (i.e. "inline")
|
||||
shape.setWrapType(WrapType.INLINE);
|
||||
shape.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
}
|
||||
}
|
||||
doc.save("c:\\2.docx");
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.dsideal.FengHuang.DingTalk;
|
||||
|
||||
import com.alibaba.druid.filter.stat.StatFilter;
|
||||
import com.dsideal.FengHuang.DingTalk.Util.Common;
|
||||
import com.dsideal.FengHuang.DingTalk.Util.Model;
|
||||
import com.dsideal.FengHuang.DingTalk.Util.OrgPerson;
|
||||
import com.dsideal.FengHuang.Util.CommonUtil;
|
||||
import com.jfinal.kit.PropKit;
|
||||
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.jfinal.plugin.activerecord.dialect.MysqlDialect;
|
||||
import com.jfinal.plugin.druid.DruidPlugin;
|
||||
import com.jfinal.plugin.redis.RedisPlugin;
|
||||
|
||||
public class Init {
|
||||
|
||||
public static void main(String[] args_) throws Exception {
|
||||
PropKit.use("dingtalk.properties");
|
||||
final String appKey = PropKit.get("appKey");
|
||||
String appSecret = PropKit.get("appSecret");
|
||||
|
||||
DruidPlugin druid = Common.createDruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"), PropKit.get("password").trim(), PropKit.get("driverClassName"));
|
||||
druid.start();
|
||||
|
||||
ActiveRecordPlugin arp = new ActiveRecordPlugin(druid);
|
||||
arp.setDevMode(false);
|
||||
arp.setDialect(new MysqlDialect());
|
||||
arp.start();
|
||||
|
||||
// 用于缓存模块的redis服务
|
||||
RedisPlugin redis = new RedisPlugin("myRedis", PropKit.get("redis_ip"), PropKit.getInt("redis_port"), 10 * 1000);
|
||||
redis.start();
|
||||
|
||||
//accessToken
|
||||
String accessToken = Common.getAccessToken(appKey, appSecret);
|
||||
|
||||
//同步钉钉与云平台中部门信息
|
||||
String orgName = "长春市东光学校";
|
||||
Record rOrg = Model.getOrgByOrgName(orgName);
|
||||
|
||||
//开发测试时专用,批量删除人员与组织机构
|
||||
// Model.fillDeptListByDataBase(rOrg);//从数据库中获取最新的部门列表(已与钉钉匹配完毕)
|
||||
// OrgPerson.delBureauPerson(accessToken,rOrg);
|
||||
// OrgPerson.delAllDept(accessToken);
|
||||
|
||||
|
||||
//初始化组织机构【需提前手动删除此学校及下属部门】
|
||||
//OrgPerson.InitOrg(accessToken, rOrg);
|
||||
|
||||
//同步人员
|
||||
Model.fillDeptListByDataBase(rOrg);//从数据库中获取最新的部门列表(已与钉钉匹配完毕)
|
||||
OrgPerson.initPerson(accessToken, rOrg);
|
||||
|
||||
|
||||
//创建角色组【执行一次即可】
|
||||
//RolePerson.createRoleGroup(accessToken, "义务教育阶段角色组"); ---> 3779920123
|
||||
|
||||
//long groupId = 3779920123L;
|
||||
|
||||
//获取指定角色组下有哪些角色
|
||||
//List<Record> list = RolePerson.getRoleList(accessToken, groupId);
|
||||
//System.out.println(list);
|
||||
|
||||
//删除指定角色组下的角色
|
||||
//RolePerson.delGroupRole(accessToken,groupId);
|
||||
|
||||
//同步角色
|
||||
//RolePerson.syncRole(accessToken, groupId);
|
||||
|
||||
//获取钉钉侧指定角色下人员信息
|
||||
// RolePerson.getRolePersonList(accessToken, 3780868223L, 0);
|
||||
//
|
||||
// for (int i = 0; i < RolePerson.rolePersonList.size(); i++) {
|
||||
// System.out.println(RolePerson.rolePersonList.get(i));
|
||||
// }
|
||||
// //获取云平台侧指定角色下人员信息
|
||||
// List<Record> list2 = Model.getRolePersonReleation();
|
||||
|
||||
|
||||
|
||||
CommonUtil.Print("恭喜,所有操作成功完成!");
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.dsideal.FengHuang.DingTalk.Util;
|
||||
|
||||
import com.dsideal.FengHuang.Util.CommonUtil;
|
||||
import com.jfinal.kit.PropKit;
|
||||
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.jfinal.plugin.activerecord.dialect.MysqlDialect;
|
||||
import com.jfinal.plugin.druid.DruidPlugin;
|
||||
|
||||
public class FillRemainCount {
|
||||
public static void main(String[] args) {
|
||||
PropKit.use("dingtalk.properties");
|
||||
DruidPlugin druid = Common.createDruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"), PropKit.get("password").trim(), PropKit.get("driverClassName"));
|
||||
druid.start();
|
||||
|
||||
ActiveRecordPlugin arp = new ActiveRecordPlugin(druid);
|
||||
arp.setDevMode(false);
|
||||
arp.setDialect(new MysqlDialect());
|
||||
arp.start();
|
||||
|
||||
for(int year=2023;year<=2053;year++){
|
||||
for(int month=1;month<=12;month++){
|
||||
Record record =new Record();
|
||||
record.set("year",year);
|
||||
record.set("month",month);
|
||||
record.set("remain_count",500000);//初始操作次数为50W
|
||||
Db.save("t_dingtalk_actioncount","year,month",record);
|
||||
}
|
||||
}
|
||||
CommonUtil.Print("恭喜,数据填充成功!");
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.dsideal.FengHuang.DingTalk;
|
||||
package com.dsideal.FengHuang.DingTalk.Util;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
Loading…
Reference in new issue