Commit c9625c37 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

修改脚本适合融合环境

parent 5c1471af
...@@ -95,7 +95,7 @@ def reg_and_audit_hospital(type=1): ...@@ -95,7 +95,7 @@ def reg_and_audit_hospital(type=1):
#将医院信息写入到文件中 #将医院信息写入到文件中
info=(h_name,h_name) info=(h_name,h_name)
titlename=('h_id','h_name') titlename=('h_id','h_name')
FileUtils().w_info4(info,module,'医院信息',titlename) FileUtils().w_info5(info,module,'医院信息',titlename)
print('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') # print('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
return h_name return h_name
reg_and_audit_hospital() reg_and_audit_hospital()
\ No newline at end of file
...@@ -149,6 +149,29 @@ class FileUtils(object): ...@@ -149,6 +149,29 @@ class FileUtils(object):
# 写入到yaml文件 # 写入到yaml文件
with open(yamlpath, "a", encoding="utf-8") as f: with open(yamlpath, "a", encoding="utf-8") as f:
yaml.dump(dict, f, Dumper=yaml.RoundTripDumper, allow_unicode=True) yaml.dump(dict, f, Dumper=yaml.RoundTripDumper, allow_unicode=True)
#写入医院信息
def w_info5(self, info,module,keyname,titlename):
module=module
dict = {}
value = {}
for i in range(len(titlename)):
value[titlename[i]] = info[i]
# value[titlename[0]] = info[0]
# value[titlename[1]] = info[1]
key=keyname
dict[key] = value
w_path=rootPath+os.sep+'data'+os.sep+module
# print(w_path)
yamlpath = os.path.join(w_path, "message")
if (self.r_info(module,keyname)!=None):
print('已有相同信息,覆盖写入')
# 写入到yaml文件
with open(yamlpath, "w", encoding="utf-8") as f:
yaml.dump(dict, f, Dumper=yaml.RoundTripDumper,allow_unicode=True)
else:
# 写入到yaml文件
with open(yamlpath, "a", encoding="utf-8") as f:
yaml.dump(dict, f, Dumper=yaml.RoundTripDumper, allow_unicode=True)
if __name__ == '__main__': if __name__ == '__main__':
# info=("aaaa","bbbbbb","mdm3-pim") # info=("aaaa","bbbbbb","mdm3-pim")
......
...@@ -23,6 +23,7 @@ json_headers2: { ...@@ -23,6 +23,7 @@ json_headers2: {
"cname": "%s", "cname": "%s",
"shortName": "%s", "shortName": "%s",
"hosLevel": "三级甲等", "hosLevel": "三级甲等",
"hosSpdType":"3",
"area": "湖南省长沙市下陆区", "area": "湖南省长沙市下陆区",
"code": "420101", "code": "420101",
"address": "湖南省长沙市下陆区", "address": "湖南省长沙市下陆区",
......
医院信息: 医院信息:
h_id: 湖南省人民医院@yiF7 h_id: 湖南省人民医院jtZBp
h_name: 湖南省人民医院@yiF7 h_name: 湖南省人民医院jtZBp
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分4秒</td> <td class='details-col-elapsed'>0分4秒</td>
<td class="details-col-elapsed">0.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/a3供货关系申请_客户类型_医院_供销关系申请提交/log.html' target='_blank'>a3供货关系申请_客户类型_医院_供销关系申请提交</a></td> <td class="details-col-elapsed"><a href='../log/注册医院审核通过/log.html' target='_blank'>注册医院审核通过</a></td>
<td class="fail">失败</td> <td class="success">成功</td>
<td class="details-col-elapsed">4.759</td> <td class="details-col-elapsed">4.119</td>
<td class="details-col-elapsed">xiaohesheng</td> <td class="details-col-elapsed">xiaohesheng</td>
</tr> </tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment