refactor: 重构多插件 UI 与配置结构,新增抖音/新美大平台核对插件
- 新增 XQ0042 抖音平台核对、XQ0041 新美大平台核对插件的 UI 源码与打包脚本 - 重构续签电子签、服务岗转正不通过电子签等插件的版本与配置 - 删除旧版考勤异常处理、微盟数据导出等冗余插件文件 - 修复出勤积分更新插件的 OPM 推送判断逻辑 - 优化壳子插件页面的 iframe 滚动条样式
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""XQ0033 插件 - 离职当月再入职人员无效积分段踢除。"""
|
||||
from datetime import date
|
||||
|
||||
from .. import config
|
||||
|
||||
_CODE = "hr_staff_base.base_code"
|
||||
_NAME = "hr_staff_base.staff_name"
|
||||
|
||||
|
||||
def _clean(v):
|
||||
if v is None:
|
||||
return ""
|
||||
return str(v).strip()
|
||||
|
||||
|
||||
def blank_rejoin_gap(report_rows, rejoin_rows, old_codes_map=None):
|
||||
"""就地清空再入职人员无效积分段,返回清空的考勤状态单元格数。
|
||||
|
||||
- 台账工号:清 [离职日, 再入职日) 中间段;
|
||||
- 历史工号(换工号再入职):清 [再入职日, 月末],但要求报告行工号+姓名同时匹配,
|
||||
避免工号被复用后误清他人积分。
|
||||
"""
|
||||
old_codes_map = old_codes_map or {}
|
||||
gaps = {} # 台账工号 -> (leave_day, join_day)
|
||||
old_gaps = {} # 历史工号 -> (join_day, 再入职人姓名)
|
||||
for r in rejoin_rows:
|
||||
code = _clean(r.get(_CODE))
|
||||
name = _clean(r.get(_NAME))
|
||||
ld = r.get(f"{config.REJOIN_FIELD_PREFIX}.leave_date")
|
||||
jd = r.get(f"{config.REJOIN_FIELD_PREFIX}.join_date")
|
||||
if not code or not ld or not jd:
|
||||
continue
|
||||
try:
|
||||
leave = date.fromisoformat(str(ld).strip()[:10])
|
||||
join = date.fromisoformat(str(jd).strip()[:10])
|
||||
except ValueError:
|
||||
continue
|
||||
gaps[code] = (leave.day, join.day)
|
||||
for old_code in old_codes_map.get(code, ()):
|
||||
old_gaps[old_code] = (join.day, name)
|
||||
if not gaps and not old_gaps:
|
||||
return 0
|
||||
|
||||
cleared = 0
|
||||
for row in report_rows:
|
||||
code, row_name = row[0], row[8]
|
||||
if code in gaps:
|
||||
leave_day, join_day = gaps[code]
|
||||
for d in range(leave_day, join_day):
|
||||
if 1 <= d <= 31 and row[8 + d] not in (None, ""):
|
||||
row[8 + d] = ""
|
||||
cleared += 1
|
||||
elif code in old_gaps:
|
||||
join_day, rejoin_name = old_gaps[code]
|
||||
if row_name != rejoin_name:
|
||||
continue
|
||||
for d in range(join_day, 32):
|
||||
if 1 <= d <= 31 and row[8 + d] not in (None, ""):
|
||||
row[8 + d] = ""
|
||||
cleared += 1
|
||||
return cleared
|
||||
Reference in New Issue
Block a user