|
@ -6899,4 +6899,41 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
return strinObj.toJSONString();
|
|
|
}
|
|
|
|
|
|
public List<String> getDeviceParam(String equ_num){
|
|
|
List<String> result = new ArrayList<>();
|
|
|
String sql = " select * from t_mediicine_device_param_tmp ";
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(equ_num)){
|
|
|
sql +=" and equ_num='"+equ_num+"' ";
|
|
|
}
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
String paramStr = "{\n" +
|
|
|
" \"orgPwd\":\"zzj{pwd}\",\n" +
|
|
|
" \"orgUser\":\"zzj{outBizNo}\",\n" +
|
|
|
"\t\t\"opterNo\":\"zzj\",\n" +
|
|
|
" \"outBizNo\":\"{outBizNo}\",\n" +
|
|
|
" \"serialNo\":\"{serialNo}\",\n" +
|
|
|
" \"terminalCom\":\"广州巨米智能设备有限公司\",\n" +
|
|
|
" \"terminalPos\":\"{equ_name}\",\n" +
|
|
|
" \"terminalType\":\"JNZ-II-F55CM\",\n" +
|
|
|
" \"terminalAppid\":\"GnbevqypHcIlFxXaUZsd0oKa2N7F6GfB\",\n" +
|
|
|
" \"terminalAppkey\":\"DK9lFVfQeRcSIMlDkMWeyZYGvwLNhNtf\"\n" +
|
|
|
"}";
|
|
|
|
|
|
for (Map<String,Object>tmp:list){
|
|
|
String deviceId = tmp.get("device_id").toString();
|
|
|
String equNum = tmp.get("equ_num").toString();
|
|
|
String serialNo = tmp.get("serial_no").toString();
|
|
|
String outBizNo = tmp.get("out_biz_no").toString();
|
|
|
String equName = tmp.get("equ_name").toString();
|
|
|
String pwd =outBizNo.substring(outBizNo.length()-6);
|
|
|
String paramContent = paramStr.replace("{outBizNo}",outBizNo).replace("{serialNo}",serialNo)
|
|
|
.replace("{equ_name}",equName).replace("{pwd}",pwd);
|
|
|
String insertSql = " INSERT INTO `t_mediicine_device_param` " +
|
|
|
"(`id`, `device_id`, `del`, `device_ip`, `yb_strin`) " +
|
|
|
"VALUES (uuid(), '"+deviceId+"', 1, '10.95.22.79', '"+paramContent+"');";
|
|
|
result.add(insertSql);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
}
|