|
@@ -43,16 +43,19 @@ def RS031001(): |
|
|
YYMMDD = strptime(post_data['Data']['YYMMDD'],"%a %b %d %H:%M:%S CST %Y") |
|
|
YYMMDD = strptime(post_data['Data']['YYMMDD'],"%a %b %d %H:%M:%S CST %Y") |
|
|
post_data['Data']['YYMMDD'] = strftime("%Y-%m-%d",YYMMDD) |
|
|
post_data['Data']['YYMMDD'] = strftime("%Y-%m-%d",YYMMDD) |
|
|
except (ValueError,KeyError) as e: |
|
|
except (ValueError,KeyError) as e: |
|
|
|
|
|
app.logger.error("人员异动申请") |
|
|
app.logger.error(e) |
|
|
app.logger.error(e) |
|
|
try: |
|
|
try: |
|
|
AppForDate = strptime(post_data['Data']['AppForDate'],"%a %b %d %H:%M:%S CST %Y") |
|
|
AppForDate = strptime(post_data['Data']['AppForDate'],"%a %b %d %H:%M:%S CST %Y") |
|
|
post_data['Data']['AppForDate'] = strftime("%Y-%m-%d",AppForDate) |
|
|
post_data['Data']['AppForDate'] = strftime("%Y-%m-%d",AppForDate) |
|
|
except (ValueError,KeyError) as e: |
|
|
except (ValueError,KeyError) as e: |
|
|
|
|
|
app.logger.error("人员异动申请") |
|
|
app.logger.error(e) |
|
|
app.logger.error(e) |
|
|
try: |
|
|
try: |
|
|
TryuseDate = strptime(post_data['Data']['TryuseDate'],"%a %b %d %H:%M:%S CST %Y") |
|
|
TryuseDate = strptime(post_data['Data']['TryuseDate'],"%a %b %d %H:%M:%S CST %Y") |
|
|
post_data['Data']['TryuseDate'] = strftime("%Y-%m-%d",TryuseDate) |
|
|
post_data['Data']['TryuseDate'] = strftime("%Y-%m-%d",TryuseDate) |
|
|
except (ValueError,KeyError) as e: |
|
|
except (ValueError,KeyError) as e: |
|
|
|
|
|
app.logger.error("人员异动申请") |
|
|
app.logger.error(e) |
|
|
app.logger.error(e) |
|
|
try: |
|
|
try: |
|
|
r = requests.post(hr_url,data=post_data.__str__().encode('utf-8')) |
|
|
r = requests.post(hr_url,data=post_data.__str__().encode('utf-8')) |
|
@@ -64,6 +67,7 @@ def RS031001(): |
|
|
return_data['Message'] = r.json()['Message'] |
|
|
return_data['Message'] = r.json()['Message'] |
|
|
return jsonify(return_data), 200 |
|
|
return jsonify(return_data), 200 |
|
|
except requests.exceptions.RequestException as e: |
|
|
except requests.exceptions.RequestException as e: |
|
|
|
|
|
app.logger.error("人员异动申请") |
|
|
app.logger.error(e) |
|
|
app.logger.error(e) |
|
|
return_data['Success'] = False |
|
|
return_data['Success'] = False |
|
|
return_data['Message'] = '接口出错!' |
|
|
return_data['Message'] = '接口出错!' |
|
@@ -88,6 +92,43 @@ def KQ061001(): |
|
|
except: |
|
|
except: |
|
|
abort(500) |
|
|
abort(500) |
|
|
|
|
|
|
|
|
|
|
|
@app.route('/api/hr/KQ061001v2', methods=['POST']) |
|
|
|
|
|
# 人员签卡申请 |
|
|
|
|
|
def KQ061001v2(): |
|
|
|
|
|
post_data['FunID'] = 'KQ061001' |
|
|
|
|
|
post_data['Data'] = request.form.to_dict() |
|
|
|
|
|
try: |
|
|
|
|
|
post_data['Data']['EmpNo'] = request.form.to_dict()['EmpNo'] |
|
|
|
|
|
post_data['Data']['YYMMDD'] = strftime("%Y-%m-%d",strptime(request.form.to_dict()['UncheckedDate'],"%a %b %d %H:%M:%S CST %Y")) |
|
|
|
|
|
post_data['Data']['SignTime'] = strftime("%H:%M",strptime(request.form.to_dict()['UncheckedTime'],"%a %b %d %H:%M:%S CST %Y")) |
|
|
|
|
|
post_data['Data']['SignTypeNo'] = request.form.to_dict()['SignTypeNo'] |
|
|
|
|
|
post_data['Data']['OAID'] = request.form.to_dict()['OAID'] |
|
|
|
|
|
post_data['Data']['SignWhy'] = request.form.to_dict()['SignWhy'] |
|
|
|
|
|
post_data['Data']['Remark'] = request.form.to_dict()['Remark'] |
|
|
|
|
|
post_data['Data']['HasConfirmed'] = request.form.to_dict()['HasConfirmed'] |
|
|
|
|
|
except (ValueError,KeyError) as e: |
|
|
|
|
|
app.logger.error("人员签卡申请") |
|
|
|
|
|
app.logger.error(e) |
|
|
|
|
|
return_data['Success'] = False |
|
|
|
|
|
return_data['Message'] = '表单填写出错,请重新填写!' |
|
|
|
|
|
return jsonify(return_data), 200 |
|
|
|
|
|
try: |
|
|
|
|
|
r = requests.post(hr_url,data=post_data.__str__().encode('utf-8')) |
|
|
|
|
|
if r.json()['Success']: |
|
|
|
|
|
return_data['Success'] = True |
|
|
|
|
|
return_data['Message'] = r.json()['Data'] |
|
|
|
|
|
else: |
|
|
|
|
|
return_data['Success'] = False |
|
|
|
|
|
return_data['Message'] = r.json()['Message'] |
|
|
|
|
|
return jsonify(return_data), 200 |
|
|
|
|
|
except requests.exceptions.RequestException as e: |
|
|
|
|
|
app.logger.error("人员签卡申请") |
|
|
|
|
|
app.logger.error(e) |
|
|
|
|
|
return_data['Success'] = False |
|
|
|
|
|
return_data['Message'] = '接口出错!' |
|
|
|
|
|
return jsonify(return_data), 200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/api/hr/KQ043001', methods=['POST']) |
|
|
@app.route('/api/hr/KQ043001', methods=['POST']) |
|
|
# 个人加班申请 |
|
|
# 个人加班申请 |
|
|
def KQ043001(): |
|
|
def KQ043001(): |
|
@@ -107,6 +148,45 @@ def KQ043001(): |
|
|
except: |
|
|
except: |
|
|
abort(500) |
|
|
abort(500) |
|
|
|
|
|
|
|
|
|
|
|
@app.route('/api/hr/KQ043001v2', methods=['POST']) |
|
|
|
|
|
# 个人加班申请 |
|
|
|
|
|
def KQ043001v2(): |
|
|
|
|
|
post_data['FunID'] = 'KQ043001' |
|
|
|
|
|
post_data['Data'] = request.form.to_dict() |
|
|
|
|
|
try: |
|
|
|
|
|
post_data['Data']['EmpNo'] = request.form.to_dict()['EmpNo'] |
|
|
|
|
|
post_data['Data']['YYMMDD'] = strftime("%Y-%m-%d",strptime(request.form.to_dict()['overTimeStart'],"%a %b %d %H:%M:%S CST %Y")) |
|
|
|
|
|
post_data['Data']['BeginTime'] = strftime("%H:%M",strptime(request.form.to_dict()['overTimeStart'],"%a %b %d %H:%M:%S CST %Y")) |
|
|
|
|
|
post_data['Data']['EndTime'] = strftime("%H:%M",strptime(request.form.to_dict()['overTimeEnd'],"%a %b %d %H:%M:%S CST %Y")) |
|
|
|
|
|
post_data['Data']['ReqOverTime'] = request.form.to_dict()['ReqOverTime'] |
|
|
|
|
|
post_data['Data']['ReqWhyNo'] = request.form.to_dict()['ReqWhyNo'] |
|
|
|
|
|
post_data['Data']['IsReplace'] = request.form.to_dict()['IsReplace'] |
|
|
|
|
|
post_data['Data']['HasConfirmed'] = request.form.to_dict()['HasConfirmed'] |
|
|
|
|
|
post_data['Data']['CalcType'] = request.form.to_dict()['CalcType'] |
|
|
|
|
|
post_data['Data']['IsReCalcHours'] = request.form.to_dict()['IsReCalcHours'] |
|
|
|
|
|
post_data['Data']['OAID'] = request.form.to_dict()['OAID'] |
|
|
|
|
|
except (ValueError,KeyError) as e: |
|
|
|
|
|
app.logger.error("个人加班申请") |
|
|
|
|
|
app.logger.error(e) |
|
|
|
|
|
return_data['Success'] = False |
|
|
|
|
|
return_data['Message'] = '表单填写出错,请重新填写!' |
|
|
|
|
|
return jsonify(return_data), 200 |
|
|
|
|
|
try: |
|
|
|
|
|
r = requests.post(hr_url,data=post_data.__str__().encode('utf-8')) |
|
|
|
|
|
if r.json()['Success']: |
|
|
|
|
|
return_data['Success'] = True |
|
|
|
|
|
return_data['Message'] = r.json()['Data'] |
|
|
|
|
|
else: |
|
|
|
|
|
return_data['Success'] = False |
|
|
|
|
|
return_data['Message'] = r.json()['Message'] |
|
|
|
|
|
return jsonify(return_data), 200 |
|
|
|
|
|
except requests.exceptions.RequestException as e: |
|
|
|
|
|
app.logger.error("个人加班申请") |
|
|
|
|
|
app.logger.error(e) |
|
|
|
|
|
return_data['Success'] = False |
|
|
|
|
|
return_data['Message'] = '接口出错!' |
|
|
|
|
|
return jsonify(return_data), 200 |
|
|
|
|
|
|
|
|
@app.route('/api/hr/KQ035001', methods=['POST']) |
|
|
@app.route('/api/hr/KQ035001', methods=['POST']) |
|
|
# 人员出差申请 |
|
|
# 人员出差申请 |
|
|
def KQ035001(): |
|
|
def KQ035001(): |
|
|