数智-合同附件批量下载

shuzhi
dxfeng 2 years ago
parent e6cf968e0f
commit c35f5e1837

@ -48,7 +48,8 @@ public class SzBatchExportServiceImpl extends Service implements SzBatchExportSe
try {
RecordSet rs = new RecordSet();
String sql = "select a.lastname ,a.workcode ,b.field0 as fileId from HrmResource a inner join cus_fielddata b on a.id =b.id and b.scopeid =3 and a.id = ? ";
// TODO 调整附件字段
String sql = "select a.lastname ,a.workcode ,b.field15 as fileId from HrmResource a inner join cus_fielddata b on a.id =b.id and b.scopeid =1 and a.id = ? ";
ZipOutputStream zipOutputStream = new ZipOutputStream(Files.newOutputStream(Paths.get(outPutPath)));
byte[] buffer = new byte[1024];
for (Long userId : idList) {
@ -109,7 +110,7 @@ public class SzBatchExportServiceImpl extends Service implements SzBatchExportSe
try {
RecordSet rs = new RecordSet();
String sql = "select a.lastname ,a.workcode ,b.fj as fileIdb.htksrq from HrmResource a inner join uf_ygqdhtbd b on a.id =b.xm where b.id = ?";
String sql = "select a.lastname ,a.workcode ,b.fj as fileId,b.htksrq from HrmResource a inner join uf_ygqdhtbd b on a.id =b.xm where b.id = ?";
ZipOutputStream zipOutputStream = new ZipOutputStream(Files.newOutputStream(Paths.get(outPutPath)));
byte[] buffer = new byte[1024];
for (Long id : idList) {

@ -0,0 +1,30 @@
package weaver.interfaces.shuzhi.cronjob;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.interfaces.schedule.BaseCronJob;
/**
*
*
* @author:dxfeng
* @createTime: 2023/06/05
* @version: 1.0
*/
public class SyncBlackListJob extends BaseCronJob {
// TODO 正式、测试表名切换
private static final String TABLE_NAME = "edc_uf_table182";
@Override
public void execute() {
new BaseBean().writeLog("######定时更新人员简历黑名单状态,任务开始######");
RecordSet rs = new RecordSet();
// 通过身份证号更新候选人信息台账
String sql = "update " + TABLE_NAME + " set sfhmd = 0 where field004 in(select sfzh from uf_hmdk)";
rs.executeUpdate(sql);
// 通过手机号码更新候选人信息台账
sql = "update " + TABLE_NAME + " set sfhmd = 0 where field005 in(select sjhm from uf_hmdk)";
rs.executeUpdate(sql);
new BaseBean().writeLog("######定时更新人员简历黑名单状态,任务结束######");
}
}

@ -2,11 +2,14 @@ package weaver.interfaces.shuzhi.cronjob;
import com.engine.shuzhi.entity.po.ModeStaffPO;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.interfaces.schedule.BaseCronJob;
import java.util.*;
/**
*
*
* @author:dxfeng
* @createTime: 2023/06/01
* @version: 1.0
@ -16,6 +19,7 @@ public class SyncModeStaffJob extends BaseCronJob {
@Override
public void execute() {
new BaseBean().writeLog("######编制数据同步服务,任务开始######");
RecordSet rs = new RecordSet();
String sql;
// 查询培训生的岗位ID
@ -35,11 +39,11 @@ public class SyncModeStaffJob extends BaseCronJob {
// 根据部门+岗位查询最新一个月的记录
if ("sqlserver".equals(rs.getDBType())) {
sql = "select top 1 id, zgrs, bzrs from uf_bzxxbd where bm = ? and gw = ? order by yf desc";
}else if("oracle".equals(rs.getDBType())){
sql = "select id, zgrs, bzrs from uf_bzxxbd where bm = ? and gw = ? and rownum = 1 order by yf desc";
}else{
sql = "select id, zgrs,bzrs from uf_bzxxbd where bm = ? and gw = ? order by yf desc limit 1";
sql = "select top 1 id, bzrs from uf_bzxxbd where bm = ? and gw = ? order by yf desc";
} else if ("oracle".equals(rs.getDBType())) {
sql = "select id, bzrs from uf_bzxxbd where bm = ? and gw = ? and rownum = 1 order by yf desc";
} else {
sql = "select id, bzrs from uf_bzxxbd where bm = ? and gw = ? order by yf desc limit 1";
}
for (ModeStaffPO modeStaff : modeStaffList) {
rs.executeQuery(sql, modeStaff.getDepartmentid(), modeStaff.getJobtitle());
@ -47,9 +51,10 @@ public class SyncModeStaffJob extends BaseCronJob {
String staffId = rs.getString("id");
String staffNum = rs.getString("bzrs");
// 岗位为培训生编制人数等于在岗人数
modeStaff.setStaffNum(specialJobIds.contains(modeStaff.getJobtitle())?modeStaff.getNum().toString():staffNum);
modeStaff.setStaffNum(specialJobIds.contains(modeStaff.getJobtitle()) ? modeStaff.getNum().toString() : staffNum);
rs.executeUpdate("update uf_bzxxbd set zgrs = ? ,bzrs = ? ,kbrs = ? where id = ?", modeStaff.getNum(), modeStaff.getStaffNum(), modeStaff.getLackNum(), staffId);
}
}
new BaseBean().writeLog("######编制数据同步服务,任务结束######");
}
}

Loading…
Cancel
Save